[f22-branch 1/1] Handle /boot on btrfs for live (#1200539)

bcl installerbot-noreply at redhat.com
Wed Mar 18 00:17:17 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

live has problems with /boot on btrfs because there is no initial
initramfs so grub.cfg is created without an initrd line and grubby
doesn't add it when the initramfs is generated.

This kludge runs writeBootLoader a second time *only* if this is a live
install with /boot on btrfs.
---
 pyanaconda/install.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pyanaconda/install.py b/pyanaconda/install.py
index a0c6f7f..96b9bb7 100644
--- a/pyanaconda/install.py
+++ b/pyanaconda/install.py
@@ -22,6 +22,7 @@
 
 from blivet import callbacks
 from blivet.osinstall import turnOnFilesystems
+from blivet.devices import BTRFSDevice
 from pyanaconda.bootloader import writeBootLoader
 from pyanaconda.progress import progress_report, progress_message, progress_step, progress_complete, progress_init
 from pyanaconda.users import createLuserConf, getPassAlgo, Users
@@ -107,6 +108,12 @@ def doConfiguration(storage, payload, ksdata, instClass):
     with progress_report(_("Generating initramfs")):
         payload.recreateInitrds()
 
+    # Work around rhbz#1200539, grubby doesn't handle grub2 missing initrd with /boot on btrfs
+    # So rerun writing the bootloader if this is live and /boot is on btrfs
+    if flags.flags.livecdInstall and (not ksdata.bootloader.disabled and ksdata.bootloader != "none") \
+       and isinstance(storage.mountpoints.get("/boot"), BTRFSDevice):
+        writeBootLoader(storage, payload, instClass, ksdata)
+
     if willRunRealmd:
         with progress_report(_("Joining realm: %s") % ksdata.realm.discovered):
             ksdata.realm.execute(storage, ksdata, instClass)


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/724bf2c78ba8eebd1da44cd25bcecdd6969b9db3


More information about the anaconda-patches mailing list