22.03.3 x86 Image Builder issues

Not sure if it qualifies for an issue at github or is an user error, hence posting here.

  1. I believe I used to be able to indicate the desired kernel and rootfs partition size in the command line when running make, like this: CONFIG_TARGET_KERNEL_PARTSIZE=128 CONFIG_TARGET_ROOTFS_PARTSIZE=256 make image PROFILE="generic" .... However, this doesn't seem to work anymore and results in the following error: openwrt error: ext4_allocate_best_fit_partial: failed to allocate 4440 blocks, out of space? (tested by creating an image with enough packages to go over 104Mb) and requires editing the values in the .config. Am I doing something wrong? Can I still set the desired partition sizes when running make without modifying .config?

  2. If I do modify the .config and the image builds fine, I get the following warning: .../staging_dir/host/bin/grub-bios-setup: warning: Your BIOS Boot Partition is under 1 MiB, please increase its size.. (that's the message verbatim, it has two periods). I found this discussion in Chinese on the matter and changing 256 to 1024 on the line 56 of the target/linux/x86/image/Makefile indeed works. I wonder if this can be replaced with the variable from .config and/or command line instead of being hardcoded.

I could totally send a PR to replace the hardcoded value with the variable, however I do not feel confident naming said variable nor adding it to the .config. For now I've just created a patch file to fix the Makefile before the make command is ran.

  1. By default the IB creates ext4-combined-efi, ext4-combined, as well as squashfs-combined-efi and squashfs-combied. Would be great if there were different profiles for x86 to create ext4 images and squashfs images (say generic and generic-squashfs). It takes not an insignificant time to create the squashfs images, would be great not to waste electrons on that.

I got the exact same error when attempting to set a custom SquashFS partition size just now with current snapshot and 23.03.5. In my case the Image Builder .config file was changed to CONFIG_TARGET_KERNEL_PARTSIZE=64 and CONFIG_TARGET_ROOTFS_PARTSIZE=2048 . When I patched the Makefile as per the Chinese link all worked ok. You can patch the correct section of the makefile with something like simple this below, but seems like a bug to me.

sed -i '/\$(CONFIG_TARGET_ROOTFS_PARTSIZE) \$(IMAGE_ROOTFS)/,/256/ s/256/'"$ROOTFS_PARTSIZE"'/' "$SOURCE_DIR/target/linux/x86/image/Makefile"

Evidently, still an issue with 23.05.0.