X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=scripts%2Fbuild_oran.sh;h=fd8df20e6a069da064aefd30a90557b316faf128;hb=be9f4e2b8f45d1c8f5f33b5c112695715d429166;hp=ef5cbb5b15294c55d0b1ab5363eb4739f732efa5;hpb=da071f80b8756ce948ae54cfee514969d7c13f39;p=pti%2Frtp.git diff --git a/scripts/build_oran.sh b/scripts/build_oran.sh index ef5cbb5..fd8df20 100755 --- a/scripts/build_oran.sh +++ b/scripts/build_oran.sh @@ -3,9 +3,11 @@ help_info () { cat << ENDHELP Usage: -$(basename $0) WORKSPACE_DIR +$(basename $0) <-w WORKSPACE_DIR> [-n] [-h] where: - WORKSPACE_DIR is the path for the project + -w WORKSPACE_DIR is the path for the project + -n dry-run only for bitbake + -h this help info ENDHELP } @@ -24,14 +26,35 @@ echo_cmd () { } if [ $# -eq 0 ]; then + echo "Missing options!" help_info exit fi +DRYRUN="" + SCRIPTS_DIR=`dirname $0` SCRIPTS_DIR=`readlink -f $SCRIPTS_DIR` -WORKSPACE=`readlink -f $1` +while getopts "w:nh" OPTION; do + case ${OPTION} in + w) + WORKSPACE=`readlink -f ${OPTARG}` + ;; + n) + DRYRUN="-n" + ;; + h) + help_info + exit + ;; + esac +done + +if [ -z ${WORKSPACE} ]; then + echo_info "No workspace specified, a directory 'workspace' will be created in current directory as the workspace" + WORKSPACE=`readlink -f workspace` +fi SRC_WRL_DIR=${WORKSPACE}/src_wrl1018 SRC_ORAN_DIR=${WORKSPACE}/src_oran @@ -58,7 +81,7 @@ ${RUN_CMD} echo_info "Cloning oran layer:" cd ${SRC_ORAN_DIR} -RUN_CMD="git clone http://stash.wrs.com/scm/~jhuang0/o-ran-pti-rtp.git" +RUN_CMD="git clone https://gerrit.o-ran-sc.org/r/pti/rtp" echo_cmd "Cloing with:" ${RUN_CMD} @@ -70,7 +93,7 @@ set ${PRJ_BUILD_DIR} # Add the meta-oran layer and required layers cd ${PRJ_BUILD_DIR} -bitbake-layers add-layer ${SRC_ORAN_DIR}/o-ran-pti-rtp/meta-oran +bitbake-layers add-layer ${SRC_ORAN_DIR}/rtp/meta-oran # Add extra configs into local.conf cat << EOF >> conf/local.conf @@ -84,4 +107,4 @@ EOF # Build the oran-inf-host image mkdir -p logs TIMESTAMP=`date +"%Y%m%d_%H%M%S"` -bitbake wrlinux-image-oran-host 2>&1|tee logs/bitbake_wrlinux-image-oran-host_${TIMESTAMP}.log +bitbake ${DRYRUN} oran-image-inf-host 2>&1|tee logs/bitbake_oran-image-inf-host_${TIMESTAMP}.log