diff --git a/.gitignore b/.gitignore index 10089bb1d..ea6b5ebdd 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ u-boot.cfg /mkgpt/bin /mkgpt/gpttable __pycache__ +./*-fip.bin diff --git a/mt7981_360t7_build.sh b/mt7981_360t7_build.sh new file mode 100755 index 000000000..333f400f2 --- /dev/null +++ b/mt7981_360t7_build.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +TOOLCHAIN=aarch64-linux-gnu- +command -v ${TOOLCHAIN}gcc +[ "$?" != "0" ] && { echo ${TOOLCHAIN}gcc not found!; exit 0; } + +export CROSS_COMPILE=$TOOLCHAIN + +BOARD=360t7 + +UBOOT_DIR=uboot-mtk-20220606 +UBOOT_CFG=mt7981_360t7_defconfig + +ATF_DIR=atf-20220606-637ba581b +ATF_CFG=mt7981_360t7_defconfig + +echo "build u-boot..." +cp -f $UBOOT_DIR/configs/$UBOOT_CFG $UBOOT_DIR/.config +make -C $UBOOT_DIR olddefconfig all +if [ -f "$UBOOT_DIR/u-boot.bin" ]; then + cp -f $UBOOT_DIR/u-boot.bin $ATF_DIR/u-boot.bin + echo "u-boot.bin done" +else + echo "u-boot.bin fail!" + exit 1 +fi + +echo "build atf..." +make -C $ATF_DIR -f makefile $ATF_CFG all +if [ -f "$ATF_DIR/build/mt7981/release/fip.bin" ]; then + cp -f $ATF_DIR/build/mt7981/release/fip.bin $BOARD-fip.bin + echo "fip.bin done" +else + echo "fip build fail!" + exit 1 +fi