1#!/bin/sh 2# 3# 4 5DTB_DIR="/usr/local/share/rpi-firmware" 6DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2710-rpi-cm3.dtb \ 7 bcm2711-rpi-4-b.dtb bcm2711-rpi-cm4-io.dtb bcm2711-rpi-cm4.dtb" 8EMBEDDED_TARGET_ARCH="aarch64" 9EMBEDDED_TARGET="arm64" 10EMBEDDEDBUILD=1 11EMBEDDEDPORTS="sysutils/u-boot-rpi-arm64 sysutils/rpi-firmware" 12FAT_SIZE="50m -b 1m" 13FAT_TYPE="16" 14IMAGE_SIZE="5120M" 15KERNEL="GENERIC" 16MD_ARGS="-x 63 -y 255" 17OL_DIR="${DTB_DIR}/overlays" 18OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo" 19PART_SCHEME="MBR" 20export BOARDNAME="RPI" 21CONFIG_POWERD_ENABLE=1 22 23arm_install_uboot() { 24 UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64" 25 UBOOT_FILES="README u-boot.bin" 26 DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \ 27 fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ 28 start_cd.elf start_db.elf start_x.elf start.elf \ 29 fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat start4.elf \ 30 start4cd.elf start4db.elf start4x.elf ${DTB}" 31 FATMOUNT="${DESTDIR%${KERNEL}}fat" 32 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" 33 chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} 34 for _UF in ${UBOOT_FILES}; do 35 chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ 36 ${FATMOUNT}/${_UF} 37 done 38 for _DF in ${DTB_FILES}; do 39 chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \ 40 ${FATMOUNT}/${_DF} 41 done 42 chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_arm64.txt \ 43 ${FATMOUNT}/config.txt 44 chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays 45 for _OL in ${OVERLAYS}; do 46 chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \ 47 ${FATMOUNT}/overlays/${_OL} 48 done 49 50 sync 51 umount_loop ${CHROOTDIR}/${FATMOUNT} 52 chroot ${CHROOTDIR} rmdir ${FATMOUNT} 53 54 return 0 55} 56