[BusyBox] Re: finding real root device

Erik Andersen andersen at codepoet.org
Tue Jan 9 06:30:37 UTC 2001


On Mon Jan 08, 2001 at 10:03:18AM +1100, Glenn McGrath wrote:
> Glenn McGrath wrote:
> > 
> > Differences
> >         - 40 bytes larger
> >         - depends on /proc
> >         - wont work if you have a strange root device that isnt in
> > /proc/partitions (e.g. loop)
> >         + probably faster than stating /dev/*
> > 
> Does the existing code work with devfs, i would think (without trying)
> that it wouldnt becasue devfs doesnt have the device numbers, its a
> virtual filesystem.
> 
> 	+ new code should work with devfs

To be honest, I have never been brave enough to actually install and try devfs.
Right now, I feel certain that the current find_real_root_device_name() in
utility.c would not work with devfs since it does not recurse down into child
directories (and having devices hidden in subdirectories is something devfs is
very hip on having).  However, presumably if you have devfsd running, then /dev
should be properly populated and find_real_root_device_name() should work as
usual. 

However, if devfs completely throws away major and minor numbers altogether,
then not only is find_real_root_device_name() broken, but other things are
broken as well, such as tar and ls...  I highly doubt that Richard Gooch could
have been that foolish.  I'd be very interested in seeing someone test this.

On the subject of testing find_real_root_device_name() -- I would very much
like to see if somone could do some testing for me (I'm in Europe for the week
and will have little chance to do mush busybox-ing besice answering email).  It
turns out that find_real_root_device_name() does not work on reiserfs, because
reiserfs does not set st_rdev in each of its inodes.  By contrast, ext2 sets
st_rdev to be the device on which the fs lives, for each inode in the
filesystem.  Hans Reiser seems to think busybox is broken.  I think reiserfs is
broken.  If someone has some time, I'd love to see find_real_root_device_name()
tested on a bunch of different filesystems using
    -    if (statBuf.st_rdev == rootStat.st_rdev) {
    +    if (statBuf.st_dev == rootStat.st_dev) {
to see if the behavior changes at all...

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list