Device specific configuration with 3 extra partitions

In a STM32MP1 image there have to be 3 more partitions in the begining of the image.

  • First Stage Bootloader
  • First Stage Bootloader (copy of the first one)
  • Second Stage Bootloader

I try to create them by overriding device_specific_configuration()

The problem is that when the partition type is msdos, there can only be 4 primary partitions or 3 primary + 1 extended with multiple logical partitions.
There can only be one extended partition.

In image_types_balena.bbclass boot, roota and rootb is primary partitions and state, data are logical partitions in an extended.

Can I patch image_types_balena.bbclass to change partitions types or do I have to copy and override IMAGE_CMD_balenaos-img() ?
If I can patch it, how do I do that?

Perhaps this methodology will work @Ankan ? → balena-st-stm32mp/resin-image.bbappend at master · kbumsik/balena-st-stm32mp (github.com)

Hi,

That method do work and I have used it earlier but I thought that maybe I could use MBR to be able to use the balena image configuration tool.

My changing to GPT will fix the problem, but I still don’t know how to patch classes or other recipes if possible. I know I can append and override a recipe, but can I patch it instead of clone, modify and override it.