From cedfb60b4cea33edcc6308875a5c8b2aa255bc20 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Sat, 29 Jun 2019 15:46:45 +0800 Subject: [PATCH] support initramfs boot - Create fake initramfs to cheat grub-mkconfig which could generate grub.cfg that have initrd setting. - Make sure temp dir existed which required by dracut while live install. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia --- pyanaconda/bootloader/installation.py | 5 +++++ pyanaconda/payload/__init__.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/pyanaconda/bootloader/installation.py b/pyanaconda/bootloader/installation.py index b620ab3..c2c097f 100644 --- a/pyanaconda/bootloader/installation.py +++ b/pyanaconda/bootloader/installation.py @@ -50,6 +50,11 @@ def write_boot_loader(storage, payload): # Install the boot loader. if not storage.bootloader.skip_bootloader: + for kernel in payload.kernel_version_list: + initrd = util.getSysroot()+"/boot/initramfs-%s.img" % kernel + if not os.path.exists(initrd): + open(initrd, "w").write("\n") + install_boot_loader(storage) diff --git a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py index 7c65d29..0da743e 100644 --- a/pyanaconda/payload/__init__.py +++ b/pyanaconda/payload/__init__.py @@ -570,6 +570,10 @@ class Payload(metaclass=ABCMeta): " using dracut instead.") use_dracut = True + # Make sure temp dir existed, dracut requires it while live install + for subdir in ["log", "tmp"]: + util.mkdirChain(util.getSysroot() + "/var/volatile/%s" % subdir) + for kernel in self.kernel_version_list: log.info("recreating initrd for %s", kernel) if not conf.target.is_image: -- 2.7.4