]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Also export root= boot param for hostonly-cmdline case.
authorThorsten Behrens <tbehrens@suse.com>
Thu, 11 Dec 2014 14:46:30 +0000 (15:46 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 16 Dec 2014 12:29:37 +0000 (13:29 +0100)
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

index c2f71bba7ffe435a608aa8258be89a8c15a16dad..81de1773a28aa0b1c0c2bdf918c36874296e6b18 100755 (executable)
@@ -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