1#!/bin/sh 2# 3# 4 5EMBEDDED_TARGET_ARCH="armv7" 6EMBEDDED_TARGET="arm" 7EMBEDDEDBUILD=1 8EMBEDDEDPORTS="sysutils/u-boot-rpi2 sysutils/rpi-firmware" 9FAT_SIZE="50m -b 1m" 10FAT_TYPE="16" 11IMAGE_SIZE="5120M" 12KERNEL="GENERIC" 13MD_ARGS="-x 63 -y 255" 14RPI_UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" 15RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" 16RPI_OL_DIR="${RPI_FIRMWARE_DIR}/overlays" 17OVERLAYS="mmc.dtbo" 18PART_SCHEME="MBR" 19export BOARDNAME="GENERICSD" 20 21arm_install_uboot_rpi2() { 22 UBOOT_FILES="u-boot.bin" 23 RPI_FIRMWARE_FILES="bootcode.bin config.txt \ 24 fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ 25 start.elf start_cd.elf start_db.elf start_x.elf \ 26 bcm2709-rpi-2-b.dtb" 27 FATMOUNT="${DESTDIR%${KERNEL}}/fat" 28 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" 29 chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} 30 for _UF in ${UBOOT_FILES}; do 31 chroot ${CHROOTDIR} cp -p ${RPI_UBOOT_DIR}/${_UF} \ 32 ${FATMOUNT}/${_UF} 33 done 34 for _UF in ${RPI_FIRMWARE_FILES}; do 35 chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ 36 ${FATMOUNT}/${_UF} 37 done 38 chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays 39 for _OL in ${OVERLAYS}; do 40 chroot ${CHROOTDIR} cp -p ${RPI_OL_DIR}/${_OL} \ 41 ${FATMOUNT}/overlays/${_OL} 42 done 43 sync 44 umount_loop ${CHROOTDIR}/${FATMOUNT} 45 chroot ${CHROOTDIR} rmdir ${FATMOUNT} 46 47 return 0 48} 49 50arm_install_uboot() { 51 arm_install_uboot_rpi2 52} 53