Image builder in VM error

Hello all
I'm trying to build my own image because I need to have a few packages installed and the default image size is too small so I use ImageBuilder to create a 512 partition.

I'm doing this in a VMware workstations running Debian 12.7.

I'm running the make command as follows:

make V=s image \ 
ROOTFS_PARTSIZE=512 \ 
PACKAGES="base-files busybox ca-bundle cgi-io dnsmasq dropbear e2fsprogs firewall4 fstools fwtool getrandom grub2 grub2-bios-setup grub2-efi jansson4 jshn jsonfilter kernel kmod-button-hotplug kmod-crypto-crc32c kmod-crypto-hash kmod-fs-vfat kmod-input-core kmod-lib-crc-ccitt kmod-lib-crc32c kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-flow kmod-nf-log kmod-nf-log6 kmod-nf-nat kmod-nf-reject kmod-nf-reject6 kmod-nfnetlink kmod-nft-core kmod-nft-fib kmod-nft-nat kmod-nft-offload kmod-nls-base kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-utf8 kmod-ppp kmod-pppoe kmod-pppox kmod-slhc libblkid1 libc libcomerr0 libext2fs2 libf2fs6 libgcc1 libiwinfo-data libiwinfo-lua libjson-c5 libjson-script liblua5.1.5 liblucihttp-lua liblucihttp0 libmnl0 libnftnl11 libpthread librt libsmartcols1 libss2 libubus-lua libuuid1 logd lua luci luci-app-firewall luci-app-opkg luci-base luci-lib-base luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-mod-network luci-mod-status luci-mod-system luci-proto-ipv6 luci-proto-ppp luci-ssl luci-theme-bootstrap mkf2fs mtd netifd nftables-json odhcp6c odhcpd-ipv6only openwrt-keyring opkg partx-utils ppp ppp-mod-pppoe procd procd-seccomp procd-ujail rpcd rpcd-mod-file rpcd-mod-iwinfo rpcd-mod-luci rpcd-mod-rrdns ubox ubus ubusd uci uclient-fetch ucode ucode-mod-fs ucode-mod-ubus ucode-mod-uci uhttpd uhttpd-mod-ubus urandom-seed urngd usign attr avahi-dbus-daemon bc blkid block-mount bnx2-firmware bnx2x-firmware btrfs-progs ca-certificates coreutils-nohup curl dbus ddns-scripts htop ip-full iperf3 ipset iptables-mod-extra iptables-mod-ipsec iptables-mod-tproxy iw iwinfo iwlwifi-firmware-ax200 iwlwifi-firmware-ax210 kmod-8139cp kmod-8139too kmod-alx kmod-asn1-decoder kmod-ath kmod-ath10k kmod-bnx2 kmod-bnx2x kmod-bonding kmod-br-netfilter kmod-ipt-physdev kmod-cfg80211 kmod-crypto-acompress kmod-crypto-aead kmod-crypto-arc4 kmod-crypto-authenc kmod-crypto-cbc kmod-crypto-ccm kmod-crypto-cmac kmod-crypto-crc32 kmod-crypto-ctr kmod-crypto-deflate kmod-crypto-des kmod-crypto-ecb kmod-crypto-echainiv kmod-crypto-gcm kmod-crypto-gf128 kmod-crypto-ghash kmod-crypto-hmac kmod-crypto-lib-chacha20 kmod-crypto-lib-chacha20poly1305 kmod-crypto-lib-curve25519 kmod-crypto-lib-poly1305 kmod-crypto-manager kmod-crypto-md5 kmod-crypto-null kmod-crypto-rng kmod-crypto-seqiv kmod-crypto-sha1 kmod-crypto-sha256 kmod-crypto-user kmod-cryptodev kmod-dax kmod-dm kmod-dma-buf kmod-drm kmod-drm-kms-helper kmod-drm-ttm kmod-dummy kmod-e1000 kmod-e1000e kmod-fb kmod-fb-cfb-copyarea kmod-fb-cfb-fillrect kmod-fb-cfb-imgblt kmod-fb-sys-fops kmod-fb-sys-ram kmod-forcedeth kmod-fs-btrfs kmod-fs-exfat kmod-fs-ext4 kmod-fs-f2fs kmod-hid kmod-hid-generic kmod-hwmon-core kmod-i2c-algo-bit kmod-i2c-core kmod-i40e kmod-iavf kmod-igb kmod-igbvf kmod-igc kmod-ikconfig kmod-input-evdev kmod-ip6tables kmod-ipsec kmod-ipsec4 kmod-ipsec6 kmod-ipt-conntrack kmod-nf-nat6 xtables-legacy kmod-ipt-nat6 kmod-ipt-core kmod-ipt-extra kmod-ipt-ipsec kmod-ipt-ipset kmod-ipt-nat kmod-ipt-raw kmod-ipt-tproxy kmod-iptunnel4 kmod-iptunnel6 kmod-nft-compat kmod-irqbypass kmod-iwlwifi kmod-ixgbe kmod-keys-encrypted kmod-keys-trusted kmod-kvm-intel kmod-kvm-x86 kmod-lib-crc16 kmod-lib-lzo kmod-lib-raid6 kmod-lib-textsearch kmod-lib-xor kmod-lib-zlib-deflate kmod-lib-zlib-inflate kmod-lib-zstd kmod-libphy kmod-mac80211 kmod-macvlan kmod-mdio kmod-mdio-devres kmod-mii kmod-mlx4-core kmod-mlx5-core kmod-mmc kmod-mppe kmod-mt76-connac kmod-mt76-core kmod-mt76-sdio kmod-mt76-usb kmod-mt7921-common kmod-mt7921e kmod-mt7921s kmod-mt7921u kmod-nf-conntrack-netlink kmod-nf-ipt kmod-nf-ipt6 kmod-nf-ipvs kmod-nf-nathelper kmod-nf-nathelper-extra kmod-nf-tproxy  kmod-oid-registry kmod-pcnet32 kmod-pps kmod-ptp kmod-random-core kmod-scsi-core kmod-sdhci kmod-tcp-bbr kmod-thermal kmod-tpm kmod-tulip kmod-tun kmod-udptunnel4 kmod-udptunnel6 kmod-usb-core kmod-usb-hid kmod-usb-net kmod-usb-net-aqc111 kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8150 kmod-usb-storage kmod-usb-storage-extras kmod-usb-storage-uas kmod-veth kmod-via-velocity kmod-vmxnet3 kmod-wireguard libatomic1 libattr libavahi-client libavahi-dbus-support libblobmsg-json libcap libcurl4 libdaemon libdbus libdevmapper libelf1 libevent2-core7 libexpat libfdisk1 libgmp10 libgnutls libip4tc2 libip6tc2 libipset13 libkmod liblzo2 libminiupnpc libmount1 libnatpmp1 libncurses6 libnettle8 libopenssl-conf libparted libpcap1 libpci libpcre libpopt0 libreadline8 libseccomp libsensors5 libstdcpp6 libsysfs2 libtasn1 libtirpc libuci-lua libwebsockets-full libusb-1.0-0 libuv1 libwebsockets-full lm-sensors lsblk luci-app-ddns luci-app-nlbwmon luci-app-openvpn luci-app-samba4 luci-app-ttyd luci-app-upnp luci-app-wol luci-proto-bonding luci-proto-wireguard mount-utils ncdu nlbwmon openssl-util parted pciids pciutils procps-ng procps-ng-watch proto-bonding resize2fs runc samba4-libs samba4-server screen shadow-common shadow-useradd shadow-utils smartmontools stress sysfsutils tcpdump terminfo tini tmux ttyd  usbids usbutils uuidgen wget-ssl wireguard-tools wireless-regdb wsdd2 zerotier zlib nano openvpn-openssl luci-app-openvpn luci-app-samba4 luci-app-ddns ca-certificates luci-app-wireguard qrencode luci-proto-wireguard luci-app-statistics collectd-mod-openvpn kmod-usb-storage kmod-usb-storage-uas kmod-fs-exfat usbutils block-mount libblkid luci-app-advanced-reboot luci-proto-relay relayd luci-app-attendedsysupgrade stdiscosrv luci-app-banip kmod-amazon-ena kmod-amd-xgbe fdisk gdisk ethtool coremark cfdisk coreutils etherwake luci-compat shadow-useradd shadow-usermod shadow-groupadd shadow-groupmod exfat-mkfs exfat-mkfs hd-idle luci-app-hd-idle luci-app-sqm cifsmount tar iptables-nft ip6tables-nft containerd docker docker-compose dockerd luci-lib-docker luci-app-dockerman minidlna luci-app-minidlna wpad-wolfssl luci-proto-batman-adv cifsmount luci-app-cshark"

It seems to run successfully until the end where i get the following

/target-x86_64_musl/linux-x86_64/tmp/openwrt-23.05.5-x86-64-generic-ext4-combined-efi.img.gz.boot/efi/boot/bootx64.efi ::/efi/boot/
+ dd if=/opt/openwrt-imagebuilder-23.05.5-x86-64.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/tmp/openwrt-23.05.5-x86-64-generic-ext4-combined-efi.img.gz.kernel of=/opt/openwrt-imagebuilder-23.05.5-x86-64.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/tmp/openwrt-23.05.5-x86-64-generic-ext4-combined-efi.img.gz bs=512 seek=512 conv=notrunc
32768+0 records in
32768+0 records out
16777216 bytes (17 MB, 16 MiB) copied, 0.101835 s, 165 MB/s
+ rm -f /opt/openwrt-imagebuilder-23.05.5-x86-64.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/tmp/openwrt-23.05.5-x86-64-generic-ext4-combined-efi.img.gz.kernel
/opt/openwrt-imagebuilder-23.05.5-x86-64.Linux-x86_64/staging_dir/host/bin/grub-bios-setup: warning: Your BIOS Boot Partition is under 1 MiB, please increase its size..

Calculating checksums...
cc      -o .o
cc: fatal error: no input files
compilation terminated.
make: *** [<builtin>: .o] Error 1
bash:  : command not found

I would be grateful for any assistance.

post the command line for the build, plus any env variables you set.

Thanks @frollic
I have posted the command line at the top. I don't have any environmental variables set anywhere. It's a vanilla build with just the prerequisites

sudo apt install build-essential libncurses5-dev libncursesw5-dev \
zlib1g-dev gawk git gettext libssl-dev xsltproc rsync wget unzip python

an image based on the config you provided builds just fine on Fedora 40, so it's related to your VM.

whole openwrt folder is 3.3GB, do you have space enough ?

I do (unless I'm misreading the output of df -h)

root@debiancli:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           791M  736K  790M   1% /run
/dev/sda2        38G  3.8G   32G  11% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda1       511M  5.9M  506M   2% /boot/efi
tmpfs           791M     0  791M   0% /run/user/1000

I ran into similar problems recently, despite using:

make image CONFIG_TARGET_KERNEL_PARTSIZE=128 CONFIG_TARGET_ROOTFS_PARTSIZE=1024

The image would not build. I've had to change the .config parameters first:

cp .config .config.old
sed -i "s|^\(CONFIG_TARGET_KERNEL_PARTSIZE\).*|\1=128|" .config
sed -i "s|^\(CONFIG_TARGET_ROOTFS_PARTSIZE\).*|\1=1024|" .config

For BIOS boot partition error, I use the following patch (on target/linux/x86/image/Makefile):

diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile.a
index 322131c..b2f3683 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile.a
@@ -53,7 +53,7 @@ define Build/combined
 		$@ \
 		$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
 		$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
-		256
+		1024
 endef

 define Build/grub-config
1 Like