From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Marco d'Itri" Date: Mon, 03 May 2004 20:29:29 +0000 Subject: isapnp.rc Message-Id: <20040503202929.GA14388@wonderland.linux.it> MIME-Version: 1 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" List-Id: To: linux-hotplug@vger.kernel.org --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. -- ciao, | Marco | [6102 l'4b7sTdpvT/Q] --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="isapnp.rc" #!/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 # Copyright (C) 2004 Marco d'Itri # # 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 1 esac --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="isapnp.aliases" # 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 --M9NhX3UHpAaciwkO-- ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel