From 7b88f3cedad86b27838138ad368fd5087f1d12cb Mon Sep 17 00:00:00 2001 From: eabdullin Date: Mon, 30 Sep 2024 15:51:59 +0000 Subject: [PATCH] import CS libguestfs-1.50.2-1.el9 --- .gitignore | 4 +- .libguestfs.metadata | 4 +- ...label-don-t-exclude-selinux-if-it-s.patch} | 2 +- SOURCES/0001-update-common-submodule.patch | 138 -- ...label-search-for-invalid-option-in-.patch} | 2 +- SOURCES/0002-update-common-submodule.patch | 88 - ...label-run-setfiles-with-T-0-if-supp.patch} | 2 +- ...pported-remote-drive-protocols-RHBZ.patch} | 4 +- ...f-libguestfs-winsupport-features-ex.patch} | 2 +- ...t-dib.patch => 0006-Remove-virt-dib.patch} | 2 +- ...-Choose-q35-machine-type-for-x86-64.patch} | 2 +- ...-inspection-test-rename-VGs-and-LVs.patch} | 4 +- ...ction-test-test-dev-mapper-VG-LV-tr.patch} | 2 +- ...d-Remove-bundled-copy-of-ocaml-augea.patch | 1686 ----------------- ...n-t-call-fclose-NULL-on-error-paths.patch} | 2 +- ...ose-test-collect-all-currently-unre.patch} | 2 +- SOURCES/0011-update-common-submodule.patch | 203 -- ...-enter-leave_blocking_section-calls.patch} | 2 +- ...e-runtime-lock-around-guestfs_close.patch} | 2 +- ...0014-Replace-Pervasives.-with-Stdlib.patch | 119 -- ...nally-acquire-the-lock-in-callbacks.patch} | 2 +- ...s_065_implicit_close.ml-for-OCaml-5.patch} | 2 +- ...ate_opt-in-preference-to-caml_state.patch} | 2 +- ...Add-chown-option-for-virt-customize.patch} | 2 +- ...e-guestfs_int_cmd_clear_close_files.patch} | 2 +- ...x-broken-link-in-the-guestfs-manual.patch} | 2 +- ...0-docs-clarify-sockdir-s-separation.patch} | 2 +- ...int_create_socketname-from-launch.c.patch} | 2 +- ...ze-Add-new-StringTriplet-for-use-by.patch} | 2 +- ...erse-device-name-translation-on-pvs.patch} | 2 +- ...ruby-Replace-MiniTest-with-Minitest.patch} | 2 +- ...-rid-of-old-Test-Unit-compatibility.patch} | 2 +- ...rt-customize-options-into-alphabeti.patch} | 2 +- ...new-virt-customize-tar-in-operation.patch} | 2 +- ...0028-New-mailing-list-email-address.patch} | 2 +- ...h => 0029-New-mailing-list-archives.patch} | 10 +- ...e-libxml-parser.h-for-xmlReadMemory.patch} | 2 +- ...c.finalise-instead-of-a-C-finalizer.patch} | 2 +- ...tom-block-before-releasing-runtime-.patch} | 2 +- ...tch => 0033-Update-common-submodule.patch} | 2 +- ...s-Test-guestfish-key-all-.-selector.patch} | 2 +- ...ize.ml-Split-chown-parameter-on-char.patch | 44 + SOURCES/0036-Update-common-submodule.patch | 65 + ...findfs_partuuid-and-findfs_partlabel.patch | 86 + ...ve-PARTUUID-and-PARTLABEL-in-etc-fst.patch | 41 + SOURCES/copy-patches.sh | 2 +- SOURCES/libguestfs-1.50.1.tar.gz.sig | 17 - SOURCES/libguestfs-1.50.2.tar.gz.sig | 17 + SPECS/libguestfs.spec | 110 +- 49 files changed, 362 insertions(+), 2342 deletions(-) rename SOURCES/{0003-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch => 0001-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch} (96%) delete mode 100644 SOURCES/0001-update-common-submodule.patch rename SOURCES/{0004-daemon-selinux-relabel-search-for-invalid-option-in-.patch => 0002-daemon-selinux-relabel-search-for-invalid-option-in-.patch} (95%) delete mode 100644 SOURCES/0002-update-common-submodule.patch rename SOURCES/{0005-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch => 0003-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch} (98%) rename SOURCES/{0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch => 0004-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch} (99%) rename SOURCES/{0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch => 0005-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch} (97%) rename SOURCES/{0008-Remove-virt-dib.patch => 0006-Remove-virt-dib.patch} (95%) rename SOURCES/{0009-lib-Choose-q35-machine-type-for-x86-64.patch => 0007-lib-Choose-q35-machine-type-for-x86-64.patch} (94%) rename SOURCES/{0012-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch => 0008-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch} (98%) rename SOURCES/{0013-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch => 0009-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch} (96%) delete mode 100644 SOURCES/0010-RHEL-Revert-build-Remove-bundled-copy-of-ocaml-augea.patch rename SOURCES/{0015-fuse-Don-t-call-fclose-NULL-on-error-paths.patch => 0010-fuse-Don-t-call-fclose-NULL-on-error-paths.patch} (96%) rename SOURCES/{0016-ocaml-implicit_close-test-collect-all-currently-unre.patch => 0011-ocaml-implicit_close-test-collect-all-currently-unre.patch} (95%) delete mode 100644 SOURCES/0011-update-common-submodule.patch rename SOURCES/{0017-ocaml-Replace-old-enter-leave_blocking_section-calls.patch => 0012-ocaml-Replace-old-enter-leave_blocking_section-calls.patch} (97%) rename SOURCES/{0018-ocaml-Release-runtime-lock-around-guestfs_close.patch => 0013-ocaml-Release-runtime-lock-around-guestfs_close.patch} (93%) delete mode 100644 SOURCES/0014-Replace-Pervasives.-with-Stdlib.patch rename SOURCES/{0019-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch => 0014-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch} (97%) rename SOURCES/{0020-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch => 0015-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch} (96%) rename SOURCES/{0021-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch => 0016-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch} (93%) rename SOURCES/{0022-generator-Add-chown-option-for-virt-customize.patch => 0017-generator-Add-chown-option-for-virt-customize.patch} (99%) rename SOURCES/{0023-lib-remove-guestfs_int_cmd_clear_close_files.patch => 0018-lib-remove-guestfs_int_cmd_clear_close_files.patch} (98%) rename SOURCES/{0024-docs-fix-broken-link-in-the-guestfs-manual.patch => 0019-docs-fix-broken-link-in-the-guestfs-manual.patch} (95%) rename SOURCES/{0025-docs-clarify-sockdir-s-separation.patch => 0020-docs-clarify-sockdir-s-separation.patch} (98%) rename SOURCES/{0026-lib-move-guestfs_int_create_socketname-from-launch.c.patch => 0021-lib-move-guestfs_int_create_socketname-from-launch.c.patch} (98%) rename SOURCES/{0027-generator-customize-Add-new-StringTriplet-for-use-by.patch => 0022-generator-customize-Add-new-StringTriplet-for-use-by.patch} (99%) rename SOURCES/{0028-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch => 0023-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch} (96%) rename SOURCES/{0029-ruby-Replace-MiniTest-with-Minitest.patch => 0024-ruby-Replace-MiniTest-with-Minitest.patch} (99%) rename SOURCES/{0030-ruby-Get-rid-of-old-Test-Unit-compatibility.patch => 0025-ruby-Get-rid-of-old-Test-Unit-compatibility.patch} (99%) rename SOURCES/{0031-generator-Sort-virt-customize-options-into-alphabeti.patch => 0026-generator-Sort-virt-customize-options-into-alphabeti.patch} (96%) rename SOURCES/{0032-generator-Add-new-virt-customize-tar-in-operation.patch => 0027-generator-Add-new-virt-customize-tar-in-operation.patch} (99%) rename SOURCES/{0033-New-mailing-list-email-address.patch => 0028-New-mailing-list-email-address.patch} (99%) rename SOURCES/{0034-New-mailing-list-archives.patch => 0029-New-mailing-list-archives.patch} (98%) rename SOURCES/{0035-lib-Include-libxml-parser.h-for-xmlReadMemory.patch => 0030-lib-Include-libxml-parser.h-for-xmlReadMemory.patch} (91%) rename SOURCES/{0036-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch => 0031-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch} (98%) rename SOURCES/{0037-ocaml-Nullify-custom-block-before-releasing-runtime-.patch => 0032-ocaml-Nullify-custom-block-before-releasing-runtime-.patch} (94%) rename SOURCES/{0038-Update-common-submodule.patch => 0033-Update-common-submodule.patch} (98%) rename SOURCES/{0039-tests-Test-guestfish-key-all-.-selector.patch => 0034-tests-Test-guestfish-key-all-.-selector.patch} (94%) create mode 100644 SOURCES/0035-generator-customize.ml-Split-chown-parameter-on-char.patch create mode 100644 SOURCES/0036-Update-common-submodule.patch create mode 100644 SOURCES/0037-New-APIs-findfs_partuuid-and-findfs_partlabel.patch create mode 100644 SOURCES/0038-inspection-Resolve-PARTUUID-and-PARTLABEL-in-etc-fst.patch delete mode 100644 SOURCES/libguestfs-1.50.1.tar.gz.sig create mode 100644 SOURCES/libguestfs-1.50.2.tar.gz.sig diff --git a/.gitignore b/.gitignore index ff47434..18345f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -SOURCES/libguestfs-1.50.1.tar.gz -SOURCES/libguestfs-common-1.50.1.tar.gz +SOURCES/libguestfs-1.50.2.tar.gz +SOURCES/libguestfs-common-1.50.2.tar.gz SOURCES/libguestfs.keyring diff --git a/.libguestfs.metadata b/.libguestfs.metadata index 3000872..c68c25e 100644 --- a/.libguestfs.metadata +++ b/.libguestfs.metadata @@ -1,3 +1,3 @@ -b2ccc62a61d43917d982bb380709cd283fda465a SOURCES/libguestfs-1.50.1.tar.gz -c2f649ede7121e974884afb1b2dfacb966f9e21e SOURCES/libguestfs-common-1.50.1.tar.gz +9a4fcb78ca452e1cf04f0b541d938ab1b07019a6 SOURCES/libguestfs-1.50.2.tar.gz +f801826d11e360a906bae5980495ac5425d709ae SOURCES/libguestfs-common-1.50.2.tar.gz 1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring diff --git a/SOURCES/0003-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch b/SOURCES/0001-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch similarity index 96% rename from SOURCES/0003-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch rename to SOURCES/0001-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch index dea3fa6..bfb04bf 100644 --- a/SOURCES/0003-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch +++ b/SOURCES/0001-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch @@ -1,4 +1,4 @@ -From e58cd8df467e342463d08e3d761c2e322287b13e Mon Sep 17 00:00:00 2001 +From d2e6dce96a9f197b688758f90481407e75ae11d2 Mon Sep 17 00:00:00 2001 From: Andrey Drobyshev Date: Wed, 26 Apr 2023 15:59:44 +0300 Subject: [PATCH] daemon/selinux-relabel: don't exclude "/selinux" if it's diff --git a/SOURCES/0001-update-common-submodule.patch b/SOURCES/0001-update-common-submodule.patch deleted file mode 100644 index f15d70b..0000000 --- a/SOURCES/0001-update-common-submodule.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 5c672d1541e7d769e73e6858944d33f66be12f30 Mon Sep 17 00:00:00 2001 -From: Laszlo Ersek -Date: Tue, 14 Mar 2023 14:15:05 +0100 -Subject: [PATCH] update common submodule - -Andrey Drobyshev (2): - inject_virtio_win: add Virtio_SCSI to block_type - inject_virtio_win: write the proper block controller PCI ID to Win registry - -Richard W.M. Jones (2): - mlcustomize: Fix overlong comment - mlcustomize: Add accessors for block driver priority list - -Roman Kagan (1): - inject_virtio_win: match only vendor/device/revision - -Signed-off-by: Laszlo Ersek -(cherry picked from commit 7414ac40c7df0a8938a05ba50907312b0093d107) ---- - common | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Submodule common 90e0077e..360e037d: -diff --git a/common/mlcustomize/inject_virtio_win.ml b/common/mlcustomize/inject_virtio_win.ml -index 5f4aab72..2a30b200 100644 ---- a/common/mlcustomize/inject_virtio_win.ml -+++ b/common/mlcustomize/inject_virtio_win.ml -@@ -49,9 +49,12 @@ type t = { - of libosinfo. Although this behaviour is documented, IMHO it has - always been a bad idea. We should change this in future to allow - the user to select where they want to get drivers from. XXX *) -+ -+ mutable block_driver_priority : string list -+ (** List of block drivers *) - } - --type block_type = Virtio_blk | IDE -+type block_type = Virtio_blk | Virtio_SCSI | IDE - and net_type = Virtio_net | E1000 | RTL8139 - and machine_type = I440FX | Q35 | Virt - -@@ -107,13 +110,17 @@ and get_inspection g root = - { g; root; - i_arch; i_major_version; i_minor_version; i_osinfo; - i_product_variant; i_windows_current_control_set; i_windows_systemroot; -- virtio_win = ""; was_set = false } -+ virtio_win = ""; was_set = false; -+ block_driver_priority = ["virtio_blk"; "vrtioblk"; "viostor"] } -+ -+let get_block_driver_priority t = t.block_driver_priority -+let set_block_driver_priority t v = t.block_driver_priority <- v - - let scsi_class_guid = "{4D36E97B-E325-11CE-BFC1-08002BE10318}" --let viostor_legacy_pciid = "VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00" --let viostor_modern_pciid = "VEN_1AF4&DEV_1042&SUBSYS_11001AF4&REV_01" --let vioscsi_legacy_pciid = "VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00" --let vioscsi_modern_pciid = "VEN_1AF4&DEV_1048&SUBSYS_11001AF4&REV_01" -+let viostor_legacy_pciid = "VEN_1AF4&DEV_1001&REV_00" -+let viostor_modern_pciid = "VEN_1AF4&DEV_1042&REV_01" -+let vioscsi_legacy_pciid = "VEN_1AF4&DEV_1004&REV_00" -+let vioscsi_modern_pciid = "VEN_1AF4&DEV_1048&REV_01" - - let rec inject_virtio_win_drivers ({ g } as t) reg = - (* Copy the virtio drivers to the guest. *) -@@ -176,14 +183,13 @@ let rec inject_virtio_win_drivers ({ g } as t) reg = - else ( - (* Can we install the block driver? *) - let block : block_type = -- let filenames = ["virtio_blk"; "vrtioblk"; "viostor"] in - let viostor_driver = try ( - Some ( - List.find ( - fun driver_file -> - let source = driverdir // driver_file ^ ".sys" in - g#exists source -- ) filenames -+ ) t.block_driver_priority - ) - ) with Not_found -> None in - match viostor_driver with -@@ -194,16 +200,22 @@ let rec inject_virtio_win_drivers ({ g } as t) reg = - IDE - - | Some driver_name -> -- (* Block driver needs tweaks to allow booting; the rest is set up by PnP -- * manager *) -+ (* Block driver needs tweaks to allow booting; -+ * the rest is set up by PnP manager. -+ *) - let source = driverdir // (driver_name ^ ".sys") in - let target = sprintf "%s/system32/drivers/%s.sys" - t.i_windows_systemroot driver_name in - let target = g#case_sensitive_path target in -+ let installed_block_type, legacy_pciid, modern_pciid = -+ match driver_name with -+ | "vioscsi" -> Virtio_SCSI, vioscsi_legacy_pciid, vioscsi_modern_pciid -+ | _ -> Virtio_blk, viostor_legacy_pciid, viostor_modern_pciid -+ in - g#cp source target; -- add_guestor_to_registry t reg driver_name viostor_legacy_pciid; -- add_guestor_to_registry t reg driver_name viostor_modern_pciid; -- Virtio_blk in -+ add_guestor_to_registry t reg driver_name legacy_pciid; -+ add_guestor_to_registry t reg driver_name modern_pciid; -+ installed_block_type in - - (* Can we install the virtio-net driver? *) - let net : net_type = -diff --git a/common/mlcustomize/inject_virtio_win.mli b/common/mlcustomize/inject_virtio_win.mli -index 0ced02e8..d14f0497 100644 ---- a/common/mlcustomize/inject_virtio_win.mli -+++ b/common/mlcustomize/inject_virtio_win.mli -@@ -20,7 +20,7 @@ - - type t (** Handle *) - --type block_type = Virtio_blk | IDE -+type block_type = Virtio_blk | Virtio_SCSI | IDE - and net_type = Virtio_net | E1000 | RTL8139 - and machine_type = I440FX | Q35 | Virt - -@@ -64,6 +64,16 @@ val from_environment : Guestfs.guestfs -> string -> string -> t - - This should only be used by [virt-v2v] and is considered a legacy method. *) - -+val get_block_driver_priority : t -> string list -+val set_block_driver_priority : t -> string list -> unit -+(** Get or set the current block driver priority list. This is -+ a list of virtio-win block driver names (eg. ["viostor"]) that -+ we search until we come to the first [name ^ ".sys"] that -+ we find, and that is the block driver which gets installed. -+ -+ This module contains a default priority list which should -+ be suitable for most use cases. *) -+ - val inject_virtio_win_drivers : t -> Registry.t -> virtio_win_installed - (** [inject_virtio_win_drivers t reg] - installs virtio drivers from the driver directory or driver diff --git a/SOURCES/0004-daemon-selinux-relabel-search-for-invalid-option-in-.patch b/SOURCES/0002-daemon-selinux-relabel-search-for-invalid-option-in-.patch similarity index 95% rename from SOURCES/0004-daemon-selinux-relabel-search-for-invalid-option-in-.patch rename to SOURCES/0002-daemon-selinux-relabel-search-for-invalid-option-in-.patch index 569cd02..5cfab2d 100644 --- a/SOURCES/0004-daemon-selinux-relabel-search-for-invalid-option-in-.patch +++ b/SOURCES/0002-daemon-selinux-relabel-search-for-invalid-option-in-.patch @@ -1,4 +1,4 @@ -From c1829048c598e11950c9d355fdd5c177a99e046f Mon Sep 17 00:00:00 2001 +From 917455b15894c6c82bd657e918ceb09cd825c9c4 Mon Sep 17 00:00:00 2001 From: Andrey Drobyshev Date: Wed, 26 Apr 2023 15:59:45 +0300 Subject: [PATCH] daemon/selinux-relabel: search for "invalid option" in diff --git a/SOURCES/0002-update-common-submodule.patch b/SOURCES/0002-update-common-submodule.patch deleted file mode 100644 index 7c86882..0000000 --- a/SOURCES/0002-update-common-submodule.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 89b6c8b458dcb00de83b543c47a6acb049f63f18 Mon Sep 17 00:00:00 2001 -From: Laszlo Ersek -Date: Tue, 21 Mar 2023 16:55:15 +0100 -Subject: [PATCH] update common submodule - -HATAYAMA Daisuke (1): - progress: fix segmentation fault when TERM variable is "dumb" - -Laszlo Ersek (2): - detect_kernels: tighten "try" scope - detect_kernels: deal with RHEL's kernel-core / kernel-modules-core split - -rwmjones (1): - Merge pull request #5 from d-hatayama/fix_segfault_progress_bar - -Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2175703 -Signed-off-by: Laszlo Ersek -(cherry picked from commit be11d25b3e2770d86699e94c5087e6625477d5ec) ---- - common | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Submodule common 360e037d..70c10a07: -diff --git a/common/mldrivers/linux_kernels.ml b/common/mldrivers/linux_kernels.ml -index a46146a1..23ff76a5 100644 ---- a/common/mldrivers/linux_kernels.ml -+++ b/common/mldrivers/linux_kernels.ml -@@ -125,9 +125,9 @@ let detect_kernels (g : G.guestfs) root bootloader apps = - *) - let modpath, version = - let prefix = "/lib/modules/" in -+ let prefix_len = String.length prefix in - try -- let prefix_len = String.length prefix in -- List.find_map ( -+ let modpath, version = List.find_map ( - fun filename -> - let filename_len = String.length filename in - if filename_len > prefix_len && -@@ -137,17 +137,29 @@ let detect_kernels (g : G.guestfs) root bootloader apps = - Some (filename, version) - ) else - None -- ) files -+ ) files in -+ (* Fall back to the version in the vmlinuz file name not only if -+ * a candidate pathname couldn't be found under /lib/modules/, -+ * but also in case the candidate pathname doesn't reference a -+ * directory. See RHBZ#2175703. -+ * -+ * Note that this "is_dir" check is deliberately kept outside of -+ * the "find_map"'s mapper function above: we want the first -+ * candidate *to be* a directory, and not the first candidate -+ * *that is* a directory. -+ *) -+ if not (g#is_dir ~followsymlinks:true modpath) then -+ raise Not_found; -+ modpath, version - with Not_found -> - let version = - String.sub vmlinuz 14 (String.length vmlinuz - 14) in - let modpath = prefix ^ version in -+ (* Check that the modpath exists. *) -+ if not (g#is_dir ~followsymlinks:true modpath) then -+ raise Not_found; - modpath, version in - -- (* Check that the modpath exists. *) -- if not (g#is_dir ~followsymlinks:true modpath) then -- raise Not_found; -- - (* Find the initramfs which corresponds to the kernel. - * Since the initramfs is built at runtime, and doesn't have - * to be covered by the RPM file list, this is basically -diff --git a/common/progress/progress.c b/common/progress/progress.c -index 4d52b97e..e4b30663 100644 ---- a/common/progress/progress.c -+++ b/common/progress/progress.c -@@ -318,7 +318,8 @@ progress_bar_set (struct progress_bar *bar, - * (b) it's just not possible to use tputs in a sane way here. - */ - /*tputs (UP, 2, putchar);*/ -- fprintf (fp, "%s", UP); -+ if (UP) -+ fprintf (fp, "%s", UP); - } - bar->count++; - diff --git a/SOURCES/0005-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch b/SOURCES/0003-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch similarity index 98% rename from SOURCES/0005-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch rename to SOURCES/0003-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch index b5bb385..fc1f29d 100644 --- a/SOURCES/0005-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch +++ b/SOURCES/0003-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch @@ -1,4 +1,4 @@ -From 3046af080baad9935627ebb671950448cfd0fa7b Mon Sep 17 00:00:00 2001 +From d2f8308813da27f422607e5aa21fc95d113a17f0 Mon Sep 17 00:00:00 2001 From: Andrey Drobyshev Date: Wed, 26 Apr 2023 15:59:46 +0300 Subject: [PATCH] daemon/selinux-relabel: run setfiles with "-T 0", if diff --git a/SOURCES/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch b/SOURCES/0004-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch similarity index 99% rename from SOURCES/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch rename to SOURCES/0004-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch index d580b3c..5e17270 100644 --- a/SOURCES/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch +++ b/SOURCES/0004-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch @@ -1,4 +1,4 @@ -From ab7e68dbeefe464734bd63a862a36f612f76d396 Mon Sep 17 00:00:00 2001 +From 66b9338e3d786db28fbd853d397741c3ceb19352 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 29 Jul 2013 14:47:56 +0100 Subject: [PATCH] RHEL: Disable unsupported remote drive protocols @@ -220,7 +220,7 @@ index 21d42498..ddabeb63 100755 rm test-add-uri.out rm test-add-uri.img diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index c8d9949b..26c576c7 100644 +index bfb43a19..314bb0ae 100644 --- a/generator/actions_core.ml +++ b/generator/actions_core.ml @@ -350,29 +350,6 @@ F is interpreted as a local file or device. diff --git a/SOURCES/0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch b/SOURCES/0005-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch similarity index 97% rename from SOURCES/0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch rename to SOURCES/0005-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch index e251a5a..8e30e60 100644 --- a/SOURCES/0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch +++ b/SOURCES/0005-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch @@ -1,4 +1,4 @@ -From b74c6c8520773c2ef4a4d69b08b70e5ceeb06964 Mon Sep 17 00:00:00 2001 +From b875668bfa9f596aba2e84999c7c9921f8dcb55e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 7 Jul 2015 09:28:03 -0400 Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for diff --git a/SOURCES/0008-Remove-virt-dib.patch b/SOURCES/0006-Remove-virt-dib.patch similarity index 95% rename from SOURCES/0008-Remove-virt-dib.patch rename to SOURCES/0006-Remove-virt-dib.patch index 8137ddc..ddb1c73 100644 --- a/SOURCES/0008-Remove-virt-dib.patch +++ b/SOURCES/0006-Remove-virt-dib.patch @@ -1,4 +1,4 @@ -From e916ad54c31a725cbf08fb186756d9e968ff20b2 Mon Sep 17 00:00:00 2001 +From d4be44928a40e7ca1ef6255fb04d28f2fa7fc6b6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 7 Feb 2023 13:20:36 +0000 Subject: [PATCH] Remove virt-dib diff --git a/SOURCES/0009-lib-Choose-q35-machine-type-for-x86-64.patch b/SOURCES/0007-lib-Choose-q35-machine-type-for-x86-64.patch similarity index 94% rename from SOURCES/0009-lib-Choose-q35-machine-type-for-x86-64.patch rename to SOURCES/0007-lib-Choose-q35-machine-type-for-x86-64.patch index 7c56357..2e83fa5 100644 --- a/SOURCES/0009-lib-Choose-q35-machine-type-for-x86-64.patch +++ b/SOURCES/0007-lib-Choose-q35-machine-type-for-x86-64.patch @@ -1,4 +1,4 @@ -From e712c4b81cbd2cf0e990d01cb4d1f54734e62de6 Mon Sep 17 00:00:00 2001 +From d9ba056079f797483ea99394b265c9bf39769687 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 9 Feb 2023 13:38:50 +0000 Subject: [PATCH] lib: Choose q35 machine type for x86-64 diff --git a/SOURCES/0012-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch b/SOURCES/0008-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch similarity index 98% rename from SOURCES/0012-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch rename to SOURCES/0008-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch index b35742b..5516195 100644 --- a/SOURCES/0012-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch +++ b/SOURCES/0008-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch @@ -1,4 +1,4 @@ -From c95b3086bdbdf840de8d3b24c3ae5e9b847bf588 Mon Sep 17 00:00:00 2001 +From 826cf6d68e4369de3d160e91b7dad6a894469797 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 19 May 2023 16:08:48 +0200 Subject: [PATCH] LUKS-on-LVM inspection test: rename VGs and LVs @@ -17,7 +17,7 @@ Reviewed-by: Richard W.M. Jones 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/test-data/phony-guests/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl -index c0cb5d0b..6362e225 100755 +index 4c8e1499..b7dc902e 100755 --- a/test-data/phony-guests/make-fedora-img.pl +++ b/test-data/phony-guests/make-fedora-img.pl @@ -224,23 +224,27 @@ EOF diff --git a/SOURCES/0013-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch b/SOURCES/0009-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch similarity index 96% rename from SOURCES/0013-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch rename to SOURCES/0009-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch index 715e658..4cdab8f 100644 --- a/SOURCES/0013-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch +++ b/SOURCES/0009-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch @@ -1,4 +1,4 @@ -From 15cc20d1f5e0413c1af26c683437995886146eb6 Mon Sep 17 00:00:00 2001 +From 56d7564eaa308ef7de44c8b2b5dfc7997140142e Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 19 May 2023 16:08:49 +0200 Subject: [PATCH] LUKS-on-LVM inspection test: test /dev/mapper/VG-LV diff --git a/SOURCES/0010-RHEL-Revert-build-Remove-bundled-copy-of-ocaml-augea.patch b/SOURCES/0010-RHEL-Revert-build-Remove-bundled-copy-of-ocaml-augea.patch deleted file mode 100644 index c21130e..0000000 --- a/SOURCES/0010-RHEL-Revert-build-Remove-bundled-copy-of-ocaml-augea.patch +++ /dev/null @@ -1,1686 +0,0 @@ -From 73061a7feafcc0a527d00f6e1e2dee3dc84bc044 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 2 Mar 2023 10:12:19 +0000 -Subject: [PATCH] RHEL: Revert "build: Remove bundled copy of ocaml-augeas" - -This is temporarily reverted in RHEL 9.3 only until this bug can be -actioned: - - https://bugzilla.redhat.com/show_bug.cgi?id=2168634 - "Request for new RHEL 9.3 package: ocaml-augeas" - -This reverts commit fbf7fe87933ac24dd78362a16117c42e40da4c0f. ---- - .gitignore | 1 + - Makefile.am | 5 +- - bundled/ocaml-augeas/COPYING.LIB | 515 +++++++++++++++++++++++++ - bundled/ocaml-augeas/Makefile.am | 82 ++++ - bundled/ocaml-augeas/augeas-c.c | 579 +++++++++++++++++++++++++++++ - bundled/ocaml-augeas/augeas.README | 8 + - bundled/ocaml-augeas/augeas.ml | 99 +++++ - bundled/ocaml-augeas/augeas.mli | 164 ++++++++ - configure.ac | 1 + - daemon/Makefile.am | 7 +- - docs/guestfs-building.pod | 5 - - docs/guestfs-hacking.pod | 14 + - m4/guestfs-ocaml.m4 | 8 - - ocaml-dep.sh.in | 1 + - 14 files changed, 1472 insertions(+), 17 deletions(-) - create mode 100644 bundled/ocaml-augeas/COPYING.LIB - create mode 100644 bundled/ocaml-augeas/Makefile.am - create mode 100644 bundled/ocaml-augeas/augeas-c.c - create mode 100644 bundled/ocaml-augeas/augeas.README - create mode 100644 bundled/ocaml-augeas/augeas.ml - create mode 100644 bundled/ocaml-augeas/augeas.mli - -diff --git a/.gitignore b/.gitignore -index 00e59fb3..ee5ea74d 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -61,6 +61,7 @@ Makefile.in - /build-aux/snippet/ - /build-aux/test-driver - /build-aux/ylwrap -+/bundled/ocaml-augeas/.depend - /compile - /config.cache - /config.guess -diff --git a/Makefile.am b/Makefile.am -index 59370440..e0a7f084 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -35,6 +35,7 @@ SUBDIRS += include lib docs examples - - # The daemon and the appliance. - SUBDIRS += common/mlutils -+SUBDIRS += bundled/ocaml-augeas - SUBDIRS += common/mlpcre - if ENABLE_DAEMON - SUBDIRS += daemon -@@ -214,7 +215,7 @@ dist-hook: docs/C_SOURCE_FILES po/POTFILES - docs/C_SOURCE_FILES: configure.ac - rm -f $@ $@-t - find $(DIST_SUBDIRS) -name '*.[ch]' | \ -- grep -v -E '^(builder/index-parse\.|builder/index-scan\.|examples/|gobject/|java/com_redhat_et_libguestfs|perl/|php/extension/config\.h|ruby/ext/guestfs/extconf\.h|tests/|test-data/)' | \ -+ grep -v -E '^(builder/index-parse\.|builder/index-scan\.|examples/|gobject/|java/com_redhat_et_libguestfs|perl/|php/extension/config\.h|ruby/ext/guestfs/extconf\.h|tests/|test-data/|bundled/)' | \ - grep -v -E '/(guestfs|rc)_protocol\.' | \ - grep -v -E '.*/errnostring\.' | \ - grep -v -E '.*-gperf\.' | \ -@@ -227,7 +228,7 @@ po/POTFILES: configure.ac - rm -f $@ $@-t - cd $(srcdir); \ - find $(DIST_SUBDIRS) -name '*.c' | \ -- grep -v -E '^(examples|perl/(blib|examples)|po-docs|tests|test-data)/' | \ -+ grep -v -E '^(examples|perl/(blib|examples)|po-docs|tests|test-data|bundled)/' | \ - grep -v -E '/((guestfs|rc)_protocol\.c|dummy\.c)$$' | \ - grep -v -E '^python/utils\.c$$' | \ - grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \ -diff --git a/bundled/ocaml-augeas/COPYING.LIB b/bundled/ocaml-augeas/COPYING.LIB -new file mode 100644 -index 00000000..ba2be481 ---- /dev/null -+++ b/bundled/ocaml-augeas/COPYING.LIB -@@ -0,0 +1,515 @@ -+ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ Version 2.1, February 1999 -+ -+ Copyright (C) 1991, 1999 Free Software Foundation, Inc. -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+[This is the first released version of the Lesser GPL. It also counts -+ as the successor of the GNU Library Public License, version 2, hence -+ the version number 2.1.] -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+Licenses are intended to guarantee your freedom to share and change -+free software--to make sure the software is free for all its users. -+ -+ This license, the Lesser General Public License, applies to some -+specially designated software packages--typically libraries--of the -+Free Software Foundation and other authors who decide to use it. You -+can use it too, but we suggest you first think carefully about whether -+this license or the ordinary General Public License is the better -+strategy to use in any particular case, based on the explanations -+below. -+ -+ When we speak of free software, we are referring to freedom of use, -+not price. Our General Public Licenses are designed to make sure that -+you have the freedom to distribute copies of free software (and charge -+for this service if you wish); that you receive source code or can get -+it if you want it; that you can change the software and use pieces of -+it in new free programs; and that you are informed that you can do -+these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+distributors to deny you these rights or to ask you to surrender these -+rights. These restrictions translate to certain responsibilities for -+you if you distribute copies of the library or if you modify it. -+ -+ For example, if you distribute copies of the library, whether gratis -+or for a fee, you must give the recipients all the rights that we gave -+you. You must make sure that they, too, receive or can get the source -+code. If you link other code with the library, you must provide -+complete object files to the recipients, so that they can relink them -+with the library after making changes to the library and recompiling -+it. And you must show them these terms so they know their rights. -+ -+ We protect your rights with a two-step method: (1) we copyright the -+library, and (2) we offer you this license, which gives you legal -+permission to copy, distribute and/or modify the library. -+ -+ To protect each distributor, we want to make it very clear that -+there is no warranty for the free library. Also, if the library is -+modified by someone else and passed on, the recipients should know -+that what they have is not the original version, so that the original -+author's reputation will not be affected by problems that might be -+introduced by others. -+^L -+ Finally, software patents pose a constant threat to the existence of -+any free program. We wish to make sure that a company cannot -+effectively restrict the users of a free program by obtaining a -+restrictive license from a patent holder. Therefore, we insist that -+any patent license obtained for a version of the library must be -+consistent with the full freedom of use specified in this license. -+ -+ Most GNU software, including some libraries, is covered by the -+ordinary GNU General Public License. This license, the GNU Lesser -+General Public License, applies to certain designated libraries, and -+is quite different from the ordinary General Public License. We use -+this license for certain libraries in order to permit linking those -+libraries into non-free programs. -+ -+ When a program is linked with a library, whether statically or using -+a shared library, the combination of the two is legally speaking a -+combined work, a derivative of the original library. The ordinary -+General Public License therefore permits such linking only if the -+entire combination fits its criteria of freedom. The Lesser General -+Public License permits more lax criteria for linking other code with -+the library. -+ -+ We call this license the "Lesser" General Public License because it -+does Less to protect the user's freedom than the ordinary General -+Public License. It also provides other free software developers Less -+of an advantage over competing non-free programs. These disadvantages -+are the reason we use the ordinary General Public License for many -+libraries. However, the Lesser license provides advantages in certain -+special circumstances. -+ -+ For example, on rare occasions, there may be a special need to -+encourage the widest possible use of a certain library, so that it -+becomes -+a de-facto standard. To achieve this, non-free programs must be -+allowed to use the library. A more frequent case is that a free -+library does the same job as widely used non-free libraries. In this -+case, there is little to gain by limiting the free library to free -+software only, so we use the Lesser General Public License. -+ -+ In other cases, permission to use a particular library in non-free -+programs enables a greater number of people to use a large body of -+free software. For example, permission to use the GNU C Library in -+non-free programs enables many more people to use the whole GNU -+operating system, as well as its variant, the GNU/Linux operating -+system. -+ -+ Although the Lesser General Public License is Less protective of the -+users' freedom, it does ensure that the user of a program that is -+linked with the Library has the freedom and the wherewithal to run -+that program using a modified version of the Library. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. Pay close attention to the difference between a -+"work based on the library" and a "work that uses the library". The -+former contains code derived from the library, whereas the latter must -+be combined with the library in order to run. -+^L -+ GNU LESSER GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License Agreement applies to any software library or other -+program which contains a notice placed by the copyright holder or -+other authorized party saying it may be distributed under the terms of -+this Lesser General Public License (also called "this License"). -+Each licensee is addressed as "you". -+ -+ A "library" means a collection of software functions and/or data -+prepared so as to be conveniently linked with application programs -+(which use some of those functions and data) to form executables. -+ -+ The "Library", below, refers to any such software library or work -+which has been distributed under these terms. A "work based on the -+Library" means either the Library or any derivative work under -+copyright law: that is to say, a work containing the Library or a -+portion of it, either verbatim or with modifications and/or translated -+straightforwardly into another language. (Hereinafter, translation is -+included without limitation in the term "modification".) -+ -+ "Source code" for a work means the preferred form of the work for -+making modifications to it. For a library, complete source code means -+all the source code for all modules it contains, plus any associated -+interface definition files, plus the scripts used to control -+compilation -+and installation of the library. -+ -+ Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running a program using the Library is not restricted, and output from -+such a program is covered only if its contents constitute a work based -+on the Library (independent of the use of the Library in a tool for -+writing it). Whether that is true depends on what the Library does -+and what the program that uses the Library does. -+ -+ 1. You may copy and distribute verbatim copies of the Library's -+complete source code as you receive it, in any medium, provided that -+you conspicuously and appropriately publish on each copy an -+appropriate copyright notice and disclaimer of warranty; keep intact -+all the notices that refer to this License and to the absence of any -+warranty; and distribute a copy of this License along with the -+Library. -+ -+ You may charge a fee for the physical act of transferring a copy, -+and you may at your option offer warranty protection in exchange for a -+fee. -+ -+ 2. You may modify your copy or copies of the Library or any portion -+of it, thus forming a work based on the Library, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) The modified work must itself be a software library. -+ -+ b) You must cause the files modified to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ c) You must cause the whole of the work to be licensed at no -+ charge to all third parties under the terms of this License. -+ -+ d) If a facility in the modified Library refers to a function or a -+ table of data to be supplied by an application program that uses -+ the facility, other than as an argument passed when the facility -+ is invoked, then you must make a good faith effort to ensure that, -+ in the event an application does not supply such function or -+ table, the facility still operates, and performs whatever part of -+ its purpose remains meaningful. -+ -+ (For example, a function in a library to compute square roots has -+ a purpose that is entirely well-defined independent of the -+ application. Therefore, Subsection 2d requires that any -+ application-supplied function or table used by this function must -+ be optional: if the application does not supply it, the square -+ root function must still compute square roots.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Library, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Library, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote -+it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Library. -+ -+In addition, mere aggregation of another work not based on the Library -+with the Library (or with a work based on the Library) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may opt to apply the terms of the ordinary GNU General Public -+License instead of this License to a given copy of the Library. To do -+this, you must alter all the notices that refer to this License, so -+that they refer to the ordinary GNU General Public License, version 2, -+instead of to this License. (If a newer version than version 2 of the -+ordinary GNU General Public License has appeared, then you can specify -+that version instead if you wish.) Do not make any other change in -+these notices. -+^L -+ Once this change is made in a given copy, it is irreversible for -+that copy, so the ordinary GNU General Public License applies to all -+subsequent copies and derivative works made from that copy. -+ -+ This option is useful when you wish to copy part of the code of -+the Library into a program that is not a library. -+ -+ 4. You may copy and distribute the Library (or a portion or -+derivative of it, under Section 2) in object code or executable form -+under the terms of Sections 1 and 2 above provided that you accompany -+it with the complete corresponding machine-readable source code, which -+must be distributed under the terms of Sections 1 and 2 above on a -+medium customarily used for software interchange. -+ -+ If distribution of object code is made by offering access to copy -+from a designated place, then offering equivalent access to copy the -+source code from the same place satisfies the requirement to -+distribute the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 5. A program that contains no derivative of any portion of the -+Library, but is designed to work with the Library by being compiled or -+linked with it, is called a "work that uses the Library". Such a -+work, in isolation, is not a derivative work of the Library, and -+therefore falls outside the scope of this License. -+ -+ However, linking a "work that uses the Library" with the Library -+creates an executable that is a derivative of the Library (because it -+contains portions of the Library), rather than a "work that uses the -+library". The executable is therefore covered by this License. -+Section 6 states terms for distribution of such executables. -+ -+ When a "work that uses the Library" uses material from a header file -+that is part of the Library, the object code for the work may be a -+derivative work of the Library even though the source code is not. -+Whether this is true is especially significant if the work can be -+linked without the Library, or if the work is itself a library. The -+threshold for this to be true is not precisely defined by law. -+ -+ If such an object file uses only numerical parameters, data -+structure layouts and accessors, and small macros and small inline -+functions (ten lines or less in length), then the use of the object -+file is unrestricted, regardless of whether it is legally a derivative -+work. (Executables containing this object code plus portions of the -+Library will still fall under Section 6.) -+ -+ Otherwise, if the work is a derivative of the Library, you may -+distribute the object code for the work under the terms of Section 6. -+Any executables containing that work also fall under Section 6, -+whether or not they are linked directly with the Library itself. -+^L -+ 6. As an exception to the Sections above, you may also combine or -+link a "work that uses the Library" with the Library to produce a -+work containing portions of the Library, and distribute that work -+under terms of your choice, provided that the terms permit -+modification of the work for the customer's own use and reverse -+engineering for debugging such modifications. -+ -+ You must give prominent notice with each copy of the work that the -+Library is used in it and that the Library and its use are covered by -+this License. You must supply a copy of this License. If the work -+during execution displays copyright notices, you must include the -+copyright notice for the Library among them, as well as a reference -+directing the user to the copy of this License. Also, you must do one -+of these things: -+ -+ a) Accompany the work with the complete corresponding -+ machine-readable source code for the Library including whatever -+ changes were used in the work (which must be distributed under -+ Sections 1 and 2 above); and, if the work is an executable linked -+ with the Library, with the complete machine-readable "work that -+ uses the Library", as object code and/or source code, so that the -+ user can modify the Library and then relink to produce a modified -+ executable containing the modified Library. (It is understood -+ that the user who changes the contents of definitions files in the -+ Library will not necessarily be able to recompile the application -+ to use the modified definitions.) -+ -+ b) Use a suitable shared library mechanism for linking with the -+ Library. A suitable mechanism is one that (1) uses at run time a -+ copy of the library already present on the user's computer system, -+ rather than copying library functions into the executable, and (2) -+ will operate properly with a modified version of the library, if -+ the user installs one, as long as the modified version is -+ interface-compatible with the version that the work was made with. -+ -+ c) Accompany the work with a written offer, valid for at -+ least three years, to give the same user the materials -+ specified in Subsection 6a, above, for a charge no more -+ than the cost of performing this distribution. -+ -+ d) If distribution of the work is made by offering access to copy -+ from a designated place, offer equivalent access to copy the above -+ specified materials from the same place. -+ -+ e) Verify that the user has already received a copy of these -+ materials or that you have already sent this user a copy. -+ -+ For an executable, the required form of the "work that uses the -+Library" must include any data and utility programs needed for -+reproducing the executable from it. However, as a special exception, -+the materials to be distributed need not include anything that is -+normally distributed (in either source or binary form) with the major -+components (compiler, kernel, and so on) of the operating system on -+which the executable runs, unless that component itself accompanies -+the executable. -+ -+ It may happen that this requirement contradicts the license -+restrictions of other proprietary libraries that do not normally -+accompany the operating system. Such a contradiction means you cannot -+use both them and the Library together in an executable that you -+distribute. -+^L -+ 7. You may place library facilities that are a work based on the -+Library side-by-side in a single library together with other library -+facilities not covered by this License, and distribute such a combined -+library, provided that the separate distribution of the work based on -+the Library and of the other library facilities is otherwise -+permitted, and provided that you do these two things: -+ -+ a) Accompany the combined library with a copy of the same work -+ based on the Library, uncombined with any other library -+ facilities. This must be distributed under the terms of the -+ Sections above. -+ -+ b) Give prominent notice with the combined library of the fact -+ that part of it is a work based on the Library, and explaining -+ where to find the accompanying uncombined form of the same work. -+ -+ 8. You may not copy, modify, sublicense, link with, or distribute -+the Library except as expressly provided under this License. Any -+attempt otherwise to copy, modify, sublicense, link with, or -+distribute the Library is void, and will automatically terminate your -+rights under this License. However, parties who have received copies, -+or rights, from you under this License will not have their licenses -+terminated so long as such parties remain in full compliance. -+ -+ 9. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Library or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Library (or any work based on the -+Library), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Library or works based on it. -+ -+ 10. Each time you redistribute the Library (or any work based on the -+Library), the recipient automatically receives a license from the -+original licensor to copy, distribute, link with or modify the Library -+subject to these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties with -+this License. -+^L -+ 11. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Library at all. For example, if a patent -+license would not permit royalty-free redistribution of the Library by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Library. -+ -+If any portion of this section is held invalid or unenforceable under -+any particular circumstance, the balance of the section is intended to -+apply, and the section as a whole is intended to apply in other -+circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 12. If the distribution and/or use of the Library is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Library under this License -+may add an explicit geographical distribution limitation excluding those -+countries, so that distribution is permitted only in or among -+countries not thus excluded. In such case, this License incorporates -+the limitation as if written in the body of this License. -+ -+ 13. The Free Software Foundation may publish revised and/or new -+versions of the Lesser General Public License from time to time. -+Such new versions will be similar in spirit to the present version, -+but may differ in detail to address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Library -+specifies a version number of this License which applies to it and -+"any later version", you have the option of following the terms and -+conditions either of that version or of any later version published by -+the Free Software Foundation. If the Library does not specify a -+license version number, you may choose any version ever published by -+the Free Software Foundation. -+^L -+ 14. If you wish to incorporate parts of the Library into other free -+programs whose distribution conditions are incompatible with these, -+write to the author to ask for permission. For software which is -+copyrighted by the Free Software Foundation, write to the Free -+Software Foundation; we sometimes make exceptions for this. Our -+decision will be guided by the two goals of preserving the free status -+of all derivatives of our free software and of promoting the sharing -+and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -+ -+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -+DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+^L -+ How to Apply These Terms to Your New Libraries -+ -+ If you develop a new library, and you want it to be of the greatest -+possible use to the public, we recommend making it free software that -+everyone can redistribute and change. You can do so by permitting -+redistribution under these terms (or, alternatively, under the terms -+of the ordinary General Public License). -+ -+ To apply these terms, attach the following notices to the library. -+It is safest to attach them to the start of each source file to most -+effectively convey the exclusion of warranty; and each file should -+have at least the "copyright" line and a pointer to where the full -+notice is found. -+ -+ -+ -+ Copyright (C) -+ -+ This library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2 of the License, or (at your option) any later version. -+ -+ This library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with this library; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ -+Also add information on how to contact you by electronic and paper -+mail. -+ -+You should also get your employer (if you work as a programmer) or -+your -+school, if any, to sign a "copyright disclaimer" for the library, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the -+ library `Frob' (a library for tweaking knobs) written by James -+Random Hacker. -+ -+ , 1 April 1990 -+ Ty Coon, President of Vice -+ -+That's all there is to it! -+ -+ -diff --git a/bundled/ocaml-augeas/Makefile.am b/bundled/ocaml-augeas/Makefile.am -new file mode 100644 -index 00000000..b6122eab ---- /dev/null -+++ b/bundled/ocaml-augeas/Makefile.am -@@ -0,0 +1,82 @@ -+# libguestfs OCaml tools common code -+# Copyright (C) 2011-2020 Red Hat Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ -+include $(top_srcdir)/subdir-rules.mk -+ -+EXTRA_DIST = \ -+ $(SOURCES_MLI) \ -+ $(SOURCES_ML) \ -+ $(SOURCES_C) \ -+ augeas.README -+ -+SOURCES_MLI = \ -+ augeas.mli -+ -+SOURCES_ML = \ -+ augeas.ml -+ -+SOURCES_C = \ -+ augeas-c.c -+ -+# We pretend that we're building a C library. automake handles the -+# compilation of the C sources for us. At the end we take the C -+# objects and OCaml objects and link them into the OCaml library. -+# This C library is never used. -+ -+noinst_LIBRARIES = libmlaugeas.a -+ -+if !HAVE_OCAMLOPT -+MLAUGEAS_CMA = mlaugeas.cma -+else -+MLAUGEAS_CMA = mlaugeas.cmxa -+endif -+ -+noinst_DATA = $(MLAUGEAS_CMA) -+ -+libmlaugeas_a_SOURCES = $(SOURCES_C) -+libmlaugeas_a_CPPFLAGS = \ -+ -DCAML_NAME_SPACE \ -+ -I. \ -+ -I$(top_builddir) \ -+ -I$(shell $(OCAMLC) -where) -+libmlaugeas_a_CFLAGS = \ -+ $(WARN_CFLAGS) $(NO_SNV_CFLAGS) $(NO_UM_CFLAGS) $(WERROR_CFLAGS) \ -+ $(AUGEAS_CFLAGS) $(LIBXML2_CFLAGS) \ -+ -fPIC -+ -+BOBJECTS = $(SOURCES_ML:.ml=.cmo) -+XOBJECTS = $(BOBJECTS:.cmo=.cmx) -+ -+OCAMLPACKAGES = -+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' -+ -+if !HAVE_OCAMLOPT -+OBJECTS = $(BOBJECTS) -+else -+OBJECTS = $(XOBJECTS) -+endif -+ -+libmlaugeas_a_DEPENDENCIES = $(OBJECTS) -+ -+$(MLAUGEAS_CMA): $(OBJECTS) libmlaugeas.a -+ $(OCAMLFIND) mklib $(OCAMLPACKAGES) \ -+ $(OBJECTS) $(libmlaugeas_a_OBJECTS) -cclib -laugeas -o mlaugeas -+ -+# Dependencies. -+.depend: $(srcdir)/*.mli $(srcdir)/*.ml -+ $(top_builddir)/ocaml-dep.sh $^ -+-include .depend -diff --git a/bundled/ocaml-augeas/augeas-c.c b/bundled/ocaml-augeas/augeas-c.c -new file mode 100644 -index 00000000..679bcb50 ---- /dev/null -+++ b/bundled/ocaml-augeas/augeas-c.c -@@ -0,0 +1,579 @@ -+/* Augeas OCaml bindings -+ * Copyright (C) 2008-2017 Red Hat Inc., Richard W.M. Jones -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ * $Id: augeas_c.c,v 1.1 2008/05/06 10:48:20 rjones Exp $ -+ */ -+ -+#include "config.h" -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#ifdef __GNUC__ -+ #define NORETURN __attribute__ ((noreturn)) -+#else -+ #define NORETURN -+#endif -+ -+extern CAMLprim value ocaml_augeas_create (value rootv, value loadpathv, value flagsv); -+extern CAMLprim value ocaml_augeas_close (value tv); -+extern CAMLprim value ocaml_augeas_defnode (value tv, value namev, value exprv, value valv); -+extern CAMLprim value ocaml_augeas_defvar (value tv, value namev, value exprv); -+extern CAMLprim value ocaml_augeas_get (value tv, value pathv); -+extern CAMLprim value ocaml_augeas_exists (value tv, value pathv); -+extern CAMLprim value ocaml_augeas_insert (value tv, value beforev, value pathv, value labelv); -+extern CAMLprim value ocaml_augeas_label (value tv, value pathv); -+extern CAMLprim value ocaml_augeas_mv (value tv, value srcv, value destv); -+extern CAMLprim value ocaml_augeas_rm (value tv, value pathv); -+extern CAMLprim value ocaml_augeas_match (value tv, value pathv); -+extern CAMLprim value ocaml_augeas_count_matches (value tv, value pathv); -+extern CAMLprim value ocaml_augeas_save (value tv); -+extern CAMLprim value ocaml_augeas_load (value tv); -+extern CAMLprim value ocaml_augeas_set (value tv, value pathv, value valuev); -+extern CAMLprim value ocaml_augeas_setm (value tv, value basev, value subv, value valv); -+extern CAMLprim value ocaml_augeas_transform (value tv, value lensv, value filev, value modev); -+extern CAMLprim value ocaml_augeas_source (value tv, value pathv) -+#ifndef HAVE_AUG_SOURCE -+ NORETURN -+#endif -+; -+ -+typedef augeas *augeas_t; -+ -+/* Map C aug_errcode_t to OCaml error_code. */ -+static const int error_map[] = { -+ /* AugErrInternal */ AUG_EINTERNAL, -+ /* AugErrPathX */ AUG_EPATHX, -+ /* AugErrNoMatch */ AUG_ENOMATCH, -+ /* AugErrMMatch */ AUG_EMMATCH, -+ /* AugErrSyntax */ AUG_ESYNTAX, -+ /* AugErrNoLens */ AUG_ENOLENS, -+ /* AugErrMXfm */ AUG_EMXFM, -+ /* AugErrNoSpan */ AUG_ENOSPAN, -+ /* AugErrMvDesc */ AUG_EMVDESC, -+ /* AugErrCmdRun */ AUG_ECMDRUN, -+ /* AugErrBadArg */ AUG_EBADARG, -+ /* AugErrLabel */ AUG_ELABEL, -+ /* AugErrCpDesc */ AUG_ECPDESC, -+}; -+static const int error_map_len = sizeof error_map / sizeof error_map[0]; -+ -+/* Raise an Augeas.Error exception, and optionally close the -+ * specified handle. -+ */ -+static void -+raise_error_and_maybe_close (augeas_t t, const char *msg, bool close_handle) -+{ -+ const value *exn = caml_named_value ("Augeas.Error"); -+ value args[5]; -+ const int code = aug_error (t); -+ const char *aug_err_msg; -+ const char *aug_err_minor; -+ const char *aug_err_details; -+ int ocaml_code = -1; -+ int i; -+ -+ if (code == AUG_ENOMEM) { -+ if (close_handle) -+ aug_close (t); -+ caml_raise_out_of_memory (); -+ } -+ -+ aug_err_msg = aug_error_message (t); -+ aug_err_minor = aug_error_minor_message (t); -+ aug_err_details = aug_error_details (t); -+ -+ for (i = 0; i < error_map_len; ++i) -+ if (error_map[i] == code) { -+ ocaml_code = i; -+ break; -+ } -+ -+ if (ocaml_code != -1) -+ args[0] = Val_int (ocaml_code); -+ else { -+ args[0] = caml_alloc (1, 0); -+ Store_field (args[0], 0, Val_int (code)); -+ } -+ args[1] = caml_copy_string (msg); -+ args[2] = caml_copy_string (aug_err_msg); -+ args[3] = caml_copy_string (aug_err_minor ? : ""); -+ args[4] = caml_copy_string (aug_err_details ? : ""); -+ -+ if (close_handle) -+ aug_close (t); -+ -+ caml_raise_with_args (*exn, 5, args); -+} -+#define raise_error(t, msg) raise_error_and_maybe_close(t, msg, false) -+ -+static void -+raise_init_error (const char *msg) -+{ -+ const value *exn = caml_named_value ("Augeas.Error"); -+ value args[5]; -+ -+ args[0] = caml_alloc (1, 0); -+ Store_field (args[0], 0, Val_int (-1)); -+ args[1] = caml_copy_string (msg); -+ args[2] = caml_copy_string ("aug_init failed"); -+ args[3] = caml_copy_string ("augeas initialization failed"); -+ args[4] = caml_copy_string (""); -+ -+ caml_raise_with_args (*exn, 5, args); -+} -+ -+static const char * -+Optstring_val (value strv) -+{ -+ if (strv == Val_int (0)) /* None */ -+ return NULL; -+ else /* Some string */ -+ return String_val (Field (strv, 0)); -+} -+ -+/* Map OCaml flags to C flags. */ -+static const int flag_map[] = { -+ /* AugSaveBackup */ AUG_SAVE_BACKUP, -+ /* AugSaveNewFile */ AUG_SAVE_NEWFILE, -+ /* AugTypeCheck */ AUG_TYPE_CHECK, -+ /* AugNoStdinc */ AUG_NO_STDINC, -+ /* AugSaveNoop */ AUG_SAVE_NOOP, -+ /* AugNoLoad */ AUG_NO_LOAD, -+ /* AugNoModlAutoload */ AUG_NO_MODL_AUTOLOAD, -+ /* AugEnableSpan */ AUG_ENABLE_SPAN, -+ /* AugNoErrClose */ AUG_NO_ERR_CLOSE, -+ /* AugTraceModuleLoading */ AUG_TRACE_MODULE_LOADING, -+}; -+ -+/* Wrap and unwrap augeas_t handles, with a finalizer. */ -+#define Augeas_t_val(rv) (*(augeas_t *)Data_custom_val(rv)) -+ -+static void -+augeas_t_finalize (value tv) -+{ -+ augeas_t t = Augeas_t_val (tv); -+ if (t) aug_close (t); -+} -+ -+static struct custom_operations custom_operations = { -+ (char *) "augeas_t_custom_operations", -+ augeas_t_finalize, -+ custom_compare_default, -+ custom_hash_default, -+ custom_serialize_default, -+ custom_deserialize_default, -+ custom_compare_ext_default, -+}; -+ -+static value Val_augeas_t (augeas_t t) -+{ -+ CAMLparam0 (); -+ CAMLlocal1 (rv); -+ /* We could choose these so that the GC can make better decisions. -+ * See 18.9.2 of the OCaml manual. -+ */ -+ const int used = 0; -+ const int max = 1; -+ -+ rv = caml_alloc_custom (&custom_operations, -+ sizeof (augeas_t), used, max); -+ Augeas_t_val(rv) = t; -+ -+ CAMLreturn (rv); -+} -+ -+#pragma GCC diagnostic ignored "-Wmissing-prototypes" -+ -+/* val create : string -> string option -> flag list -> t */ -+CAMLprim value -+ocaml_augeas_create (value rootv, value loadpathv, value flagsv) -+{ -+ CAMLparam1 (rootv); -+ const char *root = String_val (rootv); -+ const char *loadpath = Optstring_val (loadpathv); -+ int flags = 0, i; -+ augeas_t t; -+ -+ /* Convert list of flags to C. */ -+ for (; flagsv != Val_int (0); flagsv = Field (flagsv, 1)) { -+ i = Int_val (Field (flagsv, 0)); -+ flags |= flag_map[i]; -+ } -+ -+ /* Pass AUG_NO_ERR_CLOSE so we raise a detailed Augeas.Error. */ -+ t = aug_init (root, loadpath, flags | AUG_NO_ERR_CLOSE); -+ -+ if (t == NULL) -+ raise_init_error ("Augeas.create"); -+ -+ if (aug_error (t) != AUG_NOERROR) { -+ raise_error_and_maybe_close (t, "Augeas.init", true); -+ } -+ -+ CAMLreturn (Val_augeas_t (t)); -+} -+ -+/* val close : t -> unit */ -+CAMLprim value -+ocaml_augeas_close (value tv) -+{ -+ CAMLparam1 (tv); -+ augeas_t t = Augeas_t_val (tv); -+ -+ if (t) { -+ aug_close (t); -+ Augeas_t_val(tv) = NULL; /* So the finalizer doesn't double-free. */ -+ } -+ -+ CAMLreturn (Val_unit); -+} -+ -+/* val defnode : t -> string -> string -> string option -> int * bool */ -+CAMLprim value -+ocaml_augeas_defnode (value tv, value namev, value exprv, value valv) -+{ -+ CAMLparam4 (tv, namev, exprv, valv); -+ CAMLlocal2 (optv, v); -+ augeas_t t = Augeas_t_val (tv); -+ const char *name = String_val (namev); -+ const char *expr = String_val (exprv); -+ const char *val = Optstring_val (valv); -+ int r, created; -+ -+ r = aug_defnode (t, name, expr, val, &created); -+ if (r == -1) { -+ raise_error (t, "Augeas.defnode"); -+ } -+ -+ v = caml_alloc (2, 0); -+ Store_field (v, 0, Val_int (r)); -+ Store_field (v, 1, Val_bool (created)); -+ -+ CAMLreturn (v); -+} -+ -+/* val defvar : t -> string -> string option -> int option */ -+CAMLprim value -+ocaml_augeas_defvar (value tv, value namev, value exprv) -+{ -+ CAMLparam3 (tv, namev, exprv); -+ CAMLlocal2 (optv, v); -+ augeas_t t = Augeas_t_val (tv); -+ const char *name = String_val (namev); -+ const char *expr = Optstring_val (exprv); -+ int r; -+ -+ r = aug_defvar (t, name, expr); -+ if (r > 0) { /* Return Some val */ -+ v = Val_int (r); -+ optv = caml_alloc (1, 0); -+ Field (optv, 0) = v; -+ } else if (r == 0) /* Return None */ -+ optv = Val_int (0); -+ else if (r == -1) /* Error or multiple matches */ -+ raise_error (t, "Augeas.defvar"); -+ else -+ caml_failwith ("Augeas.defvar: bad return value"); -+ -+ CAMLreturn (optv); -+} -+ -+/* val get : t -> path -> value option */ -+CAMLprim value -+ocaml_augeas_get (value tv, value pathv) -+{ -+ CAMLparam2 (tv, pathv); -+ CAMLlocal2 (optv, v); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ const char *val; -+ int r; -+ -+ r = aug_get (t, path, &val); -+ if (r == 1 && val) { /* Return Some val */ -+ v = caml_copy_string (val); -+ optv = caml_alloc (1, 0); -+ Field (optv, 0) = v; -+ } else if (r == 0 || !val) /* Return None */ -+ optv = Val_int (0); -+ else if (r == -1) /* Error or multiple matches */ -+ raise_error (t, "Augeas.get"); -+ else -+ caml_failwith ("Augeas.get: bad return value"); -+ -+ CAMLreturn (optv); -+} -+ -+/* val exists : t -> path -> bool */ -+CAMLprim value -+ocaml_augeas_exists (value tv, value pathv) -+{ -+ CAMLparam2 (tv, pathv); -+ CAMLlocal1 (v); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ int r; -+ -+ r = aug_get (t, path, NULL); -+ if (r == 1) /* Return true. */ -+ v = Val_int (1); -+ else if (r == 0) /* Return false */ -+ v = Val_int (0); -+ else if (r == -1) /* Error or multiple matches */ -+ raise_error (t, "Augeas.exists"); -+ else -+ caml_failwith ("Augeas.exists: bad return value"); -+ -+ CAMLreturn (v); -+} -+ -+/* val insert : t -> ?before:bool -> path -> string -> unit */ -+CAMLprim value -+ocaml_augeas_insert (value tv, value beforev, value pathv, value labelv) -+{ -+ CAMLparam4 (tv, beforev, pathv, labelv); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ const char *label = String_val (labelv); -+ int before; -+ -+ before = beforev == Val_int (0) ? 0 : Int_val (Field (beforev, 0)); -+ -+ if (aug_insert (t, path, label, before) == -1) -+ raise_error (t, "Augeas.insert"); -+ -+ CAMLreturn (Val_unit); -+} -+ -+/* val label : t -> path -> string option */ -+CAMLprim value -+ocaml_augeas_label (value tv, value pathv) -+{ -+ CAMLparam2 (tv, pathv); -+ CAMLlocal2 (optv, v); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ const char *val; -+ int r; -+ -+ r = aug_label (t, path, &val); -+ if (r == 1 && val) { /* Return Some val */ -+ v = caml_copy_string (val); -+ optv = caml_alloc (1, 0); -+ Field (optv, 0) = v; -+ } else if (r == 0 || !val) /* Return None */ -+ optv = Val_int (0); -+ else if (r == -1) /* Error or multiple matches */ -+ raise_error (t, "Augeas.label"); -+ else -+ caml_failwith ("Augeas.label: bad return value"); -+ -+ CAMLreturn (optv); -+} -+ -+/* val mv : t -> path -> path -> unit */ -+CAMLprim value -+ocaml_augeas_mv (value tv, value srcv, value destv) -+{ -+ CAMLparam3 (tv, srcv, destv); -+ augeas_t t = Augeas_t_val (tv); -+ const char *src = String_val (srcv); -+ const char *dest = String_val (destv); -+ -+ if (aug_mv (t, src, dest) == -1) -+ raise_error (t, "Augeas.mv"); -+ -+ CAMLreturn (Val_unit); -+} -+ -+/* val rm : t -> path -> int */ -+CAMLprim value -+ocaml_augeas_rm (value tv, value pathv) -+{ -+ CAMLparam2 (tv, pathv); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ int r; -+ -+ r = aug_rm (t, path); -+ if (r == -1) -+ raise_error (t, "Augeas.rm"); -+ -+ CAMLreturn (Val_int (r)); -+} -+ -+/* val matches : t -> path -> path list */ -+CAMLprim value -+ocaml_augeas_match (value tv, value pathv) -+{ -+ CAMLparam2 (tv, pathv); -+ CAMLlocal3 (rv, v, cons); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ char **matches; -+ int r, i; -+ -+ r = aug_match (t, path, &matches); -+ if (r == -1) -+ raise_error (t, "Augeas.matches"); -+ -+ /* Copy the paths to a list. */ -+ rv = Val_int (0); -+ for (i = 0; i < r; ++i) { -+ v = caml_copy_string (matches[i]); -+ free (matches[i]); -+ cons = caml_alloc (2, 0); -+ Field (cons, 1) = rv; -+ Field (cons, 0) = v; -+ rv = cons; -+ } -+ -+ free (matches); -+ -+ CAMLreturn (rv); -+} -+ -+/* val count_matches : t -> path -> int */ -+CAMLprim value -+ocaml_augeas_count_matches (value tv, value pathv) -+{ -+ CAMLparam2 (tv, pathv); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ int r; -+ -+ r = aug_match (t, path, NULL); -+ if (r == -1) -+ raise_error (t, "Augeas.count_matches"); -+ -+ CAMLreturn (Val_int (r)); -+} -+ -+/* val save : t -> unit */ -+CAMLprim value -+ocaml_augeas_save (value tv) -+{ -+ CAMLparam1 (tv); -+ augeas_t t = Augeas_t_val (tv); -+ -+ if (aug_save (t) == -1) -+ raise_error (t, "Augeas.save"); -+ -+ CAMLreturn (Val_unit); -+} -+ -+/* val load : t -> unit */ -+CAMLprim value -+ocaml_augeas_load (value tv) -+{ -+ CAMLparam1 (tv); -+ augeas_t t = Augeas_t_val (tv); -+ -+ if (aug_load (t) == -1) -+ raise_error (t, "Augeas.load"); -+ -+ CAMLreturn (Val_unit); -+} -+ -+/* val set : t -> -> path -> value option -> unit */ -+CAMLprim value -+ocaml_augeas_set (value tv, value pathv, value valuev) -+{ -+ CAMLparam3 (tv, pathv, valuev); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ const char *val = Optstring_val (valuev); -+ -+ if (aug_set (t, path, val) == -1) -+ raise_error (t, "Augeas.set"); -+ -+ CAMLreturn (Val_unit); -+} -+ -+/* val setm : t -> path -> string option -> value option -> int */ -+CAMLprim value -+ocaml_augeas_setm (value tv, value basev, value subv, value valv) -+{ -+ CAMLparam4 (tv, basev, subv, valv); -+ augeas_t t = Augeas_t_val (tv); -+ const char *base = String_val (basev); -+ const char *sub = Optstring_val (subv); -+ const char *val = Optstring_val (valv); -+ int r; -+ -+ r = aug_setm (t, base, sub, val); -+ if (r == -1) -+ raise_error (t, "Augeas.setm"); -+ -+ CAMLreturn (Val_int (r)); -+} -+ -+/* val transform : t -> string -> string -> transform_mode -> unit */ -+CAMLprim value -+ocaml_augeas_transform (value tv, value lensv, value filev, value modev) -+{ -+ CAMLparam4 (tv, lensv, filev, modev); -+ augeas_t t = Augeas_t_val (tv); -+ const char *lens = String_val (lensv); -+ const char *file = String_val (filev); -+ const int excl = Int_val (modev) == 1 ? 1 : 0; -+ -+ if (aug_transform (t, lens, file, excl) == -1) -+ raise_error (t, "Augeas.transform"); -+ -+ CAMLreturn (Val_unit); -+} -+ -+/* val source : t -> path -> path option */ -+CAMLprim value -+ocaml_augeas_source (value tv, value pathv) -+{ -+#ifdef HAVE_AUG_SOURCE -+ CAMLparam2 (tv, pathv); -+ CAMLlocal2 (optv, v); -+ augeas_t t = Augeas_t_val (tv); -+ const char *path = String_val (pathv); -+ char *file_path; -+ int r; -+ -+ r = aug_source (t, path, &file_path); -+ if (r == 0) { -+ if (file_path) { /* Return Some file_path */ -+ v = caml_copy_string (file_path); -+ optv = caml_alloc (1, 0); -+ Field (optv, 0) = v; -+ free (file_path); -+ } else /* Return None */ -+ optv = Val_int (0); -+ } -+ else /* Error */ -+ raise_error (t, "Augeas.source"); -+ -+ CAMLreturn (optv); -+#else -+ caml_failwith ("Augeas.source: function not implemented"); -+#endif -+} -diff --git a/bundled/ocaml-augeas/augeas.README b/bundled/ocaml-augeas/augeas.README -new file mode 100644 -index 00000000..938dfd25 ---- /dev/null -+++ b/bundled/ocaml-augeas/augeas.README -@@ -0,0 +1,8 @@ -+The files augeas-c.c, augeas.ml and augeas.mli come from the -+ocaml-augeas library: -+ -+ http://git.annexia.org/?p=ocaml-augeas.git -+ -+which is released under a compatible license. We try to keep them -+identical, so if you make changes to these files then you must also -+submit the changes to ocaml-augeas, and vice versa. -\ No newline at end of file -diff --git a/bundled/ocaml-augeas/augeas.ml b/bundled/ocaml-augeas/augeas.ml -new file mode 100644 -index 00000000..aa5a1822 ---- /dev/null -+++ b/bundled/ocaml-augeas/augeas.ml -@@ -0,0 +1,99 @@ -+(* Augeas OCaml bindings -+ * Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ * $Id: augeas.ml,v 1.2 2008/05/06 10:48:20 rjones Exp $ -+ *) -+ -+type t -+ -+type flag = -+ | AugSaveBackup -+ | AugSaveNewFile -+ | AugTypeCheck -+ | AugNoStdinc -+ | AugSaveNoop -+ | AugNoLoad -+ | AugNoModlAutoload -+ | AugEnableSpan -+ | AugNoErrClose -+ | AugTraceModuleLoading -+ -+type error_code = -+ | AugErrInternal -+ | AugErrPathX -+ | AugErrNoMatch -+ | AugErrMMatch -+ | AugErrSyntax -+ | AugErrNoLens -+ | AugErrMXfm -+ | AugErrNoSpan -+ | AugErrMvDesc -+ | AugErrCmdRun -+ | AugErrBadArg -+ | AugErrLabel -+ | AugErrCpDesc -+ | AugErrUnknown of int -+ -+type transform_mode = -+ | Include -+ | Exclude -+ -+exception Error of error_code * string * string * string * string -+ -+type path = string -+ -+type value = string -+ -+external create : string -> string option -> flag list -> t -+ = "ocaml_augeas_create" -+external close : t -> unit -+ = "ocaml_augeas_close" -+external defnode : t -> string -> string -> string option -> int * bool -+ = "ocaml_augeas_defnode" -+external defvar : t -> string -> string option -> int option -+ = "ocaml_augeas_defvar" -+external get : t -> path -> value option -+ = "ocaml_augeas_get" -+external exists : t -> path -> bool -+ = "ocaml_augeas_exists" -+external insert : t -> ?before:bool -> path -> string -> unit -+ = "ocaml_augeas_insert" -+external label : t -> path -> string option -+ = "ocaml_augeas_label" -+external rm : t -> path -> int -+ = "ocaml_augeas_rm" -+external matches : t -> path -> path list -+ = "ocaml_augeas_match" -+external count_matches : t -> path -> int -+ = "ocaml_augeas_count_matches" -+external save : t -> unit -+ = "ocaml_augeas_save" -+external load : t -> unit -+ = "ocaml_augeas_load" -+external mv : t -> path -> path -> unit -+ = "ocaml_augeas_mv" -+external set : t -> path -> value option -> unit -+ = "ocaml_augeas_set" -+external setm : t -> path -> string option -> value option -> int -+ = "ocaml_augeas_setm" -+external transform : t -> string -> string -> transform_mode -> unit -+ = "ocaml_augeas_transform" -+external source : t -> path -> path option -+ = "ocaml_augeas_source" -+ -+let () = -+ Callback.register_exception "Augeas.Error" (Error (AugErrInternal, "", "", "", "")) -diff --git a/bundled/ocaml-augeas/augeas.mli b/bundled/ocaml-augeas/augeas.mli -new file mode 100644 -index 00000000..8cbeae18 ---- /dev/null -+++ b/bundled/ocaml-augeas/augeas.mli -@@ -0,0 +1,164 @@ -+(** Augeas OCaml bindings *) -+(* Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ * $Id: augeas.mli,v 1.2 2008/05/06 10:48:20 rjones Exp $ -+ *) -+ -+type t -+ (** Augeas library handle. *) -+ -+type flag = -+ | AugSaveBackup (** Rename original with .augsave *) -+ | AugSaveNewFile (** Save changes to .augnew *) -+ | AugTypeCheck (** Type-check lenses *) -+ | AugNoStdinc -+ | AugSaveNoop -+ | AugNoLoad -+ | AugNoModlAutoload -+ | AugEnableSpan -+ | AugNoErrClose -+ | AugTraceModuleLoading -+ (** Flags passed to the {!create} function. *) -+ -+type error_code = -+ | AugErrInternal (** Internal error (bug) *) -+ | AugErrPathX (** Invalid path expression *) -+ | AugErrNoMatch (** No match for path expression *) -+ | AugErrMMatch (** Too many matches for path expression *) -+ | AugErrSyntax (** Syntax error in lens file *) -+ | AugErrNoLens (** Lens lookup failed *) -+ | AugErrMXfm (** Multiple transforms *) -+ | AugErrNoSpan (** No span for this node *) -+ | AugErrMvDesc (** Cannot move node into its descendant *) -+ | AugErrCmdRun (** Failed to execute command *) -+ | AugErrBadArg (** Invalid argument in funcion call *) -+ | AugErrLabel (** Invalid label *) -+ | AugErrCpDesc (** Cannot copy node into its descendant *) -+ | AugErrUnknown of int -+ (** Possible error codes. *) -+ -+type transform_mode = -+ | Include -+ | Exclude -+ (** The operation mode for the {!transform} function. *) -+ -+exception Error of error_code * string * string * string * string -+ (** This exception is thrown when the underlying Augeas library -+ returns an error. The tuple represents: -+ - the Augeas error code -+ - the ocaml-augeas error string -+ - the Augeas error message -+ - the human-readable explanation of the Augeas error, if available -+ - a string with details of the Augeas error -+ *) -+ -+type path = string -+ (** A path expression. -+ -+ Note in future we may replace this with a type-safe path constructor. *) -+ -+type value = string -+ (** A value. *) -+ -+val create : string -> string option -> flag list -> t -+ (** [create root loadpath flags] creates an Augeas handle. -+ -+ [root] is a file system path describing the location -+ of the configuration files. -+ -+ [loadpath] is an optional colon-separated list of directories -+ which are searched for schema definitions. -+ -+ [flags] is a list of flags. *) -+ -+val close : t -> unit -+ (** [close handle] closes the handle. -+ -+ You don't need to close handles explicitly with this function: -+ they will be finalized eventually by the garbage collector. -+ However calling this function frees up any resources used by the -+ underlying Augeas library immediately. -+ -+ Do not use the handle after closing it. *) -+ -+val defnode : t -> string -> string -> string option -> int * bool -+ (** [defnode t name expr value] defines [name] whose value is the -+ result of evaluating [expr], which is a nodeset. *) -+ -+val defvar : t -> string -> string option -> int option -+ (** [defvar t name expr] defines [name] whose value is the result -+ of evaluating [expr], replacing the old value if existing. -+ [None] as [expr] removes the variable [name]. *) -+ -+val get : t -> path -> value option -+ (** [get t path] returns the value at [path], or [None] if there -+ is no value. *) -+ -+val exists : t -> path -> bool -+ (** [exists t path] returns true iff there is a value at [path]. *) -+ -+val insert : t -> ?before:bool -> path -> string -> unit -+ (** [insert t ?before path label] inserts [label] as a sibling -+ of [path]. By default it is inserted after [path], unless -+ [~before:true] is specified. *) -+ -+val label : t -> path -> string option -+ (** [label t path] gets the label of [path]. -+ -+ Returns [Some value] when [path] matches only one node, and -+ that has an associated label. *) -+ -+val rm : t -> path -> int -+ (** [rm t path] removes all nodes matching [path]. -+ -+ Returns the number of nodes removed (which may be 0). *) -+ -+val matches : t -> path -> path list -+ (** [matches t path] returns a list of path expressions -+ of all nodes matching [path]. *) -+ -+val mv : t -> path -> path -> unit -+ (** [mv t src dest] moves a node. *) -+ -+val count_matches : t -> path -> int -+ (** [count_matches t path] counts the number of nodes matching -+ [path] but does not return them (see {!matches}). *) -+ -+val save : t -> unit -+ (** [save t] saves all pending changes to disk. *) -+ -+val load : t -> unit -+ (** [load t] loads files into the tree. *) -+ -+val set : t -> path -> value option -> unit -+ (** [set t path] sets [value] as new value at [path]. *) -+ -+val setm : t -> path -> string option -> value option -> int -+ (** [setm t base sub value] sets [value] as new value for all the -+ nodes under [base] that match [sub] (or all, if [sub] is -+ [None]). -+ -+ Returns the number of nodes modified. *) -+ -+val transform : t -> string -> string -> transform_mode -> unit -+ (** [transform t lens file mode] adds or removes (depending on -+ [mode]) the transformation of the specified [lens] for [file]. *) -+ -+val source : t -> path -> path option -+ (** [source t path] returns the path to the node representing the -+ file to which [path] belongs, or [None] if [path] does not -+ represent any file. *) -diff --git a/configure.ac b/configure.ac -index 0db21297..d1397f63 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -195,6 +195,7 @@ AC_CONFIG_FILES([run], - AC_CONFIG_FILES([Makefile - appliance/Makefile - bash/Makefile -+ bundled/ocaml-augeas/Makefile - common/errnostring/Makefile - common/edit/Makefile - common/mlpcre/Makefile -diff --git a/daemon/Makefile.am b/daemon/Makefile.am -index bb2e58d0..bd1920c6 100644 ---- a/daemon/Makefile.am -+++ b/daemon/Makefile.am -@@ -215,9 +215,9 @@ guestfsd_SOURCES = \ - guestfsd_LDFLAGS = \ - -L$(shell $(OCAMLC) -where) \ - -L$(shell $(OCAMLFIND) query hivex) \ -- -L$(shell $(OCAMLFIND) query augeas) \ - -L../common/mlutils \ - -L../common/mlstdutils \ -+ -L../bundled/ocaml-augeas \ - -L../common/mlpcre - guestfsd_LDADD = \ - camldaemon.o \ -@@ -353,7 +353,8 @@ BOBJECTS = $(SOURCES_ML:.ml=.cmo) - XOBJECTS = $(BOBJECTS:.cmo=.cmx) - - OCAMLPACKAGES = \ -- -package str,unix,augeas,hivex \ -+ -package str,unix,hivex \ -+ -I $(top_builddir)/bundled/ocaml-augeas \ - -I $(top_builddir)/common/mlstdutils \ - -I $(top_builddir)/common/mlutils \ - -I $(top_builddir)/common/utils/.libs \ -@@ -384,6 +385,7 @@ camldaemon.o: $(OBJECTS) - $(OCAMLFIND) $(BEST) -output-obj -o $@ \ - $(OCAMLFLAGS) $(OCAMLPACKAGES) \ - -linkpkg \ -+ mlaugeas.$(MLARCHIVE) \ - mlpcre.$(MLARCHIVE) \ - mlstdutils.$(MLARCHIVE) \ - mlcutils.$(MLARCHIVE) \ -@@ -442,6 +444,7 @@ OCAMLLINKFLAGS = \ - mlpcre.$(MLARCHIVE) \ - mlstdutils.$(MLARCHIVE) \ - mlcutils.$(MLARCHIVE) \ -+ mlaugeas.$(MLARCHIVE) \ - $(LINK_CUSTOM_OCAMLC_ONLY) - - daemon_utils_tests_DEPENDENCIES = \ -diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod -index 5a7fa40f..b9bc885a 100644 ---- a/docs/guestfs-building.pod -+++ b/docs/guestfs-building.pod -@@ -172,11 +172,6 @@ I. - - I. - --=item ocaml-augeas -- --I. These are the OCaml bindings for Augeas, found at: --L -- - =item xz - - I. -diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod -index e1b47ec1..68cf8292 100644 ---- a/docs/guestfs-hacking.pod -+++ b/docs/guestfs-hacking.pod -@@ -71,6 +71,20 @@ Various build scripts used by autotools. - - L command and documentation. - -+=item F -+ -+Embedded copies of other libraries, mostly for convenience (and the embedded -+library is not widespread enough). -+ -+=over 4 -+ -+=item F -+ -+Bindings for the Augeas library. These come from the ocaml-augeas -+library L -+ -+=back -+ - =item F - - The L, L, L, -diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4 -index 85020717..51072c1a 100644 ---- a/m4/guestfs-ocaml.m4 -+++ b/m4/guestfs-ocaml.m4 -@@ -132,14 +132,6 @@ AS_IF([test "x$have_Hivex_OPEN_UNSAFE" = "xno"],[ - ]) - AC_SUBST([HIVEX_OPEN_UNSAFE_FLAG]) - --if test "x$enable_daemon" = "xyes"; then -- OCAML_PKG_augeas=no -- AC_CHECK_OCAML_PKG(augeas) -- if test "x$OCAML_PKG_augeas" = "xno"; then -- AC_MSG_ERROR([the OCaml module 'augeas' is required]) -- fi --fi -- - # oUnit is optional, used by some tests in common/mlstdutils (that we - # should replace with regular tests one day). If used, oUnit >= 2 is - # required. -diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in -index 385a1e6e..c9e9e3e6 100755 ---- a/ocaml-dep.sh.in -+++ b/ocaml-dep.sh.in -@@ -33,6 +33,7 @@ set -e - # directories must have unique names (eg. not ‘Utils’) else - # dependencies don't get built right. - include_dirs=" -+bundled/ocaml-augeas - common/mlgettext - common/mlpcre - common/mlstdutils diff --git a/SOURCES/0015-fuse-Don-t-call-fclose-NULL-on-error-paths.patch b/SOURCES/0010-fuse-Don-t-call-fclose-NULL-on-error-paths.patch similarity index 96% rename from SOURCES/0015-fuse-Don-t-call-fclose-NULL-on-error-paths.patch rename to SOURCES/0010-fuse-Don-t-call-fclose-NULL-on-error-paths.patch index 963b36e..5c5ceb9 100644 --- a/SOURCES/0015-fuse-Don-t-call-fclose-NULL-on-error-paths.patch +++ b/SOURCES/0010-fuse-Don-t-call-fclose-NULL-on-error-paths.patch @@ -1,4 +1,4 @@ -From 1cdc22fa656a44320e9c53401130e98f536c9759 Mon Sep 17 00:00:00 2001 +From 744a257083ccc30e6b7bae40acc04eb45a59a971 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 22 May 2023 17:15:39 +0100 Subject: [PATCH] fuse: Don't call fclose(NULL) on error paths diff --git a/SOURCES/0016-ocaml-implicit_close-test-collect-all-currently-unre.patch b/SOURCES/0011-ocaml-implicit_close-test-collect-all-currently-unre.patch similarity index 95% rename from SOURCES/0016-ocaml-implicit_close-test-collect-all-currently-unre.patch rename to SOURCES/0011-ocaml-implicit_close-test-collect-all-currently-unre.patch index 8ad4455..b988d39 100644 --- a/SOURCES/0016-ocaml-implicit_close-test-collect-all-currently-unre.patch +++ b/SOURCES/0011-ocaml-implicit_close-test-collect-all-currently-unre.patch @@ -1,4 +1,4 @@ -From feb17e93b4e58131cf6875c4ae638a791a875a22 Mon Sep 17 00:00:00 2001 +From 8aafa0631b55ec92ba1fae34d94500dd1e027083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= Date: Sat, 27 May 2023 15:32:36 +0200 Subject: [PATCH] ocaml/implicit_close test: collect all currently unreachable diff --git a/SOURCES/0011-update-common-submodule.patch b/SOURCES/0011-update-common-submodule.patch deleted file mode 100644 index 01696ec..0000000 --- a/SOURCES/0011-update-common-submodule.patch +++ /dev/null @@ -1,203 +0,0 @@ -From 194a48aef32367c45c555a4d93fb1a3375b0dead Mon Sep 17 00:00:00 2001 -From: Laszlo Ersek -Date: Fri, 19 May 2023 16:08:47 +0200 -Subject: [PATCH] update common submodule - -Laszlo Ersek (2): - options/keys: key_store_import_key(): un-constify "key" parameter - options/keys: introduce unescape_device_mapper_lvm() - -Richard W.M. Jones (1): - mlcustomize/SELinux_relabel.ml: Use Array.mem - -Roman Kagan (1): - mlcustomize: skip SELinux relabeling if it's disabled - -Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506 -Signed-off-by: Laszlo Ersek -Message-Id: <20230519140849.310774-2-lersek@redhat.com> -Reviewed-by: Richard W.M. Jones -(cherry picked from commit 83afd6d3d2c82ee3a8f22079ba12ef7eac38ac34) ---- - common | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Submodule common 70c10a07..b636c3f2: -diff --git a/common/mlcustomize/SELinux_relabel.ml b/common/mlcustomize/SELinux_relabel.ml -index 5ecf7bd7..2f3a09bf 100644 ---- a/common/mlcustomize/SELinux_relabel.ml -+++ b/common/mlcustomize/SELinux_relabel.ml -@@ -24,10 +24,6 @@ open Printf - - module G = Guestfs - --(* Simple reimplementation of Array.mem, available only with OCaml >= 4.03. *) --let array_find a l = -- List.mem a (Array.to_list l) -- - let rec relabel (g : G.guestfs) = - (* Is the guest using SELinux? (Otherwise this is a no-op). *) - if is_selinux_guest g then ( -@@ -59,14 +55,24 @@ and use_setfiles g = - g#aug_load (); - debug_augeas_errors g; - -+ let config_path = "/files/etc/selinux/config" in -+ let config_keys = g#aug_ls config_path in -+ (* SELinux may be disabled via a setting in config file *) -+ let selinux_disabled = -+ let selinuxmode_path = config_path ^ "/SELINUX" in -+ if Array.mem selinuxmode_path config_keys then -+ g#aug_get selinuxmode_path = "disabled" -+ else -+ false in -+ if selinux_disabled then -+ failwith "selinux disabled"; -+ - (* Get the SELinux policy name, eg. "targeted", "minimum". - * Use "targeted" if not specified, just like libselinux does. - *) - let policy = -- let config_path = "/files/etc/selinux/config" in - let selinuxtype_path = config_path ^ "/SELINUXTYPE" in -- let keys = g#aug_ls config_path in -- if array_find selinuxtype_path keys then -+ if Array.mem selinuxtype_path config_keys then - g#aug_get selinuxtype_path - else - "targeted" in -diff --git a/common/options/keys.c b/common/options/keys.c -index 48f1bc7c..52b27369 100644 ---- a/common/options/keys.c -+++ b/common/options/keys.c -@@ -260,8 +260,107 @@ key_store_add_from_selector (struct key_store *ks, const char *selector) - return key_store_import_key (ks, &key); - } - -+/* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */ -+static void -+unescape_device_mapper_lvm (char *id) -+{ -+ static const char dev[] = "/dev/", dev_mapper[] = "/dev/mapper/"; -+ const char *input_start; -+ char *output; -+ enum { M_SCAN, M_FILL, M_DONE } mode; -+ -+ if (!STRPREFIX (id, dev_mapper)) -+ return; -+ -+ /* Start parsing "VG-LV" from "id" after "/dev/mapper/". */ -+ input_start = id + (sizeof dev_mapper - 1); -+ -+ /* Start writing the unescaped "VG/LV" output after "/dev/". */ -+ output = id + (sizeof dev - 1); -+ -+ for (mode = M_SCAN; mode < M_DONE; ++mode) { -+ char c; -+ const char *input = input_start; -+ const char *hyphen_buffered = NULL; -+ bool single_hyphen_seen = false; -+ -+ do { -+ c = *input; -+ -+ switch (c) { -+ case '-': -+ if (hyphen_buffered == NULL) -+ /* This hyphen may start an escaped hyphen, or it could be the -+ * separator in VG-LV. -+ */ -+ hyphen_buffered = input; -+ else { -+ /* This hyphen completes an escaped hyphen; unescape it. */ -+ if (mode == M_FILL) -+ *output++ = '-'; -+ hyphen_buffered = NULL; -+ } -+ break; -+ -+ case '/': -+ /* Slash characters are forbidden in VG-LV anywhere. If there's any, -+ * we'll find it in the first (i.e., scanning) phase, before we output -+ * anything back to "id". -+ */ -+ assert (mode == M_SCAN); -+ return; -+ -+ default: -+ /* Encountered a non-slash, non-hyphen character -- which also may be -+ * the terminating NUL. -+ */ -+ if (hyphen_buffered != NULL) { -+ /* The non-hyphen character comes after a buffered hyphen, so the -+ * buffered hyphen is supposed to be the single hyphen that separates -+ * VG from LV in VG-LV. There are three requirements for this -+ * separator: (a) it must be unique (we must not have seen another -+ * such separator earlier), (b) it must not be at the start of VG-LV -+ * (because VG would be empty that way), (c) it must not be at the end -+ * of VG-LV (because LV would be empty that way). Should any of these -+ * be violated, we'll catch that during the first (i.e., scanning) -+ * phase, before modifying "id". -+ */ -+ if (single_hyphen_seen || hyphen_buffered == input_start || -+ c == '\0') { -+ assert (mode == M_SCAN); -+ return; -+ } -+ -+ /* Translate the separator hyphen to a slash character. */ -+ if (mode == M_FILL) -+ *output++ = '/'; -+ hyphen_buffered = NULL; -+ single_hyphen_seen = true; -+ } -+ -+ /* Output the non-hyphen character (including the terminating NUL) -+ * regardless of whether there was a buffered hyphen separator (which, -+ * by now, we'll have attempted to translate and flush). -+ */ -+ if (mode == M_FILL) -+ *output++ = c; -+ } -+ -+ ++input; -+ } while (c != '\0'); -+ -+ /* We must have seen the VG-LV separator. If that's not the case, we'll -+ * catch it before modifying "id". -+ */ -+ if (!single_hyphen_seen) { -+ assert (mode == M_SCAN); -+ return; -+ } -+ } -+} -+ - struct key_store * --key_store_import_key (struct key_store *ks, const struct key_store_key *key) -+key_store_import_key (struct key_store *ks, struct key_store_key *key) - { - struct key_store_key *new_keys; - -@@ -278,6 +377,7 @@ key_store_import_key (struct key_store *ks, const struct key_store_key *key) - error (EXIT_FAILURE, errno, "realloc"); - - ks->keys = new_keys; -+ unescape_device_mapper_lvm (key->id); - ks->keys[ks->nr_keys] = *key; - ++ks->nr_keys; - -diff --git a/common/options/options.h b/common/options/options.h -index 94573ee0..94e8b9ee 100644 ---- a/common/options/options.h -+++ b/common/options/options.h -@@ -169,7 +169,8 @@ extern struct matching_key *get_keys (struct key_store *ks, const char *device, - const char *uuid, size_t *nr_matches); - extern void free_keys (struct matching_key *keys, size_t nr_matches); - extern struct key_store *key_store_add_from_selector (struct key_store *ks, const char *selector); --extern struct key_store *key_store_import_key (struct key_store *ks, const struct key_store_key *key); -+extern struct key_store *key_store_import_key (struct key_store *ks, -+ struct key_store_key *key); - extern bool key_store_requires_network (const struct key_store *ks); - extern void free_key_store (struct key_store *ks); - diff --git a/SOURCES/0017-ocaml-Replace-old-enter-leave_blocking_section-calls.patch b/SOURCES/0012-ocaml-Replace-old-enter-leave_blocking_section-calls.patch similarity index 97% rename from SOURCES/0017-ocaml-Replace-old-enter-leave_blocking_section-calls.patch rename to SOURCES/0012-ocaml-Replace-old-enter-leave_blocking_section-calls.patch index 3eeb410..3de7cb3 100644 --- a/SOURCES/0017-ocaml-Replace-old-enter-leave_blocking_section-calls.patch +++ b/SOURCES/0012-ocaml-Replace-old-enter-leave_blocking_section-calls.patch @@ -1,4 +1,4 @@ -From dd58abc40175f735f6fe2669c34c67e6190e557d Mon Sep 17 00:00:00 2001 +From 25108090a1566bc49caab833fe1591a0c6f941be Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 27 Jun 2023 10:17:58 +0100 Subject: [PATCH] ocaml: Replace old enter/leave_blocking_section calls diff --git a/SOURCES/0018-ocaml-Release-runtime-lock-around-guestfs_close.patch b/SOURCES/0013-ocaml-Release-runtime-lock-around-guestfs_close.patch similarity index 93% rename from SOURCES/0018-ocaml-Release-runtime-lock-around-guestfs_close.patch rename to SOURCES/0013-ocaml-Release-runtime-lock-around-guestfs_close.patch index 034dafd..e75313a 100644 --- a/SOURCES/0018-ocaml-Release-runtime-lock-around-guestfs_close.patch +++ b/SOURCES/0013-ocaml-Release-runtime-lock-around-guestfs_close.patch @@ -1,4 +1,4 @@ -From e2110f72069f184c87df348247e8f3106c81d44a Mon Sep 17 00:00:00 2001 +From 166e4e90eef0d4c81a92940e5d61450d70f00662 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 27 Jun 2023 11:36:55 +0100 Subject: [PATCH] ocaml: Release runtime lock around guestfs_close diff --git a/SOURCES/0014-Replace-Pervasives.-with-Stdlib.patch b/SOURCES/0014-Replace-Pervasives.-with-Stdlib.patch deleted file mode 100644 index ae3711f..0000000 --- a/SOURCES/0014-Replace-Pervasives.-with-Stdlib.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 54a9e48e5e1088a1b781c30b49bce695007e12fc Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 22 May 2023 16:40:21 +0100 -Subject: [PATCH] Replace Pervasives.* with Stdlib.* -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Since OCaml 4.07 (released 2018-07-10) the always-loaded standard -library module has been called Stdlib. The old Pervasives module was -finally removed in OCaml 5. - -$ perl -pi.bak -e 's/Pervasives\./Stdlib./g' -- `git ls-files` - -OCaml >= 4.07 is now required. - -Also update the common submodule with: - - commit d61cd820b49e403848d15c5deaccbf8dd7045370 - Author: Jürgen Hötzel - Date: Sat May 20 18:16:40 2023 +0200 - - Add support for OCaml 5.0 - -(cherry picked from commit 3cb094083e61203a8751bcf31dcb56a47dec6840) ---- - common | 2 +- - daemon/chroot.ml | 2 +- - docs/guestfs-building.pod | 2 +- - generator/pr.ml | 4 ++-- - m4/guestfs-ocaml.m4 | 6 +++--- - 5 files changed, 8 insertions(+), 8 deletions(-) - -Submodule common b636c3f2..d61cd820: -diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml -index 0d2fa22f..86b21a7c 100644 ---- a/common/mlstdutils/std_utils.ml -+++ b/common/mlstdutils/std_utils.ml -@@ -341,12 +341,12 @@ module List = struct - | x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs - | _ -> invalid_arg "combine3" - -- let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function -+ let rec assoc_lbl ?(cmp = Stdlib.compare) ~default x = function - | [] -> default - | (y, y') :: _ when cmp x y = 0 -> y' - | _ :: ys -> assoc_lbl ~cmp ~default x ys - -- let uniq ?(cmp = Pervasives.compare) xs = -+ let uniq ?(cmp = Stdlib.compare) xs = - let rec loop acc = function - | [] -> acc - | [x] -> x :: acc -diff --git a/daemon/chroot.ml b/daemon/chroot.ml -index 62f387ee..087b5031 100644 ---- a/daemon/chroot.ml -+++ b/daemon/chroot.ml -@@ -51,7 +51,7 @@ let f t func arg = - try - let chan = out_channel_of_descr wfd in - output_value chan ret; -- Pervasives.flush chan; -+ Stdlib.flush chan; - Exit._exit 0 - with - exn -> -diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod -index b9bc885a..33703a96 100644 ---- a/docs/guestfs-building.pod -+++ b/docs/guestfs-building.pod -@@ -119,7 +119,7 @@ virt tools which are still written in Perl. - - I. Part of Perl core. - --=item OCaml E 4.04 -+=item OCaml E 4.07 - - =item OCaml findlib - -diff --git a/generator/pr.ml b/generator/pr.ml -index d7e6eba3..ed6e9372 100644 ---- a/generator/pr.ml -+++ b/generator/pr.ml -@@ -25,7 +25,7 @@ open Std_utils - open Utils - - (* Output channel, 'pr' prints to this. *) --let chan = ref Pervasives.stdout -+let chan = ref Stdlib.stdout - - (* Number of lines generated. *) - let lines = ref 0 -@@ -53,7 +53,7 @@ let output_to ?(perm = 0o444) filename k = - chan := open_out filename_new; - k (); - close_out !chan; -- chan := Pervasives.stdout; -+ chan := Stdlib.stdout; - - (* Is the new file different from the current file? *) - if Sys.file_exists filename && files_equal filename filename_new then -diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4 -index 51072c1a..e850fb8c 100644 ---- a/m4/guestfs-ocaml.m4 -+++ b/m4/guestfs-ocaml.m4 -@@ -38,10 +38,10 @@ AC_ARG_ENABLE([ocaml], - [], - [enable_ocaml=yes]) - --dnl OCaml >= 4.04 is required. --ocaml_ver_str=4.04 -+dnl OCaml >= 4.07 is required. -+ocaml_ver_str=4.07 - ocaml_min_major=4 --ocaml_min_minor=4 -+ocaml_min_minor=7 - AC_MSG_CHECKING([if OCaml version >= $ocaml_ver_str]) - ocaml_major="`echo $OCAMLVERSION | $AWK -F. '{print $1}'`" - ocaml_minor="`echo $OCAMLVERSION | $AWK -F. '{print $2}' | sed 's/^0//'`" diff --git a/SOURCES/0019-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch b/SOURCES/0014-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch similarity index 97% rename from SOURCES/0019-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch rename to SOURCES/0014-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch index 65d0723..5741670 100644 --- a/SOURCES/0019-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch +++ b/SOURCES/0014-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch @@ -1,4 +1,4 @@ -From e42cd859265c34d2013a45b742d4c36bb7617445 Mon Sep 17 00:00:00 2001 +From c13dd5b6d4ca94eebe32bc32993f5be0b5b373ad Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 27 Jun 2023 12:09:12 +0100 Subject: [PATCH] ocaml: Conditionally acquire the lock in callbacks diff --git a/SOURCES/0020-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch b/SOURCES/0015-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch similarity index 96% rename from SOURCES/0020-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch rename to SOURCES/0015-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch index 2bd8857..d1d38e0 100644 --- a/SOURCES/0020-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch +++ b/SOURCES/0015-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch @@ -1,4 +1,4 @@ -From 7ceafac98d3eb28d25195622cb6dc1158e9c1c2f Mon Sep 17 00:00:00 2001 +From b6c9d4624899f4d81cc8d64d47ecef60aad8dd94 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 27 Jun 2023 16:20:49 +0100 Subject: [PATCH] ocaml: Fix guestfs_065_implicit_close.ml for OCaml 5 diff --git a/SOURCES/0021-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch b/SOURCES/0016-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch similarity index 93% rename from SOURCES/0021-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch rename to SOURCES/0016-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch index c0c7648..9a22d9f 100644 --- a/SOURCES/0021-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch +++ b/SOURCES/0016-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch @@ -1,4 +1,4 @@ -From d4fabae17001702894526084bf0ab516de3599d5 Mon Sep 17 00:00:00 2001 +From ff62b8f758e16aab82960474c79a7fc10a0af3ed Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 27 Jun 2023 16:31:55 +0100 Subject: [PATCH] ocaml: Use Caml_state_opt in preference to caml_state diff --git a/SOURCES/0022-generator-Add-chown-option-for-virt-customize.patch b/SOURCES/0017-generator-Add-chown-option-for-virt-customize.patch similarity index 99% rename from SOURCES/0022-generator-Add-chown-option-for-virt-customize.patch rename to SOURCES/0017-generator-Add-chown-option-for-virt-customize.patch index df841df..bc6640a 100644 --- a/SOURCES/0022-generator-Add-chown-option-for-virt-customize.patch +++ b/SOURCES/0017-generator-Add-chown-option-for-virt-customize.patch @@ -1,4 +1,4 @@ -From 64c1716c4120e8dc69d0106b6ebcf6ccb9d4fc24 Mon Sep 17 00:00:00 2001 +From 0be1035c710d95aeca68a10fe9a7b4b740ae7aff Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 29 Jun 2023 13:33:04 +0100 Subject: [PATCH] generator: Add --chown option for virt-customize diff --git a/SOURCES/0023-lib-remove-guestfs_int_cmd_clear_close_files.patch b/SOURCES/0018-lib-remove-guestfs_int_cmd_clear_close_files.patch similarity index 98% rename from SOURCES/0023-lib-remove-guestfs_int_cmd_clear_close_files.patch rename to SOURCES/0018-lib-remove-guestfs_int_cmd_clear_close_files.patch index d7fe99e..d1aca2a 100644 --- a/SOURCES/0023-lib-remove-guestfs_int_cmd_clear_close_files.patch +++ b/SOURCES/0018-lib-remove-guestfs_int_cmd_clear_close_files.patch @@ -1,4 +1,4 @@ -From 6c63f5cd8b43448f4847d550ad313d950d6b8520 Mon Sep 17 00:00:00 2001 +From cda24a0207fda8659790376a79fdac3d1775da83 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Tue, 11 Jul 2023 13:39:06 +0200 Subject: [PATCH] lib: remove guestfs_int_cmd_clear_close_files() diff --git a/SOURCES/0024-docs-fix-broken-link-in-the-guestfs-manual.patch b/SOURCES/0019-docs-fix-broken-link-in-the-guestfs-manual.patch similarity index 95% rename from SOURCES/0024-docs-fix-broken-link-in-the-guestfs-manual.patch rename to SOURCES/0019-docs-fix-broken-link-in-the-guestfs-manual.patch index 7ddefc8..30195b9 100644 --- a/SOURCES/0024-docs-fix-broken-link-in-the-guestfs-manual.patch +++ b/SOURCES/0019-docs-fix-broken-link-in-the-guestfs-manual.patch @@ -1,4 +1,4 @@ -From f8e8aef7e9e8334db19529aa46bd28a209436b50 Mon Sep 17 00:00:00 2001 +From 1eaf876ff2a3bfeaa8756b92e5fa74a91b74f45c Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 14 Jul 2023 15:22:09 +0200 Subject: [PATCH] docs: fix broken link in the guestfs manual diff --git a/SOURCES/0025-docs-clarify-sockdir-s-separation.patch b/SOURCES/0020-docs-clarify-sockdir-s-separation.patch similarity index 98% rename from SOURCES/0025-docs-clarify-sockdir-s-separation.patch rename to SOURCES/0020-docs-clarify-sockdir-s-separation.patch index 9fd3553..785c37b 100644 --- a/SOURCES/0025-docs-clarify-sockdir-s-separation.patch +++ b/SOURCES/0020-docs-clarify-sockdir-s-separation.patch @@ -1,4 +1,4 @@ -From cde50cb9d71ffa418f45868aa0d4b874847b989a Mon Sep 17 00:00:00 2001 +From bb3b9ac1ec7021ac04bca03748f15761c6c97487 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 14 Jul 2023 15:22:10 +0200 Subject: [PATCH] docs: clarify sockdir's separation diff --git a/SOURCES/0026-lib-move-guestfs_int_create_socketname-from-launch.c.patch b/SOURCES/0021-lib-move-guestfs_int_create_socketname-from-launch.c.patch similarity index 98% rename from SOURCES/0026-lib-move-guestfs_int_create_socketname-from-launch.c.patch rename to SOURCES/0021-lib-move-guestfs_int_create_socketname-from-launch.c.patch index f5153f7..6946928 100644 --- a/SOURCES/0026-lib-move-guestfs_int_create_socketname-from-launch.c.patch +++ b/SOURCES/0021-lib-move-guestfs_int_create_socketname-from-launch.c.patch @@ -1,4 +1,4 @@ -From 986f5d8b1110b461d37d044c7a8052ed7ba27f87 Mon Sep 17 00:00:00 2001 +From 8ba3628594c354dafcc715a842199c75a5676b57 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 14 Jul 2023 15:22:11 +0200 Subject: [PATCH] lib: move guestfs_int_create_socketname() from "launch.c" to diff --git a/SOURCES/0027-generator-customize-Add-new-StringTriplet-for-use-by.patch b/SOURCES/0022-generator-customize-Add-new-StringTriplet-for-use-by.patch similarity index 99% rename from SOURCES/0027-generator-customize-Add-new-StringTriplet-for-use-by.patch rename to SOURCES/0022-generator-customize-Add-new-StringTriplet-for-use-by.patch index 9389253..b34f2c3 100644 --- a/SOURCES/0027-generator-customize-Add-new-StringTriplet-for-use-by.patch +++ b/SOURCES/0022-generator-customize-Add-new-StringTriplet-for-use-by.patch @@ -1,4 +1,4 @@ -From 6e3d91681c7dffdfdf291a809d6773691a2a7bda Mon Sep 17 00:00:00 2001 +From e7501a32cb096c1957aae0de934c0b563ff18a5f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 15 Jul 2023 16:33:18 +0100 Subject: [PATCH] generator: customize: Add new StringTriplet for use by diff --git a/SOURCES/0028-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch b/SOURCES/0023-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch similarity index 96% rename from SOURCES/0028-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch rename to SOURCES/0023-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch index 634ee30..87b9b0c 100644 --- a/SOURCES/0028-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch +++ b/SOURCES/0023-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch @@ -1,4 +1,4 @@ -From ec56c62c90d2230e8edcfaaad4517be63f5e2183 Mon Sep 17 00:00:00 2001 +From 981b48085a2d0e422578bc12d6c3b68e312bad44 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 20 Jul 2023 11:15:26 +0100 Subject: [PATCH] daemon: lvm: Do reverse device name translation on pvs_full diff --git a/SOURCES/0029-ruby-Replace-MiniTest-with-Minitest.patch b/SOURCES/0024-ruby-Replace-MiniTest-with-Minitest.patch similarity index 99% rename from SOURCES/0029-ruby-Replace-MiniTest-with-Minitest.patch rename to SOURCES/0024-ruby-Replace-MiniTest-with-Minitest.patch index 8e2b970..237998c 100644 --- a/SOURCES/0029-ruby-Replace-MiniTest-with-Minitest.patch +++ b/SOURCES/0024-ruby-Replace-MiniTest-with-Minitest.patch @@ -1,4 +1,4 @@ -From a55474caa5029c8356957afe36908ee45484ffde Mon Sep 17 00:00:00 2001 +From 12873e21070ba3d0aca45b626f4df00adb14aad5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 21 Sep 2023 15:16:51 +0100 Subject: [PATCH] ruby: Replace MiniTest with Minitest diff --git a/SOURCES/0030-ruby-Get-rid-of-old-Test-Unit-compatibility.patch b/SOURCES/0025-ruby-Get-rid-of-old-Test-Unit-compatibility.patch similarity index 99% rename from SOURCES/0030-ruby-Get-rid-of-old-Test-Unit-compatibility.patch rename to SOURCES/0025-ruby-Get-rid-of-old-Test-Unit-compatibility.patch index a592cc0..a01e908 100644 --- a/SOURCES/0030-ruby-Get-rid-of-old-Test-Unit-compatibility.patch +++ b/SOURCES/0025-ruby-Get-rid-of-old-Test-Unit-compatibility.patch @@ -1,4 +1,4 @@ -From e22e17704988b606e24e76160495626552d0845f Mon Sep 17 00:00:00 2001 +From fbe7e96cee460e26a0ff6a9c293c155a78bfdfde Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 21 Sep 2023 15:20:55 +0100 Subject: [PATCH] ruby: Get rid of old Test::Unit compatibility diff --git a/SOURCES/0031-generator-Sort-virt-customize-options-into-alphabeti.patch b/SOURCES/0026-generator-Sort-virt-customize-options-into-alphabeti.patch similarity index 96% rename from SOURCES/0031-generator-Sort-virt-customize-options-into-alphabeti.patch rename to SOURCES/0026-generator-Sort-virt-customize-options-into-alphabeti.patch index 7c82ec3..53fa5ed 100644 --- a/SOURCES/0031-generator-Sort-virt-customize-options-into-alphabeti.patch +++ b/SOURCES/0026-generator-Sort-virt-customize-options-into-alphabeti.patch @@ -1,4 +1,4 @@ -From 205e2219b977e70c97ea4b55153d94dc3df91c28 Mon Sep 17 00:00:00 2001 +From 7408a59c6b43253cc7323269258851fb6be287c4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 26 Oct 2023 21:06:21 +0100 Subject: [PATCH] generator: Sort virt-customize options into alphabetical diff --git a/SOURCES/0032-generator-Add-new-virt-customize-tar-in-operation.patch b/SOURCES/0027-generator-Add-new-virt-customize-tar-in-operation.patch similarity index 99% rename from SOURCES/0032-generator-Add-new-virt-customize-tar-in-operation.patch rename to SOURCES/0027-generator-Add-new-virt-customize-tar-in-operation.patch index 7091730..81be387 100644 --- a/SOURCES/0032-generator-Add-new-virt-customize-tar-in-operation.patch +++ b/SOURCES/0027-generator-Add-new-virt-customize-tar-in-operation.patch @@ -1,4 +1,4 @@ -From 055c43fa60c7cefbe3baf32b21cfe8ffae09bf0f Mon Sep 17 00:00:00 2001 +From 3cf513cab7bc93a80c8d9f1dea221cba471cafb9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 26 Oct 2023 19:44:03 +0100 Subject: [PATCH] generator: Add new virt-customize --tar-in operation diff --git a/SOURCES/0033-New-mailing-list-email-address.patch b/SOURCES/0028-New-mailing-list-email-address.patch similarity index 99% rename from SOURCES/0033-New-mailing-list-email-address.patch rename to SOURCES/0028-New-mailing-list-email-address.patch index 5a1b812..0d64d60 100644 --- a/SOURCES/0033-New-mailing-list-email-address.patch +++ b/SOURCES/0028-New-mailing-list-email-address.patch @@ -1,4 +1,4 @@ -From 0c1d7af8fdbf272f33ccd572ed34923ab094d695 Mon Sep 17 00:00:00 2001 +From 8dc3b9fb23e4af1b6a5271a7d40d6c2706cf1f78 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 16 Nov 2023 10:38:59 +0000 Subject: [PATCH] New mailing list email address diff --git a/SOURCES/0034-New-mailing-list-archives.patch b/SOURCES/0029-New-mailing-list-archives.patch similarity index 98% rename from SOURCES/0034-New-mailing-list-archives.patch rename to SOURCES/0029-New-mailing-list-archives.patch index 5e8873c..954f515 100644 --- a/SOURCES/0034-New-mailing-list-archives.patch +++ b/SOURCES/0029-New-mailing-list-archives.patch @@ -1,4 +1,4 @@ -From d5a52e1004b7b151a1df286a72e49e9766ade2c8 Mon Sep 17 00:00:00 2001 +From 86408417cfe9d742b70104187e52b775e89e497e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 16 Nov 2023 10:52:11 +0000 Subject: [PATCH] New mailing list archives @@ -43,10 +43,10 @@ index 40a7267e..b350edb5 100644 To find out how to build libguestfs from source, read: diff --git a/configure.ac b/configure.ac -index d1397f63..f8e5e9bb 100644 +index b72e99cf..92479e20 100644 --- a/configure.ac +++ b/configure.ac -@@ -322,7 +322,7 @@ echo "If any optional component is configured 'no' when you expected 'yes'" +@@ -321,7 +321,7 @@ echo "If any optional component is configured 'no' when you expected 'yes'" echo "then you should check the preceding messages." echo echo "Please report bugs back to the mailing list:" @@ -87,10 +87,10 @@ index 1e83a9c5..3a03282f 100644 into the libguestfs project. diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod -index 68cf8292..f0bac9f2 100644 +index e1b47ec1..987697b2 100644 --- a/docs/guestfs-hacking.pod +++ b/docs/guestfs-hacking.pod -@@ -818,7 +818,7 @@ examining the F log files carefully. +@@ -804,7 +804,7 @@ examining the F log files carefully. =head2 SUBMITTING PATCHES Submit patches to the mailing list: diff --git a/SOURCES/0035-lib-Include-libxml-parser.h-for-xmlReadMemory.patch b/SOURCES/0030-lib-Include-libxml-parser.h-for-xmlReadMemory.patch similarity index 91% rename from SOURCES/0035-lib-Include-libxml-parser.h-for-xmlReadMemory.patch rename to SOURCES/0030-lib-Include-libxml-parser.h-for-xmlReadMemory.patch index 1b8ee36..e61d61b 100644 --- a/SOURCES/0035-lib-Include-libxml-parser.h-for-xmlReadMemory.patch +++ b/SOURCES/0030-lib-Include-libxml-parser.h-for-xmlReadMemory.patch @@ -1,4 +1,4 @@ -From 64a928f631bc79d885d9822a3022c382cbd5fd55 Mon Sep 17 00:00:00 2001 +From f6f2f56535a54a90a5c02974eba09bb7a8f0709c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 27 Nov 2023 14:04:33 +0000 Subject: [PATCH] lib: Include for xmlReadMemory diff --git a/SOURCES/0036-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch b/SOURCES/0031-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch similarity index 98% rename from SOURCES/0036-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch rename to SOURCES/0031-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch index 909722c..efc2322 100644 --- a/SOURCES/0036-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch +++ b/SOURCES/0031-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch @@ -1,4 +1,4 @@ -From 27aca404cfbfdf9b3d155fa0794f86936525f40c Mon Sep 17 00:00:00 2001 +From 836b63ce6d6a47f0d8179ccd3c96ce152396ba77 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 13 Dec 2023 22:50:56 +0000 Subject: [PATCH] ocaml: Use Gc.finalise instead of a C finalizer diff --git a/SOURCES/0037-ocaml-Nullify-custom-block-before-releasing-runtime-.patch b/SOURCES/0032-ocaml-Nullify-custom-block-before-releasing-runtime-.patch similarity index 94% rename from SOURCES/0037-ocaml-Nullify-custom-block-before-releasing-runtime-.patch rename to SOURCES/0032-ocaml-Nullify-custom-block-before-releasing-runtime-.patch index 20ee83c..8d41e40 100644 --- a/SOURCES/0037-ocaml-Nullify-custom-block-before-releasing-runtime-.patch +++ b/SOURCES/0032-ocaml-Nullify-custom-block-before-releasing-runtime-.patch @@ -1,4 +1,4 @@ -From 9f52ab7794bf54169139995c5296aa5f39e47706 Mon Sep 17 00:00:00 2001 +From a534de4f269ea3c2671b99172063e872204fb978 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 14 Dec 2023 08:33:10 +0000 Subject: [PATCH] ocaml: Nullify custom block before releasing runtime lock diff --git a/SOURCES/0038-Update-common-submodule.patch b/SOURCES/0033-Update-common-submodule.patch similarity index 98% rename from SOURCES/0038-Update-common-submodule.patch rename to SOURCES/0033-Update-common-submodule.patch index 4ec3781..e589389 100644 --- a/SOURCES/0038-Update-common-submodule.patch +++ b/SOURCES/0033-Update-common-submodule.patch @@ -1,4 +1,4 @@ -From d015c300eb0d6ac1d366cf02b15b7aade7e3063a Mon Sep 17 00:00:00 2001 +From 7073e06b2e45ad1544e715d308662a00a6aa20ae Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 14 Dec 2023 09:03:49 +0000 Subject: [PATCH] Update common submodule diff --git a/SOURCES/0039-tests-Test-guestfish-key-all-.-selector.patch b/SOURCES/0034-tests-Test-guestfish-key-all-.-selector.patch similarity index 94% rename from SOURCES/0039-tests-Test-guestfish-key-all-.-selector.patch rename to SOURCES/0034-tests-Test-guestfish-key-all-.-selector.patch index 7cf5487..fd67834 100644 --- a/SOURCES/0039-tests-Test-guestfish-key-all-.-selector.patch +++ b/SOURCES/0034-tests-Test-guestfish-key-all-.-selector.patch @@ -1,4 +1,4 @@ -From 335642539772cfee442989f56f1b5d7803e4111c Mon Sep 17 00:00:00 2001 +From 5de9915acd31ffe430adc0df497173032560311c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 14 Dec 2023 09:15:08 +0000 Subject: [PATCH] tests: Test guestfish --key all:... selector diff --git a/SOURCES/0035-generator-customize.ml-Split-chown-parameter-on-char.patch b/SOURCES/0035-generator-customize.ml-Split-chown-parameter-on-char.patch new file mode 100644 index 0000000..4e28ff9 --- /dev/null +++ b/SOURCES/0035-generator-customize.ml-Split-chown-parameter-on-char.patch @@ -0,0 +1,44 @@ +From 118b93a189be2d39d2dc20ef059c9b38c60fe8be Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 19 Jan 2024 13:18:00 +0000 +Subject: [PATCH] generator/customize.ml: Split --chown parameter on ':' + character + +The previous code split it on ',' which was completely wrong. +(It reveals the lack of testing however). + +Fixes: commit c08032ebe2763f5e9ce5b14e003721475219d390 +Reported-by: Yongkui Guo +(cherry picked from commit e9a728bb22dfa1de5328fbbe7d6d7acad2dbed64) +--- + common | 2 +- + generator/customize.ml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Submodule common 0dba002c..54869c98: +diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml +index 245d9960..48ee3344 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") +diff --git a/generator/customize.ml b/generator/customize.ml +index e64b45c0..e2c4b605 100644 +--- a/generator/customize.ml ++++ b/generator/customize.ml +@@ -775,7 +775,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\") diff --git a/SOURCES/0036-Update-common-submodule.patch b/SOURCES/0036-Update-common-submodule.patch new file mode 100644 index 0000000..38afbd0 --- /dev/null +++ b/SOURCES/0036-Update-common-submodule.patch @@ -0,0 +1,65 @@ +From f1ced749d4b714e98c82a971ac60148f95312812 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 24 Apr 2024 12:23:34 +0100 +Subject: [PATCH] Update common submodule + +In particular pick this: + + commit 93a7f3af5c23ece6a8e092827ed5928a8973fd3c + Author: Richard W.M. Jones + Date: Wed Apr 24 12:08:01 2024 +0100 + + options: Allow nbd+unix:// URIs + +(cherry picked from commit 7968de46f17eed7f18c200c6528ebdfec5c3f279) +--- + common | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Submodule common 54869c98..93a7f3af: +diff --git a/common/options/uri.c b/common/options/uri.c +index 84d393c1..9180d6a2 100644 +--- a/common/options/uri.c ++++ b/common/options/uri.c +@@ -99,7 +99,7 @@ is_uri (const char *arg) + return 0; + + for (p--; p >= arg; p--) { +- if (!c_islower (*p)) ++ if (! (c_islower (*p) || *p == '+')) + return 0; + } + +@@ -148,7 +148,10 @@ parse (const char *arg, char **path_ret, char **protocol_ret, + } + */ + +- *protocol_ret = strdup (uri->scheme); ++ if (STREQ (uri->scheme, "nbd+unix")) ++ *protocol_ret = strdup ("nbd"); ++ else ++ *protocol_ret = strdup (uri->scheme); + if (*protocol_ret == NULL) { + perror ("strdup: protocol"); + return -1; +@@ -194,7 +197,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret, + if (path && path[0] == '/' && + (STREQ (uri->scheme, "gluster") || + STREQ (uri->scheme, "iscsi") || +- STREQ (uri->scheme, "nbd") || ++ STRPREFIX (uri->scheme, "nbd") || + STREQ (uri->scheme, "rbd") || + STREQ (uri->scheme, "sheepdog"))) + path++; +diff --git a/common/progress/progress.c b/common/progress/progress.c +index e4b30663..5848abd7 100644 +--- a/common/progress/progress.c ++++ b/common/progress/progress.c +@@ -123,6 +123,7 @@ progress_bar_init (unsigned flags) + bar->machine_readable = 1; + bar->utf8_mode = 0; + bar->have_terminfo = 0; ++ bar->fp = NULL; + } else { + bar->machine_readable = 0; + diff --git a/SOURCES/0037-New-APIs-findfs_partuuid-and-findfs_partlabel.patch b/SOURCES/0037-New-APIs-findfs_partuuid-and-findfs_partlabel.patch new file mode 100644 index 0000000..2aaf34d --- /dev/null +++ b/SOURCES/0037-New-APIs-findfs_partuuid-and-findfs_partlabel.patch @@ -0,0 +1,86 @@ +From 04a45af93d21880e54a386386313100a04b91ca7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 8 Jul 2024 14:37:22 +0100 +Subject: [PATCH] New APIs: findfs_partuuid and findfs_partlabel + +These search for partitions by UUID or label (name). They only work +for GPT. + +(cherry picked from commit 1816651f3c138600ad2e5ba0d6437b4753333818) +--- + daemon/findfs.ml | 4 ++++ + generator/actions_core.ml | 24 ++++++++++++++++++++++++ + generator/proc_nr.ml | 2 ++ + lib/MAX_PROC_NR | 2 +- + 4 files changed, 31 insertions(+), 1 deletion(-) + +diff --git a/daemon/findfs.ml b/daemon/findfs.ml +index cf2ba4a8..a94e0ce7 100644 +--- a/daemon/findfs.ml ++++ b/daemon/findfs.ml +@@ -27,6 +27,10 @@ let rec findfs_uuid uuid = + findfs "UUID" uuid + and findfs_label label = + findfs "LABEL" label ++and findfs_partuuid uuid = ++ findfs "PARTUUID" uuid ++and findfs_partlabel label = ++ findfs "PARTLABEL" label + + and findfs tag str = + (* Kill the cache file, forcing blkid to reread values from the +diff --git a/generator/actions_core.ml b/generator/actions_core.ml +index 314bb0ae..c3afe810 100644 +--- a/generator/actions_core.ml ++++ b/generator/actions_core.ml +@@ -5688,6 +5688,30 @@ filesystem can be found. + + To find the label of a filesystem, use C." }; + ++ { defaults with ++ name = "findfs_partuuid"; added = (1, 5, 3); ++ style = RString (RDevice, "device"), [String (PlainString, "uuid")], []; ++ impl = OCaml "Findfs.findfs_partuuid"; ++ shortdesc = "find a partition by UUID"; ++ longdesc = "\ ++This command searches the partitions and returns the one ++which has the given partition UUID. An error is returned if no such ++partition can be found. ++ ++To find the UUID of a partition, use C (C)." }; ++ ++ { defaults with ++ name = "findfs_partlabel"; added = (1, 5, 3); ++ style = RString (RDevice, "device"), [String (PlainString, "label")], []; ++ impl = OCaml "Findfs.findfs_partlabel"; ++ shortdesc = "find a partition by label"; ++ longdesc = "\ ++This command searches the partitions and returns the one ++which has the given label. An error is returned if no such ++partition can be found. ++ ++To find the label of a partition, use C (C)." }; ++ + { defaults with + name = "is_chardev"; added = (1, 5, 10); + style = RBool "flag", [String (Pathname, "path")], [OBool "followsymlinks"]; +diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml +index f71a849c..56cd97a9 100644 +--- a/generator/proc_nr.ml ++++ b/generator/proc_nr.ml +@@ -516,6 +516,8 @@ let proc_nr = [ + 511, "internal_readdir"; + 512, "clevis_luks_unlock"; + 513, "inspect_get_build_id"; ++514, "findfs_partuuid"; ++515, "findfs_partlabel"; + ] + + (* End of list. If adding a new entry, add it at the end of the list +diff --git a/lib/MAX_PROC_NR b/lib/MAX_PROC_NR +index 31cf34b8..3cda32fc 100644 +--- a/lib/MAX_PROC_NR ++++ b/lib/MAX_PROC_NR +@@ -1 +1 @@ +-513 ++515 diff --git a/SOURCES/0038-inspection-Resolve-PARTUUID-and-PARTLABEL-in-etc-fst.patch b/SOURCES/0038-inspection-Resolve-PARTUUID-and-PARTLABEL-in-etc-fst.patch new file mode 100644 index 0000000..cdc2053 --- /dev/null +++ b/SOURCES/0038-inspection-Resolve-PARTUUID-and-PARTLABEL-in-etc-fst.patch @@ -0,0 +1,41 @@ +From ebce03824a3ce75823037003ca2311d7b8d61565 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 8 Jul 2024 14:39:16 +0100 +Subject: [PATCH] inspection: Resolve PARTUUID= and PARTLABEL= in /etc/fstab + +Fixes: https://issues.redhat.com/browse/RHEL-46596 +(cherry picked from commit e616c8f286ddacf401d7c356724ae874ed883262) +--- + daemon/inspect_fs_unix_fstab.ml | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/daemon/inspect_fs_unix_fstab.ml b/daemon/inspect_fs_unix_fstab.ml +index 837c8c62..f5817a31 100644 +--- a/daemon/inspect_fs_unix_fstab.ml ++++ b/daemon/inspect_fs_unix_fstab.ml +@@ -131,6 +131,25 @@ and check_fstab_entry md_map root_mountable os_type aug entry = + with + Failure _ -> return None + ) ++ (* EFI partition UUIDs and labels. *) ++ else if String.is_prefix spec "PARTUUID=" then ( ++ let uuid = String.sub spec 9 (String.length spec - 9) in ++ let uuid = shell_unquote uuid in ++ (* Just ignore the device if the UUID cannot be resolved. *) ++ try ++ Mountable.of_device (Findfs.findfs_partuuid uuid) ++ with ++ Failure _ -> return None ++ ) ++ else if String.is_prefix spec "PARTLABEL=" then ( ++ let label = String.sub spec 10 (String.length spec - 10) in ++ let label = shell_unquote label in ++ (* Just ignore the device if the label cannot be resolved. *) ++ try ++ Mountable.of_device (Findfs.findfs_partlabel label) ++ with ++ Failure _ -> return None ++ ) + (* Resolve /dev/root to the current device. + * Do the same for the / partition of the *BSD + * systems, since the BSD -> Linux device diff --git a/SOURCES/copy-patches.sh b/SOURCES/copy-patches.sh index ce1fbb0..a557e26 100755 --- a/SOURCES/copy-patches.sh +++ b/SOURCES/copy-patches.sh @@ -7,7 +7,7 @@ set -e # ./copy-patches.sh project=libguestfs -rhel_version=9.4 +rhel_version=9.5 # Check we're in the right directory. if [ ! -f $project.spec ]; then diff --git a/SOURCES/libguestfs-1.50.1.tar.gz.sig b/SOURCES/libguestfs-1.50.1.tar.gz.sig deleted file mode 100644 index cec47f6..0000000 --- a/SOURCES/libguestfs-1.50.1.tar.gz.sig +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmP1QzoRHHJpY2hAYW5u -ZXhpYS5vcmcACgkQkXOPc+G3aKCAEBAAimQxT37HMWTHOqvj4s6ipOhDCNPlqo4L -z+syvIkgbp024IOPUbrlmSCtrCFiLXsRmmenynFv66N8GXoWmJruyJMyvBxsupZT -lTo7WdCEix/xPh/LAb8Q9RWA2SQYfkOKHRs/gr4b/LbtXBklMlcOdhegx3Mml4SW -gwK5n799YebUVgzYch5hWjHcRAphPaUdMyaJ6MUnFrfUPyGK2QO1yXdnGxkseAPz -srjlhFqu5kNojWzcaNcdHBdKvJVEZo7L6laADRS31sRH0BGVc6/DFJgOPdxROGJe -oeq3Oo1EF88P15NSTNZSXLa65n9kts2OnqRgX/c3njV9+1/JPHJWVM+VezuCcN8D -hHktHVOBjM209N5RmLtR92eROvo1aTrgjsLqOTvwbKBu7NrPc4ZICnX7dMjD6irj -vQz0P5MUmELMvdEN3FMGf45v77z+249e1z+5EGi2HUPKLfxd+I3+2mxUm2xjWOy/ -zNzkG2rCgYRB8Tioj6Mw80RYKioRyu8p5lUZvvLk85CJbT4BFH8rXgJbrEBOSunE -lWEcv690GzyszAN8zKZaIqhNzIKdlkQZAd1DMXfNBEfAy23YHRApB1O2EFhNAjAf -yEsUjpiYc0pq64QiCPGzUp4iLfMt9hg4ey5Pquud/j6cfvJ3ak5gZECbFnbUjysZ -YYpwSgy/FVI= -=OPC/ ------END PGP SIGNATURE----- diff --git a/SOURCES/libguestfs-1.50.2.tar.gz.sig b/SOURCES/libguestfs-1.50.2.tar.gz.sig new file mode 100644 index 0000000..b55429c --- /dev/null +++ b/SOURCES/libguestfs-1.50.2.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmaNN5wRHHJpY2hAYW5u +ZXhpYS5vcmcACgkQkXOPc+G3aKDZwQ/9ExtAdQIYiR1HtRiHlNDoQw5ADVeHaucD +Gy8KLJHyzCZaPVsim50/Rx9Thipn/jvVCNRoww02D8l5xm7elcqO7//N5OWNeyzO +/SUq/DEspWdfpDJVEQvID3Rtg8ZPJ/7VW9dtMe2nuUNpEyBSeqqQvXoJXzDkhcao +IT604JY7zZqeFzXaZGYyXeZUtnxpv7M/yIDGVjQ2m0WxAkpk3OYIW57bjRRTAI3d +zSnCW1qIITpMb3VtTRKw9FIhr/eZsyeLqA1QlKGKh0HEyrVDwYD+ENH4McKyOUH1 +M3pPMxOL5/WpBMpVhQsmospK25+AQRWuzm0w/h6YgP6gPbQLCe7BTkNeWz3n3f8r +W1P+eS0bj1NVs3vZYM0WC8pMx6UaqP6u5T1vH9v+VQ3/ZEqBnU60Jhso5wdQRSgG +GsarBFf2BETZkuMFiUaaKAbDgYYMVW3nsxgurW0pk5kIfeXX1+6xcqoULG/cV879 +xhUD11XBrJdCvWnpZ+xTZD3SPP4hlfAlCkHPhFw0+WdTHUEASVRnX+dZzYcAE49d +2S7XsrAphY+l2BCISdJB4OdGSnpWO8M76Y0FbPFO6bx9YJRmIAQPLWbq4RrjtAZ4 +CUObvLe54y4OHY7f22qZVg+hWusaTexphfOAMi/rInLgWbzERFlQ0iL8mVd3dQqA +oCoiARM5lzI= +=UhhX +-----END PGP SIGNATURE----- diff --git a/SPECS/libguestfs.spec b/SPECS/libguestfs.spec index 2d9118e..49cdce8 100644 --- a/SPECS/libguestfs.spec +++ b/SPECS/libguestfs.spec @@ -44,8 +44,8 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 -Version: 1.50.1 -Release: 7%{?dist} +Version: 1.50.2 +Release: 1%{?dist} License: LGPLv2+ # Build only for architectures that have a kernel @@ -79,57 +79,56 @@ Source7: libguestfs.keyring # Maintainer script which helps with handling patches. Source8: copy-patches.sh -# This is a copy of the common/ submodule from libguestfs @v1.50.1. +# This is a copy of the common/ submodule from libguestfs @v1.50.2. # We need it because the libguestfs tarball does not include common/ # directories that are not used by libguestfs (eg. common/mlcustomize). # However the patches (below) patch files in those directories and so # do not apply properly to the libguestfs tarball. Therefore before # applying the patches we unpack this in the common/ subdirectory. -Source9: libguestfs-common-1.50.1.tar.gz +Source9: libguestfs-common-1.50.2.tar.gz # Patches are maintained in the following repository: -# https://github.com/libguestfs/libguestfs/commits/rhel-9.4 +# https://github.com/libguestfs/libguestfs/commits/rhel-9.5 # Patches. -Patch0001: 0001-update-common-submodule.patch -Patch0002: 0002-update-common-submodule.patch -Patch0003: 0003-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch -Patch0004: 0004-daemon-selinux-relabel-search-for-invalid-option-in-.patch -Patch0005: 0005-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch -Patch0006: 0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch -Patch0007: 0007-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch -Patch0008: 0008-Remove-virt-dib.patch -Patch0009: 0009-lib-Choose-q35-machine-type-for-x86-64.patch -Patch0010: 0010-RHEL-Revert-build-Remove-bundled-copy-of-ocaml-augea.patch -Patch0011: 0011-update-common-submodule.patch -Patch0012: 0012-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch -Patch0013: 0013-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch -Patch0014: 0014-Replace-Pervasives.-with-Stdlib.patch -Patch0015: 0015-fuse-Don-t-call-fclose-NULL-on-error-paths.patch -Patch0016: 0016-ocaml-implicit_close-test-collect-all-currently-unre.patch -Patch0017: 0017-ocaml-Replace-old-enter-leave_blocking_section-calls.patch -Patch0018: 0018-ocaml-Release-runtime-lock-around-guestfs_close.patch -Patch0019: 0019-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch -Patch0020: 0020-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch -Patch0021: 0021-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch -Patch0022: 0022-generator-Add-chown-option-for-virt-customize.patch -Patch0023: 0023-lib-remove-guestfs_int_cmd_clear_close_files.patch -Patch0024: 0024-docs-fix-broken-link-in-the-guestfs-manual.patch -Patch0025: 0025-docs-clarify-sockdir-s-separation.patch -Patch0026: 0026-lib-move-guestfs_int_create_socketname-from-launch.c.patch -Patch0027: 0027-generator-customize-Add-new-StringTriplet-for-use-by.patch -Patch0028: 0028-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch -Patch0029: 0029-ruby-Replace-MiniTest-with-Minitest.patch -Patch0030: 0030-ruby-Get-rid-of-old-Test-Unit-compatibility.patch -Patch0031: 0031-generator-Sort-virt-customize-options-into-alphabeti.patch -Patch0032: 0032-generator-Add-new-virt-customize-tar-in-operation.patch -Patch0033: 0033-New-mailing-list-email-address.patch -Patch0034: 0034-New-mailing-list-archives.patch -Patch0035: 0035-lib-Include-libxml-parser.h-for-xmlReadMemory.patch -Patch0036: 0036-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch -Patch0037: 0037-ocaml-Nullify-custom-block-before-releasing-runtime-.patch -Patch0038: 0038-Update-common-submodule.patch -Patch0039: 0039-tests-Test-guestfish-key-all-.-selector.patch +Patch0001: 0001-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch +Patch0002: 0002-daemon-selinux-relabel-search-for-invalid-option-in-.patch +Patch0003: 0003-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch +Patch0004: 0004-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch +Patch0005: 0005-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch +Patch0006: 0006-Remove-virt-dib.patch +Patch0007: 0007-lib-Choose-q35-machine-type-for-x86-64.patch +Patch0008: 0008-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch +Patch0009: 0009-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch +Patch0010: 0010-fuse-Don-t-call-fclose-NULL-on-error-paths.patch +Patch0011: 0011-ocaml-implicit_close-test-collect-all-currently-unre.patch +Patch0012: 0012-ocaml-Replace-old-enter-leave_blocking_section-calls.patch +Patch0013: 0013-ocaml-Release-runtime-lock-around-guestfs_close.patch +Patch0014: 0014-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch +Patch0015: 0015-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch +Patch0016: 0016-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch +Patch0017: 0017-generator-Add-chown-option-for-virt-customize.patch +Patch0018: 0018-lib-remove-guestfs_int_cmd_clear_close_files.patch +Patch0019: 0019-docs-fix-broken-link-in-the-guestfs-manual.patch +Patch0020: 0020-docs-clarify-sockdir-s-separation.patch +Patch0021: 0021-lib-move-guestfs_int_create_socketname-from-launch.c.patch +Patch0022: 0022-generator-customize-Add-new-StringTriplet-for-use-by.patch +Patch0023: 0023-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch +Patch0024: 0024-ruby-Replace-MiniTest-with-Minitest.patch +Patch0025: 0025-ruby-Get-rid-of-old-Test-Unit-compatibility.patch +Patch0026: 0026-generator-Sort-virt-customize-options-into-alphabeti.patch +Patch0027: 0027-generator-Add-new-virt-customize-tar-in-operation.patch +Patch0028: 0028-New-mailing-list-email-address.patch +Patch0029: 0029-New-mailing-list-archives.patch +Patch0030: 0030-lib-Include-libxml-parser.h-for-xmlReadMemory.patch +Patch0031: 0031-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch +Patch0032: 0032-ocaml-Nullify-custom-block-before-releasing-runtime-.patch +Patch0033: 0033-Update-common-submodule.patch +Patch0034: 0034-tests-Test-guestfish-key-all-.-selector.patch +Patch0035: 0035-generator-customize.ml-Split-chown-parameter-on-char.patch +Patch0036: 0036-Update-common-submodule.patch +Patch0037: 0037-New-APIs-findfs_partuuid-and-findfs_partlabel.patch +Patch0038: 0038-inspection-Resolve-PARTUUID-and-PARTLABEL-in-etc-fst.patch %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel @@ -148,8 +147,7 @@ BuildRequires: perl(Pod::Man) BuildRequires: /usr/bin/pod2text BuildRequires: po4a BuildRequires: augeas-devel >= 1.7.0 -# Waiting for https://bugzilla.redhat.com/show_bug.cgi?id=2168634 -#BuildRequires: ocaml-augeas-devel >= 0.6 +BuildRequires: ocaml-augeas-devel >= 0.6 BuildRequires: readline-devel BuildRequires: xorriso BuildRequires: libxml2-devel @@ -1143,6 +1141,26 @@ rm ocaml/html/.gitignore %changelog +* Tue Jul 09 2024 Richard W.M. Jones - 1:1.50.2-1 +- Update to libguestfs 1.50.2 + resolves: RHEL-46775 + +* Mon Jul 08 2024 Richard W.M. Jones - 1:1.50.1-12 +- inspection: Resolve PARTUUID= and PARTLABEL= in /etc/fstab + resolves: RHEL-40142, RHEL-46596 + +* Fri Jun 28 2024 Richard W.M. Jones - 1:1.50.1-11 +- Fix (rare) undetected truncation of 64 bit int results to 32 bits + resolves: RHEL-45466 + +* Thu Jun 20 2024 Richard W.M. Jones - 1:1.50.1-10 +- Remove bundled ocaml-augeas + resolves: RHEL-32142 + +* Wed Apr 24 2024 Richard W.M. Jones - 1:1.50.1-9 +- Add support for nbd+unix:// URIs + resolves: RHEL-33851 + * Thu Dec 14 2023 Richard W.M. Jones - 1:1.50.1-7 - Add --key all:... selector resolves: RHEL-19367