U-boot modifications when using Yocto and meta-st-stm32mp
Hello,
I am working with STM32MP135F-DK and Yocto (Kirkstone), using poky, meta-openembedded, meta-st-stm32mp layers. I am creating my custom image for the board. I want to implement OTA to my board and I have chosen swupdate package to achive that. I have also chosen to follow the "dual-copy" stategy. And that's where I had to start dealing with U-boot, it's environment, and environment variables. I am certainly a beginner in Yocto and Embedded Linux. I did some research, I have followed U-boot bootcmd all way down through all ST scripts there, and as far as I can understand:
- configuration (setting CONFIG_...) of U-boot and environment variables is done in .patch files located in meta-st-stm32mp/recipes-bsp/u-boot/u-boot-stm32mp
- there is a boot.scr.cmd in stm32mp-extlinux folder but it should not be used in production, it's there to handle all availiable dev-boards and types of storage
- when my board boots it uses mmc0_extlinux/st32mp135f-dk_extlinux.conf file. The content of this file is:
# Generic Distro Configuration file generated by OpenEmbedded
menu title Select the boot mode
MENU BACKGROUND /splash_landscape.bmp
TIMEOUT 20
DEFAULT OpenSTLinux
LABEL OpenSTLinux
KERNEL /uImage
FDTDIR /
APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
LABEL stm32mp135f-dk-a7-examples
KERNEL /uImage
FDT /stm32mp135f-dk-a7-examples.dtb
APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
and there is this "APPEND root=PARTUUID= (...)" from which U-boot knows where the rootfs is. Those are my conclusions, please correct me if I am wrong somewhere.
I am struggling (don't know how to do it) with:
1. Changing the configuration of U-Boot and changing the environment variables values or adding my own variables. Should I modify the .patch files (doesn't look like a elegant solution to me). How to do it properly?
2. Getting rid of boot.scr.cmd
3. Changing the extlinux.conf file. Here I need to be able to append rootfs to certain partition(like "APPEND root=mmcblk0p9 ...", without this UUID). What is more I will have to be able to change that from user-space, so that after swupdate the board will boot from the other copy (to achive "dual copy" strategy).
I will be gratefull for any help on that!
