Imx6 extra partition

We would like to know if ít’s possible to create a second partition with the following characteristics:

  1. Data persistent after firmware update (run setupdate; run update)
  2. possibility to flash from this partition instead of a seperate sd/usb

Also we like you to know how to archieve this and what needs to be changed in the yocto build environment

Hi

  • Data persistent after firmware update (run setupdate; run update)
    That is possible. However it is not possible to sort of protect your partitioning. So if someone installs e.g. our regular image, that update will overwrite your partitioning scheme.

  • possibility to flash from this partition instead of a separate sd/usb
    That is also possible.

  • Also we like you to know how to achieve this and what needs to be changed in the yocto build environment

    1. You would change the update.sh script:
    • changing partition size for the rootfs partition and add the 3rd partition in the so freed space.
    • maybe create a binary blob of that 3rd partition, similar to how we create the binary blob of the rootfs.
    1. You would change the u-boot script loaded by ‘run update’ colibri-imx6_bin/flash_XXX.scr.
    • allowing setting the partition number, as currently we expect the update data to be on the first partition.
    • If you create a binary blob of your update partition you may also want a ‘update_update_partition’ command to have the possibility to write that partition, but you would not add that command to the update command.
    • Note that you need to convert the file with mkimage, see the colibri-imx6_bin/mk-u-boot-scripts.sh file.
    1. To update from your new eMMC partition you would make a copy of the setsdupdate environment variable in U-Boot, e.g. setemmcupdate, with drive set 0 and the new partitionnumber to 3. Then a ‘run setemmcupdate; run update’ should allow updating from what you have locally on your eMMC.

    2. If you want to integrate that in the Yocto metadata you would apply above changes to

    • update.sh and flash_xxx.scr in the image/files/… folder
    • create a patch to U-Boot changing ‘include/configs/colibri_imx6.h’ which adds your additional environment variables. Then apply the patch through the U-Boot recipe.

Max