[BusyBox] Re: finding real root device

Glenn McGrath bug1 at optushome.com.au
Thu Jan 11 12:16:16 UTC 2001


Erik Andersen wrote:
> 
> 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
> 

Ive got devfs and root reiserfs workign with busybox, it was very simple
to setup, just used the install.sh to create the busybox links, made a
few blank directories, used grub to boot it and im away.

The busybox sh is behaving much better than when i tried it a few month
ago.

I havent done any proper tests, df works it displays the real root
device, not /dev/root, but i doubt this is a proper test for the
find_real_root_device_name() becasue with devfs /dev/root is a symlink
to the the real root device.

Devfs does have the major and minor numbers for all the devices, seems
silly now that i suggesting that it mightnt..

Anyway i will try and do some more thourugh tests, and maybe try
reiserfs without devfs.


Glenn





More information about the busybox mailing list