From e60f8c55c90ae9352716bbe7e56ae0dbfcbc8e0f Mon Sep 17 00:00:00 2001 From: Din Music Date: Thu, 11 Jul 2024 15:45:39 +0000 Subject: [PATCH] snapcraft/wrappers: Script to invoke virt-v2v-in-place on host Signed-off-by: Din Music --- snapcraft/wrappers/virt-v2v-in-place | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 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 100644 index 000000000..49c58c995 --- /dev/null +++ b/snapcraft/wrappers/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}" "$@"