@manvar-pratik @TheYoctoJester
I got an email from the STM32MPU team that is relevant.
Using an SD card based example on a STM32MP157C-DK2 board, we created an SD card image with two rootfs partitions that we programmed via the STM32CubeProgrammer. Two files were changed in the build:
meta-st/meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc
meta-st/meta-st-stm32mp/conf/machine/include/st-machine-flashlayout-stm32mp.inc
Attached is the diff file showing the changes made.
A bitbake was performed and the attached TSV file was created, this was loaded into STM32CubeProgrammer and flashed onto the SD card on a connected DK2 board.
The resulting lsblk command output when booted is shown below:
root@stm32mp15-disco:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.7G 0 disk
|-mmcblk0p1 179:1 0 256K 0 part
|-mmcblk0p2 179:2 0 256K 0 part
|-mmcblk0p3 179:3 0 256K 0 part
|-mmcblk0p4 179:4 0 256K 0 part
|-mmcblk0p5 179:5 0 4M 0 part
|-mmcblk0p6 179:6 0 4M 0 part
|-mmcblk0p7 179:7 0 512K 0 part
|-mmcblk0p8 179:8 0 64M 0 part /boot
|-mmcblk0p9 179:9 0 16M 0 part /vendor
|-mmcblk0p10 179:10 0 4G 0 part /
|-mmcblk0p11 179:11 0 4G 0 part
`-mmcblk0p12 179:12 0 21.6G 0 part /usr/local
Note after first boot the rootfs partitions were resized to 4G.
FlashLayout_sdcard_stm32mp157f-dk2-optee.tsv
#Opt Id Name Type IP Offset Binary
- 0x01 fsbl-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp157f-dk2-usb.stm32
- 0x03 fip-boot FIP none 0x0 fip/fip-stm32mp157f-dk2-optee.bin
P 0x04 fsbl1 Binary mmc0 0x00004400 arm-trusted-firmware/tf-a-stm32mp157f-dk2-sdcard.stm32
P 0x05 fsbl2 Binary mmc0 0x00044400 arm-trusted-firmware/tf-a-stm32mp157f-dk2-sdcard.stm32
P 0x06 metadata1 Binary mmc0 0x00084400 arm-trusted-firmware/metadata.bin
P 0x07 metadata2 Binary mmc0 0x000C4400 arm-trusted-firmware/metadata.bin
P 0x08 fip-a FIP mmc0 0x00104400 fip/fip-stm32mp157f-dk2-optee.bin
PED 0x09 fip-b FIP mmc0 0x00504400 none
PED 0x0A u-boot-env Binary mmc0 0x00904400 none
P 0x10 bootfs System mmc0 0x00984400 st-image-bootfs-openstlinux-weston-stm32mp15-disco.ext4
P 0x11 vendorfs FileSystem mmc0 0x04984400 st-image-vendorfs-openstlinux-weston-stm32mp15-disco.ext4
P 0x12 rootfs FileSystem mmc0 0x05984400 st-image-weston-openstlinux-weston-stm32mp15-disco.ext4
P 0x13 rootfs2 FileSystem mmc0 0x105984400 st-image-weston-openstlinux-weston-stm32mp15-disco.ext4
P 0x14 userfs FileSystem mmc0 0x205984400 st-image-userfs-openstlinux-weston-stm32mp15-disco.ext4
Diff file
diff -r -x .git -u Distribution-Package-Orig/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc Distribution-Package/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc
--- Distribution-Package-Orig/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc 2023-02-28 14:26:32.498321914 -0600
+++ Distribution-Package/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc 2023-02-27 15:25:36.075497756 -0600
@@ -232,6 +232,7 @@
PARTITIONS_IMAGES += "${@bb.utils.contains('ST_BOOTFS', '1', 'bootfs', '', d)}"
PARTITIONS_IMAGES += "${@bb.utils.contains('ST_VENDORFS', '1', 'vendorfs', '', d)}"
PARTITIONS_IMAGES += "rootfs"
+PARTITIONS_IMAGES += "rootfs2"
PARTITIONS_IMAGES += "${@bb.utils.contains('ST_USERFS', '1', 'userfs', '', d)}"
# Define image to use for extra partitions
@@ -242,6 +243,8 @@
STM32MP_BOOTFS_SIZE ?= "65536"
STM32MP_ROOTFS_IMAGE ?= "${IMAGE_BASENAME}"
STM32MP_ROOTFS_LABEL ?= "rootfs"
+STM32MP_ROOTFS2_IMAGE ?= "${IMAGE_BASENAME}"
+STM32MP_ROOTFS2_LABEL ?= "rootfs2"
# Configure the rootfs size with IMAGE_ROOTFS_MAXSIZE variable
STM32MP_ROOTFS_SIZE ?= "${IMAGE_ROOTFS_MAXSIZE}"
STM32MP_USERFS_IMAGE ?= "st-image-userfs"
@@ -259,6 +262,7 @@
PARTITIONS_IMAGES[bootfs] ?= "${STM32MP_BOOTFS_IMAGE},${STM32MP_BOOTFS_LABEL},${STM32MP_BOOTFS_MOUNTPOINT},${STM32MP_BOOTFS_SIZE},System"
PARTITIONS_IMAGES[vendorfs] ?= "${STM32MP_VENDORFS_IMAGE},${STM32MP_VENDORFS_LABEL},${STM32MP_VENDORFS_MOUNTPOINT},${STM32MP_VENDORFS_SIZE},FileSystem"
PARTITIONS_IMAGES[rootfs] ?= "${STM32MP_ROOTFS_IMAGE},${STM32MP_ROOTFS_LABEL},,${STM32MP_ROOTFS_SIZE},FileSystem"
+PARTITIONS_IMAGES[rootfs2] ?= "${STM32MP_ROOTFS2_IMAGE},${STM32MP_ROOTFS2_LABEL},,${STM32MP_ROOTFS_SIZE},FileSystem"
PARTITIONS_IMAGES[userfs] ?= "${STM32MP_USERFS_IMAGE},${STM32MP_USERFS_LABEL},${STM32MP_USERFS_MOUNTPOINT},${STM32MP_USERFS_SIZE},FileSystem"
# =========================================================================
diff -r -x .git -u Distribution-Package-Orig/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-flashlayout-stm32mp.inc Distribution-Package/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-flashlayout-stm32mp.inc
--- Distribution-Package-Orig/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-flashlayout-stm32mp.inc 2023-02-28 14:26:32.498321914 -0600
+++ Distribution-Package/layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-flashlayout-stm32mp.inc 2023-02-28 08:39:07.340959288 -0600
@@ -259,6 +259,7 @@
# 4GiB for sdcard
FLASHLAYOUT_PARTITION_SIZE:nor-sdcard:${STM32MP_ROOTFS_LABEL} = "4194304"
FLASHLAYOUT_PARTITION_SIZE:sdcard:${STM32MP_ROOTFS_LABEL} = "4194304"
+FLASHLAYOUT_PARTITION_SIZE:sdcard:${STM32MP_ROOTFS2_LABEL} = "4194304"
# Set binaries to use for each partition
# -----------------------------------------------------------------------------