From 055c43fa60c7cefbe3baf32b21cfe8ffae09bf0f 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 Using 'virt-customize --tar-in some.tar:/dir -a disk.img' will unpack 'some.tar' into '/dir' in the guest. Note that this will not work for compressed tar files as written since the underlying guestfs_tar_in function requires the compression type to be set explicitly and defaults to no compression (it does not auto-detect or default to compression). (cherry picked from commit b5f7b0ec18e30d25342bc322e571edf17a72974f) --- common | 2 +- generator/customize.ml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/common b/common index e70d89a58..9a8ba5935 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit e70d89a58dae068be2e19c7c21558707261af96a +Subproject commit 9a8ba593511f94d59049bd920a6aee9210a2611f diff --git a/generator/customize.ml b/generator/customize.ml index c3dd259e8..e64b45c0d 100644 --- a/generator/customize.ml +++ b/generator/customize.ml @@ -510,6 +510,18 @@ You can have multiple I<--ssh-inject> options, for different users and also for more keys for each user." }; + { op_name = "tar-in"; + op_type = StringPair "TARFILE:REMOTEDIR"; + op_discrim = "`TarIn"; + op_shortdesc = "Copy local files or directories from a tarball into image"; + op_pod_longdesc = "\ +Copy local files or directories from a local tar file +called C into the disk image, placing them in the +directory C (which must exist). Note that +the tar file must be uncompressed (F<.tar.gz> files will not work +here)"; + }; + { op_name = "timezone"; op_type = String "TIMEZONE"; op_discrim = "`Timezone";