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
}
}
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
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}
# 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
# Build the oran-inf-host image
mkdir -p logs
TIMESTAMP=`date +"%Y%m%d_%H%M%S"`
-bitbake oran-image-inf-host 2>&1|tee logs/bitbake_oran-image-inf-host_${TIMESTAMP}.log
+bitbake ${DRYRUN} oran-image-inf-host 2>&1|tee logs/bitbake_oran-image-inf-host_${TIMESTAMP}.log