#!/bin/bash

source /opt/oecore-sdk/environment-setup-aarch64-oe-linux
cd kernel_sources/linux-xlnx
cp config_base .config
yes "" | make oldconfig
make -j 64

if [ $? -ne 0 ]; then
    echo "Failed build - ignoring commit"
    exit 125;
fi

cp kernel_sources/linux-xlnx/arch/arm64/boot/Image /tftpboot/xlnx2
source /opt/Xilinx/Vivado/2019.1/settings64.sh
boot_rfsoc_linux
check_boot_log.py
exit $?
