create wic file with swupdate files

238 views
Skip to first unread message

Javi Jap

unread,
May 28, 2024, 4:50:06 AM5/28/24
to swupdate
Hi,
I have added swupdate recipe in yocto (kirkstone) and modified the wks file to create the partitions for the dual copy scheme.
Then I manually boot the fitImage that yocto generates and do a swupdate. After the update, fitImage_A, fitImage_B and sys_active files are copied to the boot partition (mmcblk0p1) and everything works fine after that.

Now I would like to modify yocto to generate the wic file with those files (fitImage_A, fitImage_B and sys_active) in the boot partition (instead of the default fitImage) so I don't have to do an update after the wic image is flashed.

I see that fitImage_A, fitImage_B and sys_active files are being generated in bootfs directory in tmp/work/kontron_mx8mm-ked-linux/image-ked-qt/1.0-r0/bootfs/
I have tried to add the files to the IMAGE_BOOT_FILES variable (with absolute paths since yocto looks for the files listed in that variable from the image deploy directory) but it didn't work.

How can I add those files to the boot partition?

Thanks

Javi Jap

unread,
May 28, 2024, 6:51:41 AM5/28/24
to swupdate

Update:

I managed to solve this modifying the bootfs.bbclass to copy the files to the DEPLOY_DIR_IMAGE so they can be found when adding them to IMAGE_BOOT_FILES variable:

cp -L ${DEPLOY_DIR_IMAGE}/fitImage ${DEPLOY_DIR_IMAGE}/fitImage_B
cp -L ${DEPLOY_DIR_IMAGE}/fitImage ${DEPLOY_DIR_IMAGE}/fitImage_A
echo "AB" > ${DEPLOY_DIR_IMAGE}/sys_active

After doing that, adding the files to the IMAGE_BOOT_FILES variable works as expected and the files are copied to the boot partition.

IMAGE_BOOT_FILES = " \
    fitImage \
    fitImage_A \
    fitImage_B \
    sys_active \
"

Probably not the best nor elegant way to do it but now the wic image is created with all the needed files.

If there is a cleaner way I'm all ears!

Regards,
Javi
Reply all
Reply to author
Forward
0 new messages