Skip to content

Commit a8a1ab6

Browse files
authored
Invoke virt-v2v-in-place on host (#510)
This is required for virt-v2v-in-place to be invoked on the host. Requires: canonical/lxd#13748
2 parents f766c11 + 6cfe31e commit a8a1ab6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

snapcraft.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,7 @@ parts:
15041504
-not -path "${CRAFT_PRIME}/bin/remote-viewer" \
15051505
-not -path "${CRAFT_PRIME}/bin/snap-query" \
15061506
-not -path "${CRAFT_PRIME}/bin/sshfs" \
1507+
-not -path "${CRAFT_PRIME}/bin/virt-v2v-in-place" \
15071508
-not -path "${CRAFT_PRIME}/bin/xfs_admin" \
15081509
-not -path "${CRAFT_PRIME}/bin/uefivars.py" \
15091510
-not -path "${CRAFT_PRIME}/bin/lxcfs" \
@@ -1562,3 +1563,4 @@ parts:
15621563
wrappers/editor: bin/
15631564
wrappers/remote-viewer: bin/
15641565
wrappers/sshfs: bin/
1566+
wrappers/virt-v2v-in-place: bin/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
CMD="virt-v2v-in-place"
4+
5+
unset XDG_RUNTIME_DIR
6+
unset LD_LIBRARY_PATH
7+
8+
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
9+
10+
if [ "$(id -u)" = "0" ]; then
11+
exec nsenter -t 1 -m "${CMD}" "$@"
12+
fi
13+
14+
exec unshare -U -r --root="/var/lib/snapd/hostfs/" "${CMD}" "$@"

0 commit comments

Comments
 (0)