#!/bin/sh # In FreeBSD DISK_MD="md0" UBOOT_DIR="roc-rk3566-pc" UBOOT_BIN="idblock.bin" UBOOT_PATH="/usr/local/share/edk2/${UBOOT_DIR}" set -x # # Station-P2 uses EFI # station_partition_image ( ) { gpart destroy -F ${DISK_MD} gpart create -s GPT ${DISK_MD} gpart add -t linux-data -l loader -b 32k -s 16320 ${DISK_MD} gpart add -t linux-data -l uboot -s 8m ${DISK_MD} gpart add -t linux-data -l env -s 16m ${DISK_MD} gpart add -t efi -l efi -a 512k -b 16m -s 50m ${DISK_MD} gpart add -t freebsd-swap -l swapfs -a 64k -s 1G ${DISK_MD} gpart add -t freebsd-ufs -l rootfs -a 64k -s 1G ${DISK_MD} } station_uefi_write () { echo "Installing EDK2 on ${DISK_MD}" if [ -f ${UBOOT_PATH}/idblock.bin ] ; then dd if=${UBOOT_PATH}/idblock.bin of=/dev/${DISK_MD} bs=512 seek=64 conv=notrunc dd if=${UBOOT_PATH}/u-boot.itb of=/dev/${DISK_MD} bs=512 seek=20480 conv=notrunc fi } # Insert SD card reader in to USB, # uncomment next line an run # station_partition_image station_uefi_write