Rebase to guestfs-tools 1.48.2

resolves: rhbz#2059286
Default to --selinux-relabel in various tools
resolves: rhbz#2075718, rhbz#2089748
This commit is contained in:
Richard W.M. Jones 2022-05-26 14:18:54 +01:00
parent a5f6471ea8
commit 300dd8621d
6 changed files with 148 additions and 17 deletions

View File

@ -1,4 +1,4 @@
From 9cae03a73ecfd89634dee40d12c14ba00bff321d Mon Sep 17 00:00:00 2001
From 37c002682a9e5b87d5793f1567c4ddfb8ca72d11 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Sun, 10 Apr 2022 13:38:34 +0200
Subject: [PATCH] sysprep: remove lvm2's default "system.devices" file
@ -34,7 +34,7 @@ Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
create mode 100644 sysprep/sysprep_operation_lvm_system_devices.ml
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index 0e3afc8a..7d5e8aad 100644
index 0e3afc8a0..7d5e8aadf 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -46,6 +46,7 @@ operations = \
@ -47,7 +47,7 @@ index 0e3afc8a..7d5e8aad 100644
machine_id \
diff --git a/sysprep/sysprep_operation_lvm_system_devices.ml b/sysprep/sysprep_operation_lvm_system_devices.ml
new file mode 100644
index 00000000..b41fa5db
index 000000000..b41fa5dbc
--- /dev/null
+++ b/sysprep/sysprep_operation_lvm_system_devices.ml
@@ -0,0 +1,44 @@

View File

@ -1,4 +1,4 @@
From 572241b740ffeb2bd1f1f58023fcd0f3341f0a64 Mon Sep 17 00:00:00 2001
From 5792f2e95bcddf476f2fe37e0bc4d97bd881d8fa Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 10 May 2022 12:50:46 +0200
Subject: [PATCH] adopt inversion of SELinux relabeling in virt-customize
@ -30,7 +30,7 @@ Acked-by: Richard W.M. Jones <rjones@redhat.com>
7 files changed, 8 insertions(+), 31 deletions(-)
diff --git a/builder/templates/make-template.ml b/builder/templates/make-template.ml
index d8734940..58603242 100755
index 6786fec19..b40789284 100755
--- a/builder/templates/make-template.ml
+++ b/builder/templates/make-template.ml
@@ -256,8 +256,7 @@ let rec main () =
@ -56,7 +56,7 @@ index d8734940..58603242 100755
match os, arch with
| Fedora _, Armv7
diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
index f7dd6cda..aeb50529 100644
index f7dd6cdad..aeb505296 100644
--- a/builder/virt-builder.pod
+++ b/builder/virt-builder.pod
@@ -131,12 +131,6 @@ To update the installed packages to the latest version:
@ -120,7 +120,7 @@ index f7dd6cda..aeb50529 100644
=head1 MACHINE READABLE OUTPUT
The I<--machine-readable> option can be used to make the output more
Submodule common 0a231b3e..48527b87:
Submodule common 0a231b3e6..48527b876:
diff --git a/common/mlcustomize/customize-options.pod b/common/mlcustomize/customize-options.pod
index 71b545d..a83c80a 100644
--- a/common/mlcustomize/customize-options.pod
@ -293,7 +293,7 @@ index 6b696fc..84d393c 100644
}
(*ret)[0] = server;
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
index f2ee2041..99b5fe14 100644
index f2ee20413..99b5fe14d 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -415,7 +415,7 @@ let run (g : G.guestfs) root (ops : ops) =
@ -306,7 +306,7 @@ index f2ee2041..99b5fe14 100644
SELinux_relabel.relabel g
);
diff --git a/customize/test-settings.sh b/customize/test-settings.sh
index ed4c90f2..e8b492dd 100755
index ed4c90f2e..e8b492dd1 100755
--- a/customize/test-settings.sh
+++ b/customize/test-settings.sh
@@ -61,9 +61,6 @@ case "$guestname" in
@ -320,7 +320,7 @@ index ed4c90f2..e8b492dd 100755
;;
esac
diff --git a/sysprep/main.ml b/sysprep/main.ml
index 087d1a17..b760618a 100644
index 087d1a17f..b760618ad 100644
--- a/sysprep/main.ml
+++ b/sysprep/main.ml
@@ -132,8 +132,6 @@ let main () =
@ -333,7 +333,7 @@ index 087d1a17..b760618a 100644
] in
let args = basic_args @ Sysprep_operation.extra_args () in
diff --git a/sysprep/test-virt-sysprep-docs.sh b/sysprep/test-virt-sysprep-docs.sh
index 51500b5e..9d0298d6 100755
index 51500b5e9..9d0298d68 100755
--- a/sysprep/test-virt-sysprep-docs.sh
+++ b/sysprep/test-virt-sysprep-docs.sh
@@ -25,4 +25,4 @@ $top_srcdir/podcheck.pl "$srcdir/virt-sysprep.pod" virt-sysprep \

View File

@ -0,0 +1,101 @@
From 10e2f3fc7eef6da4d741f7617e80d028257d9884 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Wed, 25 May 2022 13:06:01 +0200
Subject: [PATCH] update common submodule
Shortlog for 48527b8768d7..f8de5508fe75:
Laszlo Ersek (1):
mlcustomize: refresh generated files
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2089748
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 273de755dfe7eb0f1e81dc62463c125e8bed0cff)
---
common | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Submodule common 48527b876..f8de5508f:
diff --git a/common/mlcustomize/customize-options.pod b/common/mlcustomize/customize-options.pod
index a83c80a..8aafacd 100644
--- a/common/mlcustomize/customize-options.pod
+++ b/common/mlcustomize/customize-options.pod
@@ -310,6 +310,10 @@ It cannot delete directories, only regular files.
=back
+=item B<--selinux-relabel>
+
+This is a compatibility option that does nothing.
+
=item B<--sm-attach> SELECTOR
Attach to a pool using C<subscription-manager>.
diff --git a/common/mlcustomize/customize-synopsis.pod b/common/mlcustomize/customize-synopsis.pod
index 2520853..9e2c4b2 100644
--- a/common/mlcustomize/customize-synopsis.pod
+++ b/common/mlcustomize/customize-synopsis.pod
@@ -13,4 +13,4 @@
[--uninstall PKG,PKG..] [--update] [--upload FILE:DEST]
[--write FILE:CONTENT] [--no-logfile]
[--password-crypto md5|sha256|sha512] [--no-selinux-relabel]
- [--sm-credentials SELECTOR]
+ [--selinux-relabel] [--sm-credentials SELECTOR]
diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
index 5d404e8..a17bed4 100644
--- a/common/mlcustomize/customize_cmdline.ml
+++ b/common/mlcustomize/customize_cmdline.ml
@@ -111,6 +111,8 @@ and flags = {
(* --password-crypto md5|sha256|sha512 *)
no_selinux_relabel : bool;
(* --no-selinux-relabel *)
+ selinux_relabel_ignored : bool;
+ (* --selinux-relabel *)
sm_credentials : Subscription_manager.sm_credentials option;
(* --sm-credentials SELECTOR *)
}
@@ -122,6 +124,7 @@ let rec argspec () =
let scrub_logfile = ref false in
let password_crypto = ref None in
let no_selinux_relabel = ref false in
+ let selinux_relabel_ignored = ref false in
let sm_credentials = ref None in
let rec get_ops () = {
@@ -132,6 +135,7 @@ let rec argspec () =
scrub_logfile = !scrub_logfile;
password_crypto = !password_crypto;
no_selinux_relabel = !no_selinux_relabel;
+ selinux_relabel_ignored = !selinux_relabel_ignored;
sm_credentials = !sm_credentials;
}
in
@@ -464,6 +468,12 @@ let rec argspec () =
s_"Do not relabel files with correct SELinux labels"
),
None, "Do not attempt to correct the SELinux labels of files in the guest.\n\nIn such guests that support SELinux, customization automatically\nrelabels files so that they have the correct SELinux label. (The\nrelabeling is performed immediately, but if the operation fails,\ncustomization will instead touch F</.autorelabel> on the image to\nschedule a relabel operation for the next time the image boots.) This\noption disables the automatic relabeling.\n\nThe option is a no-op for guests that do not support SELinux.";
+ (
+ [ L"selinux-relabel" ],
+ Getopt.Set selinux_relabel_ignored,
+ s_"Compatibility option doing nothing"
+ ),
+ None, "This is a compatibility option that does nothing.";
(
[ L"sm-credentials" ],
Getopt.String (
diff --git a/common/mlcustomize/customize_cmdline.mli b/common/mlcustomize/customize_cmdline.mli
index 7ee882a..7d14e78 100644
--- a/common/mlcustomize/customize_cmdline.mli
+++ b/common/mlcustomize/customize_cmdline.mli
@@ -103,6 +103,8 @@ and flags = {
(* --password-crypto md5|sha256|sha512 *)
no_selinux_relabel : bool;
(* --no-selinux-relabel *)
+ selinux_relabel_ignored : bool;
+ (* --selinux-relabel *)
sm_credentials : Subscription_manager.sm_credentials option;
(* --sm-credentials SELECTOR *)
}
--
2.31.1

View File

@ -0,0 +1,27 @@
From bbdc10642eff480246271f98180733f732c306b3 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 7 Jul 2015 09:28:03 -0400
Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for
virt-* tools (RHBZ#1240276).
Fix the tests: it doesn't let us use guestfish for arbitrary Windows
edits.
---
test-data/phony-guests/make-windows-img.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
index 30908a918..73cf5144e 100755
--- a/test-data/phony-guests/make-windows-img.sh
+++ b/test-data/phony-guests/make-windows-img.sh
@@ -37,6 +37,7 @@ fi
# Create a disk image.
guestfish <<EOF
+set-program virt-testing
sparse windows.img-t 512M
run
--
2.31.1

View File

@ -25,7 +25,7 @@
Summary: Tools to access and modify virtual machine disk images
Name: guestfs-tools
Version: 1.48.1
Version: 1.48.2
Release: 1%{?dist}
License: GPLv2+
@ -57,6 +57,8 @@ Source3: copy-patches.sh
# Patches.
Patch0001: 0001-sysprep-remove-lvm2-s-default-system.devices-file.patch
Patch0002: 0002-adopt-inversion-of-SELinux-relabeling-in-virt-custom.patch
Patch0003: 0003-update-common-submodule.patch
Patch0004: 0004-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
%if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool, gettext-devel
@ -424,14 +426,15 @@ end
%changelog
* Mon Mar 14 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.1-1
- Rebase to guestfs-tools 1.48.1
* Thu May 26 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.2-1
- Rebase to guestfs-tools 1.48.2
resolves: rhbz#2059286
- Default to --selinux-relabel in various tools
resolves: rhbz#2075718
resolves: rhbz#2075718, rhbz#2089748
- Add lvm system.devices cleanup operation to virt-sysprep
resolves: rhbz#2072493
* Sat Dec 04 2021 Richard W.M. Jones <rjones@redhat.com> - 1.46.1-6
- Clean up NetworkManager connection files
- Add the copy-patches.sh script from virt-v2v

View File

@ -1,2 +1,2 @@
SHA512 (guestfs-tools-1.48.1.tar.gz) = be1ee4e31b33b31794a84dc7939ba6474d1a224d42277b3ec91fed917bcea38de468b64cbed543156a6057126ba501b01c26beccc27a63f16ff481da5335c266
SHA512 (guestfs-tools-1.48.1.tar.gz.sig) = 930721c013cc5b6f6f786a3ede8cb4639f26f9f8c4c6592c880709ca9539a409a5e5a33beff18bbbe2a3d0833108f35589aa98f90272f241d982bac851352766
SHA512 (guestfs-tools-1.48.2.tar.gz) = e11cd5a38a1681e8b2fd56419d38ca0aaab659cb59d409b3572cadcd04fd4da3078fa33e7f21c99d11854ad08797ae24a8d71c041b1b7769fc36c1391b6eb162
SHA512 (guestfs-tools-1.48.2.tar.gz.sig) = 7f3d8064109716c4cc91416d170d66b2c336a1d559c60e9d035d6fad52df4227ebc0cce6d63ce95f570339b8e981f255c51c74c720a2cdc221ae5a0d7bc14717