From 00c5ab3e33df5101236b7c38ffc146029a1652a3 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 13 Jul 2009 15:00:14 +0200 Subject: [PATCH] only install mount script, if nbd-client succeeded --- modules.d/95nbd/nbdroot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot index ecac211..96f0cf0 100755 --- a/modules.d/95nbd/nbdroot +++ b/modules.d/95nbd/nbdroot @@ -90,17 +90,17 @@ while [ ! -b /dev/nbd0 ]; do i=$(( $i + 1)) done +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 - printf 'KERNEL=="nbd0", SYMLINK+="root"\n'> /etc/udev/rules.d/99-mount.rules + ln -s /dev/nbd0 /dev/root printf '/bin/mount -t %s -o %s %s %s\n' \ "$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \ > /mount/01-$$-nbd.sh fi -nbd-client $preopts "$nbdserver" "$nbdport" /dev/nbd0 $opts || exit 1 - # NBD doesn't emit uevents when it gets connected, so kick it echo change > /sys/block/nbd0/uevent exit 0 -- 2.7.4