]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi/nbd: do not try to mount the whole disk, if root= is missing
authorHarald Hoyer <harald@redhat.com>
Wed, 30 Oct 2013 16:36:54 +0000 (17:36 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 30 Oct 2013 16:38:43 +0000 (17:38 +0100)
only mount the whole disk for root=dhcp

modules.d/95iscsi/iscsiroot.sh
modules.d/95nbd/nbdroot.sh

index 5181f523b792d8fb157a5a0cae0cb957f7717d3e..738fff44972fbddde60243bd88040f0d11eb5003 100755 (executable)
@@ -40,14 +40,6 @@ modprobe crc32c 2>/dev/null
 [ -e /sys/module/bnx2i ] && iscsiuio
 
 if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
-    if [ -z "$root" -o -n "${root%%block:*}" ]; then
-        # if root is not specified try to mount the whole iSCSI LUN
-        printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
-        udevadm control --reload
-        write_fs_tab /dev/root
-        wait_for_dev /dev/root
-    fi
-
     for p in $(getargs rd.iscsi.param -d iscsi_param); do
        iscsi_param="$iscsi_param --param $p"
     done
@@ -55,6 +47,7 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
     iscsistart -b $iscsi_param
     echo 'started' > "/tmp/iscsistarted-iscsi"
     echo 'started' > "/tmp/iscsistarted-firmware"
+    need_shutdown
     exit 0
 fi
 
@@ -137,7 +130,7 @@ handle_netroot()
 
 # FIXME $iscsi_protocol??
 
-    if [ -z "$root" -o -n "${root%%block:*}" ]; then
+    if [ "$root" = "dhcp" ]; then
         # if root is not specified try to mount the whole iSCSI LUN
         printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules
         udevadm control --reload
index 823da0ea030bfd88d0e6eeaf6d447863ffdde8fc..2e9d917428e712a0416bceb031b4716ee8379a5c 100755 (executable)
@@ -97,7 +97,7 @@ done
 
 # 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 [ -z "$root" -o -n "${root%%block:*}" -o "$root" = "block:/dev/root" ]; then
+if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then
     printf 'KERNEL=="nbd0", ENV{DEVTYPE}!="partition", ENV{ID_FS_TYPE}=="?*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-nbd-root.rules
     udevadm control --reload
     type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh