From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Marco d'Itri" Date: Wed, 17 Dec 2003 08:28:40 +0000 Subject: Re: [patch] install initscript in udev rpm MIME-Version: 1 Content-Type: multipart/mixed; boundary="PEIAKu/WMn1b1Hv9" Message-Id: List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Dec 17, Greg KH wrote: >> Actually I would be *very* surprised if the init script I wrote for >> debian (which I sent you a few weeks ago) did not work with every >> distribution. >Can you resend it? I don't seem to be able to find it anymore. Here it is. There is a bug I have not fixed yet (it breaks if /sys/class/video4linux/ does not exist). -- ciao, | Marco | [3649 grArswY7ca0qI] --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=udev #!/bin/sh -e PATH=/sbin:/bin:/usr/sbin:/usr/bin UDEV=/sbin/udev [ -x $UDEV -a -e /proc/sys/kernel/hotplug ] || exit 0 [ -c /dev/.devfsd ] && exit 0 case "$(uname -r)" in 2.[01234].*) echo "udev requires a 2.6.x kernel, not started." exit 0 ;; esac mount_sysfs() { [ -d /sys ] || mkdir /sys [ -d /sys/class ] || mount -t sysfs sysfs: /sys } synthesize_events() { echo -n "Creating initial udev device nodes..." export ACTION=add # add tty devices for i in /sys/class/tty/* /sys/class/video4linux/*; do export DEVPATH=${i#/sys} # echo -n " $DEVPATH" $UDEV tty done # add block devices and their partitions for i in /sys/block/*; do export DEVPATH=${i#/sys} # echo -n " $DEVPATH" $UDEV block for j in $i/*; do [ -f "$j/dev" ] || continue export DEVPATH=${j#/sys} # echo -n " $DEVPATH" $UDEV block done done echo "done." return 0 } case "$1" in start|restart|force-reload) [ -d /udev ] || mkdir /udev mount_sysfs synthesize_events if [ "$(cat /proc/sys/kernel/hotplug)" = "/sbin/hotplug" ]; then : else echo $UDEV > /proc/sys/kernel/hotplug echo "/dev management daemon (udev) enabled." fi ;; stop) if [ "$(cat /proc/sys/kernel/hotplug)" = "$UDEV" ]; then echo /bin/true > /proc/sys/kernel/hotplug echo "/dev management daemon (udev) disabled." fi ;; *) echo "Usage: /etc/init.d/udev {start|stop|restart|force-reload}" exit 1 ;; esac exit 0 --PEIAKu/WMn1b1Hv9-- ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&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