Not able to increase data partition size

Hello Mender-Team,

We have integrated mender version 1.14.1 in stm32mp157c based custom board.

We are using 16GB eMMC storage for booting the image.

I’ve configured the local.conf as below for mender:

MENDER_STORAGE_TOTAL_SIZE_MB = "1024"

MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}4"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}5"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}6"
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}7"

IMAGE_FSTYPES_append = " gptimg.gz"

IMAGE_BOOT_FILES = "stm32mp1-boot.scr;boot.scr"

# Kernel + Rootfs part-A
MENDER_ROOTFS_PART_A_NUMBER = "5"
# Kernel + Rootfs part-B
MENDER_ROOTFS_PART_B_NUMBER = "6"
# use eMMC as storage device
MENDER_UBOOT_STORAGE_INTERFACE = "mmc"

# Use mmcblk2 (i.e. eMMC) as storage device.
MENDER_UBOOT_STORAGE_DEVICE = "2"
MENDER_STORAGE_DEVICE = "/dev/mmcblk2"
MENDER_STORAGE_DEVICE_BASE = "/dev/mmcblk2p"

Now, we want to utilize the whole 16GB eMMC storage. So, we tried to increase the size of data partition through “MENDER_DATA_PART_SIZE_MB” configuration.
To increase the size of /data partition, we have to increase the MENDER_STORAGE_TOTAL_SIZE_MB" configuration.

But as our requirement is to keep the flashing image time not more than 3 minutes. So, we have configured the “MENDER_STORAGE_TOTAL_SIZE_MB” to 1024 (1GB).

And if we increase the value of “MENDER_STORAGE_TOTAL_SIZE_MB” to 2048 or 4096, the flashing image time is also increasing that we don’t want.

We have also tried to integrate the mender-growfs-data feature which enables dynamic resizing of the data filesystem through systemd-growfs but as we are using mender version 1.14.1,
we are not able to integrate this feature in the yocto. It is showing the below error.

mender-growfs-data from MENDER_FEATURES_ENABLE or DISTRO_FEATURES is not a valid Mender feature.

Also, we are using the sysvinit service and not systemd.

So, is there any way to increase persistent data partition without large image file?

Any particular reason why you are staying on version 1.14.1? It sounds like your problem is basically caused by that - not being able to use the recent features.

Greetz,
Josef

Hi Josef,

Thanks for your support.
Actually, the latest ‘meta-mender-community’ GitHub repo doesn’t provide support for STM32MP1 platform. Only thud branch of ‘meta-mender-community’ provide support of STM32MP1 platform. So, we used that old release of mender.

Regards,
Pratik Manvar

Hi @manvar-pratik,

Support for the STM32MP has been merged on kirkstone just a few days ago, and the dunfell integration is discussed here, seemingly also relatievly close to being finished. So by all means in terms of security (not shipping outdated/vulnerable software) and maintainability, I would strongly advise to upgrade. Plus, you can use mender-growfs-data then :slight_smile:

Greetz,
Josef

@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
 # -----------------------------------------------------------------------------

@grahas so it is solved for you now?

For the record, there also is an integration for an STM32MP-type board now that uses a more generic setup: Octavo Systems OSD32MP1-RED on eMMC

Maybe this is good inspiration for you.

Greetz,
Josef

1 Like