Ruminations on Udev, null and console

alupu at verizon.net alupu at verizon.net
Mon Feb 28 22:58:34 PST 2011


Bruce Dubbs wrote,

> It's in section 6.2.1, not 6.2.21

Hi Bruce,

Typo.  Sorry.

>> C.2. The whole "Create some devices and directories ..." in
>> "udev-1xx" should go. Misleading, outdated and nonsensical.

> No, it really can't go. I went into my sandbox, deleted
> /lib/udev/devices/null, and commented out the copy to /dev in the udev
> bootscript.

> When I rebooted, I got the following messages:

> cannot open /dev/null
> FATAL: Module platform: regulatory not set
> FATAL: Module LNXSYSTEM: not found
> FATAL: Module doc not found
> FATAL: pci:v............... not found

> This last was repeated about 20 times for various pci values.

> When I added null back to /lib/udev/devices/ and reenabled the copy in
> the bootscripts, I got none of these messages.

Awful.  A few thoughts.
As I said in my OP:

>> LFS book: Version SVN-20110218
>> Script activation order in '... rcsysinit.d/':
>>   mountkernfs
>>   consolelog
>>   modules (no modules to install, in my case)
>>   udev
>>   ...

iN MY PREvious post, sections 5-7, null (and console) is already fully
represented.  Unfortunately, "modules" comes before "udev":

In "modules",
            modprobe ${module} ${args} >/dev/null

            # Print the module name if successful,
            # otherwise take note.
            if [ $? -eq 0 ]; then
                boot_mesg -n " ${module}" ${NORMAL}
            else
                ...

the construct ">/dev/null" could be avoided, I think.
'modprobe' offers "-q" (like 'mountpoint', previously) without
any apparent loss of functionality ("if [ $? -eq 0 ] ...").

If you use "-q" in "mountkernfs" and "udev", the only null's left
are in "rc", in the two 'for' loops:

for i ... 2> /dev/null

I just removed the "2> /dev/null" and I haven't encountered
any problems as yet (nor extra messages on the console log). 
I'm definitely uneasy for situations like,
<< ls -v /etc/rc.d/rc4.d/K*
ls: cannot access /etc/rc.d/rc4.d/K*: No such file or directory
>>
for level 4 and also for 5.

Obviously, there are a gazillion of systems out there
and this is just one of the myriad ways to skin a cat.
(I do with compassion:)

Thank you for your comments,
-- Alex
--------------------------------------------------------
For reference, an extract from my OP:

<< ["udev"]
 The irony here is that 'mountpoint' offers a "-q" option.

2. "mountkernfs" script coming before "udev" in the boot
 sequence (_has_ to mount 'sys') has two offending lines
 with ">/dev/null".  Can be corrected with a "-q".

 A bigger problem is presented by "rc".
 "rc" is the first in line, so to speak, so it can get ugly.
 Has two "for" lines with "2> /dev/null".
 My system hangs, with two error lines around INIT:
  "... init.d/rc: ... /dev/null: Read-only file system"
 I deleted the two "2> /dev/null"'s, and damn the torpedoes.
 So far, I've lived to tell this story here.
>>

Please note that (2) "rc" above was happening when
I was experimenting with NO "metal" null.



More information about the lfs-support mailing list