From 1e97f3bb9e82560461862327b331b8451777fa3d Mon Sep 17 00:00:00 2001 From: Din Music Date: Thu, 11 Jul 2024 15:40:17 +0000 Subject: [PATCH] attempt to add virt-customize Signed-off-by: Din Music --- snapcraft.yaml | 9 +++++++++ snapcraft/commands/virt-v2v-in-place | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 snapcraft/commands/virt-v2v-in-place diff --git a/snapcraft.yaml b/snapcraft.yaml index 8e619c24f..3e7d30a32 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1056,6 +1056,15 @@ parts: - bin/tar2sqfs - lib/libsquashfs.so* + virt-customize: + plugin: nil + stage-packages: + - libguestfs-tools + organize: + usr/bin/: bin/ + prime: + - bin/virt-customize + virtiofsd: source: https://gitlab.com/virtio-fs/virtiofsd source-depth: 1 diff --git a/snapcraft/commands/virt-v2v-in-place b/snapcraft/commands/virt-v2v-in-place new file mode 100755 index 000000000..49c58c995 --- /dev/null +++ b/snapcraft/commands/virt-v2v-in-place @@ -0,0 +1,13 @@ +#!/bin/sh + +CMD="virt-v2v-in-place" + +unset XDG_RUNTIME_DIR +unset LD_LIBRARY_PATH +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +if [ "$(id -u)" = "0" ]; then + exec nsenter -t 1 -m "${CMD}" "$@" +fi + +exec unshare -U -r --root="/var/lib/snapd/hostfs/" "${CMD}" "$@"