X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fbuild_inf_yocto%2Fbuild_inf_yocto.sh;h=c40fe0b1384ca6b707a85c09167688a103615d7d;hb=refs%2Fchanges%2F82%2F9782%2F1;hp=cdfa5f4173f3a54b490e87b4dc198139dd1840c9;hpb=7fdcdb16c5fd45ad077cf0dffdd99f34cadcbdd4;p=pti%2Frtp.git diff --git a/scripts/build_inf_yocto/build_inf_yocto.sh b/scripts/build_inf_yocto/build_inf_yocto.sh index cdfa5f4..c40fe0b 100755 --- a/scripts/build_inf_yocto/build_inf_yocto.sh +++ b/scripts/build_inf_yocto/build_inf_yocto.sh @@ -24,8 +24,8 @@ set -e -o pipefail # Only one bsp is supported now, there will be more in the future SUPPORTED_BSP="intel-corei7-64 " -SRC_ORAN_BRANCH="master" -SRC_STX_BRANCH="master" +SRC_ORAN_BRANCH="f-release" +SRC_STX_BRANCH="stx-5.0" SRC_YP_BRANCH="warrior" SRC_ORAN_URL="https://gerrit.o-ran-sc.org/r/pti/rtp" @@ -78,6 +78,7 @@ SUB_LAYER_META_OE_ANACONDA="\ " SCRIPTS_DIR=$(dirname $(dirname $(readlink -f $0))) +SCRIPTS_NAME=$(basename $0) TIMESTAMP=`date +"%Y%m%d_%H%M%S"` ######################################################################### @@ -87,7 +88,7 @@ TIMESTAMP=`date +"%Y%m%d_%H%M%S"` help_info () { cat << ENDHELP Usage: -$(basename $0) [-w WORKSPACE_DIR] [-b BSP] [-n] [-u] [-h] [-r Yes|No] [-e EXTRA_CONF] +${SCRIPTS_NAME} [-w WORKSPACE_DIR] [-b BSP] [-n] [-u] [-h] [-r Yes|No] [-e EXTRA_CONF] where: -w WORKSPACE_DIR is the path for the project -b BPS is one of supported BSP: "${SUPPORTED_BSP}" @@ -106,14 +107,14 @@ ENDHELP echo_step_start() { [ -n "$1" ] && msg_step=$1 echo "#########################################################################################" - echo "## STEP START: ${msg_step}" + echo "## ${SCRIPTS_NAME} - STEP START: ${msg_step}" echo "#########################################################################################" } echo_step_end() { [ -n "$1" ] && msg_step=$1 echo "#########################################################################################" - echo "## STEP END: ${msg_step}" + echo "## ${SCRIPTS_NAME} - STEP END: ${msg_step}" echo "#########################################################################################" echo } @@ -210,9 +211,10 @@ DRYRUN="" EXTRA_CONF="" SKIP_UPDATE="Yes" RM_WORK="Yes" +GET_SSTATE="No" BSP="intel-corei7-64" -while getopts "w:b:e:r:unh" OPTION; do +while getopts "w:b:e:r:unsh" OPTION; do case ${OPTION} in w) WORKSPACE=`readlink -f ${OPTARG}` @@ -232,6 +234,9 @@ while getopts "w:b:e:r:unh" OPTION; do r) check_yn_rm_work ${OPTARG} ;; + s) + GET_SSTATE="Yes" + ;; h) help_info exit @@ -276,8 +281,10 @@ ISO_ANACONDA=${PRJ_BUILD_DIR_ANACONDA}/tmp-glibc/deploy/images/${BSP}/${IMG_ANAC ISO_INF=${PRJ_BUILD_DIR_ANACONDA}/tmp-glibc/deploy/images/${BSP}/${IMG_INF}-${BSP}.iso ISO_INF_ALIAS=${PRJ_OUTPUT_DIR}/inf-image-yocto-aio-${IMG_ARCH}.iso +SSTATE_CONTAINER_IMG=infbuilder/inf-yocto-sstate:2022.05 + prepare_workspace () { - msg_step="Create workspace for the build" + msg_step="Create workspace for the Yocto build" echo_step_start mkdir -p ${PRJ_BUILD_DIR} ${SRC_ORAN_DIR} ${PRJ_BUILD_DIR_ANACONDA} \ @@ -291,6 +298,23 @@ prepare_workspace () { echo_step_end } +# This is tend to be used for CI Jenkins build only +get_sstate () { + msg_step="Get sstate cache from dockerhub image" + echo_step_start + + for i in {1..5}; do + docker pull ${SSTATE_CONTAINER_IMG}-${i} + docker create -ti --name inf-yocto-sstate-${i} ${SSTATE_CONTAINER_IMG}-${i} sh + docker cp inf-yocto-sstate-${i}:/sstate${i} ${PRJ_SHARED_SS_DIR}/sstate${i} + docker rm inf-yocto-sstate-${i} + done + mv ${PRJ_SHARED_SS_DIR}/sstate*/* ${PRJ_SHARED_SS_DIR} + #rm -rf ${PRJ_SHARED_SS_DIR}/sstate* + + echo_step_end +} + prepare_src () { msg_step="Get the source code repos" echo_step_start @@ -325,7 +349,7 @@ prepare_src () { echo_step_end -# Not andy meta-patch is needed for the time being, but new ones may be needed and added +# Not any meta-patch is needed for the time being, but new ones may be needed and added # sometime in the future, so just leave these code commented out here. # # Apply meta patches # for l in $(ls -1 ${SRC_META_PATCHES}); do @@ -530,7 +554,7 @@ build_anaconda_image () { if [ -z "${DRYRUN}" ]; then cp -Pf ${ISO_ANACONDA} ${ISO_INF} - cp -Pf ${ISO_ANACONDA} ${ISO_INF_ALIAS} + cp -f ${ISO_ANACONDA} ${ISO_INF_ALIAS} fi echo_step_end @@ -543,6 +567,9 @@ build_anaconda_image () { ######################################################################### prepare_workspace +if [ "${GET_SSTATE}" == "Yes" ]; then + get_sstate +fi prepare_src setup_stx_build setup_anaconda_build