[NewCommand] set real_root_dev

Rob Landley rob at landley.net
Fri Feb 10 00:40:00 UTC 2006


On Thursday 09 February 2006 02:27, Bernhard Fischer wrote:
> >Anyway, converting to octal's easy enough:
> >
> >./busybox printf %o 9
> >11
>
> We have a mountpoint applet. Try something like
> printf "%o:%o" $(mountpoint -x /dev/root | sed -e 's/:/ /g')

Except that /dev/root doesn't actually exist.

However, "mountpoint -d /" may actually do what you want.

By the way, according to linux-2.6.15/Documatation/initrd.txt, setting 
real-root-dev to major 3 minor 1 is:
echo 0x301 >/proc/sys/kernel/real-root-dev

I just wrote that into mine and catted it back, and got 773 which is the 
decimal (not octal) conversion of that hex value.

So it looks like what you want is something like:

printf "0x%x%02x" $(mountpoint -d / | sed '/:/ /')

Rob

P.S.  By the way, on the design of "mountpoint"?  It's easy to autodetect 
whether we're pointed at a filesystem or a block device, so that shouldn't 
have two options.  The unix way of handling quiet/verbose is that quiet is 
the default and an option like -v makes it verbose.  And there's no way to go 
"mountpoint ." and get it to tell you where the current filesystem is, 
although df can manage it if you want to chop the result out with awk.
-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.



More information about the busybox mailing list