diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/bcm5974-diagnostics | 241 | ||||
| -rwxr-xr-x | scripts/bcm5974-post-install | 50 | ||||
| -rwxr-xr-x | scripts/bcm5974-post-remove | 29 |
3 files changed, 320 insertions, 0 deletions
diff --git a/scripts/bcm5974-diagnostics b/scripts/bcm5974-diagnostics new file mode 100755 index 0000000..0322158 --- /dev/null +++ b/scripts/bcm5974-diagnostics | |||
| @@ -0,0 +1,241 @@ | |||
| 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 | |||
| 22 | DRIVER=bcm5974 | ||
| 23 | |||
| 24 | echo ----------------------------------------------------------------------- | ||
| 25 | |||
| 26 | # What kernel version am I running? | ||
| 27 | KERNEL=`uname -r` | ||
| 28 | echo \* Kernel version: $KERNEL | ||
| 29 | |||
| 30 | # What synaptics version is installed (debian)? | ||
| 31 | if [ -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 | ||
| 34 | else | ||
| 35 | echo \* Synaptics version: UNKNOWN - dpkg not found | ||
| 36 | fi | ||
| 37 | |||
| 38 | # What USB devices of interest can we find? | ||
| 39 | if [ -x /usr/sbin/lsusb ]; then | ||
| 40 | LSUSB=`lsusb|grep 05ac:02` | ||
| 41 | echo \* USB device: $LSUSB | ||
| 42 | else | ||
| 43 | echo \* USB device: UNKNOWN - lsusb not found | ||
| 44 | fi | ||
| 45 | |||
| 46 | # Do we have the module intalled? | ||
| 47 | MODLIB=/lib/modules/$KERNEL/kernel/drivers/input/mouse/$DRIVER.ko | ||
| 48 | MODLIB2=/lib/modules/$KERNEL/updates/dkms/$DRIVER.ko | ||
| 49 | if [ -f $MODLIB ]; then | ||
| 50 | echo \* $MODLIB: exists | ||
| 51 | elif [ -f $MODLIB2 ]; then | ||
| 52 | echo \* $MODLIB2: exists | ||
| 53 | else | ||
| 54 | echo \* $DRIVER does NOT exist | ||
| 55 | echo dkms: install package | ||
| 56 | echo manual: copy the file $DRIVER.ko to $MODLIB | ||
| 57 | exit 1 | ||
| 58 | fi | ||
| 59 | |||
| 60 | # Do we have the module configured? | ||
| 61 | MODULES=/etc/modules | ||
| 62 | if [ -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 | ||
| 69 | fi | ||
| 70 | |||
| 71 | # Do we have old quirks? | ||
| 72 | MODPROBE=/etc/modprobe.d/options | ||
| 73 | if [ -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 | ||
| 81 | else | ||
| 82 | echo \* $MODPROBE: file not found | ||
| 83 | fi | ||
| 84 | |||
| 85 | # Do we have the right quirks? | ||
| 86 | DRIVMOD=/etc/modprobe.d/$DRIVER | ||
| 87 | if [ -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 | ||
| 96 | else | ||
| 97 | echo \* $DRIVMOD: file not found | ||
| 98 | echo Copy the etc/modprobe.d/bcm5974 file to /etc/modprobe.d/ | ||
| 99 | exit 1 | ||
| 100 | fi | ||
| 101 | |||
| 102 | # Did the depmod bite? | ||
| 103 | USBMAP=/lib/modules/$KERNEL/modules.usbmap | ||
| 104 | if [ -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 | ||
| 113 | fi | ||
| 114 | |||
| 115 | # Was the $DRIVER module loaded? | ||
| 116 | DMESG=`lsmod|grep $DRIVER` | ||
| 117 | if [ "$DMESG" != "" ]; then | ||
| 118 | echo \* $DRIVER: module is loaded | ||
| 119 | else | ||
| 120 | echo \* $DRIVER: module is NOT loaded | ||
| 121 | echo Add this line to /etc/modules: | ||
| 122 | echo "$DRIVER" | ||
| 123 | exit 1 | ||
| 124 | fi | ||
| 125 | |||
| 126 | # Was the $DRIVER module registered? | ||
| 127 | DEVPATH=/proc/bus/input/devices | ||
| 128 | if [ -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 No help on this one... | ||
| 135 | exit 1 | ||
| 136 | fi | ||
| 137 | else | ||
| 138 | echo \* $DEVPATH: does not exist, ignore | ||
| 139 | fi | ||
| 140 | |||
| 141 | # Was the $DRIVER properly initialized? | ||
| 142 | WELLSPRING=`dmesg|grep $DRIVER|grep Wellspring` | ||
| 143 | if [ "$WELLSPRING" != "" ]; then | ||
| 144 | echo \* $DRIVER: Wellspring was initialized | ||
| 145 | else | ||
| 146 | echo \* $DRIVER: Wellspring was NOT initialized | ||
| 147 | exit 1 | ||
| 148 | fi | ||
| 149 | |||
| 150 | # Do we have synaptics working properly? | ||
| 151 | typeset -i SYNLINES=`synclient -l|wc -l` | ||
| 152 | if [ $SYNLINES -gt 10 ]; then | ||
| 153 | echo \* synaptics: configuration readable | ||
| 154 | else | ||
| 155 | echo \* synaptics: configuration NOT readable | ||
| 156 | exit 1 | ||
| 157 | fi | ||
| 158 | |||
| 159 | # Do we have a working synaptics configuration? | ||
| 160 | DIFF=/tmp/synclient-output.diff.$$ | ||
| 161 | TMP=/tmp/synclient-output.txt.$$ | ||
| 162 | synclient -l | grep -v Parameter | sort > $TMP | ||
| 163 | diff -u - $TMP > $DIFF <<EOF | ||
| 164 | AccelFactor = 0.1 | ||
| 165 | BottomEdge = 800 | ||
| 166 | CircScrollDelta = 0.1 | ||
| 167 | CircScrollTrigger = 0 | ||
| 168 | CircularPad = 0 | ||
| 169 | CircularScrolling = 0 | ||
| 170 | ClickTime = 100 | ||
| 171 | CoastingSpeed = 0 | ||
| 172 | CornerCoasting = 0 | ||
| 173 | EdgeMotionMaxSpeed = 80 | ||
| 174 | EdgeMotionMaxZ = 160 | ||
| 175 | EdgeMotionMinSpeed = 1 | ||
| 176 | EdgeMotionMinZ = 30 | ||
| 177 | EdgeMotionUseAlways = 0 | ||
| 178 | EmulateMidButtonTime = 75 | ||
| 179 | EmulateTwoFingerMinZ = 257 | ||
| 180 | FastTaps = 0 | ||
| 181 | FingerHigh = 80 | ||
| 182 | FingerLow = 16 | ||
| 183 | FingerPress = 256 | ||
| 184 | GrabEventDevice = 1 | ||
| 185 | GuestMouseOff = 0 | ||
| 186 | HorizEdgeScroll = 0 | ||
| 187 | HorizScrollDelta = 0 | ||
| 188 | HorizTwoFingerScroll = 1 | ||
| 189 | LBCornerButton = 0 | ||
| 190 | LeftEdge = 0 | ||
| 191 | LeftRightScrolling = 1 | ||
| 192 | LeftRightScrollRepeat = 1 | ||
| 193 | LockedDrags = 0 | ||
| 194 | LockedDragTimeout = 5000 | ||
| 195 | LTCornerButton = 0 | ||
| 196 | MaxDoubleTapTime = 200 | ||
| 197 | MaxSpeed = 1.2 | ||
| 198 | MaxTapMove = 100 | ||
| 199 | MaxTapTime = 223 | ||
| 200 | MinSpeed = 0.8 | ||
| 201 | MultiFingerButton = 2 | ||
| 202 | PalmDetect = 0 | ||
| 203 | PalmMinWidth = 10 | ||
| 204 | PalmMinZ = 200 | ||
| 205 | PressureMotionMaxFactor = 1 | ||
| 206 | PressureMotionMaxZ = 160 | ||
| 207 | PressureMotionMinFactor = 1 | ||
| 208 | PressureMotionMinZ = 10 | ||
| 209 | RBCornerButton = 0 | ||
| 210 | RightEdge = 1280 | ||
| 211 | RTCornerButton = 0 | ||
| 212 | ScrollButtonRepeat = 100 | ||
| 213 | SingleTapTimeout = 180 | ||
| 214 | TapButton1 = 0 | ||
| 215 | TapButton2 = 0 | ||
| 216 | TapButton3 = 0 | ||
| 217 | TopEdge = 0 | ||
| 218 | TouchpadOff = 0 | ||
| 219 | TrackstickSpeed = 40 | ||
| 220 | UpDownScrolling = 1 | ||
| 221 | UpDownScrollRepeat = 1 | ||
| 222 | VertEdgeScroll = 0 | ||
| 223 | VertScrollDelta = 40 | ||
| 224 | VertTwoFingerScroll = 1 | ||
| 225 | EOF | ||
| 226 | rm -f $TMP | ||
| 227 | |||
| 228 | echo ======================================================================= | ||
| 229 | echo The bcm5974 seems properly configured | ||
| 230 | |||
| 231 | typeset -i NDIFF=`cat $DIFF|wc -l` | ||
| 232 | if [ $NDIFF -gt 0 ]; then | ||
| 233 | echo | ||
| 234 | echo Your synaptics settings differ from the bcm5974 default: | ||
| 235 | echo ----------------------------------------------------------------------- | ||
| 236 | tail -n +4 $DIFF | ||
| 237 | echo ----------------------------------------------------------------------- | ||
| 238 | echo If in doubt, please check your /etc/X11/xorg.conf settings | ||
| 239 | fi | ||
| 240 | |||
| 241 | rm -f $DIFF | ||
diff --git a/scripts/bcm5974-post-install b/scripts/bcm5974-post-install new file mode 100755 index 0000000..21e989e --- /dev/null +++ b/scripts/bcm5974-post-install | |||
| @@ -0,0 +1,50 @@ | |||
| 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 | |||
| 22 | DRIVER=bcm5974 | ||
| 23 | ETCPATH=/etc/modprobe.d/$DRIVER | ||
| 24 | |||
| 25 | echo ----------------------------------------------------------------------- | ||
| 26 | |||
| 27 | DIR=`dirname $0` | ||
| 28 | PAT_HEAD="options usbhid quirks=" | ||
| 29 | PAT_MBA="0x05ac:0x022" | ||
| 30 | PAT_MBP="0x05ac:0x023" | ||
| 31 | MATCH_MBA=$PAT_HEAD$PAT_MBA | ||
| 32 | MATCH_MBB=$PAT_HEAD$PAT_MBB | ||
| 33 | |||
| 34 | if [ -x /usr/sbin/lsusb ]; then | ||
| 35 | if [ "lsusb|grep $PAT_MBA" != "" ]; then | ||
| 36 | SED="s/#$MATCH_MBA/$MATCH_MBA/" | ||
| 37 | elif [ $has_mbb -gt 0 ]; then | ||
| 38 | SED="s/#$MATCH_MBP/$MATCH_MBP/" | ||
| 39 | else | ||
| 40 | echo No suitable device found | ||
| 41 | exit 1 | ||
| 42 | fi | ||
| 43 | else | ||
| 44 | echo \* USB device: UNKNOWN - lsusb not found | ||
| 45 | exit 1 | ||
| 46 | fi | ||
| 47 | |||
| 48 | cat $DIR/..$ETCPATH | sed "$SED" > $ETCPATH | ||
| 49 | |||
| 50 | exit 0 | ||
diff --git a/scripts/bcm5974-post-remove b/scripts/bcm5974-post-remove new file mode 100755 index 0000000..21977de --- /dev/null +++ b/scripts/bcm5974-post-remove | |||
| @@ -0,0 +1,29 @@ | |||
| 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 | |||
| 22 | DRIVER=bcm5974 | ||
| 23 | ETCPATH=/etc/modprobe.d/$DRIVER | ||
| 24 | |||
| 25 | echo ----------------------------------------------------------------------- | ||
| 26 | |||
| 27 | rm -f $ETCPATH | ||
| 28 | |||
| 29 | exit 0 | ||
