[uClibc-cvs] [buildroot 0000290]: (buildroot) udev doesn't manage /dev when it's configured [patch included]

bugs at busybox.net bugs at busybox.net
Mon Aug 8 05:00:50 UTC 2005


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=290 
====================================================================== 
Reported By:                db
Assigned To:                uClibc
====================================================================== 
Project:                    buildroot
Issue ID:                   290
Category:                   Other
Reproducibility:            always
Severity:                   block
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             06-06-2005 00:09 PDT
Last Modified:              08-07-2005 22:00 PDT
====================================================================== 
Summary:                    (buildroot) udev doesn't manage /dev when it's
configured [patch included]
Description: 
As is well known by now, "devfs" is about to be removed from Linux 2.6
kernels.
Plus it turns out that embedded systems tend to use that more than most
other
systems, for various reasons ... including systems that buildroot makes.

Buildroot hasn't yet been able to rely on "udev" since it doesn't turn it
on.
It just sits there dead, doing nothing useful.

This patch provides a basic working integration of udev-058 (current)
with
buildroot, and has been tested with Linux 2.6.12-rc5 on two ARM9 cores.
The model is a basic one (no initramfs or initrd), and it just sets up a
ramfs /dev holding the system's device nodes.  The integration will
likely
be improved or tweaked in system-specific ways.  And it seems like udev
hasn't yet been tuned for work on embedded systems either...

====================================================================== 

---------------------------------------------------------------------- 
 andersen - 06-09-05 03:08  
---------------------------------------------------------------------- 
I note that udev.mk is trying to run mkdev.  This is bad, because
mkdev requires root, and buildroot should never be run as root,
lest a typo might result in nuking something in your build system.

It would be far better to fix the buildroot tar target to use fakeroot
rather than kluding in calls to mkdev and running as root.  A version
of busybox mkdevs that uses the device tables used for cramfs, jffs2,
and ext2 targets could make generating needed device nodes with fakeroot
a pretty simple task.  The busybox makedevs +
busybox/patches/makdevs_table.diff
would do the trick...

Anyway, for now I've nuked the mkdev calls. 

---------------------------------------------------------------------- 
 db - 06-09-05 13:03  
---------------------------------------------------------------------- 
Hmm, I see this patch has been partially integrated; thanks.  The
result is still an un-bootable system however:

 - The resulting root fs images -- the raw build_*/root image as
   well as the root_fs_*.tar image -- aren't bootable because of
   the missing device nodes.  OK, you've explained why you don't
   like that, but the result is still an un-bootable image.

 - You changed when the UDEV init script is run, so that it's too
   late.  It's got to run _before_ the "mount -a", since it's
   providing a whole new /dev/ file system.  This matters for
   things like accessing the /dev/pts files so "ssh" works, as
   well as (on systems that care) /dev/shm.

I've got a patch fixing these two, which I'll add here after I've
had time to test this with the other stuff I've got in the works.

(No, I can't use jffs2 or cramfs images.  The development cycle
starts with NFS root, and jffs2 comes later.  Also, that busybox
makdevs_table.diff won't solve the problem, since the resulting
filesystem doesn't boot far enough to run busybox ... it's missing
the console, so Linux chokes, as well as two files needed by the
C runtime.) 

---------------------------------------------------------------------- 
 db - 06-14-05 22:38  
---------------------------------------------------------------------- 
Here's the patch I'm using on top of current SVN. 

---------------------------------------------------------------------- 
 andersen - 06-24-05 00:39  
---------------------------------------------------------------------- 
The result is still an un-bootable system however since you did not read my
suggestion about using fakeroot and possibly makedevs.  :-)

Your br2-udev-v2.patch is not acceptible since it relies on using 'mknod',
which requires that buildroot be run as root.  If you run buildroot as root
then the next time someone (me, you, anyone) makes a small typo, your
entire build system could be completely destroyed.  I don't want that on
my conscience, and you certainly don't want that to happen the night
before you have to ship a product or are about to demo your last 6 months
of work to a client.....

Please come up with a different solution.  I recommend taking a look at
target/tar/tarroot.mk and/or target/squashfs/squashfsroot.mk for
acceptible methods of creating device nodes for the target. 

---------------------------------------------------------------------- 
 pnoffke - 08-07-05 22:00  
---------------------------------------------------------------------- 
I think a way to fix this is as follows:

If udev is selected for the target, use a different device table.

I've modified target/generic/Makefile.in, and created a udev device table
in target/generic/udev_table.txt.  I am not yet able to use svn from
behind my company's firewall, so I will just upload the two files.  

It might be better to rename the device_table.txt file to udev_table.txt. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-06-05 00:09  db             New Issue                                    
06-06-05 00:09  db             File Added: br2-udev.patch                    
06-09-05 03:08  andersen       Note Added: 0000239                          
06-09-05 13:03  db             Note Added: 0000241                          
06-14-05 22:38  db             Note Added: 0000243                          
06-14-05 22:39  db             File Added: br2-udev-v2.patch                    
06-24-05 00:39  andersen       Note Added: 0000255                          
08-07-05 22:00  pnoffke        Note Added: 0000391                          
======================================================================




More information about the uClibc-cvs mailing list