[v2,2/4] overlayfs: add systemd unit path prefix to FILES:${PN} array

Message ID 20220310131329.1906537-3-ch@denx.de
State Accepted, archived
Commit d19166cbc567be0803eaf8d0a2a20f44758aae7b
Headers show
Series Patches and bugfixes for overlayfs | expand

Commit Message

Claudius Heine March 10, 2022, 1:13 p.m. UTC
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.

Signed-off-by: Claudius Heine <ch@denx.de>
---
 meta/classes/overlayfs.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/overlayfs.bbclass b/meta/classes/overlayfs.bbclass
index 4a860f7308..25e30aee83 100644
--- a/meta/classes/overlayfs.bbclass
+++ b/meta/classes/overlayfs.bbclass
@@ -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]))
 }