diff mbox series

[v14,02/11] image_types.bbclass: override tar with tar-native

Message ID 20231015145749.69995-2-p.lobacz@welotec.com
State New
Headers show
Series [v14,01/11] package.bbclass: override tar with tar-native | expand

Commit Message

Piotr Łobacz Oct. 15, 2023, 2:57 p.m. UTC
Due to the bugs https://savannah.gnu.org/bugs/?61934 and
https://savannah.gnu.org/bugs/?59184, which are fixed in
tar version 1.35, we need to force yocto to use it instead
of the one provided by the host machine.

IMAGE_CMD_TAR will use the tar provided by tar recipe, which
is already in proper version.

Signed-off-by: Piotr Łobacz <p.lobacz@welotec.com>
---
 meta/classes-recipe/image_types.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/image_types.bbclass b/meta/classes-recipe/image_types.bbclass
index 4aed64e27f..c50bcf673d 100644
--- a/meta/classes-recipe/image_types.bbclass
+++ b/meta/classes-recipe/image_types.bbclass
@@ -385,5 +385,9 @@  DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
 # images that will not be built at do_rootfs time: vmdk, vhd, vhdx, vdi, qcow2, hddimg, iso, etc.
 IMAGE_TYPES_MASKED ?= ""
 
+# Minimal tar version 1.35 is needed as it has fixed bugs for storing ACL entries in textual representation
+# and is able to extract files with xattrs that are read-only; this needs to work only if acl or xattr are turned on
+DEPENDS:append = " ${@bb.utils.contains_any('DISTRO_FEATURES', 'acl xattr', 'tar-replacement-native', '', d)}"
 # bmap requires python3 to be in the PATH
-EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('.bmap') else ''}"
+# IMAGE_CMD_TAR requires tar to be in the PATH
+EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('.bmap') else ''} ${@bb.utils.contains_any('DISTRO_FEATURES', 'acl xattr', 'tar-native', '', d)}"