Skip to content

Commit

Permalink
Invoke virt-v2v-in-place on host (5.21-edge) (#538)
Browse files Browse the repository at this point in the history
From #510

This is required for conversion option `virtio` which failed the tests
for 5.21-edge in canonical/lxd-ci#274.
  • Loading branch information
tomponline authored Aug 29, 2024
2 parents 9075cd1 + a621f7c commit 1339e2f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,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" \
-not -path "${CRAFT_PRIME}/bin/lxcfs" \
Expand Down Expand Up @@ -1659,3 +1660,4 @@ parts:
wrappers/editor: bin/
wrappers/remote-viewer: bin/
wrappers/sshfs: bin/
wrappers/virt-v2v-in-place: bin/
14 changes: 14 additions & 0 deletions snapcraft/wrappers/virt-v2v-in-place
Original file line number Diff line number Diff line change
@@ -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}" "$@"

0 comments on commit 1339e2f

Please sign in to comment.