# 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"
"
SCRIPTS_DIR=$(dirname $(dirname $(readlink -f $0)))
+SCRIPTS_NAME=$(basename $0)
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}"
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
}
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}`
r)
check_yn_rm_work ${OPTARG}
;;
+ s)
+ GET_SSTATE="Yes"
+ ;;
h)
help_info
exit
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} \
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
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
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
#########################################################################
prepare_workspace
+if [ "${GET_SSTATE}" == "Yes" ]; then
+ get_sstate
+fi
prepare_src
setup_stx_build
setup_anaconda_build