Further fix to ignore zfcpdump kernel on s390x
This commit is contained in:
parent
87c3622fef
commit
80d74621ab
@ -1,7 +1,7 @@
|
|||||||
From 9fbe476d4df0b01568d3668e6121cae7c779c8c7 Mon Sep 17 00:00:00 2001
|
From 9fbe476d4df0b01568d3668e6121cae7c779c8c7 Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Mon, 29 Nov 2021 14:40:15 +0000
|
Date: Mon, 29 Nov 2021 14:40:15 +0000
|
||||||
Subject: [PATCH] Ignore zfcpdump kernel on s390x
|
Subject: [PATCH 1/2] Ignore zfcpdump kernel on s390x
|
||||||
|
|
||||||
Reported-by: Sebastian Mitterle
|
Reported-by: Sebastian Mitterle
|
||||||
Thanks: Cornelia Huck
|
Thanks: Cornelia Huck
|
||||||
|
108
0002-Ignore-unbootable-kernels-in-lib-modules.patch
Normal file
108
0002-Ignore-unbootable-kernels-in-lib-modules.patch
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
From f53868ce875fc17527696a85b48c67fefa3176e7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Wed, 1 Dec 2021 10:28:36 +0000
|
||||||
|
Subject: [PATCH 2/2] Ignore unbootable kernels in /lib/modules
|
||||||
|
|
||||||
|
The previous commit didn't ignore zfcpdump kernels if found in
|
||||||
|
/lib/modules because we didn't apply the kernel filter to those paths.
|
||||||
|
|
||||||
|
Also this commit cleans up the code in general, splitting up the
|
||||||
|
multi-purpose "kernel_filter" function into two parts with clearer
|
||||||
|
roles.
|
||||||
|
|
||||||
|
Fixes: commit 9fbe476d4df0b01568d3668e6121cae7c779c8c7
|
||||||
|
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2027375
|
||||||
|
Reported-by: Yongkui Guo
|
||||||
|
---
|
||||||
|
src/format_ext2_kernel.ml | 44 +++++++++++++++++++++++----------------
|
||||||
|
1 file changed, 26 insertions(+), 18 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
|
||||||
|
index ea69ade..79d636b 100644
|
||||||
|
--- a/src/format_ext2_kernel.ml
|
||||||
|
+++ b/src/format_ext2_kernel.ml
|
||||||
|
@@ -38,7 +38,7 @@ let rec build_kernel debug host_cpu copy_kernel kernel =
|
||||||
|
| None ->
|
||||||
|
if debug >= 1 then
|
||||||
|
printf "supermin: kernel: looking for kernels in /lib/modules/*/vmlinuz ...\n%!";
|
||||||
|
- match find_kernel_from_lib_modules debug with
|
||||||
|
+ match find_kernel_from_lib_modules debug host_cpu with
|
||||||
|
| Some k -> k
|
||||||
|
| None ->
|
||||||
|
if debug >= 1 then
|
||||||
|
@@ -89,10 +89,13 @@ and find_kernel_from_env_vars debug =
|
||||||
|
Some (kernel_env, kernel_name, kernel_version, modpath)
|
||||||
|
with Not_found -> None
|
||||||
|
|
||||||
|
-and find_kernel_from_lib_modules debug =
|
||||||
|
+and find_kernel_from_lib_modules debug host_cpu =
|
||||||
|
+ let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in
|
||||||
|
+ let files = Array.to_list files in
|
||||||
|
+
|
||||||
|
+ let files = ignore_unbootable_kernels host_cpu files in
|
||||||
|
+
|
||||||
|
let kernels =
|
||||||
|
- let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in
|
||||||
|
- let files = Array.to_list files in
|
||||||
|
let kernels =
|
||||||
|
filter_map (
|
||||||
|
fun kernel_file ->
|
||||||
|
@@ -114,22 +117,22 @@ and find_kernel_from_lib_modules debug =
|
||||||
|
| [] -> None
|
||||||
|
|
||||||
|
and find_kernel_from_boot debug host_cpu =
|
||||||
|
- let is_arm =
|
||||||
|
- String.length host_cpu >= 3 &&
|
||||||
|
- host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in
|
||||||
|
-
|
||||||
|
let all_files = Sys.readdir "/boot" in
|
||||||
|
let all_files = Array.to_list all_files in
|
||||||
|
|
||||||
|
(* In original: ls -1dvr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen *)
|
||||||
|
let patterns = patt_of_cpu host_cpu in
|
||||||
|
- let files = kernel_filter patterns is_arm all_files in
|
||||||
|
+ let files = files_matching_globs patterns all_files in
|
||||||
|
+ let files = ignore_unbootable_kernels host_cpu files in
|
||||||
|
|
||||||
|
let files =
|
||||||
|
if files <> [] then files
|
||||||
|
- else
|
||||||
|
+ else (
|
||||||
|
(* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *)
|
||||||
|
- kernel_filter ["vmlinu?-*"] is_arm all_files in
|
||||||
|
+ let files = files_matching_globs ["vmlinu?-*"] all_files in
|
||||||
|
+ let files = ignore_unbootable_kernels host_cpu files in
|
||||||
|
+ files
|
||||||
|
+ ) in
|
||||||
|
|
||||||
|
let files = List.sort (fun a b -> compare_version b a) files in
|
||||||
|
let kernels =
|
||||||
|
@@ -148,13 +151,18 @@ and find_kernel_from_boot debug host_cpu =
|
||||||
|
| kernel :: _ -> Some kernel
|
||||||
|
| [] -> None
|
||||||
|
|
||||||
|
-and kernel_filter patterns is_arm all_files =
|
||||||
|
- let files =
|
||||||
|
- List.filter
|
||||||
|
- (fun filename ->
|
||||||
|
- List.exists
|
||||||
|
- (fun patt -> fnmatch patt filename [FNM_NOESCAPE]) patterns
|
||||||
|
- ) all_files in
|
||||||
|
+and files_matching_globs patterns files =
|
||||||
|
+ List.filter
|
||||||
|
+ (fun filename ->
|
||||||
|
+ List.exists
|
||||||
|
+ (fun patt -> fnmatch patt filename [FNM_NOESCAPE]) patterns
|
||||||
|
+ ) files
|
||||||
|
+
|
||||||
|
+and ignore_unbootable_kernels host_cpu files =
|
||||||
|
+ let is_arm =
|
||||||
|
+ String.length host_cpu >= 3 &&
|
||||||
|
+ host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in
|
||||||
|
+
|
||||||
|
let files =
|
||||||
|
List.filter (fun filename -> find filename "xen" = -1) files in
|
||||||
|
let files =
|
||||||
|
--
|
||||||
|
2.32.0
|
||||||
|
|
@ -29,7 +29,7 @@
|
|||||||
Summary: Tool for creating supermin appliances
|
Summary: Tool for creating supermin appliances
|
||||||
Name: supermin
|
Name: supermin
|
||||||
Version: 5.3.1
|
Version: 5.3.1
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
|
|
||||||
ExclusiveArch: %{kernel_arches}
|
ExclusiveArch: %{kernel_arches}
|
||||||
@ -44,9 +44,9 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam
|
|||||||
# Keyring used to verify tarball signature.
|
# Keyring used to verify tarball signature.
|
||||||
Source2: libguestfs.keyring
|
Source2: libguestfs.keyring
|
||||||
|
|
||||||
# Ignore zfcpdump kernel on s390x
|
# Ignore zfcpdump kernel on s390x, upstream in 5.3.2
|
||||||
# Upstream commit: 9fbe476d4df0b01568d3668e6121cae7c779c8c7
|
|
||||||
Patch0001: 0001-Ignore-zfcpdump-kernel-on-s390x.patch
|
Patch0001: 0001-Ignore-zfcpdump-kernel-on-s390x.patch
|
||||||
|
Patch0002: 0002-Ignore-unbootable-kernels-in-lib-modules.patch
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: /usr/bin/pod2man
|
BuildRequires: /usr/bin/pod2man
|
||||||
@ -177,6 +177,9 @@ make check || {
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Dec 01 2021 Richard W.M. Jones <rjones@redhat.com> - 5.3.1-3
|
||||||
|
- Further fix to ignore zfcpdump kernel on s390x
|
||||||
|
|
||||||
* Tue Nov 30 2021 Richard W.M. Jones <rjones@redhat.com> - 5.3.1-2
|
* Tue Nov 30 2021 Richard W.M. Jones <rjones@redhat.com> - 5.3.1-2
|
||||||
- Ignore zfcpdump kernel on s390x
|
- Ignore zfcpdump kernel on s390x
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user