1
0
Fork 0

Fix boot.img creation: use pre-built u-boot instead of mkfs.fat

mkfs.fat and mcopy are disallowed in Android 16 build system.
Use pre-built U-Boot binary as boot.img for packaging purposes.
The actual bootable image is created by mkimg_gpt.sh.

Copyright (C) 2026 Brendan Szymanski <hello@bscubed.dev>
This commit is contained in:
Brendan Szymanski 2026-07-11 14:17:24 -04:00
parent c898f32cca
commit 0ffea7f732

View file

@ -25,14 +25,6 @@ $(OPI_BOOT_OUT): $(PRODUCT_OUT)/ramdisk.img
$(INSTALLED_BOOTIMAGE_TARGET): $(OPI_BOOT_OUT)
$(call pretty,"Target boot image: $@")
# Determine size in bytes, add 10 MiB padding, convert to 512-byte blocks
BOOT_SIZE_BYTES=`du -s -k $(OPI_BOOT_OUT) | awk '{ print $$1 * 1024 }'`; \
PADDED_BYTES=`expr $$BOOT_SIZE_BYTES + 10485760`; \
BLOCKS=`expr $$PADDED_BYTES / 512`; \
echo "Creating boot image with $$BLOCKS blocks..."; \
dd if=/dev/zero of=$@ bs=512 count=$$BLOCKS; \
mkfs.fat -F 32 -n "boot" $@; \
mcopy -s -i $@ $(OPI_BOOT_OUT)/* ::
cp $(KERNEL_PATH)/u-boot-rockchip.bin $@