aboutsummaryrefslogtreecommitdiffstats
path: root/mdev/lib/inputdev
blob: c02f8726666111e63d19b8002a17a38d9633b7c3 (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
#!/bin/busybox ash

set +x

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

BPATH="input"
SPATH="/sys${DEVPATH}"

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

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

		case "$NAME" in
			"TPPS/2 IBM TrackPoint")
				ln -s $MDEV mouse
				;;
			"AT Translated Set 2 keyboard")
				ln -s $MDEV kbd
				;;
			"ThinkPad Extra Buttons")
				ln -s $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