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