Files
pawlet_rpi4/mkbootimg.mk
T
oxmc 2362560796 mkbootimg: use stamp file for rpiboot, uppercase FAT label
Targeting the rpiboot directory directly confuses ninja when inner files
change (Missing restat warning, outputs should be files error). Use a
stamp file (.stamp) so ninja correctly detects when the directory contents
are stale.

Also uppercase the FAT volume label BOOT to avoid mkfs.fat's lowercase
label compatibility warning.
2026-06-07 03:24:48 -07:00

33 lines
1.1 KiB
Makefile

#
# Copyright (C) 2021-2022 KonstaKANG
# Copyright (C) 2025-2026 oxmc
#
# SPDX-License-Identifier: Apache-2.0
#
DEVICE_PATH := device/pawlet/rpi4
KERNEL_PATH := device/brcm/rpi4-kernel
VENDOR_PATH := vendor/brcm
# Use a stamp file so ninja tracks the directory contents correctly.
# Targeting the directory itself confuses ninja when inner files change.
RPI_BOOT_OUT := $(PRODUCT_OUT)/rpiboot
RPI_BOOT_STAMP := $(RPI_BOOT_OUT)/.stamp
$(RPI_BOOT_STAMP): $(INSTALLED_RAMDISK_TARGET)
mkdir -p $(RPI_BOOT_OUT)/overlays
cp $(DEVICE_PATH)/boot/* $(RPI_BOOT_OUT)
cp $(KERNEL_PATH)/Image $(RPI_BOOT_OUT)
cp $(KERNEL_PATH)/bcm2711-rpi-*.dtb $(RPI_BOOT_OUT)
cp $(KERNEL_PATH)/overlays/* $(RPI_BOOT_OUT)/overlays
cp $(PRODUCT_OUT)/ramdisk.img $(RPI_BOOT_OUT)
cp $(VENDOR_PATH)/rpi4/proprietary/boot/* $(RPI_BOOT_OUT)
echo $(BOARD_KERNEL_CMDLINE) > $(RPI_BOOT_OUT)/cmdline.txt
touch $@
$(INSTALLED_BOOTIMAGE_TARGET): $(RPI_BOOT_STAMP)
$(call pretty,"Target boot image: $@")
dd if=/dev/zero of=$@ bs=1M count=128
mkfs.fat -F 32 -n "BOOT" $@
mcopy -s -i $@ $(RPI_BOOT_OUT)/* ::