All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] os-release: fix to install in the expected location
@ 2018-09-04 15:50 Ross Burton
  2018-09-04 20:19 ` Andre McCurdy
  2018-09-04 23:00 ` Khem Raj
  0 siblings, 2 replies; 9+ messages in thread
From: Ross Burton @ 2018-09-04 15:50 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Lock

From: Joshua Lock <joshua.g.lock@intel.com>

os-release (5) recommends that the os-release file be installed in
/usr/lib/os-release and that /etc/os-release be a relative symlink to it.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
index f9887047561..c6e36001dc5 100644
--- a/meta/recipes-core/os-release/os-release.bb
+++ b/meta/recipes-core/os-release/os-release.bb
@@ -1,7 +1,7 @@
 inherit allarch
 
 SUMMARY = "Operating system identification"
-DESCRIPTION = "The /etc/os-release file contains operating system identification data."
+DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data."
 LICENSE = "MIT"
 INHIBIT_DEFAULT_DEPS = "1"
 
@@ -42,6 +42,7 @@ python do_compile () {
 do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
 
 do_install () {
-    install -d ${D}${sysconfdir}
-    install -m 0644 os-release ${D}${sysconfdir}/
+    install -d ${D}${libdir}
+    install -m 0644 os-release ${D}${libdir}/
+    lnr ${D}${libdir}/os-release ${D}${sysconfdir}
 }
-- 
2.11.0



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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-04 15:50 [PATCH] os-release: fix to install in the expected location Ross Burton
@ 2018-09-04 20:19 ` Andre McCurdy
  2018-09-04 20:46   ` Khem Raj
                     ` (2 more replies)
  2018-09-04 23:00 ` Khem Raj
  1 sibling, 3 replies; 9+ messages in thread
From: Andre McCurdy @ 2018-09-04 20:19 UTC (permalink / raw)
  To: Ross Burton; +Cc: Joshua Lock, OE Core mailing list

On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <ross.burton@intel.com> wrote:
> From: Joshua Lock <joshua.g.lock@intel.com>
>
> os-release (5) recommends that the os-release file be installed in
> /usr/lib/os-release and that /etc/os-release be a relative symlink to it.
>
> Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
>  meta/recipes-core/os-release/os-release.bb | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
> index f9887047561..c6e36001dc5 100644
> --- a/meta/recipes-core/os-release/os-release.bb
> +++ b/meta/recipes-core/os-release/os-release.bb
> @@ -1,7 +1,7 @@
>  inherit allarch
>
>  SUMMARY = "Operating system identification"
> -DESCRIPTION = "The /etc/os-release file contains operating system identification data."
> +DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data."
>  LICENSE = "MIT"
>  INHIBIT_DEFAULT_DEPS = "1"
>
> @@ -42,6 +42,7 @@ python do_compile () {
>  do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
>
>  do_install () {
> -    install -d ${D}${sysconfdir}
> -    install -m 0644 os-release ${D}${sysconfdir}/
> +    install -d ${D}${libdir}
> +    install -m 0644 os-release ${D}${libdir}/
> +    lnr ${D}${libdir}/os-release ${D}${sysconfdir}

This probably needs an "rm -f ${D}${sysconfdir}/os-release" too to
prevent problems if install is run twice as lnr doesn't handle the
case where the target already exists.

>  }
> --
> 2.11.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-04 20:19 ` Andre McCurdy
@ 2018-09-04 20:46   ` Khem Raj
  2018-09-04 22:36   ` Richard Purdie
  2018-09-05 10:31   ` Martin Jansa
  2 siblings, 0 replies; 9+ messages in thread
From: Khem Raj @ 2018-09-04 20:46 UTC (permalink / raw)
  To: Andre McCurdy
  Cc: Joshua Lock, Patches and discussions about the oe-core layer

On Tue, Sep 4, 2018 at 1:19 PM Andre McCurdy <armccurdy@gmail.com> wrote:
>
> On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <ross.burton@intel.com> wrote:
> > From: Joshua Lock <joshua.g.lock@intel.com>
> >
> > os-release (5) recommends that the os-release file be installed in
> > /usr/lib/os-release and that /etc/os-release be a relative symlink to it.
> >
> > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > Signed-off-by: Ross Burton <ross.burton@intel.com>
> > ---
> >  meta/recipes-core/os-release/os-release.bb | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
> > index f9887047561..c6e36001dc5 100644
> > --- a/meta/recipes-core/os-release/os-release.bb
> > +++ b/meta/recipes-core/os-release/os-release.bb
> > @@ -1,7 +1,7 @@
> >  inherit allarch
> >
> >  SUMMARY = "Operating system identification"
> > -DESCRIPTION = "The /etc/os-release file contains operating system identification data."
> > +DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data."
> >  LICENSE = "MIT"
> >  INHIBIT_DEFAULT_DEPS = "1"
> >
> > @@ -42,6 +42,7 @@ python do_compile () {
> >  do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
> >
> >  do_install () {
> > -    install -d ${D}${sysconfdir}
> > -    install -m 0644 os-release ${D}${sysconfdir}/
> > +    install -d ${D}${libdir}
> > +    install -m 0644 os-release ${D}${libdir}/

both install calls above could be squashed into install -D -m 0644 ...

> > +    lnr ${D}${libdir}/os-release ${D}${sysconfdir}
>
> This probably needs an "rm -f ${D}${sysconfdir}/os-release" too to
> prevent problems if install is run twice as lnr doesn't handle the
> case where the target already exists.
>
> >  }
> > --
> > 2.11.0
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-04 20:19 ` Andre McCurdy
  2018-09-04 20:46   ` Khem Raj
@ 2018-09-04 22:36   ` Richard Purdie
  2018-09-05  2:04     ` Andre McCurdy
  2018-09-05 10:31   ` Martin Jansa
  2 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2018-09-04 22:36 UTC (permalink / raw)
  To: Andre McCurdy, Ross Burton; +Cc: Joshua Lock, OE Core mailing list

On Tue, 2018-09-04 at 13:19 -0700, Andre McCurdy wrote:
> On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <ross.burton@intel.com>
> wrote:
> > From: Joshua Lock <joshua.g.lock@intel.com>
> > 
> > os-release (5) recommends that the os-release file be installed in
> > /usr/lib/os-release and that /etc/os-release be a relative symlink
> > to it.
> > 
> > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > Signed-off-by: Ross Burton <ross.burton@intel.com>
> > ---
> >  meta/recipes-core/os-release/os-release.bb | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/meta/recipes-core/os-release/os-release.bb
> > b/meta/recipes-core/os-release/os-release.bb
> > index f9887047561..c6e36001dc5 100644
> > --- a/meta/recipes-core/os-release/os-release.bb
> > +++ b/meta/recipes-core/os-release/os-release.bb
> > @@ -1,7 +1,7 @@
> >  inherit allarch
> > 
> >  SUMMARY = "Operating system identification"
> > -DESCRIPTION = "The /etc/os-release file contains operating system
> > identification data."
> > +DESCRIPTION = "The /usr/lib/os-release file contains operating
> > system identification data."
> >  LICENSE = "MIT"
> >  INHIBIT_DEFAULT_DEPS = "1"
> > 
> > @@ -42,6 +42,7 @@ python do_compile () {
> >  do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
> > 
> >  do_install () {
> > -    install -d ${D}${sysconfdir}
> > -    install -m 0644 os-release ${D}${sysconfdir}/
> > +    install -d ${D}${libdir}
> > +    install -m 0644 os-release ${D}${libdir}/
> > +    lnr ${D}${libdir}/os-release ${D}${sysconfdir}
> 
> This probably needs an "rm -f ${D}${sysconfdir}/os-release" too to
> prevent problems if install is run twice as lnr doesn't handle the
> case where the target already exists.

Doesn't do_install clean out ${D} each time it reruns though?

Cheers,

Richard


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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-04 15:50 [PATCH] os-release: fix to install in the expected location Ross Burton
  2018-09-04 20:19 ` Andre McCurdy
@ 2018-09-04 23:00 ` Khem Raj
  1 sibling, 0 replies; 9+ messages in thread
From: Khem Raj @ 2018-09-04 23:00 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Joshua Lock, Patches and discussions about the oe-core layer

On Tue, Sep 4, 2018 at 8:50 AM Ross Burton <ross.burton@intel.com> wrote:
>
> From: Joshua Lock <joshua.g.lock@intel.com>
>
> os-release (5) recommends that the os-release file be installed in
> /usr/lib/os-release and that /etc/os-release be a relative symlink to it.
>
> Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
>  meta/recipes-core/os-release/os-release.bb | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
> index f9887047561..c6e36001dc5 100644
> --- a/meta/recipes-core/os-release/os-release.bb
> +++ b/meta/recipes-core/os-release/os-release.bb
> @@ -1,7 +1,7 @@
>  inherit allarch
>
>  SUMMARY = "Operating system identification"
> -DESCRIPTION = "The /etc/os-release file contains operating system identification data."
> +DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data."
>  LICENSE = "MIT"
>  INHIBIT_DEFAULT_DEPS = "1"
>
> @@ -42,6 +42,7 @@ python do_compile () {
>  do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
>
>  do_install () {
> -    install -d ${D}${sysconfdir}
> -    install -m 0644 os-release ${D}${sysconfdir}/
> +    install -d ${D}${libdir}
> +    install -m 0644 os-release ${D}${libdir}/
> +    lnr ${D}${libdir}/os-release ${D}${sysconfdir}
>  }

I am also seeing packaging failures

ERROR: os-release-1.0-r0 do_package: QA Issue: os-release:
Files/directories were installed but not shipped in any package:
  /usr
  /usr/lib
  /usr/lib/os-release


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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-04 22:36   ` Richard Purdie
@ 2018-09-05  2:04     ` Andre McCurdy
  2018-09-05  8:47       ` richard.purdie
  0 siblings, 1 reply; 9+ messages in thread
From: Andre McCurdy @ 2018-09-05  2:04 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Joshua Lock, OE Core mailing list

On Tue, Sep 4, 2018 at 3:36 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2018-09-04 at 13:19 -0700, Andre McCurdy wrote:
>> On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <ross.burton@intel.com>
>> wrote:
>> > From: Joshua Lock <joshua.g.lock@intel.com>
>> >
>> > os-release (5) recommends that the os-release file be installed in
>> > /usr/lib/os-release and that /etc/os-release be a relative symlink
>> > to it.
>> >
>> > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
>> > Signed-off-by: Ross Burton <ross.burton@intel.com>
>> > ---
>> >  meta/recipes-core/os-release/os-release.bb | 7 ++++---
>> >  1 file changed, 4 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/meta/recipes-core/os-release/os-release.bb
>> > b/meta/recipes-core/os-release/os-release.bb
>> > index f9887047561..c6e36001dc5 100644
>> > --- a/meta/recipes-core/os-release/os-release.bb
>> > +++ b/meta/recipes-core/os-release/os-release.bb
>> > @@ -1,7 +1,7 @@
>> >  inherit allarch
>> >
>> >  SUMMARY = "Operating system identification"
>> > -DESCRIPTION = "The /etc/os-release file contains operating system
>> > identification data."
>> > +DESCRIPTION = "The /usr/lib/os-release file contains operating
>> > system identification data."
>> >  LICENSE = "MIT"
>> >  INHIBIT_DEFAULT_DEPS = "1"
>> >
>> > @@ -42,6 +42,7 @@ python do_compile () {
>> >  do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
>> >
>> >  do_install () {
>> > -    install -d ${D}${sysconfdir}
>> > -    install -m 0644 os-release ${D}${sysconfdir}/
>> > +    install -d ${D}${libdir}
>> > +    install -m 0644 os-release ${D}${libdir}/
>> > +    lnr ${D}${libdir}/os-release ${D}${sysconfdir}
>>
>> This probably needs an "rm -f ${D}${sysconfdir}/os-release" too to
>> prevent problems if install is run twice as lnr doesn't handle the
>> case where the target already exists.
>
> Doesn't do_install clean out ${D} each time it reruns though?

Yes, it does. Sometimes it's useful to rerun the run.do_install script
manually though.


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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-05  2:04     ` Andre McCurdy
@ 2018-09-05  8:47       ` richard.purdie
  2018-09-05 15:56         ` Andre McCurdy
  0 siblings, 1 reply; 9+ messages in thread
From: richard.purdie @ 2018-09-05  8:47 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Joshua Lock, OE Core mailing list

On Tue, 2018-09-04 at 19:04 -0700, Andre McCurdy wrote:
> On Tue, Sep 4, 2018 at 3:36 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Tue, 2018-09-04 at 13:19 -0700, Andre McCurdy wrote:
> > > On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <ross.burton@intel.co
> > > m>
> > > wrote:
> > > This probably needs an "rm -f ${D}${sysconfdir}/os-release" too
> > > to
> > > prevent problems if install is run twice as lnr doesn't handle
> > > the
> > > case where the target already exists.
> > 
> > Doesn't do_install clean out ${D} each time it reruns though?
> 
> Yes, it does. Sometimes it's useful to rerun the run.do_install
> script
> manually though.

We don't support that, I think its reasonable to assume that ${D} is
empty at the start of do_install. To do otherwise would mean changing a
lot of do_install functions for very little gain IMO.

Cheers,

Richard


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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-04 20:19 ` Andre McCurdy
  2018-09-04 20:46   ` Khem Raj
  2018-09-04 22:36   ` Richard Purdie
@ 2018-09-05 10:31   ` Martin Jansa
  2 siblings, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2018-09-05 10:31 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Joshua Lock, OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

On Tue, Sep 04, 2018 at 01:19:28PM -0700, Andre McCurdy wrote:
> On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <ross.burton@intel.com> wrote:
> > From: Joshua Lock <joshua.g.lock@intel.com>
> >
> > os-release (5) recommends that the os-release file be installed in
> > /usr/lib/os-release and that /etc/os-release be a relative symlink to it.
> >
> > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > Signed-off-by: Ross Burton <ross.burton@intel.com>
> > ---
> >  meta/recipes-core/os-release/os-release.bb | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
> > index f9887047561..c6e36001dc5 100644
> > --- a/meta/recipes-core/os-release/os-release.bb
> > +++ b/meta/recipes-core/os-release/os-release.bb
> > @@ -1,7 +1,7 @@
> >  inherit allarch
> >
> >  SUMMARY = "Operating system identification"
> > -DESCRIPTION = "The /etc/os-release file contains operating system identification data."
> > +DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data."
> >  LICENSE = "MIT"
> >  INHIBIT_DEFAULT_DEPS = "1"
> >
> > @@ -42,6 +42,7 @@ python do_compile () {
> >  do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
> >
> >  do_install () {
> > -    install -d ${D}${sysconfdir}
> > -    install -m 0644 os-release ${D}${sysconfdir}/
> > +    install -d ${D}${libdir}
> > +    install -m 0644 os-release ${D}${libdir}/
> > +    lnr ${D}${libdir}/os-release ${D}${sysconfdir}
> 
> This probably needs an "rm -f ${D}${sysconfdir}/os-release" too to
> prevent problems if install is run twice as lnr doesn't handle the
> case where the target already exists.

Why do we need ${D} in first place? Doesn't

ln -snf ${libdir}/os-release ${D}${sysconfdir}

solve both issues?

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

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

* Re: [PATCH] os-release: fix to install in the expected location
  2018-09-05  8:47       ` richard.purdie
@ 2018-09-05 15:56         ` Andre McCurdy
  0 siblings, 0 replies; 9+ messages in thread
From: Andre McCurdy @ 2018-09-05 15:56 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Joshua Lock, OE Core mailing list

On Wed, Sep 5, 2018 at 1:47 AM,  <richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2018-09-04 at 19:04 -0700, Andre McCurdy wrote:
>> On Tue, Sep 4, 2018 at 3:36 PM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>> > On Tue, 2018-09-04 at 13:19 -0700, Andre McCurdy wrote:
>> > > On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <ross.burton@intel.co
>> > > m>
>> > > wrote:
>> > > This probably needs an "rm -f ${D}${sysconfdir}/os-release" too
>> > > to
>> > > prevent problems if install is run twice as lnr doesn't handle
>> > > the
>> > > case where the target already exists.
>> >
>> > Doesn't do_install clean out ${D} each time it reruns though?
>>
>> Yes, it does. Sometimes it's useful to rerun the run.do_install
>> script
>> manually though.
>
> We don't support that, I think its reasonable to assume that ${D} is
> empty at the start of do_install. To do otherwise would mean changing a
> lot of do_install functions for very little gain IMO.

Most callers of lnr already explicitly remove the target first.
Ensuring new calls to lnr do the same as they are added isn't a lot of
work.


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

end of thread, other threads:[~2018-09-05 15:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 15:50 [PATCH] os-release: fix to install in the expected location Ross Burton
2018-09-04 20:19 ` Andre McCurdy
2018-09-04 20:46   ` Khem Raj
2018-09-04 22:36   ` Richard Purdie
2018-09-05  2:04     ` Andre McCurdy
2018-09-05  8:47       ` richard.purdie
2018-09-05 15:56         ` Andre McCurdy
2018-09-05 10:31   ` Martin Jansa
2018-09-04 23:00 ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.