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

Message ID 20220309142946.3028564-1-ch@denx.de
State Accepted, archived
Commit d19166cbc567be0803eaf8d0a2a20f44758aae7b
Headers show
Series overlayfs: add systemd unit path prefix to FILES:${PN} array | expand

Commit Message

Claudius Heine March 9, 2022, 2:29 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(-)

Comments

Richard Purdie March 10, 2022, 10:11 a.m. UTC | #1
On Wed, 2022-03-09 at 15:29 +0100, Claudius Heine wrote:
> 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(-)
> 
> diff --git a/meta/classes/overlayfs.bbclass b/meta/classes/overlayfs.bbclass
> index 4a860f7308..f525ea6625 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]))
>  }

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
Claudius Heine March 10, 2022, 10:37 a.m. UTC | #2
Hi Richard,

On 2022-03-10 11:11, Richard Purdie wrote:
> On Wed, 2022-03-09 at 15:29 +0100, Claudius Heine wrote:
>> 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(-)
>>
>> diff --git a/meta/classes/overlayfs.bbclass b/meta/classes/overlayfs.bbclass
>> index 4a860f7308..f525ea6625 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]))
>>   }
> 
> 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.

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

regards,
Claudius

Patch

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