# # Firefly STATION-P2 RK3568 Setup # TARGET=arm64 TARGET_ARCH=aarch64 # UEFI UBOOT_DIR="roc-rk3568-pc" UBOOT_PATH="/usr/local/share/edk2/${UBOOT_DIR}" # # Station-P2 uses EFI, # rk356x_partition_image ( ) { echo "Installing Partitions on ${DISK_MD}" disk_partition_gpt if [ -f ${UBOOT_PATH}/idblock.bin ] ; then if [ -f ${UBOOT_PATH}/resource.img ]; then gpart add -t linux-data -l loader -b 32k -s 16320 ${DISK_MD} >/dev/null 2>&1 gpart add -t linux-data -l uboot -s 8m ${DISK_MD} >/dev/null 2>&1 gpart add -t linux-data -l env -s 16m ${DISK_MD} >/dev/null 2>&1 gpart add -t linux-data -l resource -s 16m ${DISK_MD} >/dev/null 2>&1 echo "Installing BSP U-Boot on ${DISK_MD}" dd if=${UBOOT_PATH}/idblock.bin of=/dev/${DISK_MD}p1 bs=512 conv=sync >/dev/null 2>&1 dd if=${UBOOT_PATH}/uboot.img of=/dev/${DISK_MD}p2 bs=512 conv=sync >/dev/null 2>&1 dd if=${UBOOT_PATH}/resource.img of=/dev/${DISK_MD}p4 bs=512 conv=sync >/dev/null 2>&1 disk_partition_efi_create else echo "Installing EDK2 UEFI BootLoader ${UBOOT_PATH} on ${DISK_MD}" dd if=${UBOOT_PATH}/idblock.bin of=/dev/${DISK_MD} conv=notrunc bs=512 seek=64 >/dev/null 2>&1 dd if=${UBOOT_PATH}/u-boot.itb of=/dev/${DISK_MD} conv=notrunc bs=512 seek=20480 >/dev/null 2>&1 disk_partition_efi_create 32m fi else echo "Installing Mainline U-Boot on ${DISK_MD}" dd if=${UBOOT_PATH}/idbloader.img of=/dev/${DISK_MD} conv=notrunc,sync bs=512 seek=64 >/dev/null 2>&1 dd if=${UBOOT_PATH}/u-boot.itb of=/dev/${DISK_MD} conv=notrunc,sync bs=512 seek=16384 >/dev/null 2>&1 disk_partition_efi_create fi disk_partition_swap_create 256m disk_partition_ufs_create } strategy_add $PHASE_PARTITION_LWW rk356x_partition_image # Build & install loader.efi. strategy_add $PHASE_BUILD_OTHER freebsd_loader_efi_build strategy_add $PHASE_BOOT_INSTALL mkdir -p EFI/BOOT strategy_add $PHASE_BOOT_INSTALL freebsd_loader_efi_copy EFI/BOOT/bootaa64.efi # Puts the kernel on the FreeBSD ROOT partition. strategy_add $PHASE_FREEBSD_BOARD_INSTALL board_default_installkernel .