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.
1 Like

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.

1 Like

I am compiling OpenWrt 23.05.2 and still encounter this problem.

1 Like

FWIW, it has been working fine for me for over a year. Just built 23.05-SNAPSHOT with no issues. Maybe 64/128 MB for kernel is too much?


Patched .config file works as stated in my original message, the issue is that specifying the options on the command line when running IB stopped working at some point.

having this issue as well, building 23.05.2.
I specified CONFIG_TARGET_ROOTFS_PARTSIZE in the .config and got the same warning: BIOS Boot Partition is under 1 MiB.

had to use the following, but not sure why 1024 solves the issue:

(line 52, not 56).


I guess you already know you can specify to ignore squashfs in .config, but if not:

1 Like

I've linked file in master, not in a specific commit, so if the file changes, the line number may change as well. I've created a patch file for myself to take care of updating the Makefile.

Cheers, I was already manipulating the .config file anyways, now I'll be removing the squashfs images from being built too!

1 Like