From c56b57264906f5d2c644dcff71d09dfb8478c81e Mon Sep 17 00:00:00 2001 From: Din Music Date: Thu, 11 Jul 2024 15:45:39 +0000 Subject: [PATCH 1/2] snapcraft/wrappers: Script to invoke virt-v2v-in-place on host Signed-off-by: Din Music --- snapcraft/wrappers/virt-v2v-in-place | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 snapcraft/wrappers/virt-v2v-in-place diff --git a/snapcraft/wrappers/virt-v2v-in-place b/snapcraft/wrappers/virt-v2v-in-place new file mode 100755 index 000000000..fa6f6a3f6 --- /dev/null +++ b/snapcraft/wrappers/virt-v2v-in-place @@ -0,0 +1,14 @@ +#!/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}" "$@" From a621f7c7e039ea8cb3cae1cfd09dc156c3ebe8b7 Mon Sep 17 00:00:00 2001 From: Din Music Date: Wed, 3 Jul 2024 09:32:10 +0000 Subject: [PATCH 2/2] snapcraft: Add command to run virt-v2v-in-place from host Signed-off-by: Din Music --- snapcraft.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snapcraft.yaml b/snapcraft.yaml index 393e4cd2c..0ab530783 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1496,6 +1496,7 @@ parts: -not -path "${CRAFT_PRIME}/bin/remote-viewer" \ -not -path "${CRAFT_PRIME}/bin/snap-query" \ -not -path "${CRAFT_PRIME}/bin/sshfs" \ + -not -path "${CRAFT_PRIME}/bin/virt-v2v-in-place" \ -not -path "${CRAFT_PRIME}/bin/xfs_admin" \ -not -path "${CRAFT_PRIME}/bin/uefivars.py" \ -exec strip -s {} + @@ -1550,3 +1551,4 @@ parts: wrappers/editor: bin/ wrappers/remote-viewer: bin/ wrappers/sshfs: bin/ + wrappers/virt-v2v-in-place: bin/