From: Jackie Huang Date: Mon, 9 Dec 2019 09:39:02 +0000 (+0800) Subject: scripts/build_oran.sh: add option to use rm_work X-Git-Tag: bronze-rc0~92 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=45c76117833b00d5a322be46ba4e4fe8b06fff80;p=pti%2Frtp.git scripts/build_oran.sh: add option to use rm_work The rm_work class supports deletion of temporary workspace, which can ease the hard drive demands during builds, so add an option to use rm_work and enable it by default. Issue-ID: INF-4 Signed-off-by: Jackie Huang Change-Id: I3578f8b365718196a89d6aebcb70757431824d2e --- diff --git a/scripts/build_oran.sh b/scripts/build_oran.sh index 3a61f55..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 @@ -141,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