Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "S. Lockwood-Childs" <sjl@vctlabs.com>
To: openembedded-core@lists.openembedded.org
Subject: [gatesgarth][PATCH] image_types.bbclass: tar: support EXTRA_IMGAGECMD
Date: Wed, 14 Apr 2021 19:32:08 -0700	[thread overview]
Message-ID: <20210415023208.GQ1189447@codepurple> (raw)

The primary motivation for making tar image options configurable
is to provide choice on a per-machine basis between gnu and posix
formats. Neither one is suitable for all use cases.
* gnu isn't compatible when xattrs are required
* posix can cause locale headaches
  https://groups.google.com/g/swupdate/c/zUOSqmkk7cA

One could say "just fix your image installer" but it's nice to be able
to still produce images that currently-deployed systems can handle,
for instance to make update packages to update your updater :)

Default is still posix format, so current behavior is unchanged
unless EXTRA_IMAGECMD_tar is customized.

Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
---
 meta/classes/image_types.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 30951ae366..c0dca351d5 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -110,7 +110,7 @@ IMAGE_CMD_squashfs-lz4 = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAM
 
 IMAGE_CMD_TAR ?= "tar"
 # ignore return code 1 "file changed as we read it" as other tasks(e.g. do_image_wic) may be hardlinking rootfs
-IMAGE_CMD_tar = "${IMAGE_CMD_TAR} --sort=name --format=posix --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.tar -C ${IMAGE_ROOTFS} . || [ $? -eq 1 ]"
+IMAGE_CMD_tar = "${IMAGE_CMD_TAR} --sort=name --numeric-owner ${EXTRA_IMAGECMD} -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.tar -C ${IMAGE_ROOTFS} . || [ $? -eq 1 ]"
 
 do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
 IMAGE_CMD_cpio () {
@@ -228,6 +228,9 @@ EXTRA_IMAGECMD_ext4 ?= "-i 4096"
 EXTRA_IMAGECMD_btrfs ?= "-n 4096"
 EXTRA_IMAGECMD_f2fs ?= ""
 
+# Customize tar format if needed, since gnu and posix have different drawbacks
+EXTRA_IMAGECMD_tar ?= "--format=posix"
+
 do_image_cpio[depends] += "cpio-native:do_populate_sysroot"
 do_image_jffs2[depends] += "mtd-utils-native:do_populate_sysroot"
 do_image_cramfs[depends] += "util-linux-native:do_populate_sysroot"
-- 
2.20.1


             reply	other threads:[~2021-04-15  2:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  2:32 S. Lockwood-Childs [this message]
2021-04-15  2:37 ` [OE-core] [gatesgarth][PATCH] image_types.bbclass: tar: support EXTRA_IMGAGECMD Anuj Mittal
2021-04-15  2:59 ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210415023208.GQ1189447@codepurple \
    --to=sjl@vctlabs.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox