aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-installer/anaconda/files/0042-support-initramfs-boot.patch
blob: d3cb9c3d81b07ee37c82d054ad0352092bde5012 (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
From 1db96277f77da61f3b771a8c0fc7be898d7dca42 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 | 3 +++
 pyanaconda/payload/__init__.py        | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/pyanaconda/bootloader/installation.py b/pyanaconda/bootloader/installation.py
index b620ab3..c28564f 100644
--- a/pyanaconda/bootloader/installation.py
+++ b/pyanaconda/bootloader/installation.py
@@ -50,6 +50,9 @@ def write_boot_loader(storage, payload):
 
     # Install the boot loader.
     if not storage.bootloader.skip_bootloader:
+        for kernel in payload.kernel_version_list:
+            open(util.getSysroot()+"/boot/initramfs-%s.img" % kernel, "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