aboutsummaryrefslogtreecommitdiffstats
path: root/mdev/lib/inputdev
blob: 02c20eeef2983da0509288b6bf558817fbfca6f4 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/busybox ash

set +x

[ -n "$MDEV" ] || exit 0
[ -n "$DEVNAME" ] || exit 0
[ "$SUBSYSTEM" = "input" ] || exit 0

MDEV=$(basename ${MDEV})
BPATH="input"
SPATH="/sys${DEVPATH}"

NAME=""
if [ -e ${SPATH} ];
then
	NAME=$(cat ${SPATH}/../name)
fi

printf "bpath = '%s'; spath = '%s'; name = '%s';\n" "$BPATH" "$SPATH" "$NAME" \
	| logger -t daemon

cd $BPATH
case "$ACTION" in
        add|"")	
		#mv ../$MDEV .

		case "$NAME" in
			"TPPS/2 IBM TrackPoint")
				ln -fs $MDEV mouse
				;;
			"AT Translated Set 2 keyboard")
				ln -fs $MDEV kbd
				;;
			"ThinkPad Extra Buttons")
				ln -fs $MDEV extrabuttons
				;;
		esac
                ;;
        remove)
		#rm -f $MDEV

		case "$NAME" in
			"TPPS/2 IBM TrackPoint")
				rm -f mouse
				;;
			"AT Translated Set 2 keyboard")
				rm -f kbd
				;;
			"ThinkPad Extra Buttons")
				rm -f extrabuttons
				;;
		esac
                ;;
esac

exit 0