Skip to contentSkip to conversation

os-release: fix to install in the expected location

PATCH In review Ross Burton 5 participants 9 messages Sep 4, 2018 – Sep 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 os-release: fix to install in the expected location

From: Joshua Lock <[email protected]>

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.

---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/os-release/os-release.bb +4 -3
index f9887047561..c6e36001dc5 100644
@@ -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}
 }
Signature · 1 line
2.11.0
#1 lore raw
Quoted 25 lines · Ross Burton

From: Joshua Lock <[email protected]>

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.

---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/os-release/os-release.bb +1 -1
index f9887047561..c6e36001dc5 100644
@@ -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"
 

meta/recipes-core/os-release/os-release.bb python do_compile () { · line 47

Quoted 8 lines
meta/recipes-core/os-release/os-release.bb +3 -2
@@ -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.

Quoted 9 lines
meta/recipes-core/os-release/os-release.bb +0 -1
 }
--

2.11.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 26 lines · Andre McCurdy
Quoted 24 lines · Ross Burton

From: Joshua Lock <[email protected]>

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.

---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/os-release/os-release.bb +1 -1
index f9887047561..c6e36001dc5 100644
@@ -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"
 
Quoted 8 lines

meta/recipes-core/os-release/os-release.bb python do_compile () { · line 46

Quoted 8 lines
meta/recipes-core/os-release/os-release.bb +2 -2
@@ -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 ...

Quoted 20 lines

meta/recipes-core/os-release/os-release.bb python do_compile () { · line 47

Quoted 1 line
meta/recipes-core/os-release/os-release.bb +1 -0
+    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.

Quoted 9 lines
meta/recipes-core/os-release/os-release.bb +0 -1
 }
--

2.11.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
In reply to Andre McCurdy
Quoted 33 lines · Andre McCurdy
Quoted 31 lines · Ross Burton

From: Joshua Lock <[email protected]>

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.

---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/os-release/os-release.bb +0 -1
index f9887047561..c6e36001dc5 100644
@@ -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"

meta/recipes-core/os-release/os-release.bb +0 -0
@@ -42,6 +42,7 @@ python do_compile () {
 do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
 
Quoted 10 lines

meta/recipes-core/os-release/os-release.bb python do_compile () { · line 47

Quoted 6 lines
meta/recipes-core/os-release/os-release.bb +3 -2
 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

#4 lore raw
Quoted 45 lines · Richard Purdie
Quoted 33 lines · Andre McCurdy
Quoted 31 lines · Ross Burton

From: Joshua Lock <[email protected]>

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.

---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/os-release/os-release.bb +0 -1
index f9887047561..c6e36001dc5 100644
@@ -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"

meta/recipes-core/os-release/os-release.bb +0 -0
@@ -42,6 +42,7 @@ python do_compile () {
 do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
 
Quoted 10 lines

meta/recipes-core/os-release/os-release.bb python do_compile () { · line 47

Quoted 6 lines
meta/recipes-core/os-release/os-release.bb +3 -2
 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.

Quoted 1 line

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.

#5 lore raw
Quoted 12 lines · Andre McCurdy
Quoted 10 lines · Richard Purdie
Quoted 8 lines · Andre McCurdy

On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <[email protected] 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.

Quoted 5 lines
Quoted 1 line

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

#6 lore raw
Quoted 15 lines · On Wed, Sep 5, 2018 at 1:47 AM, <[email protected]> wrote:
Quoted 14 lines · Andre McCurdy
Quoted 11 lines · Richard Purdie
Quoted 8 lines · Andre McCurdy

On Tue, Sep 4, 2018 at 8:50 AM, Ross Burton <[email protected] 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?

Quoted 7 lines
Quoted 3 lines

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.

#7 lore raw
In reply to Andre McCurdy
Quoted 28 lines · Andre McCurdy
Quoted 27 lines · Ross Burton

From: Joshua Lock <[email protected]>

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.

---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/os-release/os-release.bb +1 -1
index f9887047561..c6e36001dc5 100644
@@ -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}"
 
Quoted 10 lines

meta/recipes-core/os-release/os-release.bb python do_compile () { · line 47

Quoted 6 lines
meta/recipes-core/os-release/os-release.bb +3 -2
 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?

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#8 lore raw
In reply to Ross Burton
Quoted 26 lines · Ross Burton

From: Joshua Lock <[email protected]>

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.

---
 meta/recipes-core/os-release/os-release.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/os-release/os-release.bb +1 -1
index f9887047561..c6e36001dc5 100644
@@ -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"
 

meta/recipes-core/os-release/os-release.bb python do_compile () { · line 48

Quoted 9 lines
meta/recipes-core/os-release/os-release.bb +3 -2
@@ -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