From: Harald Hoyer Date: Mon, 13 Jul 2009 13:00:14 +0000 (+0200) Subject: only install mount script, if nbd-client succeeded X-Git-Tag: 0.5~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00c5ab3e33df5101236b7c38ffc146029a1652a3;p=platform%2Fupstream%2Fdracut.git only install mount script, if nbd-client succeeded --- 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