aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-installer/anaconda/files/0003-tweak-iso-mount-dir-and-kernel-name.patch
blob: 54b65fc6ab660d51f534ad1436d96fd99492df01 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From 367fc710a94d802ace273c7aebb8f5f96647370b Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Mon, 24 Jun 2019 14:45:50 +0800
Subject: [PATCH] tweak iso mount dir and kernel name

- Tweak iso mount dir based on WRLinux

- Tweak kernel name based on OE

- Tweak nfs mount point of base repository to "/media/source"

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>

* update context for anaconda 32
* backport patch from Upstream to 'Handle bytes and strings from RPM'
* replace obsolete function 'util.getSysroot'

Signed-off-by: Kai Kang <kai.kang@windriver.com>

Rebase for anaconda 34

Signed-off-by: Kai Kang <kai.kang@windriver.com>

Rebase for anaconda 37

Signed-off-by: Kai Kang <kai.kang@windriver.com>

Rebase for anaconda 39.

* variable INSTALL_TREE has been removed in upstream

Signed-off-by: Kai Kang <kai.kang@windriver.com>

---
 pyanaconda/core/constants.py                     |  2 +-
 pyanaconda/modules/payloads/payload/dnf/utils.py | 15 +++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py
index b8075da7e3..350e7f7d94 100644
--- a/pyanaconda/core/constants.py
+++ b/pyanaconda/core/constants.py
@@ -45,7 +45,7 @@ ANACONDA_CLEANUP = "anaconda-cleanup"
 LIVE_MOUNT_POINT = "/run/initramfs/live"
 
 # Source mount points.
-MOUNT_DIR = "/run/install"
+MOUNT_DIR = "/media/realroot"
 DRACUT_ISODIR = "/run/install/source"
 DRACUT_REPO_DIR = "/run/install/repo"
 ISO_DIR = MOUNT_DIR + "/isodir"
diff --git a/pyanaconda/modules/payloads/payload/dnf/utils.py b/pyanaconda/modules/payloads/payload/dnf/utils.py
index 196632cbfe..9e0c8805a9 100644
--- a/pyanaconda/modules/payloads/payload/dnf/utils.py
+++ b/pyanaconda/modules/payloads/payload/dnf/utils.py
@@ -62,7 +62,7 @@ def get_kernel_package(dnf_manager, exclude_list):
         return None
 
     # Get the kernel packages.
-    kernels = ["kernel"]
+    kernels = ["kernel-image"]
 
     # ARM systems use either the standard Multiplatform or LPAE platform.
     if is_lpae_available():
@@ -166,19 +166,26 @@ def get_kernel_version_list():
 
     # Find all installed RPMs that provide 'kernel'.
     ts = rpm.TransactionSet(conf.target.system_root)
-    mi = ts.dbMatch('providename', 'kernel')
+    mi = ts.dbMatch()
+    mi.pattern('name', rpm.RPMMIRE_GLOB, 'kernel-image*')
 
     for hdr in mi:
+        log.info("hdr.filenames %s" % hdr.filenames)
+
         # Find all /boot/vmlinuz- files and strip off vmlinuz-.
         files.extend((
             f.split("/")[-1][8:] for f in hdr.filenames
-            if fnmatch.fnmatch(f, "/boot/vmlinuz-*") or
-            fnmatch.fnmatch(f, "/boot/efi/EFI/%s/vmlinuz-*" % efi_dir)
+            if ((fnmatch.fnmatch(f, "/boot/*") or
+                 fnmatch.fnmatch(f, "/boot/efi/EFI/%s/*" % efi_dir))
+                and len(f.split("/")[-1]) > 7
+                and not f.endswith('.sig'))
         ))
 
     # Sort the kernel versions.
     sort_kernel_version_list(files)
 
+    log.info("kernelVersionList %s" % files)
+
     return files
 
 
-- 
2.7.4