aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-installer/anaconda/files/0042-support-initramfs-boot.patch
blob: 777255d8377574f6984c1b29db962b69c0de8760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From cedfb60b4cea33edcc6308875a5c8b2aa255bc20 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
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 <hongxu.jia@windriver.com>
---
 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