SwUpdate

639 views
Skip to first unread message

Pascal FIFRE

unread,
Mar 31, 2017, 4:14:47 AM3/31/17
to swup...@googlegroups.com

Hi All,

 

I’m a new user of swupdate.

I can use swupdate to update a full or some images (uboot, rootfs) on embedded by erasing partitions.

 

I need also to upgrade some parts of user application firmware (not kernel, uboot or complete rootfs), but package not only simple files.

How can describe the update in sw-description ?

 

Best regards and thanks for your help.

 

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55

4 rue Charles Bourseul

22300 Lannion

FRANCE

www.eco-compteur.com

pascal...@eco-counter.com

 

Stefano Babic

unread,
Mar 31, 2017, 4:58:08 AM3/31/17
to Pascal FIFRE, swup...@googlegroups.com
On 31/03/2017 10:14, Pascal FIFRE wrote:
> Hi All,
>
>
>
> I’m a new user of swupdate.
>
> I can use swupdate to update a full or some images (uboot, rootfs) on
> embedded by erasing partitions.
>
>
>
> I need also to upgrade some parts of user application firmware (not
> kernel, uboot or complete rootfs), but package not only simple files.
>
> How can describe the update in sw-description ?

Use tarball and the "archive" handler - check howto in the documentation.

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Pascal FIFRE

unread,
Mar 31, 2017, 7:58:33 AM3/31/17
to Stefano Babic, swup...@googlegroups.com
Thanks a lot Stepfano.

I will get a look on "archive" handler to do that.


Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Stefano Babic [mailto:sba...@denx.de]
Envoyé : vendredi 31 mars 2017 10:58
À : Pascal FIFRE <pascal...@eco-counter.com>; swup...@googlegroups.com
Objet : Re: [swupdate] SwUpdate

Pascal FIFRE

unread,
Apr 4, 2017, 8:00:09 AM4/4/17
to Stefano Babic, swup...@googlegroups.com
Hi Stepfano,

I try also to use the swupdate under Yocto.

I would like to install some applications packages to upgrade the system.

Which can I use rpm generated by Yocto ?

Best regards,

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Pascal FIFRE
Envoyé : vendredi 31 mars 2017 13:59
À : 'Stefano Babic' <sba...@denx.de>; swup...@googlegroups.com
Objet : RE: [swupdate] SwUpdate

Stefano Babic

unread,
Apr 5, 2017, 5:22:31 AM4/5/17
to Pascal FIFRE, Stefano Babic, swup...@googlegroups.com
Hi Pascal,

On 04/04/2017 14:00, Pascal FIFRE wrote:
> Hi Stepfano,
>
> I try also to use the swupdate under Yocto.
>
> I would like to install some applications packages to upgrade the system.
>
> Which can I use rpm generated by Yocto ?
>

Not sure I understand what you want to do. SWUpdate is firstly an image
updater, that means it can update your resulting rootfs after you add
some packages to your IMAGE_INSTALL.

It is a file updater, too. Anyway, there is no direct support for a
package format. If you need one, you have to write your own handler to
support it. And then, check for the "pkg" packaged.

SWUpdate supported tarball - so a way to do what I think you mind is to
extract the "data.tar.gz" file from a opkg package, and adding it to the
.swu image setting the handler as "archive".

Pascal FIFRE

unread,
Apr 5, 2017, 8:05:48 AM4/5/17
to Stefano Babic, swup...@googlegroups.com
Hi Stefano,

In fact, sometimes I need to upgrade all the rootfs with an image and sometimes only some application will be updated.
The goal is to have a process that will be capable to make some atomic upgrade, because in some case we use a cellular link where the data sent are expensive.
Then we want to upgrade only what it's needed.
I want to use the same update process to do that to simplify the uses cases and swupdate seems to be a good choice for it.

Also, I use Yocto to build the images and packages then I use the meta-swupdate to build the swu files.
It works fine for rootfs and linux images, but I have difficulties to use it for files and directories updates.
I think, I need to spend more time to look around the tarball and archive way.

Best regards
Pascal

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Stefano Babic [mailto:sba...@denx.de]
Envoyé : mercredi 5 avril 2017 11:22
À : Pascal FIFRE <pascal...@eco-counter.com>; Stefano Babic <sba...@denx.de>; swup...@googlegroups.com
Objet : Re: [swupdate] SwUpdate

Pascal FIFRE

unread,
Nov 7, 2017, 3:13:05 AM11/7/17
to Stefano Babic, swup...@googlegroups.com
Hi Stefano,

I use the swupdate under Yocto to upgrade software on embedded gateway.
It works fine with double-copy strategy (great !).

I need, now, to retrieve network configuration after an upgrade (ex: network, wifi, dns, etc.)
Then, I want to copy the network files (/etc/network/interfaces, /etc/wpa-supplicant.conf, /etc/resolv.conf, /etc/ntp.conf) to a preserved data partition before switching between versions and copy back these from data partition after switching.

Can I use shell scripts to do that ?
When I use the shell scripts, must they be presents in the first version or can they be directly integrated in the swu and used before switching ?

Best regards,

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Pascal FIFRE
Envoyé : mercredi 5 avril 2017 14:06
À : 'Stefano Babic' <sba...@denx.de>; swup...@googlegroups.com
Objet : RE: [swupdate] SwUpdate

Stefano Babic

unread,
Nov 7, 2017, 3:29:12 AM11/7/17
to Pascal FIFRE, Stefano Babic, swup...@googlegroups.com
Hi Pascal,

On 07/11/2017 09:12, Pascal FIFRE wrote:
> Hi Stefano,
>
> I use the swupdate under Yocto to upgrade software on embedded gateway.
> It works fine with double-copy strategy (great !).
>

Glad to hear this.

> I need, now, to retrieve network configuration after an upgrade (ex: network, wifi, dns, etc.)
> Then, I want to copy the network files (/etc/network/interfaces, /etc/wpa-supplicant.conf, /etc/resolv.conf, /etc/ntp.conf) to a preserved data partition before switching between versions and copy back these from data partition after switching.
>
> Can I use shell scripts to do that ?

If you just need to save the configuration in a data partition, you can
put them in a tarball and put it into the SWU image. You can add an
entry "file" to sw-description and let SWUpdate doing the rest. The
activation is done in your case after the switch.

Of course, you can also use shell scripts.

> When I use the shell scripts, must they be presents in the first version or can they be directly integrated in the swu and used before switching ?

They can be part of the SWU - one goal in SWUpdate is to let that the
update can change in the time, and you can add logic inside the SWU
itself. In this direction there is also the LUA's patches sent some days
ago.

My suggestion is to avoid to use as much as possible shell scripts and
switch to the LUA, that is a closer and safer environment. But nobody
forbids you to use shell scripts as well.

Best regards,
Stefano Babic

Pascal FIFRE

unread,
Nov 7, 2017, 5:04:50 AM11/7/17
to Stefano Babic, swup...@googlegroups.com
Thanks for your quick answer.

In fact, I can't put a tarball of configuration into the SWU image because each client configuration may be different.
Then I need to dynamically save the config before switching.

Another tricky problem comes because I don't anticipate this saving (oops!) and some products are already installed without any

OK. I take account your remark regarding the shell scripts and use LUA scripts.

Regards,

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Stefano Babic [mailto:sba...@denx.de]
Envoyé : mardi 7 novembre 2017 09:29

Pascal FIFRE

unread,
Nov 7, 2017, 5:39:02 AM11/7/17
to Stefano Babic, swup...@googlegroups.com
Hi Stefano,

Does the LUA script pre-install will run before the switching between the 2 partitions ?
In that case, I can use it to save the current configuration and copy back after.

Regards,

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Stefano Babic [mailto:sba...@denx.de]
Envoyé : mardi 7 novembre 2017 09:29

Hamish Guthrie

unread,
Nov 7, 2017, 5:56:32 AM11/7/17
to Pascal FIFRE, Stefano Babic, swup...@googlegroups.com
Hi Pascal,

> In fact, I can't put a tarball of configuration into the SWU image because each client
> configuration may be different.
> Then I need to dynamically save the config before switching.

You may want to look at a slightly different strategy and that is by using a read-only filesystem with symlinks into a data volume/partition for the configuration. This would mean that all of your changeable configuration data would be in a separate partition (maybe along with user-data if there is any for your device) which is not touched by an update. Here is a talk given which discusses why and how to do this: http://events.linuxfoundation.org/sites/events/files/slides/readonly-rootfs-elce-2016.pdf

Best Regards
Hamish Guthrie

Stefano Babic

unread,
Nov 7, 2017, 6:06:36 AM11/7/17
to Hamish Guthrie, Pascal FIFRE, Stefano Babic, swup...@googlegroups.com
Hi Hamish,
Right, thanks for remind this. Another way we discussed at Cris' talk
was using overlayfs for configuration data - it is an option, too, and
it avoids to set links

Stefano Babic

unread,
Nov 7, 2017, 6:35:09 AM11/7/17
to Pascal FIFRE, Stefano Babic, swup...@googlegroups.com
On 07/11/2017 11:38, Pascal FIFRE wrote:
> Hi Stefano,
>
> Does the LUA script pre-install will run before the switching between the 2 partitions ?

Sure. preinstall scripts run before any image is installed. Post install
scripts run after each image, including u-boot environment, has been
installed.

You can also write an embedded LUA script inside sw-description and this
runs at parser time.

> In that case, I can use it to save the current configuration and copy back after.
>

Pascal FIFRE

unread,
Nov 7, 2017, 7:35:00 AM11/7/17
to Hamish Guthrie, Stefano Babic, swup...@googlegroups.com
Hi Amish,

Thanks for your precisions on that.
Yes, it will be a more robust solution, but I need to update a gateway without this kind of feature for now.
There will be implemented in the next steps.

Best regards,

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Hamish Guthrie [mailto:Hamish....@kistler.com]
Envoyé : mardi 7 novembre 2017 11:57
À : Pascal FIFRE <pascal...@eco-counter.com>; Stefano Babic <sba...@denx.de>; swup...@googlegroups.com
Objet : RE: [swupdate] SwUpdate

Pascal FIFRE

unread,
Nov 7, 2017, 7:35:13 AM11/7/17
to Stefano Babic, swup...@googlegroups.com
Thanks stefano

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Stefano Babic [mailto:sba...@denx.de]
Envoyé : mardi 7 novembre 2017 12:35
À : Pascal FIFRE <pascal...@eco-counter.com>; Stefano Babic <sba...@denx.de>; swup...@googlegroups.com
Objet : Re: [swupdate] SwUpdate

Pascal FIFRE

unread,
Nov 7, 2017, 7:47:41 AM11/7/17
to Stefano Babic, swup...@googlegroups.com
Then my last question is :
Can I integrate the pre-install script in a swu package (which is not in the current rootfs) and run it before image install ?

Thanks a lot for your support.

Pascal FIFRE | Project Manager / R&D Engineer | ECO COMPTEUR
(+33)2 96 48 69 55
4 rue Charles Bourseul
22300 Lannion
FRANCE
www.eco-compteur.com
pascal...@eco-counter.com

-----Message d'origine-----
De : Stefano Babic [mailto:sba...@denx.de]
Envoyé : mardi 7 novembre 2017 12:35
À : Pascal FIFRE <pascal...@eco-counter.com>; Stefano Babic <sba...@denx.de>; swup...@googlegroups.com
Objet : Re: [swupdate] SwUpdate

Stefano Babic

unread,
Nov 7, 2017, 7:52:52 AM11/7/17
to Pascal FIFRE, Stefano Babic, swup...@googlegroups.com
On 07/11/2017 13:47, Pascal FIFRE wrote:
> Then my last question is :
> Can I integrate the pre-install script in a swu package (which is not in the current rootfs) and run it before image install ?

Yes, this is the normal way to do. Pre- and post- install scripts are
delivered in the SWU.


>
> Thanks a lot for your support.

You're welcome.

Bes regards,
Stefano Babic
Reply all
Reply to author
Forward
0 new messages