[PATCH] doc: sw-description: acceptance of version related properties

49 views
Skip to first unread message

Dominik Schütz

unread,
Aug 20, 2026, 10:04:34 AMAug 20
to swupdate
Document that `name`, `version`, `install-if-higher`, and
`install-if-different` are also accepted for scripts in
`sw-description`. This is necessary to ensure that `emmc_boot`,
`emmc_boot_toggle`, and scripts that switch the rootfs between A and B
run only when the corresponding image has actually been flashed.

Signed-off-by: Dominik Schütz <dominik...@ropa-maschinenbau.de>
---
 doc/source/sw-description.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/source/sw-description.rst b/doc/source/sw-description.rst
index 3934994e..6933f4c7 100644
--- a/doc/source/sw-description.rst
+++ b/doc/source/sw-description.rst
@@ -1509,12 +1509,12 @@ There are 4 main sections inside sw-description:
    +-------------+----------+------------+---------------------------------------+
    | name        | string   | images     | name that identifies the sw-component |
    |             |          | files      | it can be any string and it is        |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | version     | string   | images     | version for the sw-component          |
    |             |          | files      | it can be any string and it is        |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | description | string   |            | user-friendly description of the      |
@@ -1525,12 +1525,12 @@ There are 4 main sections inside sw-description:
    +-------------+----------+------------+---------------------------------------+
    | install-if\ | bool     | images     | flag                                  |
    | -different  |          | files      | if set, name and version are          |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | install-if\ | bool     | images     | flag                                  |
    | -higher     |          | files      | if set, name and version are          |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | install-if\ | bool     | images     | flag                                  |
--
2.55.0

Stefano Babic

unread,
Aug 20, 2026, 10:13:39 AMAug 20
to Dominik Schütz, swupdate
Hi Dominik,

On 8/20/26 15:38, Dominik Schütz wrote:
> Document that `name`, `version`, `install-if-higher`, and
> `install-if-different` are also accepted for scripts in
> `sw-description`.

True

> This is necessary to ensure that `emmc_boot`,
> `emmc_boot_toggle`, and scripts that switch the rootfs between A and B
> run only when the corresponding image has actually been flashed.

But this has nothing to do. Maybe you have a use case I am not aware -
what are you meaning here ? If images must be switched must be decided
somewhere else, the script should just be skipped if toggle is not desired.

Best regards,
Stefano
>     | description | string   |            | user-friendly description
> of the      |
> @@ -1525,12 +1525,12 @@ There are 4 main sections inside sw-description:
>     +-------------+----------+------------
> +---------------------------------------+
>     | install-if\ | bool     | images     | flag
>            |
>     | -different  |          | files      | if set, name and version
> are          |
> -   |             |          |            | compared with the entries in
>          |
> +   |             |          | scripts    | compared with the entries in
>          |
>     |             |          |            | sw-versions
>           |
>     +-------------+----------+------------
> +---------------------------------------+
>     | install-if\ | bool     | images     | flag
>            |
>     | -higher     |          | files      | if set, name and version
> are          |
> -   |             |          |            | compared with the entries in
>          |
> +   |             |          | scripts    | compared with the entries in
>          |
>     |             |          |            | sw-versions
>           |
>     +-------------+----------+------------
> +---------------------------------------+
>     | install-if\ | bool     | images     | flag
>            |
> --
> 2.55.0
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> swupdate/e841d47e-98f2-43ef-9983-9a177026cc5en%40googlegroups.com
> <https://groups.google.com/d/msgid/swupdate/
> e841d47e-98f2-43ef-9983-9a177026cc5en%40googlegroups.com?
> utm_medium=email&utm_source=footer>.

--
_______________________________________________________________________
Nabla Software Engineering GmbH
Hirschstr. 111A | 86156 Augsburg | Tel: +49 821 45592596
Geschäftsführer : Stefano Babic | HRB 40522 Augsburg
E-Mail: sba...@nabladev.com

Dominik Schütz

unread,
Aug 20, 2026, 10:42:27 AMAug 20
to swupdate
Hi Stefano,

> Maybe you have a use case I am not aware -  what are you meaning here ?

Take the following sw-description as an example:
software = {
    version = "1.0";
    description = "Upgrade of U-Boot if version is newer than current version";
    images = (
        {
            name = "u-boot";
            version = "2024.04";
            description = "Image of U-Boot";
            type = "raw";
            filename = "imx-boot.xz";
            device = "/dev/swupdate/update_part/uboot";
            compressed = "xz";
            install-if-higher = true;
        }
    );

    scripts = (
        {
            name = "u-boot";
            version = "2024.04";
            description = "Switches U-Boot parition";
            type = "emmc_boot_toggle";
            device = "/dev/swupdate/device";
            install-if-higher = true;
        }
    );
}

The Links /dev/swupdate/update_part/uboot and /dev/swupdate/device will be created before swupdate is started.

Stefano Babic

unread,
Aug 20, 2026, 10:58:16 AMAug 20
to Dominik Schütz, swupdate
Hi Dominik,
This is of course allowed and plausible, but it is a special case
because you have forced the script to have the same version number than
U-Boot. Not wrong, just a way to do. The decision if U-Boot is installed
or not is done when the image is parsed, in the script is executed the
check another time to have the same result.

Same result can be done by storing in a Lua variable if image.skip by
parsing "images" and check it when scripts are parsed.

That is patch is fine, but from commit message " This is necessary to
ensure that `emmc_boot.." should be removed because is just one of the
possible way to get the result.

Best regards,
Stefano
> <https://groups.google.com/d/msgid/>
> > swupdate/e841d47e-98f2-43ef-9983-9a177026cc5en%40googlegroups.com
> <http://40googlegroups.com>
> > <https://groups.google.com/d/msgid/swupdate/ <https://
> groups.google.com/d/msgid/swupdate/>
> > e841d47e-98f2-43ef-9983-9a177026cc5en%40googlegroups.com
> <http://40googlegroups.com>?
> > utm_medium=email&utm_source=footer>.
>
> --
> _______________________________________________________________________
> Nabla Software Engineering GmbH
> Hirschstr. 111A | 86156 Augsburg | Tel: +49 821 45592596 <tel:
> +49%20821%2045592596>
> Geschäftsführer : Stefano Babic | HRB 40522 Augsburg
> E-Mail: sba...@nabladev.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> swupdate/bf66b339-304b-405e-89f8-38d77789dac5n%40googlegroups.com
> <https://groups.google.com/d/msgid/swupdate/
> bf66b339-304b-405e-89f8-38d77789dac5n%40googlegroups.com?

Dominik Schütz

unread,
Aug 20, 2026, 11:26:49 AMAug 20
to swupdate
Document that `name`, `version`, `install-if-higher`, and
`install-if-different` are also accepted for scripts in
`sw-description`.

Signed-off-by: Dominik Schütz <dominik...@ropa-maschinenbau.de>
---
v2:
- Commit message revised based on feedback from Stefano Babic.

 doc/source/sw-description.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/source/sw-description.rst b/doc/source/sw-description.rst
index 3934994e..6933f4c7 100644
--- a/doc/source/sw-description.rst
+++ b/doc/source/sw-description.rst
@@ -1509,12 +1509,12 @@ There are 4 main sections inside sw-description:
    +-------------+----------+------------+---------------------------------------+
    | name        | string   | images     | name that identifies the sw-component |
    |             |          | files      | it can be any string and it is        |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | version     | string   | images     | version for the sw-component          |

    |             |          | files      | it can be any string and it is        |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | description | string   |            | user-friendly description of the      |
@@ -1525,12 +1525,12 @@ There are 4 main sections inside sw-description:
    +-------------+----------+------------+---------------------------------------+
    | install-if\ | bool     | images     | flag                                  |
    | -different  |          | files      | if set, name and version are          |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | install-if\ | bool     | images     | flag                                  |
    | -higher     |          | files      | if set, name and version are          |
-   |             |          |            | compared with the entries in          |
+   |             |          | scripts    | compared with the entries in          |
    |             |          |            | sw-versions                           |
    +-------------+----------+------------+---------------------------------------+
    | install-if\ | bool     | images     | flag                                  |
--
2.55.0

Reply all
Reply to author
Forward
0 new messages