[BusyBox] Serious bug in find_mount_point.c
Rob Landley
rob at landley.net
Mon Mar 14 04:20:50 UTC 2005
On Saturday 12 March 2005 08:53 pm, Rainer Weikusat wrote:
> Rob Landley <rob at landley.net> writes:
> > On Friday 11 March 2005 05:21 pm, Rainer Weikusat wrote:
> >> Brent Roman <brent at mbari.org> writes:
> >> > Guess what?
> >> >
> >> > The fedora 2 box has no /dev/root !!
> >>
> >> Hmm ... why do you think it should?
> >
> > Because it's in the linux device list?
> >
> > http://www.lanana.org/docs/device-list/devices-2.6+.txt
> >
> > Block major 4, minor 0.
>
> 4 block Aliases for dynamically allocated major devices to be used
> when its not possible to create the real device nodes
> because the root filesystem is mounted read-only.
>
> 0 = /dev/root
>
> [...]
>
> Locally defined links
>
> The following links may be established locally to conform to
> the configuration of the system. This is merely a tabulation
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> of existing practice, and does not constitute a
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> recommendation. However, if they exist, they should have the
> ^^^^^^^^^^^^^^^
> following uses.
>
> [...]
>
> /dev/root root device symbolic Current root filesystem
> /dev/swap swap device symbolic Current swap device
I.E. if you don't want to use the block device to what the kernel autodetected
on the way up, you can make it a symlink to your real device instead.
As for this being "just a convention":
knoppix at ttyp1[linux-2.6.11.3]$ grep "\/dev\/root" init/*
init/do_mounts.c: create_dev("/dev/root", ROOT_DEV, NULL);
init/do_mounts.c: do_mount_root("/dev/root", "nfs", root_mountflags,
data) == 0)
init/do_mounts.c: fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0);
init/do_mounts.c: create_dev("/dev/root", ROOT_DEV, root_device_name);
init/do_mounts.c: mount_block_root("/dev/root", root_mountflags);
init/do_mounts_initrd.c: create_dev("/dev/root.old", Root_RAM0, NULL);
init/do_mounts_initrd.c: mount_block_root("/dev/root.old",
root_mountflags & ~MS_RDONLY);
init/do_mounts_initrd.c: int fd = sys_open("/dev/root.old",
O_RDWR, 0);
init/do_mounts_rd.c: create_dev("/dev/root", ROOT_DEV, root_device_name);
init/do_mounts_rd.c: return rd_load_image("/dev/root");
Can't say I've looked into it too closely since 2.4, though. That area's
changed a bit...
Rob
More information about the busybox
mailing list