-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmkbootimg.mk
More file actions
27 lines (24 loc) · 876 Bytes
/
mkbootimg.mk
File metadata and controls
27 lines (24 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# Copyright (C) 2021-2022 KonstaKANG
#
# SPDX-License-Identifier: Apache-2.0
#
DEVICE_PATH := device/brcm/rpi4
KERNEL_PATH := device/brcm/rpi4-kernel
VENDOR_PATH := vendor/brcm
RPI_BOOT_OUT := $(PRODUCT_OUT)/rpiboot
$(RPI_BOOT_OUT): $(INSTALLED_RAMDISK_TARGET)
mkdir -p $(RPI_BOOT_OUT)
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
$(INSTALLED_BOOTIMAGE_TARGET): $(RPI_BOOT_OUT)
$(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)/* ::