diff mbox series

[meta-swupdate] swupdate: fix RDEPENDS, swupdate-usb depends on swupdate-progress

Message ID 20230301111813.1056090-1-sean@geanix.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series [meta-swupdate] swupdate: fix RDEPENDS, swupdate-usb depends on swupdate-progress | expand

Commit Message

Sean Nyekjaer March 1, 2023, 11:18 a.m. UTC
If only swupdate-usb (and swupdate) is installed we are missing the
swupdate-progress package. This results in the following error:
Failed to start swupdate-usb@sda1.service: Unit
swupdate-progress.service not found.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
 recipes-support/swupdate/swupdate.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic March 1, 2023, 12:46 p.m. UTC | #1
Hi Sean,

On 01.03.23 12:18, Sean Nyekjaer wrote:
> If only swupdate-usb (and swupdate) is installed we are missing the
> swupdate-progress package. This results in the following error:
> Failed to start swupdate-usb@sda1.service: Unit
> swupdate-progress.service not found.
> 
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
> ---
>   recipes-support/swupdate/swupdate.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
> index faaf03d..0cac25e 100644
> --- a/recipes-support/swupdate/swupdate.inc
> +++ b/recipes-support/swupdate/swupdate.inc
> @@ -81,7 +81,7 @@ FILES:${PN}-www = " \
>       ${wwwdir}/* \
>   "
>   
> -RDEPENDS:${PN}-usb += "${PN}-client"
> +RDEPENDS:${PN}-usb += "${PN}-client ${PN}-progress"
>   

It does not seem the right fix. The USB Service checks for a USB stick 
and sends a SWU via swupdate-client to SWupdate. That means, just 
swupdate and swupdate-client are strictly required.

swupdate-progress is optional, and everybody can decide if add 
swupdate-progress to own image. It looks to me better to remove 
swupdate-progress.service from the USB service.

>   # The tools package is deprecated, it is an empty meta package for backward compatibility
>   RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \

Best regards,
Stefano Babic
Sean Nyekjaer March 1, 2023, 12:56 p.m. UTC | #2
Hi Stefano,

> On 1 Mar 2023, at 13.46, Stefano Babic <sbabic@denx.de> wrote:
> 
> Hi Sean,
> 
> On 01.03.23 12:18, Sean Nyekjaer wrote:
>> If only swupdate-usb (and swupdate) is installed we are missing the
>> swupdate-progress package. This results in the following error:
>> Failed to start swupdate-usb@sda1.service: Unit
>> swupdate-progress.service not found.
>> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
>> ---
>>  recipes-support/swupdate/swupdate.inc | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
>> index faaf03d..0cac25e 100644
>> --- a/recipes-support/swupdate/swupdate.inc
>> +++ b/recipes-support/swupdate/swupdate.inc
>> @@ -81,7 +81,7 @@ FILES:${PN}-www = " \
>>      ${wwwdir}/* \
>>  "
>>  -RDEPENDS:${PN}-usb += "${PN}-client"
>> +RDEPENDS:${PN}-usb += "${PN}-client ${PN}-progress"
>>  
> 
> It does not seem the right fix. The USB Service checks for a USB stick and sends a SWU via swupdate-client to SWupdate. That means, just swupdate and swupdate-client are strictly required.
> 
> swupdate-progress is optional, and everybody can decide if add swupdate-progress to own image. It looks to me better to remove swupdate-progress.service from the USB service.

swupdate-progress is not optional as the swupdate-usb@.service requires swupdate-progress.service

$ cat recipes-support/swupdate/swupdate/swupdate-usb@.service
[Unit]
Description=usb media swupdate service
Requires=swupdate.service
Requires=swupdate-progress.service

[Service]
ExecStartPre=/bin/mkdir -p /tmp/%I
ExecStartPre=/bin/mount /dev/%I /tmp/%I
ExecStart=/bin/sh -c "swupdate-client -v /tmp/%I/*.swu"
ExecStopPost=/bin/umount /tmp/%I
ExecStopPost=/bin/rmdir /tmp/%I

Maybe we should change that Requires to a Wants instead?

> 
>>  # The tools package is deprecated, it is an empty meta package for backward compatibility
>>  RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \
> 
> Best regards,
> Stefano Babic
> 
> -- 
> =====================================================================
> DENX Software Engineering GmbH,        Managing Director: Erika Unter
> HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
> =====================================================================

/Sean
Stefano Babic March 1, 2023, 1:03 p.m. UTC | #3
On 01.03.23 13:56, Sean Nyekjær wrote:
> Hi Stefano,
> 
>> On 1 Mar 2023, at 13.46, Stefano Babic <sbabic@denx.de> wrote:
>>
>> Hi Sean,
>>
>> On 01.03.23 12:18, Sean Nyekjaer wrote:
>>> If only swupdate-usb (and swupdate) is installed we are missing the
>>> swupdate-progress package. This results in the following error:
>>> Failed to start swupdate-usb@sda1.service: Unit
>>> swupdate-progress.service not found.
>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
>>> ---
>>>   recipes-support/swupdate/swupdate.inc | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
>>> index faaf03d..0cac25e 100644
>>> --- a/recipes-support/swupdate/swupdate.inc
>>> +++ b/recipes-support/swupdate/swupdate.inc
>>> @@ -81,7 +81,7 @@ FILES:${PN}-www = " \
>>>       ${wwwdir}/* \
>>>   "
>>>   -RDEPENDS:${PN}-usb += "${PN}-client"
>>> +RDEPENDS:${PN}-usb += "${PN}-client ${PN}-progress"
>>>   
>>
>> It does not seem the right fix. The USB Service checks for a USB stick and sends a SWU via swupdate-client to SWupdate. That means, just swupdate and swupdate-client are strictly required.
>>
>> swupdate-progress is optional, and everybody can decide if add swupdate-progress to own image. It looks to me better to remove swupdate-progress.service from the USB service.
> 
> swupdate-progress is not optional as the swupdate-usb@.service requires swupdate-progress.service
> 

And I wrote to remove the Requires from service instead of forcing to be 
installed.


> $ cat recipes-support/swupdate/swupdate/swupdate-usb@.service
> [Unit]
> Description=usb media swupdate service
> Requires=swupdate.service
> Requires=swupdate-progress.service

        ^-- drop this to fix it


> 
> [Service]
> ExecStartPre=/bin/mkdir -p /tmp/%I
> ExecStartPre=/bin/mount /dev/%I /tmp/%I
> ExecStart=/bin/sh -c "swupdate-client -v /tmp/%I/*.swu"
> ExecStopPost=/bin/umount /tmp/%I
> ExecStopPost=/bin/rmdir /tmp/%I
> 
> Maybe we should change that Requires to a Wants instead?

Right - nevertheless, progress has its own service. To run an automatic 
update via USB, the progress is not strictly required and can be removed.

Best regards,
Stefano Babic

> 
>>
>>>   # The tools package is deprecated, it is an empty meta package for backward compatibility
>>>   RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \
>>
>> Best regards,
>> Stefano Babic
>>
>> -- 
>> =====================================================================
>> DENX Software Engineering GmbH,        Managing Director: Erika Unter
>> HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
>> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
>> =====================================================================
> 
> /Sean
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index faaf03d..0cac25e 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -81,7 +81,7 @@  FILES:${PN}-www = " \
     ${wwwdir}/* \
 "
 
-RDEPENDS:${PN}-usb += "${PN}-client"
+RDEPENDS:${PN}-usb += "${PN}-client ${PN}-progress"
 
 # The tools package is deprecated, it is an empty meta package for backward compatibility
 RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \