File system is getting corrupted after update

251 views
Skip to first unread message

Keshava Kumar

unread,
Oct 12, 2021, 12:08:26 AM10/12/21
to swupdate
Hi SWUpdate community, 

I am working on SWUpdate with yocto project on i.MX8QM custom board. 
I am using reference of meta-swupdate-boards and have created another board corresponding to my board. 

Yocto version is Zeus. 
Uboot : 2020.04

I am using Dual partition system as I have enough space. 

I am trying to update Linux Image to test the initial bring up. Here is my sw-description file
Below is my sw-description: 
software =
{
        version = "0.1.0";

        orion = {
                hardware-compatibility: [ "1.0"];
                stable : {
                        copy1 : {
                                images: (
                                        {
                                                filename = "Image-orion.bin";
                                                path = "/Image";
                                                device = "/dev/mmcblk1p1";
                                                filesystem = "vfat";
                                                installed-directly = true;
                                        }
                                );

                        };
                        copy2 : {
                                images: (
                                        {
                                                filename = "Image-orion.bin";
                                                path = "/Image";
                                                device = "/dev/mmcblk1p2";
                                                filesystem = "vfat";
                                                installed-directly = true;
                                        }
                                );
                        };
                };
        }
}

I am able to create a *.swu image using above sw-description. 
But When I am trying to update, I am getting below message: 

root@ig-snxxyy01-isym:~# swupdate -l 7 -e stable,copy1 -i update-image-orion.swu -H orion:1.0
[DEBUG] : SWUPDATE running :  [read_settings_file] : Reading config file /etc/swupdate.cfg
[DEBUG] : SWUPDATE running :  [read_module_settings] : Reading config settings for module globals
[TRACE] : SWUPDATE running :  [swupdate_dgst_init] : public key / cert test.pem ignored, you need to set SIGALG
Swupdate v2021.04.0

Licensed under GPLv2. See source distribution for detailed copyright notices.

[INFO ] : SWUPDATE running :  [lua_handlers_init] : No Lua handler(s) found.
[TRACE] : SWUPDATE running :  [lua_handlers_init] :     /usr/share/lua/5.3/swupdate_handlers.lua
[TRACE] : SWUPDATE running :  [lua_handlers_init] :     /usr/share/lua/5.3/swupdate_handlers/init.lua
[TRACE] : SWUPDATE running :  [lua_handlers_init] :     /usr/lib/lua/5.3/swupdate_handlers.lua
[TRACE] : SWUPDATE running :  [lua_handlers_init] :     /usr/lib/lua/5.3/swupdate_handlers/init.lua
[TRACE] : SWUPDATE running :  [lua_handlers_init] :     ./swupdate_handlers.lua
[TRACE] : SWUPDATE running :  [lua_handlers_init] :     ./swupdate_handlers/init.lua
[INFO ] : SWUPDATE running :  [main] : Running on orion Revision 1.0
[INFO ] : SWUPDATE running :  [print_registered_handlers] : Registered handlers:
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     dummy
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     archive
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     tar
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     uboot
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     bootloader
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     lua
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     raw
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     rawfile
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     rawcopy
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     shellscript
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     preinstall
[INFO ] : SWUPDATE running :  [print_registered_handlers] :     postinstall
[DEBUG] : SWUPDATE running :  [parse_image_selector] : Parsing selector: stable,copy1
[INFO ] : SWUPDATE running :  [main] : software set: stable mode: copy1
[DEBUG] : SWUPDATE running :  [read_module_settings] : No config settings found for module versions
[TRACE] : SWUPDATE running :  [listener_create] : creating socket at /tmp/swupdateprog
[TRACE] : SWUPDATE running :  [network_initializer] : Main loop daemon
[TRACE] : SWUPDATE running :  [listener_create] : creating socket at /tmp/sockinstctrl
[TRACE] : SWUPDATE running :  [network_thread] : Incoming network request: processing...
[INFO ] : SWUPDATE started :  Software Update started !
[TRACE] : SWUPDATE running :  [network_initializer] : Software update started
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] : Found file
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] :   filename sw-description
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] :   size 517
[DEBUG] : SWUPDATE running :  [parse_cfg] : Parsing config file /tmp/sw-description
[TRACE] : SWUPDATE running :  [get_common_fields] : Version 0.1.0
[TRACE] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[TRACE] : SWUPDATE running :  [_parse_images] : Found Image: Image-orion.bin in device : /Image for handler raw (installed from stream)
[TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware orion Revision: 1.0
[TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware compatibility verified
[DEBUG] : SWUPDATE running :  [preupdatecmd] : Running Pre-update command
[TRACE] : SWUPDATE running :  [extract_files] : Found file
[TRACE] : SWUPDATE running :  [extract_files] :         filename emmcsetup.lua
[TRACE] : SWUPDATE running :  [extract_files] :         size 175 Not required: skipping
[TRACE] : SWUPDATE running :  [extract_files] : Found file
[TRACE] : SWUPDATE running :  [extract_files] :         filename Image-orion.bin
[TRACE] : SWUPDATE running :  [extract_files] :         size 27636224 required
[TRACE] : SWUPDATE running :  [extract_files] : Installing STREAM Image-orion.bin, 27636224 bytes
[WARN ] : SWUPDATE running :  [bootloader_initialize] : Cannot read environment, using default
[ERROR] : SWUPDATE failed [0] ERROR /home/hmecd001523/saikumar/orion-yocto-bsp/build/tmp/work/orion-poky-linux/swupdate/2021.04-r0/git/bootloader/uboot.c : bootloader_initialize : 40 : Error: Cannot read default environment from file
[TRACE] : SWUPDATE running :  [install_single_image] : Found installer for stream Image-orion.bin raw
[TRACE] : SWUPDATE running :  [extract_files] : END INSTALLING STREAMING
[TRACE] : SWUPDATE running :  [extract_padding] : Expecting 388 padding bytes at end-of-file
[TRACE] : SWUPDATE running :  [network_initializer] : Valid image found: copying to FLASH
[WARN ] : SWUPDATE running :  [bootloader_initialize] : Cannot read environment, using default
[ERROR] : SWUPDATE failed [0] ERROR /home/hmecd001523/saikumar/orion-yocto-bsp/build/tmp/work/orion-poky-linux/swupdate/2021.04-r0/git/bootloader/uboot.c : bootloader_initialize : 40 : Error: Cannot read default environment from file
[INFO ] : SWUPDATE running :  Installation in progress
[WARN ] : SWUPDATE running :  [bootloader_initialize] : Cannot read environment, using default
[ERROR] : SWUPDATE failed [0] ERROR /home/hmecd001523/saikumar/orion-yocto-bsp/build/tmp/work/orion-poky-linux/swupdate/2021.04-r0/git/bootloader/uboot.c : bootloader_initialize : 40 : Error: Cannot read default environment from file
[WARN ] : SWUPDATE running :  [bootloader_initialize] : Cannot read environment, using default
[ERROR] : SWUPDATE failed [0] ERROR /home/hmecd001523/saikumar/orion-yocto-bsp/build/tmp/work/orion-poky-linux/swupdate/2021.04-r0/git/bootloader/uboot.c : bootloader_initialize : 40 : Error: Cannot read default environment from file
[ERROR] : SWUPDATE failed [0] ERROR /home/hmecd001523/saikumar/orion-yocto-bsp/build/tmp/work/orion-poky-linux/swupdate/2021.04-r0/git/core/stream_interface.c : network_initializer : 626 : Cannot persistently store INSTALLED update state.
[ERROR] : SWUPDATE failed [1] Installation failed !
[TRACE] : SWUPDATE running :  [network_initializer] : Main thread sleep again !
[INFO ] : No SWUPDATE running :  Waiting for requests...
[INFO ] : SWUPDATE running :  [endupdate] : Swupdate *failed* !

As I am new to swupdate, I have few queries: 
1. I can see that my files are copying to my Boot media "Valid image found: copying to FLASH" . But I am not able to see the image. After this update, entire boot media is showing junk characters. So I am not too sure what is happening. 
2. What needs to be done for enabling "Cannot read default environment from file". I was getting some error in following " PREFERRED_PROVIDER_u-boot-fw-utils = “libubootenv”" in local.conf file. 
3. How we can enabled default environment varibale?

Please let me know if I need to share further details. 

Thanks, 
Keshava 
Reply all
Reply to author
Forward
0 new messages