blob: 6e49aa1f169155dd8915d2f061dcb30cb00092c7 (
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
|
#!/bin/sh
#
#logger check_driver called with: $1 - $2 - $3 -
wanted=$1
devpath=$2
bustype=$3
device=$(readlink /sys/$devpath/device)
device=${device##*/}
driver=$(readlink /sys/$devpath/device/driver)
driver=${driver##*/}
logger device $device is bound to the $driver driver
if [ "$driver" != "$wanted" ]; then
logger must rebind
echo -n "$device" > /sys/$devpath/device/driver/unbind
echo -n "$device" > /sys/bus/$bustype/drivers/$wanted/bind
else
logger no need to rebind
fi
|