Skip to content

Commit

Permalink
snapcraft/wrappers: Script to invoke virt-v2v-in-place on host
Browse files Browse the repository at this point in the history
Signed-off-by: Din Music <[email protected]>
  • Loading branch information
MusicDin committed Jul 11, 2024
1 parent 803237c commit e60f8c5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions snapcraft/wrappers/virt-v2v-in-place
Original file line number Diff line number Diff line change
@@ -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}" "$@"

0 comments on commit e60f8c5

Please sign in to comment.