Alternative to 'rdev' in BusyBox

Denys Vlasenko vda.linux at googlemail.com
Fri Aug 15 19:37:28 UTC 2008


On Friday 15 August 2008 20:54, Grant Erickson wrote:
> In thread:
> 
>     http://www.busybox.net/lists/busybox/2007-June/027878.html
> 
> Mike Frysinger suggested that 'rdev' was the preferred way of determining
> the real device corresponding to the kernel-created but non-file
> system-populated "/dev/root". However, as of busybox-1.11.1, rdev does not
> appear to exist as a tool.

Yes, it isn't in busybox.

I straced rdev and it seems to scan /dev to find a device which
matches stat("/") device major/minor.

> It appears that this aspect of rdev could be trivially implemented through
> find_block_device() in libbbb/find_root_device.c.

Yes. Ironically, currently find_block_device() in unused.

> Is there a better, more preferable solution in embedded systems leveraging
> BusyBox to determine the name of the real device node synonymous with
> /dev/root, aside form pulling in util-linux-ng?

A limited implementation of rdev (sans hacky vmlinux editing stuff)
is a good busybox applet candidate.

Do you care about it enough to submit a patch?
--
vda



More information about the busybox mailing list