IMAGE_ROOTFS_EXTRA_SPACE and IMAGE_OVERHEAD_FACTOR do not work as expected #yocto
If I set IMAGE_OVERHEAD_FACTOR = "1" and IMAGE_ROOTFS_EXTRA_SPACE = "600000", I would expect the generated rootfs to have an additional freespace of 600M but I get this:
``` $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -lh -rw-r--r-- 2 ejo ejo 1,3G jan. 29 17:09 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129160710.rootfs.ext4 $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -l -rw-r--r-- 2 ejo ejo 1308622848 jan. 29 17:09 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129160710.rootfs.ext4 $ fdisk tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic -l Device Boot Start End Sectors Size Id Type tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic1 * 8192 69335 61144 29,9M c W95 FAT32 (LBA) tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic2 73728 3396403 3322676 1,6G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic3 3399680 6722355 3322676 1,6G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic4 6725632 8056831 1331200 650M 83 Linux ```
Vs when not setting the variables:
``` $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -lh -rw-r--r-- 2 ejo ejo 856M jan. 29 16:58 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.ext4 $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -l -rw-r--r-- 2 ejo ejo 897581056 jan. 29 16:58 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.ext4 $ fdisk tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic -l Device Boot Start End Sectors Size Id Type tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic1 * 8192 69335 61144 29,9M c W95 FAT32 (LBA) tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic2 73728 2352743 2279016 1,1G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic3 2359296 4638311 2279016 1,1G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic4 4644864 5976063 1331200 650M 83 Linux ```
So it looks like by setting the variables bitbake first adds 411041792 bytes 392 MiB to the .ext4 file, then WKS adds another 0.3GB to each rootfs partition. Why does this happen? Why isn't the full 600MB added to the .ext4 file? This causes issues with the meta-rauc layer which uses .ext4 file when creating update bundles, see issue here https://github.com/rauc/meta-rauc/issues/173
IMO when setting IMAGE_ROOTFS_EXTRA_SPACE = "600000" 600kB should be added to the .ext4 file not 392MiB and then another 300MB by growing the partition in wks.
I would suggest to try something like this
# Add 3G spaceIMAGE_ROOTFS_EXTRA_SPACE_appendl = " + 3000000"
Quoted 41 lines · On Fri, Jan 29, 2021 at 8:20 AM <[email protected]> wrote:
If I set
IMAGE_OVERHEAD_FACTOR= "1" andIMAGE_ROOTFS_EXTRA_SPACE= "600000", I would expect the generated rootfs to have an additional freespace of 600M but I get this:``` $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -lh -rw-r--r-- 2 ejo ejo 1,3G jan. 29 17:09 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129160710.rootfs.ext4 $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -l -rw-r--r-- 2 ejo ejo 1308622848 jan. 29 17:09 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129160710.rootfs.ext4 $ fdisk tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic -l Device Boot Start End Sectors Size Id Type tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic1 * 8192 69335 61144 29,9M c W95 FAT32 (LBA) tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic2 73728 3396403 3322676 1,6G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic3 3399680 6722355 3322676 1,6G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic4 6725632 8056831 1331200 650M 83 Linux ```Vs when not setting the variables:
``` $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -lh -rw-r--r-- 2 ejo ejo 856M jan. 29 16:58 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.ext4 $ ls tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.ext4 -l -rw-r--r-- 2 ejo ejo 897581056 jan. 29 16:58 tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.ext4 $ fdisk tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129143554.rootfs.wic -l Device Boot Start End Sectors Size Id Type tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic1 * 8192 69335 61144 29,9M c W95 FAT32 (LBA) tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic2 73728 2352743 2279016 1,1G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic3 2359296 4638311 2279016 1,1G 83 Linux tmp/deploy/images/rpi-cm3/core-base-image-rpi-cm3-20210129155627.rootfs.wic4 4644864 5976063 1331200 650M 83 Linux ```So it looks like by setting the variables bitbake first adds 411041792 bytes 392 MiB to the .ext4 file, then WKS adds another 0.3GB to each rootfs partition. Why does this happen? Why isn't the full 600MB added to the .ext4 file? This causes issues with the meta-rauc layer which uses .ext4 file when creating update bundles, see issue here https://github.com/rauc/meta-rauc/issues/173
IMO when setting
IMAGE_ROOTFS_EXTRA_SPACE= "600000" 600kB should be added to the .ext4 file not 392MiB and then another 300MB by growing the partition in wks.