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
|
#!/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=`find . -type f -name '*.ko' -o -name '*.o' | \
sed -r -e 's/\.k?o$/,/' -e 's,^.*/,,g' | \
grep -v -E '^(usbcore|usb-uhci|uhci|usb-ohci)$' | \
sort | sed -e '$s/,$//'`
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
test -f /etc/default/hotplug && . /etc/default/hotplug
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 $(echo "$STATIC_MODULE_LIST" | sed -e 's/ /, /g') || true
fi
if test "$IGNORE_PCI_CLASS_DISPLAY" != ""; then
db_set hotplug/ignore_pci_class_display "$IGNORE_PCI_CLASS_DISPLAY" || true
fi
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_input low hotplug/ignore_pci_class_display || true
db_go || true
|