From 11a9afa00260d1012f798eb76ec9b37941ee11b6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 19 Jan 2024 13:53:14 +0000 Subject: [PATCH] Fix virt-customize --chown invalid format error New upstream github repository. --- ...ory-to-https-github.com-libguestfs-g.patch | 44 +++++++++++++ ...er-Add-a-test-of-the-chown-parameter.patch | 64 +++++++++++++++++++ guestfs-tools.spec | 10 ++- 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 0001-Move-the-repository-to-https-github.com-libguestfs-g.patch create mode 100644 0002-builder-Add-a-test-of-the-chown-parameter.patch diff --git a/0001-Move-the-repository-to-https-github.com-libguestfs-g.patch b/0001-Move-the-repository-to-https-github.com-libguestfs-g.patch new file mode 100644 index 0000000..6cef80b --- /dev/null +++ b/0001-Move-the-repository-to-https-github.com-libguestfs-g.patch @@ -0,0 +1,44 @@ +From f1f68bd19ef6cc1b295ca452eb4ba877db70df1c Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 15 Jan 2024 09:56:31 +0000 +Subject: [PATCH 1/2] Move the repository to + https://github.com/libguestfs/guestfs-tools + +--- + README | 6 +++++- + drivers/virt-drivers.pod | 2 +- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/README b/README +index 2148f9067f5..988c5f910bc 100644 +--- a/README ++++ b/README +@@ -7,7 +7,11 @@ For discussion, development, patches, etc. please use the mailing list: + + https://lists.libguestfs.org + +-Copyright (C) 2009-2023 Red Hat Inc. ++Upstream git repository: ++ ++ https://github.com/libguestfs/guestfs-tools ++ ++Copyright (C) 2009-2024 Red Hat Inc. + + The programs are distributed under the GPLv2+. Some parts are LGPLv2+ + licensed. See individual files for license details, and COPYING and +diff --git a/drivers/virt-drivers.pod b/drivers/virt-drivers.pod +index 266dd68eebb..600815d3cda 100644 +--- a/drivers/virt-drivers.pod ++++ b/drivers/virt-drivers.pod +@@ -83,7 +83,7 @@ kernels are provided. For example: + Many more fields are usually available for Linux guests, including a + complete list of kernel modules and information about support for + virtio. For a complete example see: +-L ++L + + =head2 EdriversE + +-- +2.43.0 + diff --git a/0002-builder-Add-a-test-of-the-chown-parameter.patch b/0002-builder-Add-a-test-of-the-chown-parameter.patch new file mode 100644 index 0000000..03a7969 --- /dev/null +++ b/0002-builder-Add-a-test-of-the-chown-parameter.patch @@ -0,0 +1,64 @@ +From 299dc5ec2a0bdd9adecef75adc6a5eca0dc685b1 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 19 Jan 2024 13:22:51 +0000 +Subject: [PATCH 2/2] builder: Add a test of the --chown parameter + +Also update the libguestfs common submodule, pulling in this change +from libguestfs: + + generator/customize.ml: Split --chown parameter on ':' character + +and this patch to common/mltools: + + mltools/libosinfo-c.c: Fix off-by-one error +--- + builder/test-virt-builder.sh | 4 ++++ + common | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/builder/test-virt-builder.sh b/builder/test-virt-builder.sh +index 705788a3ccd..f839fd7afe0 100755 +--- a/builder/test-virt-builder.sh ++++ b/builder/test-virt-builder.sh +@@ -69,6 +69,7 @@ virt-builder phony-fedora \ + --write '/etc/append6: + ' \ + --append-line '/etc/append6:line2' \ ++ --chown 1:1:/etc/append6 \ + --firstboot Makefile --firstboot-command 'echo "hello"' \ + --firstboot-install "minicom,inkscape" + +@@ -112,6 +113,7 @@ echo append5: + cat /etc/append5 + echo append6: + cat /etc/append6 ++stat /etc/append6 | grep '^[ug]id:' + + echo ----- + EOF +@@ -154,6 +156,8 @@ append6: + + line2 + ++uid: 1 ++gid: 1 + -----" ]; then + echo "$0: unexpected output:" + cat test-virt-builder.out +Submodule common 0dba002c20b..54869c98753: +diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml +index 245d996..48ee334 100644 +--- a/common/mlcustomize/customize_cmdline.ml ++++ b/common/mlcustomize/customize_cmdline.ml +@@ -157,7 +157,7 @@ let rec argspec () = + let len = String.length arg in + String.sub arg 0 i, String.sub arg (i+1) (len-(i+1)) + and split_string_triplet option_name arg = +- match String.nsplit ~max:3 "," arg with ++ match String.nsplit ~max:3 ":" arg with + | [a; b; c] -> a, b, c + | _ -> + error (f_"invalid format for '--%s' parameter, see the man page") +-- +2.43.0 + diff --git a/guestfs-tools.spec b/guestfs-tools.spec index eae906d..f5bef3d 100644 --- a/guestfs-tools.spec +++ b/guestfs-tools.spec @@ -19,7 +19,7 @@ Summary: Tools to access and modify virtual machine disk images Name: guestfs-tools Version: 1.52.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later AND LGPL-2.0-or-later # Build only for architectures that have a kernel @@ -41,6 +41,10 @@ Source1: http://download.libguestfs.org/guestfs-tools/%{source_directory}/ Source2: libguestfs.keyring %endif +# Upstream patches since 1.52.0 was released: +Patch: 0001-Move-the-repository-to-https-github.com-libguestfs-g.patch +Patch: 0002-builder-Add-a-test-of-the-chown-parameter.patch + %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel %endif @@ -398,6 +402,10 @@ end %changelog +* Fri Jan 19 2024 Richard W.M. Jones - 1.52.0-2 +- Fix virt-customize --chown invalid format error +- New upstream github repository. + * Thu Jan 4 2024 Richard W.M. Jones - 1.52.0-1 - New stable version 1.52.0