Skip to contentSkip to conversation

starting with an empty /dev

PATCH Marco d'Itri 2 participants 2 messages Feb 13, 2004

lore
Share & tools
lore
#0 lore raw

IIRC initramfs already contains these devices, but anyway it's important to remember that if they are removed everything will break. Should we start thinking about how udev could be used in the real world?

----- Forwarded message from [email protected] -----

From: [email protected]
To: Marco d'Itri <[email protected]>
Subject: Re: [udev] howto

Quoted 5 lines · Marco d'Itri
Quoted 1 line · On Feb 04, [email protected] wrote:

Can You please explain me how to do it? Or point me to some link where it is

You don't. Currently udev is experimental and uses /udev to not mess with your system. If you feel brave then make a symlink from /dev.

Maybe you dont care but I have installed udev and it is working for me great. But there were some problems.

I have found that devices:
/dev/null,
/dev/console

are needed befode /etc/init.d/udev starts (/etc/rcS.d/S37udev) so I twisted the init script not to remove those file during shutdown, and to create it during booting only if needed.

I didnt know where should I send this thing (maybe this is only my problem) but I use your debs so I am sending it to you.

Bye

-mat

This is the patch:

etc/init.d/udev renamed from orig/udev +14 -2
@@ -28,7 +28,19 @@
       export DEVPATH=${j#/sys}
       class=${DEVPATH#/class/}
       class=${class%/*}
-#      echo -n " $DEVPATH($class)"
+
+      special=${DEVPATH#/class/}
+      special=${special#$class/}
+      case "$special" in
+        null | console)
+           [ -c "/dev/$special" ] && continue
+           echo "/dev/$special included."
+           ;;
+        *)
+           #echo "$special -> udev."
+           ;;
+      esac
+      #echo -n " $DEVPATH($class)"
       { $UDEV $class || echo -n " failed: $DEVPATH"; } &
     done
   done
@@ -62,7 +74,7 @@
     [ -d /udev ] || mkdir /udev
     mount_sysfs
     export ACTION­d
-    echo -n "Creating initial udev device nodes..."
+    echo "Creating initial udev device nodes..."
     synthesize_events
     make_extra_nodes
     echo "done."
Quoted 5 lines

--
ciao, |
Marco | [4460 diQvhSSO5SlHk]

-mat

----- End forwarded message -----

Signature · 13 lines
ciao, |
Marco | [4582 ig78KWqxlsXk.]


-------------------------------------------------------
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_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 3 lines · Marco d'Itri

IIRC initramfs already contains these devices, but anyway it's important to remember that if they are removed everything will break. Should we start thinking about how udev could be used in the real world?

the devices that are needed are somewhat distro (well, init scripts) dependent ...

Quoted 2 lines

Maybe you dont care but I have installed udev and it is working for me great. But there were some problems.

using /udev never even occurred to me ... i've been using udev on my /dev since 002 :x

Quoted 3 lines

I have found that devices:
/dev/null,
/dev/console

like i said above, this is specific to your init scripts ... /dev/console is needed if you want to see output from your init scripts ... you can boot *just fine* without it ... just wait a while into the getty's pop up :)
/dev/null is needed by your _init scripts_ ... many boot up scripts just pump their output into /dev/null and then when there are errors, they output happy little errors for the user to understand ... if, before you've loaded up udev, you try to pump into /dev/null and your / is ro, the init scripts are going to think the command it just tried to run failed and so in general, everything dies

i've already created a small patch for inclusion with the Gentoo baselayout to handle the case when /dev/null doesnt exist (yeah, i like to rm -rf /dev/* ; sync ; reboot -nf for fun ... no seriously, i do) that way if you dont have anything in /dev/, your machine will boot up and you can login to create whatever nodes you may need in order to have a 'normal' bootup (which is kind of where you're at matt, /dev/console and /dev/null)
-mike