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