Skip to content
Snippets Groups Projects
Commit ae7a9d47 authored by CentOS Sources's avatar CentOS Sources
Browse files

import supermin-5.2.1-7.el9

parents
No related merge requests found
SOURCES/libguestfs.keyring
SOURCES/supermin-5.2.1.tar.gz
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
7a5a5ee7c9b13b88bc3e7719f4639da52a84aafd SOURCES/supermin-5.2.1.tar.gz
From 9fbe476d4df0b01568d3668e6121cae7c779c8c7 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 29 Nov 2021 14:40:15 +0000
Subject: [PATCH 1/2] Ignore zfcpdump kernel on s390x
Reported-by: Sebastian Mitterle
Thanks: Cornelia Huck
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2027375
---
src/format_ext2_kernel.ml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
index 3be4413..ea69ade 100644
--- a/src/format_ext2_kernel.ml
+++ b/src/format_ext2_kernel.ml
@@ -157,6 +157,8 @@ and kernel_filter patterns is_arm all_files =
) all_files in
let files =
List.filter (fun filename -> find filename "xen" = -1) files in
+ let files =
+ List.filter (fun filename -> find filename "zfcpdump" = -1) files in
let files =
if not is_arm then files
else (
--
2.32.0
From fd9f17c7eb63979af882533a0d234bfc8ca42de3 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 1 Feb 2021 10:07:02 +0000
Subject: [PATCH] Open Unix.LargeFile to avoid "lstat: Value too large for
defined data type".
On 32 bit platforms, because OCaml native ints are limited to 31 bits,
there is a trap in the normal Unix.stat, Unix.lstat functions where
any field in the stat struct may overflow. The result is random
errors like:
supermin: error: lstat: Value too large for defined data type: /tmp/tmp.Ss9aYEBASm/d2/root
You would probably only see this on armv7.
The OCaml Unix module has a "LargeFile" submodule which fixes this by
using int64 for some (unfortunately not all) fields.
For more information see the OCaml sources, file
otherlibs/unix/stat.c, all instances of "EOVERFLOW".
---
src/format_chroot.ml | 1 +
src/format_ext2.ml | 1 +
src/format_ext2_initrd.ml | 1 +
src/format_ext2_kernel.ml | 5 +++--
src/mode_build.ml | 1 +
src/package_handler.ml | 1 +
src/ph_dpkg.ml | 1 +
src/ph_pacman.ml | 1 +
src/ph_rpm.ml | 1 +
src/supermin.ml | 1 +
src/utils.ml | 1 +
11 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/format_chroot.ml b/src/format_chroot.ml
index 346c24b..34606f7 100644
--- a/src/format_chroot.ml
+++ b/src/format_chroot.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/format_ext2.ml b/src/format_ext2.ml
index 6348c29..e311ea6 100644
--- a/src/format_ext2.ml
+++ b/src/format_ext2.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/format_ext2_initrd.ml b/src/format_ext2_initrd.ml
index 38977e6..6268442 100644
--- a/src/format_ext2_initrd.ml
+++ b/src/format_ext2_initrd.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
index 98bff3a..3be4413 100644
--- a/src/format_ext2_kernel.ml
+++ b/src/format_ext2_kernel.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
@@ -95,8 +96,8 @@ and find_kernel_from_lib_modules debug =
let kernels =
filter_map (
fun kernel_file ->
- let size = try (stat kernel_file).st_size with Unix_error _ -> 0 in
- if size < 10000 then None
+ let size = try (stat kernel_file).st_size with Unix_error _ -> 0L in
+ if size < 10000_L then None
else (
let kernel_name = Filename.basename kernel_file in
let modpath = Filename.dirname kernel_file in
diff --git a/src/mode_build.ml b/src/mode_build.ml
index ed47366..ff7733e 100644
--- a/src/mode_build.ml
+++ b/src/mode_build.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/package_handler.ml b/src/package_handler.ml
index 0409438..f0d6db3 100644
--- a/src/package_handler.ml
+++ b/src/package_handler.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/ph_dpkg.ml b/src/ph_dpkg.ml
index 1e785de..6d4fce1 100644
--- a/src/ph_dpkg.ml
+++ b/src/ph_dpkg.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml
index 67f7512..50500a5 100644
--- a/src/ph_pacman.ml
+++ b/src/ph_pacman.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index 9745efd..183b5f3 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
diff --git a/src/supermin.ml b/src/supermin.ml
index e923111..9f838d9 100644
--- a/src/supermin.ml
+++ b/src/supermin.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
open Types
diff --git a/src/utils.ml b/src/utils.ml
index b25df88..f5990ef 100644
--- a/src/utils.ml
+++ b/src/utils.ml
@@ -17,6 +17,7 @@
*)
open Unix
+open Unix.LargeFile
open Printf
let (+^) = Int64.add
--
2.29.0.rc2
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
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmAXzH4RHHJpY2hAYW5u
ZXhpYS5vcmcACgkQkXOPc+G3aKDLlxAAuqTnWZF8M4KYwSY1XydtgsF4CGjUmhHM
/L6KRsVOR7+hc/yevg/ZJMYieRs1jSW0FHh/16AdRjLRuLhV4BFZGd3wybbYsNUe
aIrbG4dna7pjRYN6wKZIWTNfiYnf7Mqd0MvTfU6rUN0P8O0skbI1xUpcDnViP+GR
sI+yIhM/EpithouoRBqz3sSDtkImXbepSphhnxMb64At6eLWDD09F32uHSqMBALI
ThFeu6mGWNvdsbJAVzDjoXGOynthMLGSb4mE0+uPDP3rFs0FhygNtcdn2KQDTG1S
Jd7MQ2/3w/BilSDTUY/sxqED04GSARxKINgFIOcmHvDnyPltLRX8ET8hCtCkNT1Y
6DgOvUpf77cRKZR6PiQYwor7/bvCwWmOF4AtEaq1x6aWm4D/qFrtN+ofWYsJC5Kz
qBEas7lR40SiiE8EKFDdEoyazps4ZVl5RpZO6Re4yhPbtLhiT8hwzyyNaia9MTyU
k6hU8fivnvnMCAwksJwBN35HxCRgHpOK/CP1IvoxuGA0Q5zwDp7KiHqQjszI5LIa
i2N4VNVwRi/MRrtu7l+B63elKH52SFOJhnLUdUhAJFVhB1jqXZ2y8kOWiZwB2dFc
7KPfkyGRoK39U7ipoI5sUThxl7tfkJSHpbo9/SEL7wFx2fL64oCqdz6t5T4ERPia
6ZGfgCLJNMU=
=aVXZ
-----END PGP SIGNATURE-----
#!/bin/bash -
# Generate RPM requires automatically for supermin appliances.
# Copyright (C) 2009-2015 Red Hat Inc.
# This script is called with a list of supermin.d/*packages* files
# (either passed on the command line, or if that is empty, then passed
# through stdin). Each file is a simple list of packages, so we
# simply have to `cat' the contents in order to get the list of
# requires - it could hardly be simpler.
function process_file
{
cat "$1"
}
if [ "$#" -ge 1 ]; then
for f in "$@"; do
process_file "$f"
done
else
# Get the list of files from stdin. One filename per line?
while read line; do
process_file "$line"
done
fi
%__supermin_requires %{_rpmconfigdir}/supermin-find-requires
%__supermin_path /supermin\.d/[^/]*packages[^/]*
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment