Rebase to libguestfs 1.52.2 (along the stable branch)

Remove dependency on syslinux packages
resolves: RHEL-50565
This commit is contained in:
Richard W.M. Jones 2024-07-25 12:36:51 +01:00
parent a2c4e63c73
commit 9e5c584b88
7 changed files with 14 additions and 118 deletions

View File

@ -1,4 +1,4 @@
From 15cc88b3cbc810a7d832af8f1046c71cc6e51118 Mon Sep 17 00:00:00 2001 From 1638cd9e58161147bd2f440b6e28bf7365fc5688 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 10 May 2024 13:27:22 +0100 Date: Fri, 10 May 2024 13:27:22 +0100
Subject: [PATCH] daemon: Reimplement partition GPT functions using sfdisk Subject: [PATCH] daemon: Reimplement partition GPT functions using sfdisk

View File

@ -1,34 +0,0 @@
From 0572a675c9ba5d2bb4e31bc5844fcfd9bc3538cf Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Wed, 15 May 2024 09:11:49 +0200
Subject: [PATCH] appliance: only wait for resolv.conf update if dhcpcd
succeeded
In case network was requested, but the host lacks both dhclient and
dhcpcd, skip the loop which waits for a resolv.conf update.
This reduces boot time by 10 seconds.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
(cherry picked from commit 4ef645778a563759406cee597b9ff37c99da33fe)
---
appliance/init | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/appliance/init b/appliance/init
index cb200d5bf..128a3c20e 100755
--- a/appliance/init
+++ b/appliance/init
@@ -119,8 +119,7 @@ if test "$guestfs_network" = 1; then
rm -f /etc/dhcp/dhclient-enter-hooks.d/resolved
if dhclient --version >/dev/null 2>&1; then
dhclient $iface
- else
- dhcpcd $iface
+ elif dhcpcd $iface; then
# https://github.com/NetworkConfiguration/dhcpcd/issues/258
for i in `seq 0 10`; do
if grep nameserver /etc/resolv.conf; then break; fi
--
2.43.0

View File

@ -1,4 +1,4 @@
From 768d81c5f681e2fff922eb31ddc2318f9704de85 Mon Sep 17 00:00:00 2001 From 8539b763639cbe80e4b248455c0c28bd8ced9cbe Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 28 Jun 2024 09:42:20 +0100 Date: Fri, 28 Jun 2024 09:42:20 +0100
Subject: [PATCH] daemon: Fix parsing in part_get_gpt_attributes Subject: [PATCH] daemon: Fix parsing in part_get_gpt_attributes

View File

@ -1,40 +0,0 @@
From a5bc2980ec85d04ad1905d299b7b8c083c26965f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= <juergen@archlinux.org>
Date: Thu, 20 Jun 2024 13:27:51 +0100
Subject: [PATCH] rust: Handle null pointer when creating slice
Starting with Rust 1.78 null assertions in the standard library are
now checked when compiling in test/debug mode.
Fixes: https://github.com/libguestfs/libguestfs/issues/145
(cherry picked from commit 43946911c7e4eda422b8d041e063689e7434b04e)
---
rust/src/event.rs | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/rust/src/event.rs b/rust/src/event.rs
index 752e73610..72afd3cf6 100644
--- a/rust/src/event.rs
+++ b/rust/src/event.rs
@@ -105,8 +105,16 @@ impl<'a> base::Handle<'a> {
None => panic!("Failed to parse bitmask: {}", event),
};
let eh = EventHandle { eh: event_handle };
- let buf = unsafe { slice::from_raw_parts(buf as *const u8, buf_len) };
- let array = unsafe { slice::from_raw_parts(array, array_len) };
+ let buf = if !buf.is_null() {
+ unsafe { slice::from_raw_parts(buf as *const u8, buf_len) }
+ } else {
+ &[]
+ };
+ let array = if !array.is_null() {
+ unsafe { slice::from_raw_parts(array, array_len) }
+ } else {
+ &[]
+ };
let callback: &Box<dyn Fn(guestfs::Event, EventHandle, &[u8], &[u64])> =
Box::leak(unsafe { Box::from_raw(opaque as *mut _) });
--
2.43.0

View File

@ -1,34 +0,0 @@
From 3e749db4e291af9d0d49244d82bdb844735dedb1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 28 Jun 2024 09:39:59 +0100
Subject: [PATCH] generator/daemon: Don't truncate 64 bit results from OCaml
functions
Commit d5b6f1df5f ("daemon: Allow parts of the daemon and APIs to be
written in OCaml.", 2017) contained a bug where in any OCaml function
that returns int64_t, the result was truncated to an int. This
particularly affected part_get_gpt_attributes as that returns large 64
bit numbers, but probably affects other functions too, undetected.
Fixes: commit d5b6f1df5ff2d387a5dfc89b8316c0dff67ce2c9
(cherry picked from commit 882ef4d93a2f8b150a66fa89f87ef1c4dd42de2f)
---
generator/daemon.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/generator/daemon.ml b/generator/daemon.ml
index 5e2a78b91..78a2412d2 100644
--- a/generator/daemon.ml
+++ b/generator/daemon.ml
@@ -835,7 +835,7 @@ let generate_daemon_caml_stubs () =
| RInt _ ->
pr " CAMLreturnT (int, Int_val (retv));\n"
| RInt64 _ ->
- pr " CAMLreturnT (int, Int64_val (retv));\n"
+ pr " CAMLreturnT (int64_t, Int64_val (retv));\n"
| RBool _ ->
pr " CAMLreturnT (int, Bool_val (retv));\n"
| RConstString _ -> assert false
--
2.43.0

View File

@ -41,8 +41,8 @@ ExcludeArch: %{ix86}
Summary: Access and modify virtual machine disk images Summary: Access and modify virtual machine disk images
Name: libguestfs Name: libguestfs
Epoch: 1 Epoch: 1
Version: 1.52.1 Version: 1.52.2
Release: 6%{?dist} Release: 1%{?dist}
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
# Build only for architectures that have a kernel # Build only for architectures that have a kernel
@ -81,10 +81,7 @@ Source8: copy-patches.sh
# Patches. # Patches.
Patch0001: 0001-daemon-Reimplement-partition-GPT-functions-using-sfd.patch Patch0001: 0001-daemon-Reimplement-partition-GPT-functions-using-sfd.patch
Patch0002: 0002-appliance-only-wait-for-resolv.conf-update-if-dhcpcd.patch Patch0002: 0002-daemon-Fix-parsing-in-part_get_gpt_attributes.patch
Patch0003: 0003-rust-Handle-null-pointer-when-creating-slice.patch
Patch0004: 0004-generator-daemon-Don-t-truncate-64-bit-results-from-.patch
Patch0005: 0005-daemon-Fix-parsing-in-part_get_gpt_attributes.patch
BuildRequires: autoconf, automake, libtool, gettext-devel BuildRequires: autoconf, automake, libtool, gettext-devel
@ -261,9 +258,11 @@ BuildRequires: sleuthkit
%endif %endif
BuildRequires: squashfs-tools BuildRequires: squashfs-tools
BuildRequires: strace BuildRequires: strace
%if !0%{?rhel}
%ifarch %{ix86} x86_64 %ifarch %{ix86} x86_64
BuildRequires: syslinux syslinux-extlinux BuildRequires: syslinux syslinux-extlinux
%endif %endif
%endif
BuildRequires: systemd BuildRequires: systemd
BuildRequires: tar BuildRequires: tar
BuildRequires: udev BuildRequires: udev
@ -1109,6 +1108,11 @@ rm ocaml/html/.gitignore
%changelog %changelog
* Thu Jul 25 2024 Richard W.M. Jones <rjones@redhat.com> - 1:1.52.2-1
- Rebase to libguestfs 1.52.2 (along the stable branch)
- Remove dependency on syslinux packages
resolves: RHEL-50565
* Fri Jun 28 2024 Richard W.M. Jones <rjones@redhat.com> - 1:1.52.1-6 * Fri Jun 28 2024 Richard W.M. Jones <rjones@redhat.com> - 1:1.52.1-6
- Fix parsing in part_get_gpt_attributes - Fix parsing in part_get_gpt_attributes
resolves: RHEL-45465 resolves: RHEL-45465

View File

@ -1,2 +1,2 @@
SHA512 (libguestfs-1.52.1.tar.gz) = 13ccc03a72ddf8dee33ca3b2f4c26235b43d395a9dfc75d8020d7f55350c0f79a0fe557591c8fcf893e02dd868e1420480fa7b356dfe25f275bdee62aeb189ed SHA512 (libguestfs-1.52.2.tar.gz) = 5eb4fbcc8e8879932a212c38c515598cd229e0e10b3e86d5655a10f30f5cc8c3df4e6f4b60095ccdaddbd493114ea84d9c0cdb9db7496dc83283fc4d369ece71
SHA512 (libguestfs-1.52.1.tar.gz.sig) = f9edfc4260f00f100d521ddc6cc8c2f3838cc178d5b0fafe4208d6734909cf145b9424ac287f06087d835393f8d70e0ccec44384753ddf03dd4096011f615651 SHA512 (libguestfs-1.52.2.tar.gz.sig) = d43128be62848372e6c52a39ef8dd5e898e8b8005df5ba2b4269c9757d6f480b21bfd60b16df165b8b4bcadefa71aa8daaae8755789f48b6736f4a5475aa1c59