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

Message ID 20230331084952.414690-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, 8:49 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 | 2 ++
 1 file changed, 2 insertions(+)

Comments

Schmidt, Adriaan March 31, 2023, 9:06 a.m. UTC | #1
Srinuvasan Arjunan, Freitag, 31. März 2023 10:50:
> 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 | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> index 06cae02..56b650a 100644
> --- a/meta/classes/sdk.bbclass
> +++ b/meta/classes/sdk.bbclass
> @@ -11,6 +11,8 @@ inherit crossvars
>  BBCLASSEXTEND = "sdk"
>  BPN = "${PN}"
> 
> +TAR_OPTIONS = "--transform="s|.|$(basename ${PP_DEPLOY}/${IMAGE_FULLNAME})|""
> +

Hi Arjunan,

this will change the tar options globally for all images, not only the SDKs.
You probably want to:
TAR_OPTIONS:class-sdk = "..."

Or even:
TAR_OPTIONS:append:class-sdk = " ..."
                                ^- important space here

The latter would allow other options to be set via configs.

Regards,
Adriaan

>  python sdk_virtclass_handler() {
>      pn = e.data.getVar('PN')
>      if pn.endswith('-sdk'):
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/20230331084952.414690-1-
> srinuvasan_a%40mentor.com.

Patch

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 06cae02..56b650a 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -11,6 +11,8 @@  inherit crossvars
 BBCLASSEXTEND = "sdk"
 BPN = "${PN}"
 
+TAR_OPTIONS = "--transform="s|.|$(basename ${PP_DEPLOY}/${IMAGE_FULLNAME})|""
+
 python sdk_virtclass_handler() {
     pn = e.data.getVar('PN')
     if pn.endswith('-sdk'):