Skip to content

[swupdate] boot loader ustate is not changed to "OK" after successful update

I am trying to build and test image for swupdate without secureboot.

I followed below steps,

 host$ git clone https://gitlab.com/cip-project/cip-core/isar-cip-core.git
 host$ cd isar-cip-core
 host$ wget https://raw.githubusercontent.com/siemens/kas/2.6.2/kas-container
 host$ chmod a+x kas-container 
 host$ ./kas-container --isar build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml
  • save the generated swu build/tmp/deploy/images/qemu-amd64/cip-core-image-cip-core-buster-qemu-amd64.swu in a separate folder (tmp).
  • modify the image for example add a new version to the image by adding PV=2.0.0 to cip-core-image.bb
  • start the new target and copy the swu cip-core-image-cip-core-buster-qemu-amd64.swu to the running system.
qemu$ SWUPDATE_BOOT=y ./start-qemu.sh amd64 
qemu$ scp <host-user-name>@<host-ip>:<path-to-swu-file-in-host>/tmp/cip-core-image-cip-core-buster-qemu-amd64.swu .
  • check which partition is booted
qemu$ lsblk 
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0    2G  0 disk
├─sda1   8:1    0 16.4M  0 part
├─sda2   8:2    0   32M  0 part
├─sda3   8:3    0   32M  0 part
├─sda4   8:4    0 1000M  0 part /
└─sda5   8:5    0 1000M  0 part
  • check bootloader ustate before swupdate
qemu$ bg_printenv
----------------------------
 Config Partition #0 Values:
in_progress:      no
revision:         2
kernel:           C:BOOT0:cip-core-image-cip-core-buster-qemu-amd64-vmlinuz
kernelargs:       console=tty0 console=ttyS0,115200 rootwait earlyprintk root=PARTUUID=fedcba98-7654-3210-cafe-5e0710000001 rw initrd=cip-core-image-cip-core-buster-qemu-amd64-initrd.img
watchdog timeout: 60 seconds
ustate:           0 (OK)

user variables:

----------------------------
 Config Partition #1 Values:
in_progress:      no
revision:         1
kernel:           C:BOOT1:cip-core-image-cip-core-buster-qemu-amd64-vmlinuz
kernelargs:       console=tty0 console=ttyS0,115200 rootwait earlyprintk root=PARTUUID=fedcba98-7654-3210-cafe-5e0710000002 rw initrd=cip-core-image-cip-core-buster-qemu-amd64-initrd.img
watchdog timeout: 60 seconds
ustate:           0 (OK)
  • apply swupdate and reboot
qemu$ swupdate -i cip-core-image-cip-core-buster-qemu-amd64.swu
Swupdate v2021.04.0

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

[INFO ] : SWUPDATE started :  Software Update started !
[INFO ] : SWUPDATE running :  Installation in progress
[INFO ] : SWUPDATE successful ! SWUPDATE successful !
[INFO ] : No SWUPDATE running :  Waiting for requests...
qemu$ reboot
  • check which partition is booted
qemu$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0    2G  0 disk
├─sda1   8:1    0 16.4M  0 part
├─sda2   8:2    0   32M  0 part
├─sda3   8:3    0   32M  0 part
├─sda4   8:4    0 1000M  0 part
└─sda5   8:5    0 1000M  0 part / 
  • check boot loader ustate after swupdate
qemu$ bg_printenv
----------------------------
Config Partition #0 Values:
in_progress:      no
revision:         2
kernel:           C:BOOT0:cip-core-image-cip-core-buster-qemu-amd64-vmlinuz
kernelargs:       console=tty0 console=ttyS0,115200 rootwait earlyprintk root=PARTUUID=fedcba98-7654-3210-cafe-5e0710000001 rw initrd=cip-core-image-cip-core-buster-qemu-amd64-initrd.img
watchdog timeout: 60 seconds
ustate:           0 (OK)

user variables:

----------------------------
 Config Partition #1 Values:
in_progress:      no
revision:         3
kernel:           C:BOOT1:vmlinuz
kernelargs:       root=PARTUUID=fedcba98-7654-3210-cafe-5e0710000002 console=tty0 console=ttyS0,115200 rootwait earlyprintk rw initrd=cip-core-image-cip-core-buster-qemu-amd64-initrd.img
watchdog timeout: 60 seconds
ustate:           2 (TESTING)

swupdate is successful and it is changing rootfs sda4-->sda5, but ustate is still in "TESTING" state, it is not moving to "OK".
Kindly check and let me know if there are any missing/wrong steps in my trial.

Edited by Shivanand Kunijadar
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information