Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] testimage: get real os-release file
@ 2025-05-12 15:58 Peter Marko
  2025-05-12 22:21 ` [OE-core] " Richard Purdie
  2025-05-13  7:41 ` [OE-core][PATCH v2] " Peter Marko
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Marko @ 2025-05-12 15:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Peter Marko

From: Peter Marko <peter.marko@siemens.com>

/etc/os-release is a symlink to /usr/lib.
Symlink is retrieved as a dead link which points to nowhere if also the
original file is not accompanying it.
Fetch the real file instead of this link.

Alternative could be to use "tar -h" (supported also by busybox tar),
however that could lose some important information if links are relevant
for failure analysis.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 meta/classes-recipe/testimage.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index e090b1ef4b..862f3e53a3 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -26,7 +26,7 @@ TESTIMAGE_FAILED_QA_ARTIFACTS = "\
     ${localstatedir}/log \
     ${localstatedir}/volatile/log \
     ${sysconfdir}/version \
-    ${sysconfdir}/os-release"
+    ${nonarch_libdir}/os-release"
 
 # If some ptests are run and fail, retrieve corresponding directories
 TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/*/ptest', '', d)}"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] testimage: get real os-release file
  2025-05-12 15:58 [PATCH] testimage: get real os-release file Peter Marko
@ 2025-05-12 22:21 ` Richard Purdie
  2025-05-13  7:41   ` Marko, Peter
  2025-05-13  7:41 ` [OE-core][PATCH v2] " Peter Marko
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2025-05-12 22:21 UTC (permalink / raw)
  To: peter.marko, openembedded-core

On Mon, 2025-05-12 at 17:58 +0200, Peter Marko via lists.openembedded.org wrote:
> From: Peter Marko <peter.marko@siemens.com>
> 
> /etc/os-release is a symlink to /usr/lib.
> Symlink is retrieved as a dead link which points to nowhere if also the
> original file is not accompanying it.
> Fetch the real file instead of this link.
> 
> Alternative could be to use "tar -h" (supported also by busybox tar),
> however that could lose some important information if links are relevant
> for failure analysis.
> 
> Signed-off-by: Peter Marko <peter.marko@siemens.com>
> ---
>  meta/classes-recipe/testimage.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
> index e090b1ef4b..862f3e53a3 100644
> --- a/meta/classes-recipe/testimage.bbclass
> +++ b/meta/classes-recipe/testimage.bbclass
> @@ -26,7 +26,7 @@ TESTIMAGE_FAILED_QA_ARTIFACTS = "\
>      ${localstatedir}/log \
>      ${localstatedir}/volatile/log \
>      ${sysconfdir}/version \
> -    ${sysconfdir}/os-release"
> +    ${nonarch_libdir}/os-release"
>  
>  # If some ptests are run and fail, retrieve corresponding directories
>  TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/*/ptest', '', d)}"

The definitive location for this is ${sysconfdir} as far as I know and
I'm nervous about replacing that. We could list both? For this file,
resolving the symlink is the right thing to do but that might not be
the case for all files listed in the variable which does make this
trickier to solve...

Cheers,

RIchard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [OE-core] [PATCH] testimage: get real os-release file
  2025-05-12 22:21 ` [OE-core] " Richard Purdie
@ 2025-05-13  7:41   ` Marko, Peter
  0 siblings, 0 replies; 4+ messages in thread
From: Marko, Peter @ 2025-05-13  7:41 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core@lists.openembedded.org



> -----Original Message-----
> From: Richard Purdie <richard.purdie@linuxfoundation.org>
> Sent: Tuesday, May 13, 2025 0:21
> To: Marko, Peter (FT D EU SK BFS1) <Peter.Marko@siemens.com>;
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] testimage: get real os-release file
> 
> On Mon, 2025-05-12 at 17:58 +0200, Peter Marko via lists.openembedded.org
> wrote:
> > From: Peter Marko <peter.marko@siemens.com>
> >
> > /etc/os-release is a symlink to /usr/lib.
> > Symlink is retrieved as a dead link which points to nowhere if also the
> > original file is not accompanying it.
> > Fetch the real file instead of this link.
> >
> > Alternative could be to use "tar -h" (supported also by busybox tar),
> > however that could lose some important information if links are relevant
> > for failure analysis.
> >
> > Signed-off-by: Peter Marko <peter.marko@siemens.com>
> > ---
> >  meta/classes-recipe/testimage.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-
> recipe/testimage.bbclass
> > index e090b1ef4b..862f3e53a3 100644
> > --- a/meta/classes-recipe/testimage.bbclass
> > +++ b/meta/classes-recipe/testimage.bbclass
> > @@ -26,7 +26,7 @@ TESTIMAGE_FAILED_QA_ARTIFACTS = "\
> >      ${localstatedir}/log \
> >      ${localstatedir}/volatile/log \
> >      ${sysconfdir}/version \
> > -    ${sysconfdir}/os-release"
> > +    ${nonarch_libdir}/os-release"
> >
> >  # If some ptests are run and fail, retrieve corresponding directories
> >  TESTIMAGE_FAILED_QA_ARTIFACTS +=
> "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/*/ptest', '', d)}"
> 
> The definitive location for this is ${sysconfdir} as far as I know and
> I'm nervous about replacing that. We could list both? For this file,
> resolving the symlink is the right thing to do but that might not be
> the case for all files listed in the variable which does make this
> trickier to solve...
> 
> Cheers,
> 
> Richard

OK, I'm sending a v2 to fetch both files.
I have also tested that the3 code works when a requested file does not exist.
If someone changes where the link points to, this variable will need to be adapted in such layer, too.

Peter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [OE-core][PATCH v2] testimage: get real os-release file
  2025-05-12 15:58 [PATCH] testimage: get real os-release file Peter Marko
  2025-05-12 22:21 ` [OE-core] " Richard Purdie
@ 2025-05-13  7:41 ` Peter Marko
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Marko @ 2025-05-13  7:41 UTC (permalink / raw)
  To: openembedded-core; +Cc: Peter Marko

From: Peter Marko <peter.marko@siemens.com>

/etc/os-release is a symlink to /usr/lib.
Symlink is retrieved as a dead link which points to nowhere if also the
original file is not accompanying it.
Fetch the real file in addition to this link.

Alternative could be to use "tar -h" (supported also by busybox tar),
however that could lose some important information if links are relevant
for failure analysis.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 meta/classes-recipe/testimage.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index e090b1ef4b..847a6f18a8 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -26,7 +26,9 @@ TESTIMAGE_FAILED_QA_ARTIFACTS = "\
     ${localstatedir}/log \
     ${localstatedir}/volatile/log \
     ${sysconfdir}/version \
-    ${sysconfdir}/os-release"
+    ${sysconfdir}/os-release \
+    ${nonarch_libdir}/os-release \
+"
 
 # If some ptests are run and fail, retrieve corresponding directories
 TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/*/ptest', '', d)}"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-13  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12 15:58 [PATCH] testimage: get real os-release file Peter Marko
2025-05-12 22:21 ` [OE-core] " Richard Purdie
2025-05-13  7:41   ` Marko, Peter
2025-05-13  7:41 ` [OE-core][PATCH v2] " Peter Marko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox