X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=scripts%2Fbuild_oran.sh;h=7d899bbb8cb3f4e1779c0783bd1c38841a572618;hb=2d4dbbd68dc1a73b00d22bc9c2e8776e1feebac5;hp=ee1e1d2d09d259295d6346b227d8d475b50fd445;hpb=90b87ffa661d207f060cae47021acd418f53a3eb;p=pti%2Frtp.git diff --git a/scripts/build_oran.sh b/scripts/build_oran.sh index ee1e1d2..7d899bb 100755 --- a/scripts/build_oran.sh +++ b/scripts/build_oran.sh @@ -1,11 +1,13 @@ -#!/bin/sh +#!/bin/bash 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 @@ -50,7 +73,7 @@ echo_cmd "Cloning wrlinux 1018 source from github:" cd ${SRC_WRL_DIR} ${RUN_CMD} -RUN_CMD="./wrlinux-x/setup.sh --machines intel-x86-64 --layers wrlinux-ovp meta-cloud-services" +RUN_CMD="./wrlinux-x/setup.sh --machines intel-x86-64 --layers meta-cloud-services" echo_cmd "Setup wrlinux build project:" ${RUN_CMD} @@ -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 @@ -79,9 +102,11 @@ cat << EOF >> conf/local.conf ######################## DISTRO = "oran-inf" BB_NO_NETWORK = '0' +WRTEMPLATE += "feature/oran-host-rt-tune" 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 +set -o pipefail +bitbake ${DRYRUN} oran-image-inf-host 2>&1|tee logs/bitbake_oran-image-inf-host_${TIMESTAMP}.log