meta/classes/sdk.bbclass: add --transform in TAR_OPTIONS

Message ID 20230331103325.414901-1-srinuvasan_a@mentor.com
State Superseded, archived
Headers show
Series meta/classes/sdk.bbclass: add --transform in TAR_OPTIONS | expand

Commit Message

Srinuvasan Arjunan March 31, 2023, 10:33 a.m. UTC
From: Srinuvasan A <srinuvasan_a@mentor.com>

When we untar the SDK rootfs archive file, all the contents are extracted
into the current directory, not a folder, this looks ugly hence fixed
it with the file name transformations option.

Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
---
 meta/classes/sdk.bbclass | 1 +
 1 file changed, 1 insertion(+)

Comments

Srinuvasan Arjunan April 3, 2023, 10:01 a.m. UTC | #1
Hi adriaan,

                    Can you please have a look, addressed your comments.

  Thanks,
  Srinuvasan.A

On Friday, March 31, 2023 at 4:03:49 PM UTC+5:30 Srinuvasan Arjunan wrote:

From: Srinuvasan A <srinuv...@mentor.com> 

When we untar the SDK rootfs archive file, all the contents are extracted 
into the current directory, not a folder, this looks ugly hence fixed 
it with the file name transformations option. 

Signed-off-by: Srinuvasan A <srinuv...@mentor.com> 
--- 
meta/classes/sdk.bbclass | 1 + 
1 file changed, 1 insertion(+) 

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass 
index 06cae02..50f718c 100644 
--- a/meta/classes/sdk.bbclass 
+++ b/meta/classes/sdk.bbclass 
@@ -53,6 +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|.|$(basename 
${PP_DEPLOY}/${IMAGE_FULLNAME})|"" 

# bitbake dependencies 
SDKDEPENDS += "sdk-files ${SDK_INSTALL}"
Schmidt, Adriaan April 5, 2023, 10:40 a.m. UTC | #2
Hi,
Yes, looks better now. This limits the change to the SDK tarball only.
However, I did not test the result, as I don’t really use the Isar SDK Feature.
Maybe someone else can comment whether this change in the SDK tarball could have impact somewhere else.
Thanks,
Adriaan

From: isar-users@googlegroups.com <isar-users@googlegroups.com> On Behalf Of Srinuvasan Arjunan
Sent: Montag, 3. April 2023 12:01
To: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] meta/classes/sdk.bbclass: add --transform in TAR_OPTIONS

   Hi adriaan,

                    Can you please have a look, addressed your comments.

  Thanks,
  Srinuvasan.A
On Friday, March 31, 2023 at 4:03:49 PM UTC+5:30 Srinuvasan Arjunan wrote:
From: Srinuvasan A <srinuv...@mentor.com>

When we untar the SDK rootfs archive file, all the contents are extracted
into the current directory, not a folder, this looks ugly hence fixed
it with the file name transformations option.

Signed-off-by: Srinuvasan A <srinuv...@mentor.com>
---
meta/classes/sdk.bbclass | 1 +
1 file changed, 1 insertion(+)

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 06cae02..50f718c 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -53,6 +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|.|$(basename ${PP_DEPLOY}/${IMAGE_FULLNAME})|""

# bitbake dependencies
SDKDEPENDS += "sdk-files ${SDK_INSTALL}"
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com<mailto:isar-users+unsubscribe@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/06e04599-5749-418f-a162-2e3a9b019150n%40googlegroups.com<https://groups.google.com/d/msgid/isar-users/06e04599-5749-418f-a162-2e3a9b019150n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Jan Kiszka April 5, 2023, 10:57 a.m. UTC | #3
On 31.03.23 12:33, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
> 
> When we untar the SDK rootfs archive file, all the contents are extracted
> into the current directory, not a folder, this looks ugly hence fixed
> it with the file name transformations option.
> 
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> ---
>  meta/classes/sdk.bbclass | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> index 06cae02..50f718c 100644
> --- a/meta/classes/sdk.bbclass
> +++ b/meta/classes/sdk.bbclass
> @@ -53,6 +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|.|$(basename ${PP_DEPLOY}/${IMAGE_FULLNAME})|""
>  
>  # bitbake dependencies
>  SDKDEPENDS += "sdk-files ${SDK_INSTALL}"

To my understanding, this will move the content of the SDK tarball into
a subfolder. What will that name be? ${IMAGE_FULLNAME}? And isn't
$(basename ${PP_DEPLOY}/${IMAGE_FULLNAME}) the same as just
${IMAGE_FULLNAME}?

I'm fine with the relocation per se, I'm just wondering if we documented
or otherwise referred to the structure of an unpacked SDK somewhere, in
the user manual eg., and if that then also needs updating.

Jan
Srinuvasan Arjunan April 12, 2023, 1:38 p.m. UTC | #4
On Wed, Apr 5, 2023 at 4:27 PM 'Jan Kiszka' via isar-users <
isar-users@googlegroups.com> wrote:

> On 31.03.23 12:33, Srinuvasan Arjunan wrote:
> > From: Srinuvasan A <srinuvasan_a@mentor.com>
> >
> > When we untar the SDK rootfs archive file, all the contents are extracted
> > into the current directory, not a folder, this looks ugly hence fixed
> > it with the file name transformations option.
> >
> > Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> > ---
> >  meta/classes/sdk.bbclass | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> > index 06cae02..50f718c 100644
> > --- a/meta/classes/sdk.bbclass
> > +++ b/meta/classes/sdk.bbclass
> > @@ -53,6 +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|.|$(basename
> ${PP_DEPLOY}/${IMAGE_FULLNAME})|""
> >
> >  # bitbake dependencies
> >  SDKDEPENDS += "sdk-files ${SDK_INSTALL}"
>
> To my understanding, this will move the content of the SDK tarball into
> a subfolder. What will that name be? ${IMAGE_FULLNAME}? And isn't
> $(basename ${PP_DEPLOY}/${IMAGE_FULLNAME}) the same as just
> ${IMAGE_FULLNAME}?
>

    Tested, yes ${IMAGE_FULLNAME} works here instead of $(basename
${PP_DEPLOY}/${IMAGE_FULLNAME})

>
> I'm fine with the relocation per se, I'm just wondering if we documented
> or otherwise referred to the structure of an unpacked SDK somewhere, in
> the user manual eg., and if that then also needs updating.
>

     Yes we have gap in the document, will update and send next version

>
> Jan
>
> --
> Siemens AG, Technology
> Competence Center Embedded Linux
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/b460e006-136e-9c4f-311a-edfa724c32e2%40siemens.com
> .
>

Patch

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 06cae02..50f718c 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -53,6 +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|.|$(basename ${PP_DEPLOY}/${IMAGE_FULLNAME})|""
 
 # bitbake dependencies
 SDKDEPENDS += "sdk-files ${SDK_INSTALL}"