I'm trying to build a custom x86 image with Image Builder with non-default rootfs size.
I can manually (or with
sed) edit the
.config file and change
CONFIG_TARGET_ROOTFS_PARTSIZE value, but is there a way to do it from the command line?
So far I've tried the following none, of which worked for me:
make CONFIG_TARGET_ROOTFS_PARTSIZE=512 image
make -e image
I also tried
GNUMAKEFLAGS instead of
MAKEFLAGS above, to no avail.
CONFIG_TARGET_ROOTFS_PARTSIZE isn't propagated to sub-makes in the Image Builder.
For now, using
sed as a workaround:
sed -i 's/^\s*\(CONFIG_TARGET_ROOTFS_PARTSIZE\)\s*=\s*[^#\n \t]*/\1=512/' .config
Coincidentally, I've been experimenting with various KERNEL and ROOTFS partition sizes earlier today and I can confirm that specifying various values for
CONFIG_TARGET_ROOTFS_PARTSIZE on CLI for OpenWrt 21.02.1 image builder's
make command doesn't work. The values from the
.config file are always used and never overridden with values from CLI.
Sources stating that it should: How to set root filesystem partition size on x86 ImabeBuilder? and https://openwrt.org/docs/guide-user/installation/openwrt_x86#building_your_own_image_with_larger_partition_size.
Tagging @jow @vgaetera and another IB expert @aparcar
Yes but It doesn't, I suppose because the
.config file gets included again in the nested make files (try
grep -r CONFIG_TARGET_ROOTFS_PARTSIZE), and it seems that any "override" variables specified on the
make image command line aren't propagated to sub-makes, as well the
MAKEFLAGS env variable.
I haven't fully followed through all the logic, but I noticed
unset PROFILE FILES PACKAGES MAKEFLAGS (can be seen with
grep -r MAKEFLAGS).
I'm also surprised the following doesn't work as expected, I didn't see
GNUMAKEFLAGS being altered anywhere: