diff --git a/src/runtime_src/tools/scripts/ertbuild.sh b/src/runtime_src/tools/scripts/ertbuild.sh index 52842ff540f..36f0a592da1 100755 --- a/src/runtime_src/tools/scripts/ertbuild.sh +++ b/src/runtime_src/tools/scripts/ertbuild.sh @@ -24,21 +24,23 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" usage() { echo "Build platfrom specific embedded runtime (ert)" echo - echo "-platform Embedded Platform name, e.g. zcu102ng / xcu104_revmin" - echo "-vivado Full path to vivado executable" - echo "-xsct Full path to xsct executable" - echo "-petalinux Full path to petalinux folder" - echo "-xrt XRT github repo path" - echo "[-build-dsa ] Build DSA or not, if not then copy a pre-build DSA from a relative path to vivado executable. Default=Yes" - echo "[-build-sysroot ] Build SYSROOT or not, default=No" - echo "[-bsp ] Optional, full path to the platform bsp file, if not supplied, then the PetaLinux project is created using --template" - echo "[-help] List this help" + echo "-platform Embedded Platform name, e.g. zcu102ng / zcu104_revmin" + echo "-vivado Full path to vivado executable" + echo "-xsct Full path to xsct executable" + echo "-petalinux Full path to petalinux folder" + echo "-xrt XRT github repo path" + echo "[-full-peta-linux-build Do a full peta-linux build or not. Full petalinux builds will take much longer time. Default=No" + echo "[-build-dsa ] Build DSA or not, if not then copy a pre-build DSA from a relative path to vivado executable. Default=Yes" + echo "[-build-sysroot ] Build SYSROOT or not, default=No" + echo "[-bsp ] Optional, full path to the platform bsp file, if not supplied, then the PetaLinux project is created using --template" + echo "[-help] List this help" exit $1 } BSP_FILE="/null/null/fasan" GEN_DSA="Yes" BUILD_SYSROOT="No" +FULL_PETA_BULD="No" while [ $# -gt 0 ]; do case "$1" in -help) @@ -54,6 +56,11 @@ while [ $# -gt 0 ]; do BUILD_SYSROOT=$1 shift ;; + -full-peta-linux-build) + shift + FULL_PETA_BULD=$1 + shift + ;; -vivado) shift PATH_TO_VIVADO=$1 @@ -202,14 +209,14 @@ mkdir -p ${PLATFORM_NAME}/build/conf/ echo " * Configuring PetaLinux Project" # Allow users to access shell without login echo "CONFIG_YOCTO_ENABLE_DEBUG_TWEAKS=y" >> ${PLATFORM_NAME}/project-spec/configs/config -echo "petalinux-config -p $PLATFORM_NAME --get-hw-description=${PLATFOMR_SDK} --oldconfig" -petalinux-config -p $PLATFORM_NAME --get-hw-description=${PLATFOMR_SDK} --oldconfig +echo "petalinux-config -p $PLATFORM_NAME --get-hw-description=${PLATFOMR_SDK} --silentconfig" +petalinux-config -p $PLATFORM_NAME --get-hw-description=${PLATFOMR_SDK} --silentconfig + -#NASSER echo "Replacing CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE" perl -p -i -e "s/CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE/# CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE\ is\ not\ set/g" ${PLATFORM_NAME}/project-spec/configs/config cd ${PLATFORM_NAME} -petalinux-config --oldconfig +petalinux-config --silentconfig cd - echo " * Change to meta directory: ${PLATFORM_NAME}/project-spec/meta-user/" @@ -258,18 +265,20 @@ addIfNoExists 'IMAGE_INSTALL_append = " zocl"' $PETALINUX_IMAGE_BBAPPEND addIfNoExists 'IMAGE_INSTALL_append = " opencl-headers-dev"' $PETALINUX_IMAGE_BBAPPEND addIfNoExists 'IMAGE_INSTALL_append = " opencl-clhpp-dev"' $PETALINUX_IMAGE_BBAPPEND -echo " * Adding XRT Kernel Node to Device Tree" -echo "cat ${XRT_REPO_DIR}/src/runtime_src/driver/zynq/fragments/xlnk_dts_fragment_mpsoc.dts >> recipes-bsp/device-tree/files/system-user.dtsi" -cat ${XRT_REPO_DIR}/src/runtime_src/driver/zynq/fragments/xlnk_dts_fragment_mpsoc.dts >> recipes-bsp/device-tree/files/system-user.dtsi +if [ $FULL_PETA_BULD == "Yes" ]; then + echo " * Adding XRT Kernel Node to Device Tree" + echo "cat ${XRT_REPO_DIR}/src/runtime_src/driver/zynq/fragments/xlnk_dts_fragment_mpsoc.dts >> recipes-bsp/device-tree/files/system-user.dtsi" + cat ${XRT_REPO_DIR}/src/runtime_src/driver/zynq/fragments/xlnk_dts_fragment_mpsoc.dts >> recipes-bsp/device-tree/files/system-user.dtsi -if [ -f ${ORIGINAL_DIR}/dsa_build/${PLATFORM_NAME}_fragment.dts ]; then - echo "cat ${ORIGINAL_DIR}/dsa_build/${PLATFORM_NAME}_fragment.dts >> recipes-bsp/device-tree/files/system-user.dtsi" - cat ${ORIGINAL_DIR}/dsa_build/${PLATFORM_NAME}_fragment.dts >> recipes-bsp/device-tree/files/system-user.dtsi + if [ -f ${ORIGINAL_DIR}/dsa_build/${PLATFORM_NAME}_fragment.dts ]; then + echo "cat ${ORIGINAL_DIR}/dsa_build/${PLATFORM_NAME}_fragment.dts >> recipes-bsp/device-tree/files/system-user.dtsi" + cat ${ORIGINAL_DIR}/dsa_build/${PLATFORM_NAME}_fragment.dts >> recipes-bsp/device-tree/files/system-user.dtsi + fi fi echo " * Configuring the kernel" #Configure Linux kernel (default kernel config is good for zocl driver) -petalinux-config -c kernel --oldconfig +petalinux-config -c kernel --silentconfig echo " * Configuring rootfs" # Configure rootfs, enable below components: @@ -290,16 +299,20 @@ addIfNoExists 'CONFIG_opencl-headers-dev=y' ../configs/rootfs_config addIfNoExists 'CONFIG_opencl-clhpp-dev=y' ../configs/rootfs_config -petalinux-config -c rootfs --oldconfig +petalinux-config -c rootfs --silentconfig # Build package echo " * Performing PetaLinux Build (from: ${PWD})" -echo "petalinux-build" -petalinux-build -# NASSER for incremental XRT build use -petalinux-build -c xrt -petalinux-build -c zocl +if [ $FULL_PETA_BULD == "Yes" ]; then + echo "petalinux-build --force (FULL)" + petalinux-build --force +else + echo "petalinux-build (XRT ONLY)" + petalinux-build -c xrt + echo "petalinux-build (ZOCL Only)" + petalinux-build -c zocl +fi cd $ORIGINAL_DIR echo " * Copying PetaLinux boot files (from: $PWD)" @@ -334,7 +347,7 @@ if [ $BUILD_SYSROOT == "Yes" ]; then cd - fi -echo " * Expanding $ORIGINAL_DIR/${PLATFORM_NAME}/images/linux/rootfs.tar.gz" +echo " * Expanding $ORIGINAL_DIR/${PLATFORM_NAME}/images/linux/rootfs.tar.gz in $PWD" tar zxf $ORIGINAL_DIR/${PLATFORM_NAME}/images/linux/rootfs.tar.gz cd ${ORIGINAL_DIR}/dsa_build