linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John L. Fjellstad" <john-hotplug@fjellstad.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] init.d script for debian
Date: Tue, 17 Feb 2004 19:07:55 +0000	[thread overview]
Message-ID: <20040217190755.GA10647@fjellstad.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 292 bytes --]

The /dev/null node gets removed to early, so than any subsequent 
removal gets an error message about missing /dev/null. I moved
the removal of /dev/null to last, and added the previous patch

-- 
John L. Fjellstad
web: http://www.fjellstad.org/          Quis custodiet ipsos custodes

[-- Attachment #1.2: udev.debian.patch --]
[-- Type: text/plain, Size: 1591 bytes --]

--- 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 == "remove" ]; then
+				if [ $j == "${sysfs_dir}/class/mem/null" ]; then
+				
+					continue;
+				fi
+			fi
 			if [ -f $j/dev ]; then
 				export DEVPATH=${j#${sysfs_dir}}
 				CLASS=`echo ${i#${sysfs_dir}} | \
@@ -53,6 +59,12 @@
 			fi
 		done
 	done
+
+	if [ $ACTION == "remove" ]; then
+		export DEVPATH=/class/mem/null;
+		CLASS=mem;
+		$bin $CLASS &
+	fi
 }
 
 
@@ -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=add
 	run_udev 
 
@@ -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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

             reply	other threads:[~2004-02-17 19:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-17 19:07 John L. Fjellstad [this message]
2004-02-17 19:56 ` [PATCH] init.d script for debian Marco d'Itri
2004-02-17 21:05 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040217190755.GA10647@fjellstad.org \
    --to=john-hotplug@fjellstad.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).