2017-06-23 00:08:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2018-03-21 14:36:16 +00:00
|
|
|
DTB_DIR="/usr/local/share/rpi-firmware"
|
2020-11-22 18:42:08 +00:00
|
|
|
DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb"
|
2017-06-23 00:08:36 +00:00
|
|
|
EMBEDDED_TARGET_ARCH="aarch64"
|
2017-11-17 17:34:52 +00:00
|
|
|
EMBEDDED_TARGET="arm64"
|
|
|
|
EMBEDDEDBUILD=1
|
2020-12-15 15:13:06 +00:00
|
|
|
EMBEDDEDPORTS="sysutils/u-boot-rpi-arm64 sysutils/rpi-firmware"
|
2017-06-23 00:08:36 +00:00
|
|
|
FAT_SIZE="50m -b 1m"
|
|
|
|
FAT_TYPE="16"
|
2019-03-21 14:17:55 +00:00
|
|
|
IMAGE_SIZE="3072M"
|
2017-11-17 17:34:52 +00:00
|
|
|
KERNEL="GENERIC"
|
2017-06-23 00:08:36 +00:00
|
|
|
MD_ARGS="-x 63 -y 255"
|
2018-03-21 14:36:16 +00:00
|
|
|
OL_DIR="${DTB_DIR}/overlays"
|
2019-12-05 16:17:56 +00:00
|
|
|
OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo"
|
2017-11-17 17:34:52 +00:00
|
|
|
PART_SCHEME="MBR"
|
2020-12-15 15:13:06 +00:00
|
|
|
export BOARDNAME="RPI"
|
2017-06-23 00:08:36 +00:00
|
|
|
|
|
|
|
arm_install_uboot() {
|
2020-12-15 15:13:06 +00:00
|
|
|
UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64"
|
2018-04-10 17:40:44 +00:00
|
|
|
UBOOT_FILES="README u-boot.bin"
|
2019-12-05 16:17:56 +00:00
|
|
|
DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \
|
2018-04-10 17:40:44 +00:00
|
|
|
fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \
|
2020-01-31 15:56:08 +00: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 00:08:36 +00:00
|
|
|
FATMOUNT="${DESTDIR%${KERNEL}}fat"
|
2018-07-22 12:03:17 +00:00
|
|
|
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}"
|
2017-06-23 00:08:36 +00: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 17:40:44 +00:00
|
|
|
for _DF in ${DTB_FILES}; do
|
|
|
|
chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \
|
|
|
|
${FATMOUNT}/${_DF}
|
|
|
|
done
|
2020-12-15 15:13:06 +00:00
|
|
|
chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_arm64.txt \
|
2018-05-17 19:10:13 +00:00
|
|
|
${FATMOUNT}/config.txt
|
2017-06-23 00:08:36 +00:00
|
|
|
chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
|
|
|
|
for _OL in ${OVERLAYS}; do
|
2018-03-21 14:36:16 +00:00
|
|
|
chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \
|
|
|
|
${FATMOUNT}/overlays/${_OL}
|
2017-06-23 00:08:36 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
sync
|
|
|
|
umount_loop ${CHROOTDIR}/${FATMOUNT}
|
|
|
|
chroot ${CHROOTDIR} rmdir ${FATMOUNT}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|