u-boot/build-imx8-nmhw23.sh

38 lines
875 B
Bash
Executable File

#!/usr/bin/env bash
# Stop on error
set -e
# Create vendor common dir link
if [ ! -d "board/netmodule/common" ]; then
ln -s `realpath board/freescale/common` board/netmodule/common
fi
# Build boot image
make imx8_nmhw23_defconfig
make
# Checkout imx-image git if not present
if [ ! -d "imx-mkimage.git" ]; then
git clone https://source.codeaurora.org/external/imx/imx-mkimage -b imx_4.14.98_2.0.0_ga imx-mkimage.git
ln -s `realpath bl31.bin` imx-mkimage.git/iMX8QX/bl31.bin
ln -s `realpath ahab-container.img` imx-mkimage.git/iMX8QX/mx8qx-ahab-container.img
ln -s `realpath imx8-nmhw23-scfw.bin` imx-mkimage.git/iMX8QX/scfw_tcm.bin
fi
# Generate boot image
cp u-boot.bin imx-mkimage.git/iMX8QX/
cd imx-mkimage.git
make SOC=iMX8QX flash
cd ..
cp imx-mkimage.git/iMX8QX/flash.bin .
# Generate eMMC/SD image
dd if=flash.bin of=flash.sd bs=1k seek=32 conv=fsync