summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2009-10-01 14:32:01 +0200
committerHarald Hoyer <harald@redhat.com>2009-10-01 14:46:15 +0200
commitd84c1df90623220cfa529b679cbc2b363a8a36e5 (patch)
tree9f6ddd8a642c9cee323030c5149909c85b2d77d3
parenta1dd79d4fe33a0859aafe79e4a19f4f5e909aee7 (diff)
nbd/nbdroot: add better check if nbd0 is ready to be mounted
-rwxr-xr-xmodules.d/95nbd/nbdroot8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot
index 1661b94..51a1a94 100755
--- a/modules.d/95nbd/nbdroot
+++ b/modules.d/95nbd/nbdroot
@@ -93,10 +93,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
- echo 'settle_exit_if_exists="--exit-if-exists=/dev/nbd0"; [ -e /dev/nbd0 ] && { ln -s /dev/nbd0 /dev/root 2>/dev/null; rm "$job"; }' \
- >> /initqueue/nbd.sh
-
- echo '[ -e /dev/root ]' > /initqueue-finished/nbd.sh
+ 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;' \
+ > /initqueue-settled/nbd.sh
printf '/bin/mount -t %s -o %s %s %s\n' \
"$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \
@@ -105,6 +103,4 @@ fi
# NBD doesn't emit uevents when it gets connected, so kick it
echo change > /sys/block/nbd0/uevent
-# force udevsettle to break
-> /initqueue/work
exit 0