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 58 59
|
#!/bin/sh -e
# hotplug.config
#
# source debconf library
. /usr/share/debconf/confmodule
# this module use multiselect
db_capb multiselect
KERNEL=`uname -r`
case $KERNEL in
2.2.*) MODULE_DIR=/lib/modules/$KERNEL ;;
*) MODULE_DIR=/lib/modules/$KERNEL/kernel/drivers;;
esac
usbmodules=
test -d $MODULE_DIR/usb &&
cd $MODULE_DIR/usb &&
# get available usb modules
usbmodules=`echo * | sed -e 's/.o /, /g' -e 's/.o$//' \
-e 's/\<usbcore\>,//' \
-e 's/\<\(usb-\)*uhci\>,//' \
-e 's/\<usb-ohci\>,//'`
isusbmodule() {
echo $usbmodules | grep -q "$1"
}
test -f /etc/hotplug/usb.option && . /etc/hotplug/usb.option
test -f /etc/default/hotplug.usb && . /etc/default/hotplug.usb
# note
db_input low hotplug/usb_keyboard || true
db_go || true
if test "$USBD_ENABLE" != ""; then
db_set hotplug/usbd_enable "$USBD_ENABLE" || true
fi
if test "$X11_USBMICE_HACK" != ""; then
db_set hotplug/x11_usbmice_hack "$X11_USBMICE_HACK" || true
fi
if test "$STATIC_MODULE_LIST" != ""; then
db_set hotplug/static_module_list "$STATIC_MODULE_LIST" || true
fi
db_input low hotplug/usbd_enable || true
db_go || true
# if mousedev and/or input are module, then ask to load for X11 support
if isusbmodule mousedev || isusbmodule input; then
db_input high hotplug/x11_usbmice_hack || true
db_go || true
fi
db_subst hotplug/static_module_list usbmodules $usbmodules
db_input low hotplug/static_module_list || true
db_go || true
|