[LFS Trac] #2685: Does udev populate /dev correctly?

LFS Trac trac at linuxfromscratch.org
Thu Jun 17 18:31:12 PDT 2010


#2685: Does udev populate /dev correctly?
-----------------------------------------+----------------------------------
 Reporter:  bdubbs@…                     |       Owner:  lfs-book@…                   
     Type:  defect                       |      Status:  new                          
 Priority:  normal                       |   Milestone:  6.7                          
Component:  Bootscripts                  |     Version:  SVN                          
 Severity:  normal                       |    Keywords:                               
-----------------------------------------+----------------------------------

Comment(by hohoxu_hao115):

 Hi,Andrew Benton

 I saw your reply on lfs-dev, I haven't  subscribed to lfs-dev mailing
 list, so I reply here.

 Here is what my system shows:


 {{{
 [hongxun at HouLFS-09:17:11 ~]$ ls -l /lib/udev/devices
 total 12
 crw-rw-rw- 1 root root 1, 3 Jun 18  2010 null1
 drwxr-xr-x 2 root root 4096 Mar 25 15:23 pts
 drwxr-xr-x 2 root root 4096 Mar 25 15:23 shm
 drwxr-xr-x 2 root root 4096 Jun 18 09:04 testdir

 [hongxun at HouLFS-09:14:08 devices]$ ls -dl /dev/{pts,shm,testdir,null1}
 crw-rw-rw- 1 root root 1, 3 Jun 18  2010 /dev/null1
 drwxr-xr-x 2 root root    0 Jun 18  2010 /dev/pts
 drwxrwxrwt 2 root root   40 Jun 18 09:11 /dev/shm
 drwxr-xr-x 2 root root   40 Jun 18  2010 /dev/testdir

 [hongxun at HouLFS-09:26:51 ~]$ diff -u lfs-
 bootscripts-20100529/lfs/init.d/udev /etc/rc.d/init.d/udev
 --- lfs-bootscripts-20100529/lfs/init.d/udev    2010-05-29
 18:41:33.000000000 +0800
 +++ /etc/rc.d/init.d/udev       2010-06-18 09:26:51.207638349 +0800
 @@ -34,28 +34,26 @@
                 # made or removed during this boot don't affect the next
 one.
                 # The reason we don't write to mtab is because we don't
 ever
                 # want /dev to be unavailable (such as by `umount -a').
 -               if ! mountpoint /dev > /dev/null; then
 -                       mount -n -t tmpfs tmpfs /dev -o mode=755
 -               fi
 -               if [ ${?} != 0 ]; then
 -                       echo_failure
 -                       boot_mesg -n "FAILURE:\n\nCannot mount a tmpfs"
 ${FAILURE}
 -                       boot_mesg -n " onto /dev, this system will be
 halted."
 -                       boot_mesg -n "\n\nAfter you press Enter, this
 system"
 -                       boot_mesg -n " will be halted and powered off."
 -                       boot_mesg -n "\n\nPress Enter to continue..."
 ${INFO}
 -                       boot_mesg "" ${NORMAL}
 -                       read ENTER
 -                       /etc/rc.d/init.d/halt stop
 -               fi
 +               #if ! mountpoint /dev > /dev/null; then
 +               #       mount -n -t tmpfs tmpfs /dev -o mode=755
 +               #fi
 +#              if [ ${?} != 0 ]; then
 +#                      echo_failure
 +#                      boot_mesg -n "FAILURE:\n\nCannot mount a tmpfs"
 ${FAILURE}
 +#                      boot_mesg -n " onto /dev, this system will be
 halted."
 +#                      boot_mesg -n "\n\nAfter you press Enter, this
 system"
 +#                      boot_mesg -n " will be halted and powered off."
 +#                      boot_mesg -n "\n\nPress Enter to continue..."
 ${INFO}
 +#                      boot_mesg "" ${NORMAL}
 +#                      read ENTER
 +#                      /etc/rc.d/init.d/halt stop
 +#              fi

                 # Udev handles uevents itself, so we don't need to have
                 # the kernel call out to any binary in response to them
 -               echo > /proc/sys/kernel/hotplug
 +               #echo > /proc/sys/kernel/hotplug

 -               # Copy the only static device node that Udev >= 155
 doesn't
 -               # handle to /dev
 -               cp -a /lib/udev/devices/null /dev
 +               # Copy static device nodes to /dev

                 # Start the udev daemon to continually watch for, and act
 on,
                 # uevents

 [hongxun at HouLFS-09:26:53 ~]$ udevd -V
 157
 }}}

 It's no doubt that udev daemon will copy the files for you.

 Do {pts,shm} exist under your /lib/udev/devices directory?

-- 
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/2685#comment:2>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.



More information about the lfs-book mailing list