]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix lxc-oci template with loop backingstore 3376/head
authorToni Ylenius <toni.ylenius@iki.fi>
Sun, 12 Apr 2020 19:28:24 +0000 (22:28 +0300)
committerToni Ylenius <toni.ylenius@iki.fi>
Sun, 12 Apr 2020 19:31:30 +0000 (22:31 +0300)
Move the content of rootfs inside OCI package to rootfs instead of
replacing it, as the directory is used as the mountpoint.

Tested with directory and loop backingstore.

Signed-off-by: Toni Ylenius <toni.ylenius@iki.fi>
templates/lxc-oci.in

index 8017c38c1ee548f50ba45515d2139580ca9510ee..dab077191b106781b31aacb5c190777f2004fd1d 100644 (file)
@@ -348,8 +348,7 @@ fi
 # shellcheck disable=SC2039
 # shellcheck disable=SC2068
 umoci --log=error unpack ${umoci_args[@]} --image "${DOWNLOAD_TEMP}:latest" "${LXC_ROOTFS}.tmp"
-rmdir "${LXC_ROOTFS}"
-mv "${LXC_ROOTFS}.tmp/rootfs" "${LXC_ROOTFS}"
+find "${LXC_ROOTFS}.tmp/rootfs" -mindepth 1 -maxdepth 1 -exec mv '{}' "${LXC_ROOTFS}/" \;
 
 OCI_CONF_FILE=$(getconfigpath "${DOWNLOAD_TEMP}" latest)
 LXC_CONF_FILE="${LXC_PATH}/config"