isapnp.rc
I'm attaching a new version of isapnp.rc and a companion aliases file to be installed as /etc/modprobe.d/isapnp (because this is easier than writing the kernel patches needed and waiting for Linus to accept them).
The purpose of isapnp.rc is to automatically load the driver modules needed by non-PCI hardware devices like floppy and rtc to allow udev to create the /dev nodes.
It only supports 2.6 kernels, but this is probably acceptable because older kernels do not support udev and can use on-demand modules loading. (Older versions tried to support 2.4 kernels but this proved very hard if not impossibile because tools in /usr/bin were required and the script became too much complex.)
I'm going to add it to the next release of the debian hotplug package. Comments are welcome.
Signature · 2 lines
ciao, | Marco | [6102 l'4b7sTdpvT/Q]
#!/bin/sh -e
#
# isapnp.rc synthesizes isapnp hotplug events at boot time
# it requires a 2.6 kernel with CONFIG_ISAPNP defined
#
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version.
#
# Copyright (C) 2004 Simone Gotti <[email protected]> # Copyright (C) 2004 Marco d'Itri <[email protected]> #
# only 2.6 kernels are supported [ -d /sys/bus/pnp/devices/ ] || return 0
cd /etc/hotplug
. ./hotplug.functions
isapnp_boot_events()
{
if [ "$(echo /sys/bus/pnp/devices/*/id)" = "/sys/bus/pnp/devices/*/id" ]; then
return 0
fi
cat /sys/bus/pnp/devices/*/id \
| sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
| while read MODULE; do
# ignore blacklisted devices
if grep -qi "^$MODULE\$" /etc/hotplug/blacklist; then
return 0
fi
# see do_pnp_entry() in /usr/src/linux/scripts/file2alias.c if $MODPROBE -q pnp:d$MODULE; then
mesg " $MODULE: loaded sucessfully"
else
mesg " $MODULE: can't be loaded"
fi
done
}
# See how we were called.
case "$1" in
start|restart)
isapnp_boot_events
;;
stop)
# echo "isapnp stop -- ignored"
;;
status)
# echo "isapnp status -- ignored"
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1esac
# These aliases are used by /etc/hotplug/isapnp.rc and are needed here
# because the modules themselves are not providing them. alias pnp:dPNP0400 parport_pc alias pnp:dPNP0401 parport_pc alias pnp:dPNP0510 irtty-sir alias pnp:dPNP0511 irtty-sir alias pnp:dPNP0700 floppy alias pnp:dPNP0800 pcspkr alias pnp:dPNP0B00 rtc alias pnp:dPNP0303 atkbd alias pnp:dPNP0F13 psmouse alias pnp:dPNPB02F analog