From 16a560c22f6dd84f4aee7e6fdfcc6735a582974a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 23 Mar 2021 10:25:17 +0000 Subject: [PATCH] New upstream version 1.45.2. - This drops the tools. Now packaged as guestfs-tools. - guestfish, guestmount, guestunmount now packaged with libguestfs. - virt-rescue now packaged in libguestfs-rescue. - Drop ChangeLog file. - Remove virt-dib in RHEL 9. - Depend on PCRE2 instead of PCRE. --- ...nclude-huge-ChangeLog-in-the-tarball.patch | 60 +++ ...u-mode-maximum-for-cpu-max-on-libvir.patch | 47 --- ...-tests-Remove-dependency-on-Sys-Virt.patch | 180 -------- ...-Remove-completion-scripts-for-tools.patch | 125 ++++++ libguestfs-php8.patch | 20 - libguestfs.spec | 388 +++++------------- sources | 4 +- 7 files changed, 283 insertions(+), 541 deletions(-) create mode 100644 0001-Don-t-include-huge-ChangeLog-in-the-tarball.patch delete mode 100644 0001-appliance-Use-cpu-mode-maximum-for-cpu-max-on-libvir.patch delete mode 100644 0001-tests-Remove-dependency-on-Sys-Virt.patch create mode 100644 0002-bash-completion-Remove-completion-scripts-for-tools.patch delete mode 100644 libguestfs-php8.patch diff --git a/0001-Don-t-include-huge-ChangeLog-in-the-tarball.patch b/0001-Don-t-include-huge-ChangeLog-in-the-tarball.patch new file mode 100644 index 0000000..757df37 --- /dev/null +++ b/0001-Don-t-include-huge-ChangeLog-in-the-tarball.patch @@ -0,0 +1,60 @@ +From eb53d74ba2e5e9086a5ac8679d55e6a338397e07 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 23 Mar 2021 10:00:12 +0000 +Subject: [PATCH 1/2] Don't include huge ChangeLog in the tarball. + +Adds a few megabytes which people can easily get from the git +repository. +--- + .gitignore | 1 - + Makefile.am | 9 +-------- + 2 files changed, 1 insertion(+), 9 deletions(-) + +diff --git a/.gitignore b/.gitignore +index 716a9b2cd..f6e7d18e5 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -81,7 +81,6 @@ Makefile.in + /build-aux/test-driver + /build-aux/ylwrap + /bundled/ocaml-augeas/.depend +-/ChangeLog + /compile + /config.cache + /config.guess +diff --git a/Makefile.am b/Makefile.am +index 9feac761b..743d2fbad 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -215,15 +215,13 @@ maintainer-upload-website: + # When doing 'make dist' update a few files automatically. + # + # BUGS - list of bugs (created from Bugzilla) +-# ChangeLog - changelog (created from git) + # docs/C_SOURCE_FILES + # - source files scanned for internal documentation + # po/POTFILES - files with ordinary extensions, but not OCaml files + # po/POTFILES-ml - OCaml files, which need a special tool to translate + +-dist-hook: BUGS ChangeLog docs/C_SOURCE_FILES po/POTFILES po/POTFILES-ml ++dist-hook: BUGS docs/C_SOURCE_FILES po/POTFILES po/POTFILES-ml + cp BUGS $(distdir)/BUGS +- cp ChangeLog $(distdir)/ChangeLog + + BUGS: configure.ac + rm -f $@ $@-t +@@ -231,11 +229,6 @@ BUGS: configure.ac + $(top_srcdir)/update-bugs.sh > $@-t + mv $@-t $@ + +-ChangeLog: configure.ac +- rm -f $@ $@-t +- git log --decorate=false > $@-t +- mv $@-t $@ +- + # This has to be in the top-level Makefile.am so that we have access + # to DIST_SUBDIRS. + docs/C_SOURCE_FILES: configure.ac +-- +2.29.0.rc2 + diff --git a/0001-appliance-Use-cpu-mode-maximum-for-cpu-max-on-libvir.patch b/0001-appliance-Use-cpu-mode-maximum-for-cpu-max-on-libvir.patch deleted file mode 100644 index 9c7e099..0000000 --- a/0001-appliance-Use-cpu-mode-maximum-for-cpu-max-on-libvir.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 13ceb6a87b2869909a6a0e3c8caa962b72e4cb0e Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 18 Mar 2021 12:32:26 +0000 -Subject: [PATCH] appliance: Use for -cpu max on libvirt. - -Note this requires libvirt >= 7.1.0 which was only released in March 2021. - -With an older libvirt you will see this error: - - Original error from libvirt: unsupported configuration: Invalid mode attribute 'maximum' [code=67 int1=-1] - -In theory we could check if this is supported by looking at the -libvirt capabilities and fall back, but this commit does not do that, -in the expectation that most people will be using the default backend -(direct) and on Fedora/RHEL we will add an explicit minimum version -dependency to the package. - -qemu support has been around quite a bit longer (at least since 2017). - -Fixes: commit 30f74f38bd6e42e783ba80895f4d6826abddd417 ---- - lib/launch-libvirt.c | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) - -diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c -index 2d995bee0..194530c49 100644 ---- a/lib/launch-libvirt.c -+++ b/lib/launch-libvirt.c -@@ -1183,13 +1183,8 @@ construct_libvirt_xml_cpu (guestfs_h *g, - } end_element (); - } - else if (STREQ (cpu_model, "max")) { -- if (params->data->is_kvm) -- attribute ("mode", "host-passthrough"); -- else -- attribute ("mode", "host-model"); -- start_element ("model") { -- attribute ("fallback", "allow"); -- } end_element (); -+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1935572#c11 */ -+ attribute ("mode", "maximum"); - } - else - single_element ("model", cpu_model); --- -2.29.0.rc2 - diff --git a/0001-tests-Remove-dependency-on-Sys-Virt.patch b/0001-tests-Remove-dependency-on-Sys-Virt.patch deleted file mode 100644 index d8e3dab..0000000 --- a/0001-tests-Remove-dependency-on-Sys-Virt.patch +++ /dev/null @@ -1,180 +0,0 @@ -From 061be6bb84b83ecfac9f647dccab847a7937fbcf Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 18 Mar 2021 12:15:01 +0000 -Subject: [PATCH] tests: Remove dependency on Sys::Virt. - -This was only used for a single rule (check-valgrind-local-guests) -which ran "make check-valgrind" on local guests. This was never -really used by me and was fairly inadvisable anyway, so we can easily -remove it and thus remove the dependency on perl Sys::Virt. ---- - .gitignore | 1 - - Makefile.am | 11 ------- - configure.ac | 2 -- - docs/guestfs-building.pod | 4 --- - m4/guestfs-perl.m4 | 2 +- - pick-guests.pl.in | 63 --------------------------------------- - 6 files changed, 1 insertion(+), 82 deletions(-) - delete mode 100755 pick-guests.pl.in - -diff --git a/.gitignore b/.gitignore -index 2c8bd36dc..b81b4317c 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -365,7 +365,6 @@ Makefile.in - /php/extension/tests/guestfs_*.sh - /php/extension/tests/guestfs_090_bindtests.phpt - /php/extension/tmp-php.ini --/pick-guests.pl - /po-docs/*/*.1 - /po-docs/*/*.3 - /po-docs/*/*.5 -diff --git a/Makefile.am b/Makefile.am -index 91f33e8d7..d4424af1e 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -368,7 +368,6 @@ check-all: - $(MAKE) -j1 \ - check \ - check-valgrind \ -- check-valgrind-local-guests \ - check-direct \ - check-valgrind-direct \ - check-uml \ -@@ -394,15 +393,6 @@ check-valgrind: build-test-guests - done; \ - exit $$(( $$errors ? 1 : 0 )) - --check-valgrind-local-guests: -- @GUESTS=`$(top_builddir)/run ./pick-guests.pl 5`; \ -- errors=0; \ -- for f in `grep -l '^$@:' $(SUBDIRS:%=%/Makefile.am)`; do \ -- echo $(MAKE) GUESTS="$$GUESTS" -C `dirname $$f` $@; \ -- $(MAKE) GUESTS="$$GUESTS" -C `dirname $$f` $@ || (( errors++ )); \ -- done; \ -- exit $$(( $$errors ? 1 : 0 )) -- - check-direct: - @backend=`$(top_builddir)/run ./fish/guestfish get-backend`; \ - if [ "$$backend" != "direct" ]; then \ -@@ -576,7 +566,6 @@ help: - @echo "make -k check ... and display all errors at once." - @echo - @echo "make check-valgrind Run a subset of the tests under valgrind." -- @echo "make check-valgrind-local-guests Test under valgrind using local guests." - @echo "make check-direct Test using direct backend." - @echo "make check-valgrind-direct Test valgrind + direct backend." - @echo "make check-uml Test using User-Mode Linux." -diff --git a/configure.ac b/configure.ac -index 66f29aa23..165bb4c43 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -205,8 +205,6 @@ AC_CONFIG_FILES([ocaml-link.sh], - [chmod +x,-w ocaml-link.sh]) - AC_CONFIG_FILES([php/extension/php-for-tests.sh], - [chmod +x,-w php/extension/php-for-tests.sh]) --AC_CONFIG_FILES([pick-guests.pl], -- [chmod +x,-w pick-guests.pl]) - AC_CONFIG_FILES([podwrapper.pl], - [chmod +x,-w podwrapper.pl]) - AC_CONFIG_FILES([run], -diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod -index b83aea280..5870ed74b 100644 ---- a/docs/guestfs-building.pod -+++ b/docs/guestfs-building.pod -@@ -372,10 +372,6 @@ Optional. Used to build the Go bindings. - - Optional. For testing memory problems. - --=item Perl C -- --Optional. -- - =item libvirt-python - - Optional. For testing Python libvirt/libguestfs interactions. -diff --git a/m4/guestfs-perl.m4 b/m4/guestfs-perl.m4 -index 4c889d843..c8337ed9b 100644 ---- a/m4/guestfs-perl.m4 -+++ b/m4/guestfs-perl.m4 -@@ -66,7 +66,7 @@ AM_CONDITIONAL([HAVE_PERL], - dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.) - AS_IF([test "x$PERL" != "xno"],[ - missing_perl_modules=no -- for pm in Pod::Usage Getopt::Long Sys::Virt Locale::TextDomain Win::Hivex Win::Hivex::Regedit ; do -+ for pm in Pod::Usage Getopt::Long Locale::TextDomain Win::Hivex Win::Hivex::Regedit ; do - AC_MSG_CHECKING([for $pm]) - if ! $PERL -M$pm -e1 >&AS_MESSAGE_LOG_FD 2>&1; then - AC_MSG_RESULT([no]) -diff --git a/pick-guests.pl.in b/pick-guests.pl.in -deleted file mode 100755 -index e96e33a9c..000000000 ---- a/pick-guests.pl.in -+++ /dev/null -@@ -1,63 +0,0 @@ --#!/usr/bin/env perl --# @configure_input@ --# Copyright (C) 2009-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. -- --# Pick guests at random on the local machine which are accessible. --# This is used by 'make check-valgrind-local-guests'. -- --use strict; --use warnings; -- --use Sys::Guestfs; --use Sys::Virt; --use List::Util qw(shuffle); -- --die "$0 nr-guests\n" unless @ARGV == 1; --my $n = $ARGV[0]; -- --my $vmm = Sys::Virt->new (uri => '@libvirt_ro_uri@'); --my @domains = ($vmm->list_domains, $vmm->list_defined_domains); -- --# Only guests which are accessible by the current (non-root) user. On --# the machine where I run these tests, I have added my user account to --# the 'disk' group, so that most guests are accessible. However --# because libvirt changes the permissions on guest disks, a guest --# which has been run on the machine becomes inaccessible, hence the --# need for this code - RWMJ. --my @accessible; --foreach my $dom (@domains) { -- my $name = $dom->get_name; -- my $g = Sys::Guestfs->new; -- eval { -- $g->add_domain ($name, readonly => 1, -- libvirturi => '@libvirt_ro_uri@'); -- # $g->launch (); - don't actually need to do this -- }; -- push @accessible, $name unless $@; --} -- --# Randomize the list of guests. --@accessible = shuffle (@accessible); -- --$n = @accessible if @accessible < $n; -- --# Return the first n guests from the list. --for (my $i = 0; $i < $n; ++$i) { -- print " " if $i > 0; -- print $accessible[$i]; --} --print "\n"; --- -2.29.0.rc2 - diff --git a/0002-bash-completion-Remove-completion-scripts-for-tools.patch b/0002-bash-completion-Remove-completion-scripts-for-tools.patch new file mode 100644 index 0000000..4ccac0b --- /dev/null +++ b/0002-bash-completion-Remove-completion-scripts-for-tools.patch @@ -0,0 +1,125 @@ +From 4991fe525961450704bbc80b5f2095bc8499f767 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 23 Mar 2021 11:08:42 +0000 +Subject: [PATCH 2/2] bash-completion: Remove completion scripts for tools. + +These have moved to guestfs-tools. + +Fixes: commit 733d2182b64df7abc5c5cd7d78177baa6079628c +--- + .gitignore | 19 ---------- + bash/Makefile.am | 43 +--------------------- + bash/{virt-alignment-scan => guestunmount} | 0 + 3 files changed, 2 insertions(+), 60 deletions(-) + rename bash/{virt-alignment-scan => guestunmount} (100%) + +diff --git a/.gitignore b/.gitignore +index f6e7d18e5..a37ab0593 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -45,29 +45,10 @@ Makefile.in + /appliance/supermin.d + /AUTHORS + /autom4te.cache +-/bash/guestunmount +-/bash/virt-builder +-/bash/virt-cat + /bash/virt-copy-in + /bash/virt-copy-out +-/bash/virt-customize +-/bash/virt-df +-/bash/virt-dib +-/bash/virt-diff +-/bash/virt-edit +-/bash/virt-filesystems +-/bash/virt-format +-/bash/virt-get-kernel +-/bash/virt-inspector +-/bash/virt-log +-/bash/virt-ls +-/bash/virt-resize +-/bash/virt-sysprep +-/bash/virt-sparsify +-/bash/virt-tail + /bash/virt-tar-in + /bash/virt-tar-out +-/bash/virt-win-reg + /build-aux/.gitignore + /build-aux/ar-lib + /build-aux/compile +diff --git a/bash/Makefile.am b/bash/Makefile.am +index 23933806e..86f38d4af 100644 +--- a/bash/Makefile.am ++++ b/bash/Makefile.am +@@ -20,35 +20,16 @@ include $(top_srcdir)/subdir-rules.mk + scripts = \ + guestfish \ + guestmount \ ++ guestunmount \ + libguestfs-test-tool \ +- virt-alignment-scan \ + virt-rescue + + # Some of the scripts are simply symbolic links. + symlinks = \ +- guestunmount \ +- virt-builder \ +- virt-cat \ + virt-copy-in \ + virt-copy-out \ +- virt-customize \ +- virt-diff \ +- virt-df \ +- virt-dib \ +- virt-edit \ +- virt-filesystems \ +- virt-format \ +- virt-get-kernel \ +- virt-inspector \ +- virt-log \ +- virt-ls \ +- virt-resize \ +- virt-sparsify \ +- virt-sysprep \ +- virt-tail \ + virt-tar-in \ +- virt-tar-out \ +- virt-win-reg ++ virt-tar-out + + # Note: Don't distribute the symbolic links, only the real files. + EXTRA_DIST = \ +@@ -59,26 +40,6 @@ EXTRA_DIST = \ + CLEANFILES += \ + $(symlinks) + +-# Any tool that has --short-options and --long-options only is handled +-# by this common script. +-virt-win-reg: +- rm -f $@ +- $(LN_S) libguestfs-test-tool $@ +- +-# Any tool that has --short-options and --long-options and a few +-# common options like -d is handled by this common script. However +-# this script cannot deal with commands that use --ro/--rw +-# (eg. virt-rescue), nor commands that have lots of exceptions +-# (eg. guestfish). Those tools have to be handled individually. +-guestunmount \ +-virt-builder virt-cat virt-customize virt-df virt-dib virt-diff \ +-virt-edit virt-filesystems virt-format virt-get-kernel virt-inspector \ +-virt-log virt-ls \ +-virt-resize virt-sparsify virt-sysprep \ +-virt-tail: +- rm -f $@ +- $(LN_S) virt-alignment-scan $@ +- + # guestfish is handled specially. + virt-copy-in virt-copy-out virt-tar-in virt-tar-out: + rm -f $@ +diff --git a/bash/virt-alignment-scan b/bash/guestunmount +similarity index 100% +rename from bash/virt-alignment-scan +rename to bash/guestunmount +-- +2.29.0.rc2 + diff --git a/libguestfs-php8.patch b/libguestfs-php8.patch deleted file mode 100644 index 5fbd871..0000000 --- a/libguestfs-php8.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up ./generator/php.ml.php8 ./generator/php.ml ---- ./generator/php.ml.php8 2021-03-05 12:58:48.985383761 +0100 -+++ ./generator/php.ml 2021-03-05 13:00:10.731000947 +0100 -@@ -98,9 +98,15 @@ and generate_php_c () = - - static int res_guestfs_h; - -+/* removed from PHP 8 */ -+#ifndef TSRMLS_CC -+#define TSRMLS_DC -+#define TSRMLS_CC -+#endif -+ - #if ZEND_MODULE_API_NO >= 20151012 - # define GUESTFS_RETURN_STRING(x, duplicate) \\ -- do { if (duplicate) RETURN_STRING(x) else { RETVAL_STRING(x); efree ((char *)x); return; } } while (0) -+ do { if (duplicate) { RETURN_STRING(x); } else { RETVAL_STRING(x); efree ((char *)x); return; } } while (0) - # define guestfs_add_assoc_string(arg, key, str, dup) \\ - add_assoc_string(arg, key, str) - # define guestfs_add_assoc_stringl(arg, key, str, len, dup) \\ diff --git a/libguestfs.spec b/libguestfs.spec index 808b936..5d0b8b6 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -55,8 +55,8 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 -Version: 1.45.1 -Release: 6%{?dist} +Version: 1.45.2 +Release: 1%{?dist} License: LGPLv2+ # Build only for architectures that have a kernel @@ -86,22 +86,15 @@ Source7: libguestfs.keyring # Maintainer script which helps with handling patches. Source8: copy-patches.sh -# Trivial fix for PHP 8 (upstream in libguestfs >= 1.45.2) -Patch0: %{name}-php8.patch - -# Remove dependency on perl(Sys::Virt) (upstream in libguestfs >= 1.45.2) -Patch1: 0001-tests-Remove-dependency-on-Sys-Virt.patch - -# Fix -cpu max mode with libvirt backend. -# Upstream in libguestfs >= 1.45.2. -# Requires libvirt >= 7.1.0 -Patch2: 0001-appliance-Use-cpu-mode-maximum-for-cpu-max-on-libvir.patch +# Upstream patches since 1.45.2 was released fixing various build issues. +Patch1: 0001-Don-t-include-huge-ChangeLog-in-the-tarball.patch +Patch2: 0002-bash-completion-Remove-completion-scripts-for-tools.patch %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel %endif -# Basic build requirements for the library and virt tools. +# Basic build requirements. BuildRequires: gcc, gcc-c++ BuildRequires: make BuildRequires: rpcgen @@ -122,7 +115,7 @@ BuildRequires: glibc-static BuildRequires: libselinux-utils BuildRequires: libselinux-devel BuildRequires: fuse, fuse-devel -BuildRequires: pcre-devel +BuildRequires: pcre2-devel BuildRequires: file-devel BuildRequires: libvirt-devel BuildRequires: gperf @@ -153,11 +146,8 @@ BuildRequires: systemd-devel BuildRequires: bash-completion BuildRequires: /usr/bin/ping BuildRequires: /usr/bin/wget -BuildRequires: curl BuildRequires: xz BuildRequires: /usr/bin/qemu-img -BuildRequires: perl(Win::Hivex) -BuildRequires: perl(Win::Hivex::Regedit) %if 0%{verify_tarball_signature} BuildRequires: gnupg2 @@ -222,8 +212,8 @@ BuildRequires: bzip2 BuildRequires: coreutils BuildRequires: cpio BuildRequires: cryptsetup -BuildRequires: curl %if !0%{?rhel} +BuildRequires: curl BuildRequires: debootstrap %endif BuildRequires: dhclient @@ -250,7 +240,9 @@ BuildRequires: iproute BuildRequires: iputils BuildRequires: kernel BuildRequires: kmod +%if !0%{?rhel} BuildRequires: kpartx +%endif BuildRequires: less BuildRequires: libcap %if !0%{?rhel} @@ -269,7 +261,7 @@ BuildRequires: ntfs-3g ntfsprogs ntfs-3g-system-compression BuildRequires: openssh-clients BuildRequires: parted BuildRequires: pciutils -BuildRequires: pcre +BuildRequires: pcre2 BuildRequires: policycoreutils BuildRequires: procps BuildRequires: psmisc @@ -290,7 +282,9 @@ BuildRequires: tar BuildRequires: udev BuildRequires: util-linux BuildRequires: vim-minimal +%if !0%{?rhel} BuildRequires: which +%endif BuildRequires: xfsprogs BuildRequires: xz BuildRequires: yajl @@ -313,7 +307,7 @@ Requires: augeas-libs%{?_isa} >= 1.7.0 Requires: libacl%{?_isa} Requires: libcap%{?_isa} Requires: hivex%{?_isa} >= 1.3.10 -Requires: pcre%{?_isa} +Requires: pcre2%{?_isa} Requires: libselinux%{?_isa} Requires: systemd-libs%{?_isa} Requires: yajl%{?_isa} @@ -344,12 +338,12 @@ Requires: selinux-policy >= 3.11.1-63 Requires: edk2-aarch64 %endif -# For UML backend (this backend only works on x86). -# UML has been broken upstream (in the kernel) for a while, so don't -# include this. Note that uml_utilities also depends on Perl. -#% ifarch % {ix86} x86_64 -#Requires: uml_utilities -#% endif +# For guestfish. +#Requires: /usr/bin/emacs #theoretically, but too large +Requires: /usr/bin/hexedit +Requires: /usr/bin/less +Requires: /usr/bin/man +Requires: /usr/bin/vi # https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Packages_granted_exceptions Provides: bundled(gnulib) @@ -363,29 +357,15 @@ Conflicts: libguestfs-winsupport < 7.2 %endif - %description Libguestfs is a library for accessing and modifying virtual machine disk images. http://libguestfs.org -It can be used to make batch configuration changes to guests, get disk -used/free statistics (virt-df), perform backups and guest clones, -change registry/UUID/hostname info, build guests from scratch -(virt-builder) and much more. - Libguestfs uses Linux kernel and qemu code, and can access any type of guest filesystem that Linux and qemu can, including but not limited to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, qcow2, vmdk. -Libguestfs is split into several subpackages. The basic subpackages are: - - libguestfs C library - libguestfs-tools virt-* tools, guestfish and guestmount (FUSE) - libguestfs-tools-c only the subset of virt tools written in C - (for reduced dependencies) - virt-dib safe and secure diskimage-builder replacement - For enhanced features, install: %if !0%{?rhel} @@ -442,6 +422,18 @@ Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} for %{name}. +%if !0%{?rhel} +%package dib +Summary: Additional tools for virt-dib +License: LGPLv2+ +Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} + +%description dib +This adds extra packages needed by virt-dib to %{name}. You should +normally install the virt-dib package which depends on this one. +%endif + + %if !0%{?rhel} %package forensics Summary: Filesystem forensics support for %{name} @@ -481,13 +473,14 @@ disk images containing HFS+ / Mac OS Extended filesystems. %package rescue -Summary: Additional tools for virt-rescue +Summary: virt-rescue shell License: LGPLv2+ Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} %description rescue -This adds additional tools to use inside the virt-rescue shell, -such as ssh, network utilities, editors and debugging utilities. +This adds the virt-rescue shell which is a "rescue disk" for virtual +machines, and additional tools to use inside the shell such as ssh, +network utilities, editors and debugging utilities. %package rsync @@ -556,144 +549,6 @@ The only reason this is a separate package is to avoid core libguestfs having to depend on Perl. See https://bugzilla.redhat.com/1194158 -%package tools-c -Summary: System administration tools for virtual machines -License: GPLv2+ -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} - -# For guestfish: -#Requires: /usr/bin/emacs #theoretically, but too large -Requires: /usr/bin/hexedit -Requires: /usr/bin/less -Requires: /usr/bin/man -Requires: /usr/bin/vi - -# For virt-builder: -Requires: gnupg2 -Requires: xz -#Requires: nbdkit, nbdkit-plugin-xz -Requires: curl - -# For virt-builder-repository: -Suggests: osinfo-db - -# Some Fedora, and all RHEL 7, use XFS: -Recommends: libguestfs-xfs - -# For virt-edit and virt-customize: -Suggests: perl - - -%description tools-c -This package contains miscellaneous system administrator command line -tools for virtual machines. - -Note that you should install %{name}-tools (which pulls in -this package). This package is only used directly when you want -to avoid dependencies on Perl. - - -%package tools -Summary: System administration tools for virtual machines -License: GPLv2+ -BuildArch: noarch -Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} - - -%description tools -This package contains miscellaneous system administrator command line -tools for virtual machines. - -Guestfish is the Filesystem Interactive SHell, for accessing and -modifying virtual machine disk images from the command line and shell -scripts. - -The guestmount command lets you mount guest filesystems on the host -using FUSE and %{name}. - -Virt-alignment-scan scans virtual machines looking for partition -alignment problems. - -Virt-builder is a command line tool for rapidly making disk images -of popular free operating systems. - -Virt-cat is a command line tool to display the contents of a file in a -virtual machine. - -Virt-copy-in and virt-copy-out are command line tools for uploading -and downloading files and directories to and from virtual machines. - -Virt-customize is a command line tool for customizing virtual machine -disk images. - -Virt-df is a command line tool to display free space on virtual -machine filesystems. Unlike other tools, it doesn’t just display the -amount of space allocated to a virtual machine, but can look inside -the virtual machine to see how much space is really being used. It is -like the df(1) command, but for virtual machines, except that it also -works for Windows virtual machines. - -Virt-diff shows the differences between virtual machines. - -Virt-edit is a command line tool to edit the contents of a file in a -virtual machine. - -Virt-filesystems is a command line tool to display the filesystems, -partitions, block devices, LVs, VGs and PVs found in a disk image -or virtual machine. It replaces the deprecated programs -virt-list-filesystems and virt-list-partitions with a much more -capable tool. - -Virt-format is a command line tool to erase and make blank disks. - -Virt-get-kernel extracts a kernel/initrd from a disk image. - -Virt-inspector examines a virtual machine and tries to determine the -version of the OS, the kernel version, what drivers are installed, -whether the virtual machine is fully virtualized (FV) or -para-virtualized (PV), what applications are installed and more. - -Virt-log is a command line tool to display the log files from a -virtual machine. - -Virt-ls is a command line tool to list out files in a virtual machine. - -Virt-make-fs is a command line tool to build a filesystem out of -a collection of files or a tarball. - -Virt-rescue provides a rescue shell for making interactive, -unstructured fixes to virtual machines. - -Virt-resize can resize existing virtual machine disk images. - -Virt-sparsify makes virtual machine disk images sparse (thin-provisioned). - -Virt-sysprep lets you reset or unconfigure virtual machines in -preparation for cloning them. - -Virt-tail follows (tails) a log file within a guest, like 'tail -f'. - -Virt-tar-in and virt-tar-out are archive, backup and upload tools -for virtual machines. These replace the deprecated program virt-tar. - -Virt-win-reg lets you look at and modify the Windows Registry of -Windows virtual machines. - - -%package -n virt-dib -Summary: Safe and secure diskimage-builder replacement -License: GPLv2+ - -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} - - -%description -n virt-dib -Virt-dib is a safe and secure alternative to the OpenStack -diskimage-builder command. It is compatible with most -diskimage-builder elements. - - %package bash-completion Summary: Bash tab-completion scripts for %{name} tools BuildArch: noarch @@ -912,13 +767,8 @@ fi --disable-erlang \ $extra -# Building index-parse.c by hand works around a race condition in the -# autotools cruft, where two or more copies of yacc race with each -# other, resulting in a corrupted file. -# # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the # vendor dir not the site dir. -make -j1 -C builder index-parse.c make V=1 INSTALLDIRS=vendor %{?_smp_mflags} @@ -937,11 +787,6 @@ fi %install -# This file is creeping over 1 MB uncompressed, and since it is -# included in the -devel subpackage, compress it to reduce -# installation size. -gzip -9 ChangeLog - # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the # vendor dir not the site dir. make DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor install @@ -958,14 +803,6 @@ find $RPM_BUILD_ROOT -name .packlist -delete find $RPM_BUILD_ROOT -name '*.bs' -delete find $RPM_BUILD_ROOT -name 'bindtests.pl' -delete -# Remove obsolete binaries (RHBZ#1213298). -rm $RPM_BUILD_ROOT%{_bindir}/virt-list-filesystems -rm $RPM_BUILD_ROOT%{_bindir}/virt-list-partitions -rm $RPM_BUILD_ROOT%{_bindir}/virt-tar -rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-list-filesystems.1* -rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-list-partitions.1* -rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-tar.1* - # golang: Ignore what libguestfs upstream installs, and just copy the # source files to %%{_datadir}/gocode/src. %ifarch %{golang_arches} @@ -974,37 +811,47 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/gocode/src cp -a golang/src/libguestfs.org $RPM_BUILD_ROOT%{_datadir}/gocode/src %endif -# Move installed documentation back to the source directory so -# we can install it using a %%doc rule. -mv $RPM_BUILD_ROOT%{_docdir}/libguestfs installed-docs -gzip --best installed-docs/*.xml - # Split up the monolithic packages file in the supermin appliance so # we can install dependencies in subpackages. pushd $RPM_BUILD_ROOT%{_libdir}/guestfs/supermin.d +function remove +{ + grep -Ev "^$1$" < packages > packages-t + mv packages-t packages +} + function move_to { if ! grep -Esq "^$1$" packages; then echo "move_to $1: package name not found in packages file" exit 1 fi - grep -Ev "^$1$" < packages > packages-t - mv packages-t packages + remove "$1" echo "$1" >> "$2" } -move_to curl zz-packages-dib %if !0%{?rhel} +move_to curl zz-packages-dib move_to debootstrap zz-packages-dib -%endif move_to kpartx zz-packages-dib move_to qemu-img zz-packages-dib move_to which zz-packages-dib +%else +remove curl +remove debootstrap +remove kpartx +remove qemu-img +remove which +%endif %if !0%{?rhel} move_to sleuthkit zz-packages-forensics move_to gfs2-utils zz-packages-gfs2 move_to hfsplus-tools zz-packages-hfsplus +%else +remove sleuthkit +remove gfs2-utils +remove hfsplus-tools %endif move_to iputils zz-packages-rescue move_to lsof zz-packages-rescue @@ -1018,6 +865,8 @@ move_to xfsprogs zz-packages-xfs %ifnarch %{arm} aarch64 s390 s390x riscv64 move_to zfs-fuse zz-packages-zfs %endif +%else +remove zfs-fuse %endif %if !0%{?rhel} @@ -1052,23 +901,39 @@ rm ocaml/html/.gitignore %files -f %{name}.lang %doc COPYING README +%{_bindir}/guestfish +%{_bindir}/guestmount +%{_bindir}/guestunmount %{_bindir}/libguestfs-test-tool +%{_bindir}/virt-copy-in +%{_bindir}/virt-copy-out +%{_bindir}/virt-tar-in +%{_bindir}/virt-tar-out %{_libdir}/guestfs/ %exclude %{_libdir}/guestfs/supermin.d/zz-packages-* %{_libdir}/libguestfs.so.* +%{_mandir}/man1/guestfish.1* %{_mandir}/man1/guestfs-faq.1* %{_mandir}/man1/guestfs-performance.1* %{_mandir}/man1/guestfs-recipes.1* %{_mandir}/man1/guestfs-release-notes-1*.1* %{_mandir}/man1/guestfs-release-notes-historical.1* %{_mandir}/man1/guestfs-security.1* +%{_mandir}/man1/guestmount.1* +%{_mandir}/man1/guestunmount.1* %{_mandir}/man1/libguestfs-test-tool.1* +%{_mandir}/man1/virt-copy-in.1* +%{_mandir}/man1/virt-copy-out.1* +%{_mandir}/man1/virt-tar-in.1* +%{_mandir}/man1/virt-tar-out.1* +%{_mandir}/man5/libguestfs-tools.conf.5* +%config %{_sysconfdir}/profile.d/guestfish.sh +%config(noreplace) %{_sysconfdir}/libguestfs-tools.conf %files devel -%doc AUTHORS BUGS ChangeLog.gz HACKING TODO README +%doc AUTHORS BUGS HACKING TODO README %doc examples/*.c -%doc installed-docs/* %{_libdir}/libguestfs.so %{_sbindir}/libguestfs-make-fixed-appliance %{_mandir}/man1/guestfs-building.1* @@ -1083,6 +948,11 @@ rm ocaml/html/.gitignore %{_libdir}/pkgconfig/libguestfs.pc +%if !0%{?rhel} +%files dib +%{_libdir}/guestfs/supermin.d/zz-packages-dib +%endif + %if !0%{?rhel} %files forensics %{_libdir}/guestfs/supermin.d/zz-packages-forensics @@ -1105,6 +975,8 @@ rm ocaml/html/.gitignore %files rescue %{_libdir}/guestfs/supermin.d/zz-packages-rescue +%{_bindir}/virt-rescue +%{_mandir}/man1/virt-rescue.1* %if !0%{?rhel} %files ufs @@ -1126,93 +998,17 @@ rm ocaml/html/.gitignore # no files -%files tools-c -%doc README -%config(noreplace) %{_sysconfdir}/libguestfs-tools.conf -%{_sysconfdir}/virt-builder -%dir %{_sysconfdir}/xdg/virt-builder -%dir %{_sysconfdir}/xdg/virt-builder/repos.d -%config %{_sysconfdir}/xdg/virt-builder/repos.d/* -%config %{_sysconfdir}/profile.d/guestfish.sh -%{_mandir}/man5/libguestfs-tools.conf.5* -%{_bindir}/guestfish -%{_mandir}/man1/guestfish.1* -%{_bindir}/guestmount -%{_mandir}/man1/guestmount.1* -%{_bindir}/guestunmount -%{_mandir}/man1/guestunmount.1* -%{_bindir}/virt-alignment-scan -%{_mandir}/man1/virt-alignment-scan.1* -%{_bindir}/virt-builder -%{_mandir}/man1/virt-builder.1* -%{_bindir}/virt-builder-repository -%{_mandir}/man1/virt-builder-repository.1* -%{_bindir}/virt-cat -%{_mandir}/man1/virt-cat.1* -%{_bindir}/virt-copy-in -%{_mandir}/man1/virt-copy-in.1* -%{_bindir}/virt-copy-out -%{_mandir}/man1/virt-copy-out.1* -%{_bindir}/virt-customize -%{_mandir}/man1/virt-customize.1* -%{_bindir}/virt-df -%{_mandir}/man1/virt-df.1* -%{_bindir}/virt-diff -%{_mandir}/man1/virt-diff.1* -%{_bindir}/virt-edit -%{_mandir}/man1/virt-edit.1* -%{_bindir}/virt-filesystems -%{_mandir}/man1/virt-filesystems.1* -%{_bindir}/virt-format -%{_mandir}/man1/virt-format.1* -%{_bindir}/virt-get-kernel -%{_mandir}/man1/virt-get-kernel.1* -%{_bindir}/virt-index-validate -%{_mandir}/man1/virt-index-validate.1* -%{_bindir}/virt-inspector -%{_mandir}/man1/virt-inspector.1* -%{_bindir}/virt-log -%{_mandir}/man1/virt-log.1* -%{_bindir}/virt-ls -%{_mandir}/man1/virt-ls.1* -%{_bindir}/virt-make-fs -%{_mandir}/man1/virt-make-fs.1* -%{_bindir}/virt-rescue -%{_mandir}/man1/virt-rescue.1* -%{_bindir}/virt-resize -%{_mandir}/man1/virt-resize.1* -%{_bindir}/virt-sparsify -%{_mandir}/man1/virt-sparsify.1* -%{_bindir}/virt-sysprep -%{_mandir}/man1/virt-sysprep.1* -%{_bindir}/virt-tail -%{_mandir}/man1/virt-tail.1* -%{_bindir}/virt-tar-in -%{_mandir}/man1/virt-tar-in.1* -%{_bindir}/virt-tar-out -%{_mandir}/man1/virt-tar-out.1* - - -%files tools -%doc README -%{_bindir}/virt-win-reg -%{_mandir}/man1/virt-win-reg.1* - - -%files -n virt-dib -%doc COPYING README -%{_bindir}/virt-dib -%{_mandir}/man1/virt-dib.1* -%{_libdir}/guestfs/supermin.d/zz-packages-dib - - %files bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/guestfish %{_datadir}/bash-completion/completions/guestmount %{_datadir}/bash-completion/completions/guestunmount %{_datadir}/bash-completion/completions/libguestfs-test-tool -%{_datadir}/bash-completion/completions/virt-* +%{_datadir}/bash-completion/completions/virt-copy-in +%{_datadir}/bash-completion/completions/virt-copy-out +%{_datadir}/bash-completion/completions/virt-rescue +%{_datadir}/bash-completion/completions/virt-tar-in +%{_datadir}/bash-completion/completions/virt-tar-out %files -n ocaml-%{name} @@ -1317,6 +1113,15 @@ rm ocaml/html/.gitignore %changelog +* Tue Mar 23 2021 Richard W.M. Jones - 1:1.45.2-1 +- New upstream version 1.45.2. +- This drops the tools. Now packaged as guestfs-tools. +- guestfish, guestmount, guestunmount now packaged with libguestfs. +- virt-rescue now packaged in libguestfs-rescue. +- Drop ChangeLog file. +- Remove virt-dib in RHEL 9. +- Depend on PCRE2 instead of PCRE. + * Thu Mar 18 2021 Richard W.M. Jones - 1:1.45.1-6 - Drop dependency on perl(Sys::Virt). - Fix -cpu max and require libvirt >= 7.1.0. @@ -2132,7 +1937,6 @@ rm ocaml/html/.gitignore * Thu Jul 09 2015 Richard W.M. Jones - 1:1.29.50-1 - New upstream version 1.29.50. - - Add virt-dib. * Thu Jul 02 2015 Richard W.M. Jones - 1:1.29.49-1 diff --git a/sources b/sources index 0b47c86..e98ceae 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libguestfs-1.45.1.tar.gz) = 8a4a39908d0697bd0b1dd99348b830e500e61bde6768f8518befc025ae67ee9ac44ada8795c54cb6faa8e95049b1c14b46887372b9e0569a52e9219c4fd54d52 -SHA512 (libguestfs-1.45.1.tar.gz.sig) = e2ade5f67402b618f60bb2bf4264f23528a6cf27537091a0ccfd5bf045901eab8aa2d0b6db89edee0c9141837967f7e9f769ffd4f49bca9c950fadeb7617eb01 +SHA512 (libguestfs-1.45.2.tar.gz) = ff8a9ad7f420e2e10e0b91258d2cd12b3f00bdceed1c71b0d0b8f55b2275ce0e60c123066d66669a041400327abed6ddea7d8b0930c33f916e76a6ffe6ada8be +SHA512 (libguestfs-1.45.2.tar.gz.sig) = e4e6d58f241073338f2ae810e4eb2c7747b8889914fde3d1e67ddb447e164955a62afc1f1b7d9fba7fa208d87980ebbe81ea4fd1610db3bc3b47a09ef2dab512