X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=scripts%2Fbuild_oran.sh;h=12dce7bc9dc521ec455d1ff3bd2f4933c69fc01c;hb=refs%2Fchanges%2F28%2F2028%2F1;hp=bf8b9c0d2768312e44e10a0581fec1562e7751ed;hpb=b06a9779c08267f3e76eb0081657f8b8ca47501f;p=pti%2Frtp.git diff --git a/scripts/build_oran.sh b/scripts/build_oran.sh index bf8b9c0..12dce7b 100755 --- a/scripts/build_oran.sh +++ b/scripts/build_oran.sh @@ -26,6 +26,7 @@ where: -n dry-run only for bitbake -h this help info -e EXTRA_CONF is the pat for extra config file + -r whether to inherit rm_work (default is Yes) ENDHELP } @@ -49,23 +50,44 @@ if [ $# -eq 0 ]; then exit fi +check_yn_rm_work () { + yn="$1" + case ${yn} in + [Yy]|[Yy]es) + RM_WORK="Yes" + ;; + [Nn]|[Nn]o) + RM_WORK="No" + ;; + *) + echo "Invalid arg for -r option." + help_info + exit 1 + ;; + esac +} + DRYRUN="" EXTRA_CONF="" +RM_WORK="Yes" SCRIPTS_DIR=`dirname $0` SCRIPTS_DIR=`readlink -f $SCRIPTS_DIR` -while getopts "w:e:nh" OPTION; do +while getopts "w:e:r:nh" OPTION; do case ${OPTION} in w) WORKSPACE=`readlink -f ${OPTARG}` ;; e) EXTRA_CONF=`readlink -f ${OPTARG}` - ;; + ;; n) DRYRUN="-n" ;; + r) + check_yn_rm_work ${OPTARG} + ;; h) help_info exit @@ -104,8 +126,10 @@ ${RUN_CMD} if cd ${SCRIPTS_DIR} && git rev-parse --is-inside-work-tree > /dev/null 2>&1; then CLONED_ORAN_REPO=`dirname ${SCRIPTS_DIR}` echo_info "Use the cloned oran repo: ${CLONED_ORAN_REPO}" - cd ${SRC_ORAN_DIR} - ln -sf ${CLONED_ORAN_REPO} rtp + mkdir ${SRC_ORAN_DIR}/rtp + cd ${SRC_ORAN_DIR}/rtp + ln -sf ${CLONED_ORAN_REPO}/meta-oran meta-oran + ln -sf ${CLONED_ORAN_REPO}/scripts scripts else echo_info "Cloning oran layer:" cd ${SRC_ORAN_DIR} @@ -139,6 +163,10 @@ WRTEMPLATE += "feature/oran-host-rt-tune" IMAGE_INSTALL_remove = "ceph" EOF +if [ "${RM_WORK}" == "Yes" ]; then + echo "INHERIT += 'rm_work'" >> conf/local.conf +fi + if [ "${EXTRA_CONF}" != "" ] && [ -f "${EXTRA_CONF}" ]; then cat ${EXTRA_CONF} >> conf/local.conf fi