From cee3b8966c064969bd784285ce63702898a753a3 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 11 Aug 2011 14:22:47 +0200 Subject: [PATCH] 95nbd/nbdroot: also mount nbd0 for root=dhcp and missing root= --- modules.d/95nbd/nbdroot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot index f99c36f..1fb2140 100755 --- a/modules.d/95nbd/nbdroot +++ b/modules.d/95nbd/nbdroot @@ -94,7 +94,8 @@ nbd-client $preopts "$nbdserver" "$nbdport" /dev/nbd0 $opts || exit 1 # If we didn't get a root= on the command line, then we need to # add the udev rules for mounting the nbd0 device -if [ ! -e /etc/udev/rules.d/99-mount.rules ]; then +root=$(getarg root=) +if [ -z "$root" ] || strstr "$root" "nbd:" || strstr "$root" "dhcp"; then echo '[ -e /dev/root ] || { info=$(udevadm info --query=env --name=/dev/nbd0); [ -z "${info%%*ID_FS_TYPE*}" ] && { ln -s /dev/nbd0 /dev/root 2>/dev/null; :; };} && rm $job;' \ > $hookdir/initqueue/settled/nbd.sh @@ -105,4 +106,5 @@ fi # NBD doesn't emit uevents when it gets connected, so kick it echo change > /sys/block/nbd0/uevent +udevadm settle exit 0 -- 2.7.4