u-boot does not take alternate partition afte swupdate successful

151 views
Skip to first unread message

Thomas Poly

unread,
Apr 24, 2024, 4:00:24 AM4/24/24
to swupdate
Hi Stefano,

Thanks for the guidance. I made the modifications as advised and confirmed that both U-Boot and Linux share environment variables, including the 'ustate' updated by swupdate.

Following a successful swupdate where ustate is updated in Linux and upon reboot, U-Boot recognizes ustate set to 1. However, U-Boot persists in booting to the old partition instead of the updated one.

What modifications are necessary within U-Boot to switch the partition?

Below, I've provided the relevant logs for your reference:

swupdate logs:

[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 1154
[DEBUG] : SWUPDATE running :  [parse_cfg] : Parsing config file /tmp/sw-description
[TRACE] : SWUPDATE running :  [get_common_fields] : Version 0.1.0
[TRACE] : SWUPDATE running :  [get_common_fields] : reboot_required 1
[TRACE] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[TRACE] : SWUPDATE running :  [_parse_images] : Found compressed Image: core-image-full-cmdline-beaglebone-yocto.ext4.gz in device : /dew
[TRACE] : SWUPDATE running :  [_parse_scripts] : Found Script: emmcsetup.lua
[TRACE] : SWUPDATE running :  [_parse_bootloader] : Bootloader var: bootcmd_legacy_mmc1 = setenv mmcdev 1;setenv bootpart 1:3; run mmcbot
[TRACE] : SWUPDATE running :  [_parse_bootloader] : Bootloader var: boot_targets = legacy_mmc1 mmc1 nand0 pxe dhcp
[TRACE] : SWUPDATE running :  [parse] : Number of found artifacts: 1
[TRACE] : SWUPDATE running :  [parse] : Number of scripts: 1
[TRACE] : SWUPDATE running :  [parse] : Number of steps to be run: 3
[TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware beaglebone 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 1691 required
[TRACE] : SWUPDATE running :  [extract_files] : Found file
[TRACE] : SWUPDATE running :  [extract_files] :         filename core-image-full-cmdline-beaglebone-yocto.ext4.gz
[TRACE] : SWUPDATE running :  [extract_files] :         size 38306905 required
[TRACE] : SWUPDATE running :  [server_handle_initial_state] : Got state=2 from command line.
[DEBUG] : SWUPDATE running :  [server_get_device_info] : Getting information for device 'bbb'
[DEBUG] : SWUPDATE running :  [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you .

[DEBUG] : SWUPDATE running :  [channel_get] : Trying to GET http://papero:8080/default/controller/v1/bbb
[TRACE] : SWUPDATE running :  [extract_padding] : Expecting up to 512 padding bytes at end-of-file
[TRACE] : SWUPDATE running :  [network_initializer] : Valid image found: copying to FLASH
[INFO ] : SWUPDATE running :  Installation in progress
[TRACE] : SWUPDATE running :  [start_lua_script] : Calling Lua /tmp/scripts/emmcsetup.lua
[TRACE] : SWUPDATE running :  [run_lua_script] : LUA Exit: is boolean 1
[TRACE] : SWUPDATE running :  [install_single_image] : Found installer for stream core-image-full-cmdline-beaglebone-yocto.ext4.gz raw
* Could not resolve host: papero
* Closing connection 9
[ERROR] : SWUPDATE failed [0] ERROR channel_curl.c : channel_get : 1549 : Channel get operation failed (6): 'Couldn't resolve host name'
[ERROR] : SWUPDATE failed [0] ERROR swupdate_vars.c : swupdate_vars_get : 89 : Failed to get variable action_id
[INFO ] : SWUPDATE running :  [server_start] : Sleeping for 10s until retrying...
[TRACE] : SWUPDATE running :  [start_lua_script] : Calling Lua /tmp/scripts/emmcsetup.lua
[TRACE] : SWUPDATE running :  [run_lua_script] : LUA Exit: is boolean 1
[TRACE] : SWUPDATE running :  [run_lua_script] : Script output: Post installed script called script end
[INFO ] : SWUPDATE successful ! SWUPDATE successful !
[DEBUG] : SWUPDATE running :  [postupdate] : Running Post-update command

The system is going down for reboot NOW!
INIT: Sending processes configured via /etc/inittab the TERM signal
[TRACE] : SWUPDATE running :  [__run_cmd] : /sbin/reboot command returned 0
[TRACE] : SWUPDATE running :  [network_initializer] : Main thread sleep again !
[INFO ] : No SWUPDATE running :  Waiting for requests...
Stopping OpenBSD Secure Shell server: sshdstopped /usr/sbin/sshd (pid 268)

fw_printenv output (Linux):

beaglebone-yocto:~# fw_printenv
arch=arm
baudrate=115200

ustate=1
vendor=ti
ver=U-Boot 2022.01 (Jan 10 2022 - 18:46:34 +0000)


printenv output (U-Boot):

=>
=> printenv
arch=arm
baudrate=115200

ustate=1
vendor=ti
ver=U-Boot 2022.01 (Jan 10 2022 - 18:46:34 +0000)

Thanks,
Thomas

Stefano Babic

unread,
Apr 24, 2024, 4:46:53 AM4/24/24
to Thomas Poly, swupdate
Hi Thomas,

On 24.04.24 00:59, Thomas Poly wrote:
>> Hi Stefano,
>>
>> Thanks for the guidance. I made the modifications as advised and
>> confirmed that both U-Boot and Linux share environment variables,
>> including the 'ustate' updated by swupdate.
>>

Ok - then the interface between SWUpdate and U-Boot is working.

>> Following a successful swupdate where ustate is updated in Linux and
>> upon reboot, U-Boot recognizes ustate set to 1. However, U-Boot
>> persists in booting to the old partition instead of the updated one.
>>
>> What modifications are necessary within U-Boot to switch the partition?

U-Boot's environment is not standardized and the sripts starting from
"bootcmd" rule how the board boots. That means you can change the
environment from SWUpdate, but scripts in U-Boot simply ignore the
variables you set. If you have just taken the environment from an
evaluation board, you have to change the environment (see
CONFIG_ENV_EXTRA) to support an A/B approach. Think about that many
boards (and eval boards first at all) are providing with stock U-Boot
just a quick way to boot the board, but there is no support for update.
You have to understand how the boot scripts were written, and change
them accordingly to evaluate the variable you set via the update.

Best regards,
Stefano

>>
>> Below, I've provided the relevant logs for your reference:
>>
>> *swupdate logs:*
>> *fw_printenv output (Linux):*
>> *
>> *
>> beaglebone-yocto:~# fw_printenv
>> arch=arm
>> baudrate=115200
>>
>> ustate=1
>> vendor=ti
>> ver=U-Boot 2022.01 (Jan 10 2022 - 18:46:34 +0000)
>>
>>
>> *printenv output (U-Boot):*
>>
>> =>
>> => printenv
>> arch=arm
>> baudrate=115200
>>
>> ustate=1
>> vendor=ti
>> ver=U-Boot 2022.01 (Jan 10 2022 - 18:46:34 +0000)
>>
>> Thanks,
>> Thomas
>
> --
> 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 on the web visit
> https://groups.google.com/d/msgid/swupdate/b25a33ed-0a1e-4a8b-810a-216444f6e8f8n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/b25a33ed-0a1e-4a8b-810a-216444f6e8f8n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages