summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bcm5974-diagnostics232
-rwxr-xr-xscripts/bcm5974-post-install63
-rwxr-xr-xscripts/bcm5974-post-remove29
-rwxr-xr-xscripts/bcm5974-pre-install42
-rwxr-xr-xscripts/patch-name-version.sh9
5 files changed, 9 insertions, 366 deletions
diff --git a/scripts/bcm5974-diagnostics b/scripts/bcm5974-diagnostics
deleted file mode 100755
index acd0bf4..0000000
--- a/scripts/bcm5974-diagnostics
+++ /dev/null
@@ -1,232 +0,0 @@
1#!/bin/bash
2#
3# bcm5943-diagnostics - troubleshooting the BCM5974 setup
4#
5# Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se)
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
22DRIVER=bcm5974
23
24echo -----------------------------------------------------------------------
25
26# What kernel version am I running?
27KERNEL=`uname -r`
28echo \* Kernel version: $KERNEL
29
30# What synaptics version is installed (debian)?
31if [ -x /usr/bin/dpkg-query ]; then
32 SYNAPTICS=`/usr/bin/dpkg-query -W -f='${Version}\n' xserver-xorg-input-synaptics`
33 echo \* Synaptics version: $SYNAPTICS
34else
35 echo \* Synaptics version: UNKNOWN - dpkg not found
36fi
37
38# What USB devices of interest can we find?
39if [ -x /usr/sbin/lsusb ]; then
40 LSUSB=`lsusb|grep 05ac:02`
41 echo \* USB device: $LSUSB
42else
43 echo \* USB device: UNKNOWN - lsusb not found
44fi
45
46# Do we have the module intalled?
47MODLIB=/lib/modules/$KERNEL/kernel/drivers/input/mouse/$DRIVER.ko
48MODLIB2=/lib/modules/$KERNEL/updates/dkms/$DRIVER.ko
49if [ -f $MODLIB ]; then
50 echo \* $MODLIB: exists
51elif [ -f $MODLIB2 ]; then
52 echo \* $MODLIB2: exists
53else
54 echo \* $DRIVER does NOT exist
55 echo dkms: install package
56 echo manual: copy the file $DRIVER.ko to $MODLIB
57 exit 1
58fi
59
60# Do we have the module configured?
61MODULES=/etc/modules
62if [ -f $MODULES ]; then
63 if (grep -q $DRIVER $MODULES); then
64 echo \* $MODULES: has $DRIVER config, please remove
65 exit 1
66 else
67 echo \* $MODULES: $DRIVER no longer explicitly listed, good
68 fi
69fi
70
71# Do we have old quirks?
72MODPROBE=/etc/modprobe.d/options
73if [ -f $MODPROBE ]; then
74 MODPROBEOPTS=`grep quirks= $MODPROBE|grep -v ^#|grep 0x05ac:0x02`
75 if [ "$MODPROBEOPTS" != "" ]; then
76 echo \* $MODPROBE: has obsolete quirks - please remove
77 exit 1
78 else
79 echo \* $MODPROBE: no obsolete quirks, good
80 fi
81else
82 echo \* $MODPROBE: file not found
83fi
84
85# Do we have the right quirks?
86DRIVMOD=/etc/modprobe.d/$DRIVER
87if [ -f $DRIVMOD ]; then
88 DRIVMODOPTS=`grep quirks= $DRIVMOD|grep -v ^#|grep 0x05ac:0x02`
89 if [ "$DRIVMODOPTS" != "" ]; then
90 echo \* $DRIVMOD: has quirks, good
91 else
92 echo \* $DRIVMOD: does NOT have quirks
93 echo Uncomment the right quirk line in $DRIVMOD
94 exit 1
95 fi
96else
97 echo \* $DRIVMOD: file not found
98 echo Copy the etc/modprobe.d/bcm5974 file to /etc/modprobe.d/
99 exit 1
100fi
101
102# Did the depmod bite?
103USBMAP=/lib/modules/$KERNEL/modules.usbmap
104if [ -f $USBMAP ]; then
105 typeset -i nusb=`grep $DRIVER $USBMAP|grep 0x05ac|grep 0x02|wc -l`
106 if [ $nusb -gt 0 ]; then
107 echo \* $USBMAP: maps to $DRIVER, good
108 else
109 echo \* $USBMAP: does NOT map to $DRIVER
110 echo Run depmod -a as root
111 exit 1
112 fi
113fi
114
115# Was the $DRIVER module loaded?
116DMESG=`lsmod|grep $DRIVER`
117if [ "$DMESG" != "" ]; then
118 echo \* $DRIVER: module is loaded
119else
120 echo \* $DRIVER: module is NOT loaded
121 echo Add this line to /etc/modules:
122 echo "$DRIVER"
123 exit 1
124fi
125
126# Was the $DRIVER module registered?
127DEVPATH=/proc/bus/input/devices
128if [ -f $DEVPATH ]; then
129 DEVICES=`grep $DRIVER /proc/bus/input/devices`
130 if [ "$DEVICES" != "" ]; then
131 echo \* $DEVPATH: module is registered
132 else
133 echo \* $DEVPATH: module is NOT registered
134 echo "Please double-check the quirks settings in $DRIVMOD"
135 exit 1
136 fi
137else
138 echo \* $DEVPATH: does not exist, ignore
139fi
140
141# Do we have synaptics working properly?
142typeset -i SYNLINES=`synclient -l|wc -l`
143if [ $SYNLINES -gt 10 ]; then
144 echo \* synaptics: configuration readable
145else
146 echo \* synaptics: configuration NOT readable
147 exit 1
148fi
149
150# Do we have a working synaptics configuration?
151DIFF=/tmp/synclient-output.diff.$$
152TMP=/tmp/synclient-output.txt.$$
153synclient -l | grep -v Parameter | sort > $TMP
154diff -u - $TMP > $DIFF <<EOF
155 AccelFactor = 0.1
156 BottomEdge = 800
157 CircScrollDelta = 0.1
158 CircScrollTrigger = 0
159 CircularPad = 0
160 CircularScrolling = 0
161 ClickTime = 100
162 CoastingSpeed = 0
163 CornerCoasting = 0
164 EdgeMotionMaxSpeed = 80
165 EdgeMotionMaxZ = 160
166 EdgeMotionMinSpeed = 1
167 EdgeMotionMinZ = 30
168 EdgeMotionUseAlways = 0
169 EmulateMidButtonTime = 75
170 EmulateTwoFingerMinZ = 257
171 FastTaps = 0
172 FingerHigh = 80
173 FingerLow = 16
174 FingerPress = 256
175 GrabEventDevice = 1
176 GuestMouseOff = 0
177 HorizEdgeScroll = 0
178 HorizScrollDelta = 0
179 HorizTwoFingerScroll = 1
180 LBCornerButton = 0
181 LeftEdge = 0
182 LeftRightScrolling = 1
183 LeftRightScrollRepeat = 1
184 LockedDrags = 0
185 LockedDragTimeout = 5000
186 LTCornerButton = 0
187 MaxDoubleTapTime = 200
188 MaxSpeed = 1.2
189 MaxTapMove = 100
190 MaxTapTime = 223
191 MinSpeed = 0.8
192 MultiFingerButton = 2
193 PalmDetect = 0
194 PalmMinWidth = 10
195 PalmMinZ = 200
196 PressureMotionMaxFactor = 1
197 PressureMotionMaxZ = 160
198 PressureMotionMinFactor = 1
199 PressureMotionMinZ = 10
200 RBCornerButton = 0
201 RightEdge = 1280
202 RTCornerButton = 0
203 ScrollButtonRepeat = 100
204 SingleTapTimeout = 180
205 TapButton1 = 0
206 TapButton2 = 0
207 TapButton3 = 0
208 TopEdge = 0
209 TouchpadOff = 0
210 TrackstickSpeed = 40
211 UpDownScrolling = 1
212 UpDownScrollRepeat = 1
213 VertEdgeScroll = 0
214 VertScrollDelta = 40
215 VertTwoFingerScroll = 1
216EOF
217rm -f $TMP
218
219echo =======================================================================
220echo The bcm5974 seems properly configured
221
222typeset -i NDIFF=`cat $DIFF|wc -l`
223if [ $NDIFF -gt 0 ]; then
224 echo
225 echo Your synaptics settings differ from the bcm5974 default:
226 echo -----------------------------------------------------------------------
227 tail -n +4 $DIFF
228 echo -----------------------------------------------------------------------
229 echo If in doubt, please check your /etc/X11/xorg.conf settings
230fi
231
232rm -f $DIFF
diff --git a/scripts/bcm5974-post-install b/scripts/bcm5974-post-install
deleted file mode 100755
index de5094c..0000000
--- a/scripts/bcm5974-post-install
+++ /dev/null
@@ -1,63 +0,0 @@
1#!/bin/bash
2#
3# bcm5943-post-install - post-installing the BCM5974
4#
5# Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se)
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
22DRIVER=bcm5974
23ETCPATH=/etc/modprobe.d/$DRIVER
24
25echo -----------------------------------------------------------------------
26
27DIR=`dirname $0`
28LSUSB=/usr/sbin/lsusb
29
30PAT_HEAD="options usbhid quirks="
31
32DEV[0]="0223"
33DEV[1]="0224"
34DEV[2]="0225"
35DEV[3]="0230"
36DEV[4]="0231"
37DEV[5]="0232"
38DEV[6]="0236"
39DEV[7]="0237"
40DEV[8]="0238"
41
42if [ -x $LSUSB ]; then
43 typeset -i i=0
44 while [ $i -lt 9 ]; do
45 PAT=05ac:${DEV[$i]}
46 MATCH=${PAT_HEAD}0x05ac:0x${DEV[$i]}
47 if [ "`$LSUSB|grep $PAT`" != "" ]; then
48 SED="s/#$MATCH/$MATCH/"
49 fi
50 i=$i+1
51 done
52else
53 echo \* USB device: UNKNOWN - lsusb not found
54 exit 1
55fi
56
57if [ "$SED" != "" ]; then
58 cat $DIR/..$ETCPATH | sed "$SED" > $ETCPATH
59 exit 0
60else
61 echo No suitable device found
62 exit 1
63fi
diff --git a/scripts/bcm5974-post-remove b/scripts/bcm5974-post-remove
deleted file mode 100755
index 21977de..0000000
--- a/scripts/bcm5974-post-remove
+++ /dev/null
@@ -1,29 +0,0 @@
1#!/bin/bash
2#
3# bcm5943-post-remove - post-removing the BCM5974
4#
5# Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se)
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
22DRIVER=bcm5974
23ETCPATH=/etc/modprobe.d/$DRIVER
24
25echo -----------------------------------------------------------------------
26
27rm -f $ETCPATH
28
29exit 0
diff --git a/scripts/bcm5974-pre-install b/scripts/bcm5974-pre-install
deleted file mode 100755
index 1e2b864..0000000
--- a/scripts/bcm5974-pre-install
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/bin/bash
2#
3# bcm5943-pre-install - check system before installing the bcm5974
4#
5# Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se)
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
22DRIVER=bcm5974
23LSUSB=/usr/sbin/lsusb
24
25PAT[0]="05ac:022"
26PAT[1]="05ac:023"
27
28if [ -x $LSUSB ]; then
29 if [ "`$LSUSB|grep ${PAT[0]}`" != "" ]; then
30 exit 0
31 elif [ "`$LSUSB|grep ${PAT[1]}`" != "" ]; then
32 exit 0
33 else
34 echo bcm5974: no suitable device found
35 exit -1
36 fi
37else
38 echo bcm5974: cannot determine device type
39 exit -1
40fi
41
42exit 0
diff --git a/scripts/patch-name-version.sh b/scripts/patch-name-version.sh
new file mode 100755
index 0000000..d1a7796
--- /dev/null
+++ b/scripts/patch-name-version.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2#1: name
3#2: version
4#3: file
5cat $3 \
6| sed "s/^NAME=.*/NAME=$1/" \
7| sed "s/^VERSION=.*/VERSION=$2/" \
8> /tmp/$1.$$
9mv /tmp/$1.$$ $3