summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmodules.d/95iscsi/iscsiroot.sh5
-rwxr-xr-xmodules.d/95iscsi/parse-iscsiroot.sh4
-rwxr-xr-xmodules.d/95nbd/nbdroot.sh9
3 files changed, 15 insertions, 3 deletions
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index 20738cfd..463fa458 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -10,6 +10,7 @@
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
+type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
@@ -43,6 +44,8 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; 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
@@ -136,6 +139,8 @@ handle_netroot()
# 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
+ write_fs_tab /dev/root
+ wait_for_dev /dev/root
# install mount script
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
index cc59f5aa..eccde3cc 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -24,6 +24,8 @@
[ -n "$iscsiroot" ] && [ -n "$iscsi_firmware" ] && die "Mixing iscsiroot and iscsi_firmware is dangerous"
+type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh
+
# Root takes precedence over netroot
if [ "${root%%:*}" = "iscsi" ] ; then
if [ -n "$netroot" ] ; then
@@ -33,6 +35,8 @@ if [ "${root%%:*}" = "iscsi" ] ; 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
root=/dev/root
+
+ write_fs_tab /dev/root
fi
# If it's not empty or iscsi we don't continue
diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh
index b176a165..4aebef0d 100755
--- a/modules.d/95nbd/nbdroot.sh
+++ b/modules.d/95nbd/nbdroot.sh
@@ -101,11 +101,14 @@ nbd-client $preopts "$nbdserver" $nbdport /dev/nbd0 $opts || exit 1
# add the udev rules for mounting the nbd0 device
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;' \
+ 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; type systemctl >/dev/null 2>&1 && systemctl --no-block start sysroot.mount;:; };} && rm $job;' \
> $hookdir/initqueue/settled/nbd.sh
- printf '/bin/mount -t %s -o %s %s %s\n' \
- "$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \
+ type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh
+ write_fs_tab /dev/nbd0 "$nbdfstype" "$fsopts"
+
+ printf '/bin/mount %s\n' \
+ "$NEWROOT" \
> $hookdir/mount/01-$$-nbd.sh
fi