public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Quirin Gylstorff <Quirin.Gylstorff@siemens.com>
To: jan.kiszka@siemens.com, srinuvasan_a@mentor.com,
	isar-users@googlegroups.com, amikan@ilbers.de,
	adriaan.schmidt@siemens.com, florian.bezdeka@siemens.com
Subject: [PATCH] classes/imagetypes: Fix image tarball by removing first level directory
Date: Tue, 26 Sep 2023 18:21:54 +0200	[thread overview]
Message-ID: <20230926162154.2346564-1-Quirin.Gylstorff@siemens.com> (raw)

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Commit be7f0f('meta/classes/sdk.bbclass: add --transform in TAR_OPTIONS')
broke the usage of rootfs tarballs directly, e.g. as NFS root in LAVA,
by adding rootfs as the first level directory.

The patch adds the variable TAR_TRANSFORM to adjust the tarball structure
as necessary. The default replaces `rootfs` with `.` which restores the old
layout in the tarball.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 meta/classes/imagetypes.bbclass | 4 ++--
 meta/classes/sdk.bbclass        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/imagetypes.bbclass b/meta/classes/imagetypes.bbclass
index 6b612386..a3be0a1d 100644
--- a/meta/classes/imagetypes.bbclass
+++ b/meta/classes/imagetypes.bbclass
@@ -5,8 +5,8 @@
 
 #image type: tar
 IMAGER_INSTALL:tar = "tar"
-TAR_OPTIONS ?= ""
-
+TAR_TRANSFORM = "--transform='s|rootfs|.|'"
+TAR_OPTIONS:append = " ${TAR_TRANSFORM}"
 IMAGE_CMD:tar() {
     ${SUDO_CHROOT} tar ${TAR_OPTIONS} -cvSf \
                  ${IMAGE_FILE_CHROOT} --one-file-system -C ${PP} rootfs
diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 3d650a18..216213ac 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -53,7 +53,7 @@ ROOTFS_MANIFEST_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}"
 ROOTFS_DPKGSTATUS_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}"
 
 IMAGE_FSTYPES:class-sdk = "${SDK_FORMATS}"
-TAR_OPTIONS:append:class-sdk = " --transform="s|rootfs|${IMAGE_FULLNAME}|""
+TAR_TRANSFORM:class-sdk = " --transform='s|rootfs|${IMAGE_FULLNAME}|'"
 
 # bitbake dependencies
 SDKDEPENDS += "sdk-files ${SDK_INSTALL}"
-- 
2.40.1


             reply	other threads:[~2023-09-26 16:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 16:21 Quirin Gylstorff [this message]
2023-09-29  6:45 ` Uladzimir Bely

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=20230926162154.2346564-1-Quirin.Gylstorff@siemens.com \
    --to=quirin.gylstorff@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=florian.bezdeka@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=srinuvasan_a@mentor.com \
    /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