From mboxrd@z Thu Jan 1 00:00:00 1970 From: md@Linux.IT (Marco d'Itri) Date: Fri, 29 Oct 2004 14:15:09 +0000 Subject: ide.rc Message-Id: <20041029141509.GA9119@wonderland.linux.it> MIME-Version: 1 Content-Type: multipart/mixed; boundary="ZPt4rx8FFjLCG7dd" List-Id: To: linux-hotplug@vger.kernel.org --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I'm attaching a .rc script for hotplug which loads at boot time the ide-* modules needed by the system (which, as everybody knows by now, cannot be automatically loaded anymore when using udev). -- ciao, | Marco | [8804 tr7xD/mgdubuA] --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ide.rc" #!/bin/sh -e # # ide.rc loads the modules for IDE devices at boot time, if needed # it requires a 2.6 kernel # # Copyright (C) 2004 Marco d'Itri # # only 2.6 kernels are supported [ -d /sys/block/ ] || exit 0 cd /etc/hotplug . ./hotplug.functions # XXX this function should be moved to hotplug.functions is_blacklisted() { MODULE_EXPR="$(echo $1 | sed -e 's/[-_]/[-_]/g')" if grep -qs "^${MODULE_EXPR}$" \ $HOTPLUG_DIR/blacklist $HOTPLUG_DIR/blacklist.d/*; then return 0 fi return 1 } ide_boot_events() { [ "$(echo /proc/ide/*/media)" = "/proc/ide/*/media" ] && return for drive in /proc/ide/*/media; do # nothing to do if the device has already been took in charge unit=${drive#/proc/ide/}; unit=${unit%/media} [ -d /sys/block/$unit ] && continue read media < $drive case "$media" in disk) MODULE=ide-disk ;; cdrom) MODULE=ide-cd ;; tape) MODULE=ide-tape ;; floppy) MODULE=ide-floppy ;; *) MODULE=ide-generic ;; esac # ignore blacklisted modules if is_blacklisted $MODULE; then mesg " $MODULE: blacklisted" continue fi if modprobe --quiet $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) ide_boot_events ;; stop) ;; status) ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 esac --ZPt4rx8FFjLCG7dd-- ------------------------------------------------------- This Newsletter Sponsored by: Macrovision For reliable Linux application installations, use the industry's leading setup authoring tool, InstallShield X. Learn more and evaluate today. http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/ _______________________________________________ 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