dracut/0069-Also-export-root-boot-param-for-hostonly-cmdline-cas.patch

49 lines
1.6 KiB
Diff
Raw Normal View History

From 7700b3df4c753112d9a38745388b1e1fd54ce5c5 Mon Sep 17 00:00:00 2001
From: Thorsten Behrens <tbehrens@suse.com>
Date: Thu, 11 Dec 2014 15:46:30 +0100
Subject: [PATCH] Also export root= boot param for hostonly-cmdline case.
If there's a root fallback, at least attempt to have it falling
back to the last root filesystem this system ran off of.
Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
modules.d/95rootfs-block/module-setup.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules.d/95rootfs-block/module-setup.sh b/modules.d/95rootfs-block/module-setup.sh
index c2f71bb..81de177 100755
--- a/modules.d/95rootfs-block/module-setup.sh
+++ b/modules.d/95rootfs-block/module-setup.sh
@@ -29,14 +29,18 @@ cmdline_journal() {
return 0
}
-# called by dracut
-cmdline() {
+cmdline_rootfs() {
local dev=/dev/block/$(find_root_block_device)
if [ -e $dev ]; then
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
printf " rootflags=%s" "$(find_mp_fsopts /)"
printf " rootfstype=%s" "$(find_mp_fstype /)"
fi
+}
+
+# called by dracut
+cmdline() {
+ cmdline_rootfs
cmdline_journal
}
@@ -45,6 +49,8 @@ install() {
if [[ $hostonly_cmdline == "yes" ]]; then
local _journaldev=$(cmdline_journal)
[[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
+ local _rootdev=$(cmdline_rootfs)
+ [[ $_rootdev ]] && printf "%s\n" "$_rootdev" >> "${initdir}/etc/cmdline.d/95root-dev.conf"
fi
inst_multiple umount