From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John L. Fjellstad" Date: Tue, 17 Feb 2004 19:07:55 +0000 Subject: Re: [PATCH] init.d script for debian Message-Id: <20040217190755.GA10647@fjellstad.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="BwCQnh7xodEAoBMC" List-Id: To: linux-hotplug@vger.kernel.org --BwCQnh7xodEAoBMC Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The /dev/null node gets removed to early, so than any subsequent=20 removal gets an error message about missing /dev/null. I moved the removal of /dev/null to last, and added the previous patch --=20 John L. Fjellstad web: http://www.fjellstad.org/ Quis custodiet ipsos custodes --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="udev.debian.patch" Content-Transfer-Encoding: quoted-printable --- udev.debian.orig 2004-02-13 02:01:37.000000000 +0100 +++ udev.debian 2004-02-17 20:05:07.000000000 +0100 @@ -45,6 +45,12 @@ # all other device classes for i in ${sysfs_dir}/class/*; do for j in $i/*; do + if [ $ACTION =3D=3D "remove" ]; then + if [ $j =3D=3D "${sysfs_dir}/class/mem/null" ]; then + =09 + continue; + fi + fi if [ -f $j/dev ]; then export DEVPATH=3D${j#${sysfs_dir}} CLASS=3D`echo ${i#${sysfs_dir}} | \ @@ -53,6 +59,12 @@ fi done done + + if [ $ACTION =3D=3D "remove" ]; then + export DEVPATH=3D/class/mem/null; + CLASS=3Dmem; + $bin $CLASS & + fi } =20 =20 @@ -61,13 +73,18 @@ if [ ! -d $udev_dir ]; then mkdir $udev_dir fi - if [ ! -d $sysfs_dir ]; then + # don't use udev if sysfs is not mounted + if [ ! -d $sysfs_dir/block ]; then exit 1 fi # propogate /udev from /sys - we only need this while we do not # have initramfs and an early user-space with which to do early # device bring up action "Creating initial udev device nodes: " /bin/true + if [ ! -c $udev_dir/null ]; then + action "Creating initial ${udev_dir}/null" /bin/true + /bin/mknod ${udev_dir}/null c 1 3 + fi export ACTION=3Dadd run_udev=20 =20 @@ -78,6 +95,7 @@ cd $udev_dir && ln -s fd/2 stderr cd $udev_dir && ln -s /proc/kcore core cd $udev_dir && ln -s /proc/asound/oss/sndstat sndstat + ;; stop) # be careful @@ -90,6 +108,7 @@ rm -f $udev_dir/stdout rm -f $udev_dir/stdin rm -f $udev_dir/fd + rm -f $udev_dir/memstick1 ;; status) if [ -d $udev_dir ]; then --LQksG6bCIzRHxTLp-- --BwCQnh7xodEAoBMC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iEYEARECAAYFAkAyZosACgkQkz0vhQtHHRibmQCdGf3Tj0clqxKg4srNkj4KqVVg O8wAoK9xrR+Ze277CYk29B584XuDYA0T =L9IC -----END PGP SIGNATURE----- --BwCQnh7xodEAoBMC-- ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&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