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