From: Jacob McNamee Date: Sun, 28 Jan 2024 20:57:24 +0000 (-0800) Subject: lxc-download, lxc-local: preserve xattrs on unpack X-Git-Tag: v6.0.0~26^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07e3a516e4fe605541d8836a73c7e2a3163e2f11;p=thirdparty%2Flxc.git lxc-download, lxc-local: preserve xattrs on unpack Update tar invocation to preserve all xattrs when unpacking the rootfs, notably retaining security.capability xattrs (e.g. for ping, newuidmap) Note: bsdtar already preserves xattrs with -p Signed-off-by: Jacob McNamee --- diff --git a/templates/lxc-download.in b/templates/lxc-download.in index c6d741c6f..75bff2427 100755 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -414,7 +414,7 @@ fi if [ "${IS_BSD_TAR}" = "true" ]; then tar ${EXCLUDES} --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" else - tar --anchored ${EXCLUDES} --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" + tar --anchored ${EXCLUDES} --numeric-owner --xattrs-include='*' -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" fi mkdir -p "${LXC_ROOTFS}/dev/pts/" diff --git a/templates/lxc-local.in b/templates/lxc-local.in index fbabd306e..673a02e15 100755 --- a/templates/lxc-local.in +++ b/templates/lxc-local.in @@ -338,7 +338,7 @@ unpack_rootfs() { echo "Excludes: ${EXCLUDES}" fi - tar --anchored ${EXCLUDES} --numeric-owner -xpJf "${LXC_FSTREE}" -C "${LXC_ROOTFS}" + tar --anchored ${EXCLUDES} --numeric-owner --xattrs-include='*' -xpJf "${LXC_FSTREE}" -C "${LXC_ROOTFS}" prepare_rootfs }