2017-06-23 02:08:36 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2018-03-21 15:36:16 +01:00
|
|
|
DTB_DIR="/usr/local/share/rpi-firmware"
|
2024-04-20 00:53:46 +02:00
|
|
|
DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2710-rpi-cm3.dtb \
|
2024-04-26 00:10:32 +02:00
|
|
|
bcm2711-rpi-4-b.dtb bcm2711-rpi-cm4-io.dtb bcm2711-rpi-cm4.dtb"
|
2017-06-23 02:08:36 +02:00
|
|
|
EMBEDDED_TARGET_ARCH="aarch64"
|
2017-11-17 18:34:52 +01:00
|
|
|
EMBEDDED_TARGET="arm64"
|
|
|
|
EMBEDDEDBUILD=1
|
2020-12-15 16:13:06 +01:00
|
|
|
EMBEDDEDPORTS="sysutils/u-boot-rpi-arm64 sysutils/rpi-firmware"
|
2017-06-23 02:08:36 +02:00
|
|
|
FAT_SIZE="50m -b 1m"
|
|
|
|
FAT_TYPE="16"
|
2022-02-08 19:07:57 +01:00
|
|
|
IMAGE_SIZE="6144M"
|
|
|
|
KERNEL="HARDENEDBSD"
|
2017-06-23 02:08:36 +02:00
|
|
|
MD_ARGS="-x 63 -y 255"
|
2018-03-21 15:36:16 +01:00
|
|
|
OL_DIR="${DTB_DIR}/overlays"
|
2019-12-05 17:17:56 +01:00
|
|
|
OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo"
|
2017-11-17 18:34:52 +01:00
|
|
|
PART_SCHEME="MBR"
|
2020-12-15 16:13:06 +01:00
|
|
|
export BOARDNAME="RPI"
|
2024-01-05 20:41:24 +01:00
|
|
|
CONFIG_POWERD_ENABLE=1
|
2017-06-23 02:08:36 +02:00
|
|
|
|
|
|
|
arm_install_uboot() {
|
2020-12-15 16:13:06 +01:00
|
|
|
UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64"
|
2018-04-10 19:40:44 +02:00
|
|
|
UBOOT_FILES="README u-boot.bin"
|
2019-12-05 17:17:56 +01:00
|
|
|
DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \
|
2018-04-10 19:40:44 +02:00
|
|
|
fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \
|
2020-01-31 16:56:08 +01:00
|
|
|
start_cd.elf start_db.elf start_x.elf start.elf \
|
|
|
|
fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat start4.elf \
|
|
|
|
start4cd.elf start4db.elf start4x.elf ${DTB}"
|
2017-06-23 02:08:36 +02:00
|
|
|
FATMOUNT="${DESTDIR%${KERNEL}}fat"
|
2018-07-22 14:03:17 +02:00
|
|
|
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}"
|
2017-06-23 02:08:36 +02:00
|
|
|
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
|
|
|
|
for _UF in ${UBOOT_FILES}; do
|
|
|
|
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
|
|
|
|
${FATMOUNT}/${_UF}
|
|
|
|
done
|
2018-04-10 19:40:44 +02:00
|
|
|
for _DF in ${DTB_FILES}; do
|
|
|
|
chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \
|
|
|
|
${FATMOUNT}/${_DF}
|
|
|
|
done
|
2020-12-15 16:13:06 +01:00
|
|
|
chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_arm64.txt \
|
2018-05-17 21:10:13 +02:00
|
|
|
${FATMOUNT}/config.txt
|
2017-06-23 02:08:36 +02:00
|
|
|
chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
|
|
|
|
for _OL in ${OVERLAYS}; do
|
2018-03-21 15:36:16 +01:00
|
|
|
chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \
|
|
|
|
${FATMOUNT}/overlays/${_OL}
|
2017-06-23 02:08:36 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
sync
|
|
|
|
umount_loop ${CHROOTDIR}/${FATMOUNT}
|
|
|
|
chroot ${CHROOTDIR} rmdir ${FATMOUNT}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|