skipped update and reboot

359 views
Skip to first unread message

Nico Orlando

unread,
Sep 13, 2022, 9:37:57 AM9/13/22
to swupdate
Hello,

I am developing an update that also uses the sw-versions. What I am looking for is an implementation that if the version of the update has already been installed on the board, then the board should not be restarted after the update. If, on the other hand, the version of the update that I want to install has not been installed on the board then after update I want to restart the card.

Do you know a way to implement such a situation with Swupdate?

Regards,
N

esad ergül

unread,
Sep 14, 2022, 9:37:28 AM9/14/22
to swupdate
Hi Orlando,

if you look at the documentation you will see that swupdate is able to check the software version before installation.
As it can be seen below, swupdate can check the version of a sub-image or the version of the whole swu-image.





Swupdate will reject the installation and not execute the postinstall command "reboot" if you use the version tag from sw-description 
to compare the version of the update image and the version of the installed image. (whole swu-image)

# sw-description-template
software = {
    version = "1.2.3";

     ........................
    images: ({
         ................
         install-if-different = true;
    ................
};

# run swupdate with -R command
# you can also use the swupdate.cfg file to pass the argument (no-reinstalling) to swupdate.
$ swupdate -R 1.2.3 -i demo.swu ..... -p reboot

.......................................................
[ERROR] : SWUPDATE failed [0] ERROR core/parser.c : parse : 243 : No reinstalling allowed: new version 1.2.3 == installed 1.2.3
[ERROR] : SWUPDATE failed [0] ERROR core/stream_interface.c : extract_files : 165 : Compatible SW not found
[ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...

..................

Best regards
Esad Ergül

esad ergül

unread,
Sep 14, 2022, 9:59:33 AM9/14/22
to swupdate
Hi,

I have to correct one thing. 

installed-if-different tag is not needed here if you want to check the version of entire swu image. 

installed-if-different tag is used to check the version of a sub-image. At this point you should also define name and version tags under each sub-image,
 if you want to check their installed versions.  

Best regards
Esad Ergül
Reply all
Reply to author
Forward
0 new messages