-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path0025-Use-kernel-install-instead-of-grubby-to-regenerate.patch
76 lines (69 loc) · 3.04 KB
/
0025-Use-kernel-install-instead-of-grubby-to-regenerate.patch
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From 909cdcc3399a586443fad7114fcbedda6de520ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?=
Date: Sat, 16 Oct 2021 17:43:23 +0200
Subject: [PATCH] Use kernel-install instead of grubby to regenerate
Since we have own hook there, it properly handles Xen.
This means we no longer need post scripts in kickstart for that.
Adapted from QubesOS/qubes-anaconda/blob/677b12bf6206bc10ffae88435cefb261c2ee9105/0017-Use-kernel-install-instead-of-grubby-to-regenerate.patch
---
.../modules/storage/bootloader/utils.py | 42 +++----------------
1 file changed, 6 insertions(+), 36 deletions(-)
diff --git a/pyanaconda/modules/storage/bootloader/utils.py b/pyanaconda/modules/storage/bootloader/utils.py
index 0317ecdbed..6cf91b3c86 100644
--- a/pyanaconda/modules/storage/bootloader/utils.py
+++ b/pyanaconda/modules/storage/bootloader/utils.py
@@ -235,7 +235,7 @@ def create_bls_entries(sysroot, storage, kernel_versions):
def recreate_initrds(sysroot, kernel_versions):
- """Recreate the initrds by calling new-kernel-pkg or dracut.
+ """Recreate the initrds by calling kernel-install or dracut
This needs to be done after all configuration files have been
written, since dracut depends on some of them.
@@ -243,40 +243,10 @@ def recreate_initrds(sysroot, kernel_versions):
:param sysroot: a path to the root of the installed system
:param kernel_versions: a list of kernel versions
"""
- if os.path.exists(sysroot + "/usr/sbin/new-kernel-pkg"):
- use_dracut = False
- else:
- log.debug("new-kernel-pkg does not exist, using dracut instead")
- use_dracut = True
-
for kernel in kernel_versions:
log.info("Recreating initrd for %s", kernel)
-
- if conf.target.is_image:
- # Dracut runs in the host-only mode by default, so we need to
- # turn it off by passing the -N option, because the mode is not
- # sensible for disk image installations. Using /dev/disk/by-uuid/
- # is necessary due to disk image naming.
- execWithRedirect(
- "dracut", [
- "-N", "--persistent-policy", "by-uuid",
- "-f", "/boot/initramfs-%s.img" % kernel, kernel
- ],
- root=sysroot
- )
- else:
- if use_dracut:
- execWithRedirect(
- "depmod", ["-a", kernel], root=sysroot
- )
- execWithRedirect(
- "dracut",
- ["-f", "/boot/initramfs-%s.img" % kernel, kernel],
- root=sysroot
- )
- else:
- execWithRedirect(
- "new-kernel-pkg",
- ["--mkinitrd", "--dracut", "--depmod", "--update", kernel],
- root=sysroot
- )
+ execWithRedirect(
+ "kernel-install",
+ ["add", kernel, "/boot/vmlinuz-%s" % kernel],
+ root=sysroot
+ )
--
2.45.2