Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/supermin.git#084b2b09087fb4444cb17ed4e08d358030ef9b55
This commit is contained in:
DistroBaker 2021-02-01 10:42:33 +00:00
parent fe18c2dcb6
commit 03d2a81f63
4 changed files with 193 additions and 37 deletions

View File

@ -0,0 +1,180 @@
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

View File

@ -1,29 +0,0 @@
From 3f831d30d87658d362e9b4f25fa569937fa1c23f Mon Sep 17 00:00:00 2001
From: Gustavo Luiz Duarte <gustavold@linux.ibm.com>
Date: Tue, 31 Mar 2020 23:11:44 -0300
Subject: [PATCH] supermin: Fix IBM Virtual SCSI driver name
The driver was renamed from ibmvscsic to ibmvscsi on kernel 3.7.
See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9965c2f19be470c452357ae4f6304467cdeada55
The old name is kept so supermin works with recent kernels as well as kernel
version older than 3.7.
---
src/format_ext2_initrd.ml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/format_ext2_initrd.ml b/src/format_ext2_initrd.ml
index b67bb55..38977e6 100644
--- a/src/format_ext2_initrd.ml
+++ b/src/format_ext2_initrd.ml
@@ -44,6 +44,7 @@ let kmods = [
"crc*.ko*";
"libcrc*.ko*";
"ibmvscsic.ko*";
+ "ibmvscsi.ko*";
"libnvdimm.ko*";
"nd_pmem.ko*";
"nd_btt.ko*";
--
2.24.1

View File

@ -1,2 +1,2 @@
SHA512 (supermin-5.2.0.tar.gz) = 782d00f95a37ad75833b659300b085b5c7bfa1c795eae9aa57b3c52cab0332d6e6b8e1bddc5b1c0075cc64b60e22b64387771cd9f457568408889244a4628467 SHA512 (supermin-5.2.1.tar.gz) = f10ea404e0b27238ea3c25cb68f44e716aa180a45a420e63c1958768032f0710e8e3e7f1346cda780ea1f916f499499da2c02df4019d91ea3b3a69b75cfda545
SHA512 (supermin-5.2.0.tar.gz.sig) = 425a1a7277f48bc837d290c43af025f1e39cdd2da2d5460bebe27c9b86c2b8f57a23172c1fa3d45bbb749b1bb96486f59a8363443825f27d86297b22435b46f3 SHA512 (supermin-5.2.1.tar.gz.sig) = bde7907ea61e8bb3e59fac235c7bd8e22ef2e16831b80344c4574fdff873a5fc8b8972716143ee9d9bd745ac99b72f11aa4530a8d184a3f287b3212ef85c7a13

View File

@ -21,15 +21,15 @@
%endif %endif
# Whether we should verify tarball signature with GPGv2. # Whether we should verify tarball signature with GPGv2.
%global verify_tarball_signature %{nil} %global verify_tarball_signature 1
# The source directory. # The source directory.
%global source_directory 5.2-stable %global source_directory 5.2-stable
Summary: Tool for creating supermin appliances Summary: Tool for creating supermin appliances
Name: supermin Name: supermin
Version: 5.2.0 Version: 5.2.1
Release: 6%{?dist} Release: 1%{?dist}
License: GPLv2+ License: GPLv2+
ExclusiveArch: %{kernel_arches} ExclusiveArch: %{kernel_arches}
@ -40,9 +40,8 @@ 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
# Fix: ppc64le: ibmvscsi driver missing from supermin appliance. # Upstream fix for stat field overflow on armv7.
# Upstream patch, fixes RHBZ#1819019 Patch1: 0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch
Patch1: 0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch
BuildRequires: make BuildRequires: make
BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2man
@ -165,6 +164,12 @@ make check || {
%changelog %changelog
* Mon Feb 01 2021 Richard W.M. Jones <rjones@redhat.com> - 5.2.1-1
- New upstream version 5.2.1.
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Jan 14 2021 Richard W.M. Jones <rjones@redhat.com> - 5.2.0-6 * Thu Jan 14 2021 Richard W.M. Jones <rjones@redhat.com> - 5.2.0-6
- Remove inactive strip override (see RHBZ#1915570). - Remove inactive strip override (see RHBZ#1915570).