From mboxrd@z Thu Jan 1 00:00:00 1970 From: md@Linux.IT (Marco d'Itri) Date: Mon, 01 Nov 2004 01:47:24 +0000 Subject: Re: ide.rc Message-Id: <20041101014724.GA22438@wonderland.linux.it> MIME-Version: 1 Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq" List-Id: References: <20041029141509.GA9119@wonderland.linux.it> In-Reply-To: <20041029141509.GA9119@wonderland.linux.it> To: linux-hotplug@vger.kernel.org --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Oct 30, "Alexander E. Patrakov" wrote: > This script would be probably a bit wrong for my old server. This server has a > LSI Logic SCSI adapter (with two hard disks attached) and a ServerWorks IDE > adapter with one attached CD-ROM drive. For some strange reason, to use this > CD-ROM, I must have both serverworks, ide_generic and ide_cd modules loaded. > Your script won't load ide_generic. The kernel is 2.6.7-1-686. As it has been explained, this is probably a bug/feature in the serverworks driver. The correct solution would be for the debian kernel package to ship a /etc/modprobe.d/kernel-image-2.6.7-1-686 file containing something like: install serverworks /sbin/modprobe --ignore-install serverworks && { /sbin/modprobe ide-generic; /sbin/modprobe ide-cd; } (Do you mind opening a bug about this in the debian BTS?) > Also, your script starts before pci.rc (because "i" is before "p" in the > alphabet) and therefore will not find anything on my old server at all (the > serverworks module is loaded by pci.rc). Good point. tsort(1) comes to help, as you can see in the attached replacement for the main hotplug init script. There is no ide.agent script because there are no "real" IDE hotplug events from the kernel. Probably there is no need for them, this is just a workaround to load the modules for udev. -- ciao, | Marco | [8851 soOFdKlIC1OSk] --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hotplug.init" #!/bin/sh -e # # description: Starts and stops each hotpluggable subsystem. # On startup, may simulate hotplug events for devices # that were present at boot time, before filesystems # used by /sbin/hotplug became available. PATH=/sbin:/bin:/usr/sbin:/usr/bin [ -x /sbin/hotplug ] || exit 0 if [ ! -f /proc/sys/kernel/hotplug ]; then echo "Kernel hotplug support not enabled." exit 0 fi [ -e /etc/default/hotplug ] && . /etc/default/hotplug run_rcs() { SUBSYSTEMS=$( { for RC in /etc/hotplug/*.rc; do basename=${RC#/etc/hotplug/} name=${basename%.rc} echo "$name $name" done # follows couples of ordered elements echo "ide pci" echo "usb pci" } | tsort | tac ) for name in $SUBSYSTEMS; do printf " %-8s\n" $name if [ "$(eval echo \$HOTPLUG_RC_$name)" = no ]; then printf " %-8s [disabled]\n" $name continue fi set +e /etc/hotplug/$name.rc $1 RC_STATUS=$? set -e if [ "$1" = status ]; then continue fi if [ $RC_STATUS = 0 ]; then printf " %-8s [success]\n" $name else printf " %-8s [failed]\n" $name fi done } case "$1" in start) echo "Starting hotplug subsystem:" echo /sbin/hotplug > /proc/sys/kernel/hotplug run_rcs $1 echo "done" ;; stop) echo "Stopping hotplug subsystem:" run_rcs $1 echo /bin/true > /proc/sys/kernel/hotplug echo "done" ;; restart|force-reload) echo -n "Restarting hotplug subsystem:" run_rcs stop run_rcs start echo "." ;; status) run_rcs $1 ;; *) echo "Usage: $0 {start|stop|restart|status|force-reload}" >&2 exit 1 ;; esac exit 0 --45Z9DzgjV8m4Oswq-- ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&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