dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
599 stars 399 forks source link

Fails: root=/dev/nbd0 netroot=nbd:server:export #539

Closed alkisg closed 4 years ago

alkisg commented 5 years ago

There's an issue in /usr/sbin/nbdroot which causes the following kernel cmdline to fail: root=/dev/nbd0 netroot=nbd:server:export

One reason to pass both root= and netroot= is, for example, root=/dev/nbd0p1 netroot=, which mounts a whole raw disk over the net, but boots its first partition. And while root=/dev/nbd0p1 does work, the symmetrical root=/dev/nbd0 doesn't.

The problem is in line 93: if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then

This doesn't match "/dev/nbd0", so nbdroot thinks it doesn't need to create the hookdir mount hook, so boot proceeds without blocking, failing because the device node /dev/nbd0 there is ready before networking comes up, before nbd-client runs etc.

So this line should become: if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" -o "${root#block:/dev/nbd}" != "${root}" ]; then

johannbg commented 4 years ago

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

alkisg commented 4 years ago

Hello! I tested dracut while developing https://ltsp.org, and I reported the problems I found, but since they weren't fixed, all ltsp users currently use initramfs-tools based distributions, we have no dracut installations.

Feel free to close it, if any dracut developer or user wants to work on this in the future they can reopen it then. Thanks!

johannbg commented 4 years ago

Yeps closing