Evan Broder ad1a59456b initramfs-tools: Fix handling of numeric root= arguments to be udev-friendly
If you pass a root= argument with a numeric device number
(i.e. root=0806), that's currently resolved by running mknod to create
a /dev/root device with an appropriate major/minor number and setting
ROOT=/dev/root (the parse_numeric function in scripts/functions).

However, this /dev/root device is completely unknown to udev. On
Ubuntu, this leads to problems because we use udev to wait for the
root device to appear. Since /dev/root isn't in udev's database, the
boot hangs forever (well, it hangs until rootdelay passes).

udev's standard configuration creates /dev/block/N:N symlinks for
every block device in its database (see the first non-comment line of
/lib/udev/rules.d/50-udev-default.rules). Setting ROOT to the
/dev/block/N:N symlink instead of creating a new /dev/root device and
setting ROOT to that solves Ubuntu's problem.

See https://bugs.launchpad.net/bugs/576429 for more discussion.

I think I actually want to take a different approach in order to
maintain the current semantics of setting root=X:Y.

In particular, if the user passes in a value that has a prefixed 0,
that will get passed directly to mknod, which would treat the number
as octal. So root=010:0 would actually create a device with major
number 8. Instead of trying to resolve this directly, we can use the
shell's arithmetic expansion to get a decimal number back.

Closes: #606806

[ change condition from specific udev script to udevd availability. ]
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
2011-03-30 11:35:20 +02:00
..
nfs
2010-06-18 11:43:37 +02:00