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"
|
2019-02-04 18:29:23 +00:00
|
|
|
DTB="bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.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
|
2018-03-21 14:36:16 +00:00
|
|
|
EMBEDDEDPORTS="sysutils/u-boot-rpi3 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"
|
|
|
|
NODOC=1
|
2018-03-21 14:36:16 +00:00
|
|
|
OL_DIR="${DTB_DIR}/overlays"
|
2018-05-17 19:10:13 +00:00
|
|
|
OVERLAYS="mmc.dtbo pwm.dtbo pi3-disable-bt.dtbo"
|
2017-11-17 17:34:52 +00:00
|
|
|
PART_SCHEME="MBR"
|
2017-06-23 00:08:36 +00:00
|
|
|
export BOARDNAME="RPI3"
|
|
|
|
|
|
|
|
arm_install_uboot() {
|
|
|
|
UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3"
|
2018-04-10 17:40:44 +00:00
|
|
|
UBOOT_FILES="README u-boot.bin"
|
2018-05-17 19:10:13 +00:00
|
|
|
DTB_FILES="armstub8.bin bootcode.bin fixup_cd.dat \
|
2018-04-10 17:40:44 +00:00
|
|
|
fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \
|
|
|
|
start_cd.elf start_db.elf start_x.elf start.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
|
2018-05-17 19:10:13 +00:00
|
|
|
chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_rpi3.txt \
|
|
|
|
${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
|
|
|
|
}
|