Can't find "images" node in sw-description

118 views
Skip to first unread message

Mohammed Billoo

unread,
Jun 1, 2022, 6:06:27 PM6/1/22
to swupdate
Hi,

The following is my sw-description file, which is very similar to the one that exists on the terminal-server branch of the meta-swupdate-boards repo (I just changed filename to the final tarball name):

software =
{
    version = "0.1.0";

    raspberrypi3 = {
        hardware-compatibility: [ "1.0"];
        stable : {
            copy1 : {
                images: (
                    {
                        filename = "terminal-server-image-raspberrypi3.ext4.gz";
                        type = "raw";
                        compressed = true;
                        device = "/dev/mmcblk0p2";
                    }
                );
                                uboot: (
                                        {
                                            name = "rpipart";
                                          value = "2";
                                        }
                );

            };
            copy2 : {
                images: (
                    {
                        filename = "terminal-server-image-raspberrypi3.ext4.gz";
                        type = "raw";
                        compressed = true;
                        device = "/dev/mmcblk0p3";
                    }
                );
                                uboot: (
                                        {
                                            name = "rpipart";
                                          value = "3";
                                        }
                );
            };
        };
    }
}

When running the resulting .swu file through swupdate's checker, I get the following error:

[ERROR] : SWUPDATE failed [0] ERROR /home/mbilloo/bowery/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/swupdate/2022.05-r0/git/parser/parser.c : parser : 966 : Found nothing to install
[DEBUG] : SWUPDATE running :  [parse_json] : Parsing config file /tmp/sw-description
[ERROR] : SWUPDATE failed [0] ERROR /home/mbilloo/bowery/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/swupdate/2022.05-r0/git/parser/parser.c : parse_json : 1057 : JSON File corrupted
[ERROR] : SWUPDATE failed [0] ERROR /home/mbilloo/bowery/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/swupdate/2022.05-r0/git/core/parser.c : parse : 164 : no parser available to parse sw-description!
[ERROR] : SWUPDATE failed [0] ERROR /home/mbilloo/bowery/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/swupdate/2022.05-r0/git/core/stream_interface.c : extract_files : 165 : Compatible SW not found

I added some additional debugging in swupdate and discovered that it's failing here (setting is NULL):

setting = find_node_and_path(p, cfg, "images", swcfg, nodes);
INFO("MAB, setting = %p", setting);

if (!setting)
        return 0;

Can anyone help me to understand what is incorrect with my sw-description file?

Thanks

Dominique MARTINET

unread,
Jun 1, 2022, 8:16:10 PM6/1/22
to Mohammed Billoo, swupdate
Mohammed Billoo wrote on Wed, Jun 01, 2022 at 03:06:26PM -0700:
> software =
> {
> version = "0.1.0";
>
> raspberrypi3 = {

You're using the syntax described to support multiple devices based on
their hwrevision, so unless /etc/hwrevision matches (should be here
"raspberrypi3 something") swupdate won't enter this block

> [ERROR] : SWUPDATE failed [0] ERROR
> /home/mbilloo/bowery/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/swupdate/2022.05-r0/git/parser/parser.c
> : parser : 966 : Found nothing to install

Note that when nothing is found to install the parser will try next
available format (here json) so it complains later the file is
corrupted, but there's (probably) nothing wrong with the file itself, it
just doesn't match system configuration

--
Dominique

Mohammed Billoo

unread,
Jun 3, 2022, 8:46:57 AM6/3/22
to Dominique MARTINET, swupdate
I believe the following invocation eliminates the need for /etc/hwrevisions: 

$> ./swupdate -H raspberrypi3:* -c -i ./update-image-raspberrypi3.swu -l6

I was able to trace the issue down to the invocation of config_lookup for the 'images' node:

[INFO ] : SWUPDATE running :  [parser] : MAB - going to call get_hw_revision
[INFO ] : SWUPDATE running :  [get_hw_revision] : MAB - boardname already set
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = 0x74306080
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = 0x743060c8
[TRACE] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = 0x74306080
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = (nil)
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = 0x74305ef8
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = (nil)
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = 0x74306080
[INFO ] : SWUPDATE running :  [find_node_and_path] : MAB found root node for 'images'
[INFO ] : SWUPDATE running :  [find_node_and_path] : MAB path_append is not NULL for 'images'
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = (nil)
[INFO ] : SWUPDATE running :  [find_node_and_path] : MAB find_root = (nil) for 'images'
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = 0x74305ef8
[INFO ] : SWUPDATE running :  [find_node_and_path] : MAB found root node for 'images'
[INFO ] : SWUPDATE running :  [find_node_and_path] : MAB path_append is not NULL for 'images'
[INFO ] : SWUPDATE running :  [find_root_libconfig] : MAB, elem = (nil)
[INFO ] : SWUPDATE running :  [find_node_and_path] : MAB find_root = (nil) for 'images'
[INFO ] : SWUPDATE running :  [parse_images] : MAB - setting = NULL


--
MAB

Pierre-Jean Texier

unread,
Jun 3, 2022, 9:05:56 AM6/3/22
to m...@mab-labs.com, swup...@googlegroups.com, dominique...@atmark-techno.com
Hi Mohammed,

Le 03/06/2022 à 14:46, Mohammed Billoo a écrit :
> I believe the following invocation eliminates the need for
> /etc/hwrevisions:
>
> $> ./swupdate -H raspberrypi3:* -c -i ./update-image-raspberrypi3.swu -l6
>

Yes indeed, but you missed to mention on which part your image must be
installed (copy1 or copy2 as described in your sw-description file).

You need to add: --e stable,copy1 or --e stable,copy2 (see [1])

Thanks,

[1] -
https://github.com/sbabic/meta-swupdate-boards/blob/terminal-server/recipes-support/swupdate/swupdate/raspberrypi3/09-swupdate-args#L3
--
Pierre-Jean Texier

Mohammed Billoo

unread,
Jun 3, 2022, 9:11:21 AM6/3/22
to Pierre-Jean Texier, swupdate, Dominique MARTINET
Hi Pierre-Jean,

Thanks! That did the trick (and saved me from going down the rabbit hole of tracing libconfig).
--
Mohammed A Billoo
Embedded Linux Consultant
MAB Labs Embedded Solutions
22 East Quackenbush Ave
Dumont, NJ 07628

Pierre-Jean Texier

unread,
Jun 3, 2022, 9:13:19 AM6/3/22
to Mohammed Billoo, swupdate, Dominique MARTINET
Mohammed,

Le 03/06/2022 à 15:11, Mohammed Billoo a écrit :
> Hi Pierre-Jean,
>
> Thanks! That did the trick (and saved me from going down the rabbit hole of
> tracing libconfig).
>

Perfect, you're welcome ;)


Thanks,
--
Pierre-Jean
Reply all
Reply to author
Forward
0 new messages