1#!/bin/sh 2# 3# $FreeBSD$ 4# 5 6EMBEDDED_TARGET_ARCH="aarch64" 7EMBEDDED_TARGET="arm64" 8EMBEDDEDBUILD=1 9EMBEDDEDPORTS="sysutils/u-boot-pine64" 10FAT_SIZE="54m -b 1m" 11FAT_TYPE="16" 12IMAGE_SIZE="2560M" 13KERNEL="GENERIC" 14MD_ARGS="-x 63 -y 255" 15NODOC=1 16PART_SCHEME="MBR" 17export BOARDNAME="PINE64" 18 19arm_install_uboot() { 20 UBOOT_DIR="/usr/local/share/u-boot/u-boot-pine64" 21 UBOOT_FILES="u-boot-sunxi-with-spl.bin" 22 FATMOUNT="${DESTDIR%${KERNEL}}fat" 23 UFSMOUNT="${DESTDIR%${KERNEL}}ufs" 24 chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ 25 of=/dev/${mddev} bs=1k seek=8 conv=sync 26 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" 27 chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} 28 chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} 29 30 BOOTFILES="$(chroot ${CHROOTDIR} \ 31 env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ 32 WITH_UNIFIED_OBJDIR=yes \ 33 make -C ${WORLDDIR}/stand -V .OBJDIR)" 34 BOOTFILES="$(chroot ${CHROOTDIR} realpath ${BOOTFILES})" 35 36 chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT 37 chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader/loader.efi \ 38 ${FATMOUNT}/EFI/BOOT/bootaa64.efi 39 chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot 40 sync 41 umount_loop ${CHROOTDIR}/${FATMOUNT} 42 umount_loop ${CHROOTDIR}/${UFSMOUNT} 43 chroot ${CHROOTDIR} rmdir ${FATMOUNT} 44 chroot ${CHROOTDIR} rmdir ${UFSMOUNT} 45 46 return 0 47} 48