[PATCH 12/15] Also export root= boot param for hostonly-cmdline case.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Thorsten Behrens <tbehrens@xxxxxxxx>

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@xxxxxxxx>
Signed-off-by: Thomas Renninger <trenn@xxxxxxx>
---
 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
-- 
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux