From 992f67709cdaba787d57530c613eb41d5bfe219a Mon Sep 17 00:00:00 2001 From: Bunnaroath Sou Date: Wed, 30 Jan 2019 14:42:47 -0800 Subject: Update to generate bsp at a custom location --- bsp/update-targets.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/bsp/update-targets.sh b/bsp/update-targets.sh index 780d662..fc1b76c 100755 --- a/bsp/update-targets.sh +++ b/bsp/update-targets.sh @@ -1,5 +1,60 @@ #!/usr/bin/env sh +help() { + cat >&2 <&2; exit 1;; + esac +done + +if [[ "$CUSTOM_PATH" == "" && "$CUSTOM_NAME" == "" && "$DTSFILE" == "" ]] +then + TARGET_LIST="$(ls -d coreip*) " + TARGET_LIST+="sifive-hifive1 freedom-e310-arty " +else + if [[ ! -f "$DTSFILE" && "$DTSFILE" != "*.dts" ]] + then + echo "[ERROR] $0: $DTSFILE must be a dts file" >&2 + help "$0" + exit 1 + fi + if [[ "$CUSTOM_NAME" == "" ]] + then + echo "[ERROR] $0: --target-name is mandatory" >&2 + help "$0" + exit 1 + fi + CUSTOM_TARGET="$CUSTOM_PATH/bsp/$CUSTOM_NAME" + if [[ ! -d "$CUSTOM_TARGET" ]] + then + echo "[ERROR] $0: "$CUSTOM_TARGET" not found!" >&2 + help "$0" + exit 1 + fi + cp $DTSFILE $CUSTOM_TARGET + TARGET_LIST="$CUSTOM_TARGET " +fi + DTC=dtc MEE_HEADER_GENERATOR=freedom-mee_header-generator LDSCRIPT_GENERATOR=freedom-ldscript-generator @@ -9,9 +64,6 @@ DTB_FILENAME=temp.dtb HEADER_FILENAME=mee.h LDSCRIPT_FILENAME=mee.lds -TARGET_LIST="$(ls -d coreip*) " -TARGET_LIST+="sifive-hifive1 freedom-e310-arty " - update_target() { TARGET=$1 @@ -30,6 +82,7 @@ update_target() { echo "" } +echo $PWD for TARGET in $TARGET_LIST do update_target $TARGET -- cgit v1.2.3