Skip to contentSkip to conversation

overlayfs: add systemd unit path prefix to FILES:${PN} array

PATCH In review Claudius Heine 2 participants 3 messages Mar 9, 2022 – Mar 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 overlayfs: add systemd unit path prefix to FILES:${PN} array

The 'FILES:${PN}' array is missing the systemd unit dir prefix causing them to not be packaged and the build fails with the installed-vs-shipped error.

This adds the systemd_system_unitdir variable in front of every unit file added with this class.

---
 meta/classes/overlayfs.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/overlayfs.bbclass +2 -1
index 4a860f7308..f525ea6625 100644
@@ -103,7 +103,8 @@ python () {
     unitList = unitFileList(d)
     for unit in unitList:
         d.appendVar('SYSTEMD_SERVICE:' + d.getVar('PN'), ' ' + unit)
-        d.appendVar('FILES:' + d.getVar('PN'), ' ' + strForBash(unit))
+        d.appendVar('FILES:' + d.getVar('PN'), ' ' +
+		d.getVar('systemd_system_unitdir') + '/' + strForBash(unit))
 
     d.setVar('OVERLAYFS_UNIT_LIST', ' '.join([strForBash(s) for s in unitList]))
 }
Signature · 1 line
2.35.1
#1 lore raw
Quoted 17 lines · Claudius Heine

The 'FILES:${PN}' array is missing the systemd unit dir prefix causing them to not be packaged and the build fails with the installed-vs-shipped error.

This adds the systemd_system_unitdir variable in front of every unit file added with this class.

---
 meta/classes/overlayfs.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/overlayfs.bbclass +0 -0
index 4a860f7308..f525ea6625 100644

meta/classes/overlayfs.bbclass python () { · line 110

Quoted 9 lines
meta/classes/overlayfs.bbclass +2 -1
@@ -103,7 +103,8 @@ python () {
     unitList = unitFileList(d)
     for unit in unitList:
         d.appendVar('SYSTEMD_SERVICE:' + d.getVar('PN'), ' ' + unit)
-        d.appendVar('FILES:' + d.getVar('PN'), ' ' + strForBash(unit))
+        d.appendVar('FILES:' + d.getVar('PN'), ' ' +
+		d.getVar('systemd_system_unitdir') + '/' + strForBash(unit))
 
     d.setVar('OVERLAYFS_UNIT_LIST', ' '.join([strForBash(s) for s in unitList]))
 }

I have to wonder how this is being tested since this patch injects tabs into a python function and that triggers warnings about tabs in python code.

That caused selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/3227
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/3240
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/3271

I've tweaked the patch to fix the whitespace here and in the other patch but I notice more patches on the list also with what I suspect are whitespace issues.

Cheers,

Richard

#2 lore raw

Hi Richard,

Quoted 31 lines · Richard Purdie
Quoted 17 lines · Claudius Heine

The 'FILES:${PN}' array is missing the systemd unit dir prefix causing them to not be packaged and the build fails with the installed-vs-shipped error.

This adds the systemd_system_unitdir variable in front of every unit file added with this class.

---
  meta/classes/overlayfs.bbclass | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/overlayfs.bbclass +0 -0
index 4a860f7308..f525ea6625 100644

meta/classes/overlayfs.bbclass python () { · line 110

Quoted 9 lines
meta/classes/overlayfs.bbclass +2 -1
@@ -103,7 +103,8 @@ python () {
      unitList = unitFileList(d)
      for unit in unitList:
          d.appendVar('SYSTEMD_SERVICE:' + d.getVar('PN'), ' ' + unit)
-        d.appendVar('FILES:' + d.getVar('PN'), ' ' + strForBash(unit))
+        d.appendVar('FILES:' + d.getVar('PN'), ' ' +
+		d.getVar('systemd_system_unitdir') + '/' + strForBash(unit))
 
      d.setVar('OVERLAYFS_UNIT_LIST', ' '.join([strForBash(s) for s in unitList]))
  }

I have to wonder how this is being tested since this patch injects tabs into a python function and that triggers warnings about tabs in python code.

Quoted 8 lines

That caused selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/3227
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/3240
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/3271

I've tweaked the patch to fix the whitespace here and in the other patch but I notice more patches on the list also with what I suspect are whitespace issues.

Ouch, I will check my editor config. Sorry for this.

regards,
Claudius