File: afbinit.init

package info (click to toggle)
afbinit 1.0-1
  • links: PTS
  • area: contrib
  • in suites: sarge, woody
  • size: 52 kB
  • ctags: 18
  • sloc: ansic: 199; sh: 43; makefile: 38
file content (37 lines) | stat: -rw-r--r-- 757 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin
set -e

# This only applies to UltraSPARC's
[ `uname -m` = "sparc64" ] || exit 0

# The microcode loader binary and the microcode itself must exist.
if [ ! -x /usr/sbin/afbinit -o ! -f /usr/lib/afb.ucode ]; then
	exit
fi

# Need a better way to test this
[ `dmesg | grep -c "Elite 3D"` -ne 0 ] || exit

case "$1" in
  start)
	# Make FB device list.
	afb_devs=`/bin/dmesg | /bin/egrep -i "Elite 3D" | /bin/sed 's/\:.*//'`

	# Load microcode onto each card.
	for AFB in ${afb_devs}; do
		echo -n "${AFB}: Loading Elite3D microcode... "
		/usr/sbin/afbinit /dev/${AFB} /usr/lib/afb.ucode
		echo "done."
	done
	;;
  stop|restart|force-reload) # Nothing
	;;
  *)
	echo "Usage: $0 start" >&2
	exit 1
	;;
esac

exit 0