- echo_info "For all layers source: ${SRC_LAYER_DIR}"
- echo_info "For StarlingX build project: ${PRJ_BUILD_DIR}"
- echo_info "For anaconda (installer) build project: ${PRJ_BUILD_DIR_ANACONDA}"
-
- echo_step_end
-}
-
-prepare_src () {
- msg_step="Get the source code repos"
- echo_step_start
-
- # Clone the oran layer if it's not already cloned
- # Check if the script is inside the repo
- 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}"
- mkdir -p ${SRC_ORAN_DIR}/rtp
- cd ${SRC_ORAN_DIR}/rtp
- rm -rf meta-stx-oran scripts
- ln -sf ${CLONED_ORAN_REPO}/scripts scripts
- ln -sf ${CLONED_ORAN_REPO}/meta-stx-oran meta-stx-oran
- else
- echo_info "Cloning oran layer:"
- cd ${SRC_ORAN_DIR}
- clone_update_repo ${SRC_ORAN_BRANCH} ${SRC_ORAN_URL} rtp
- fi
-
- echo_info "Cloning or update Yocto layers:"
-
- cd ${SRC_LAYER_DIR}
- for layer_url in ${SRC_YP_URL}; do
- layer_name=$(basename ${layer_url%%;commit*})
- layer_commit=$(basename ${layer_url##*;commit=})
- clone_update_repo ${SRC_YP_BRANCH} ${layer_url%%;commit*} ${layer_name} ${layer_commit}
- done
-
- echo_info "Cloning or update meta-starlingx layers:"
- clone_update_repo ${SRC_STX_BRANCH} ${SRC_STX_URL} $(basename ${SRC_STX_URL})
-
- echo_step_end
-
-# Not andy 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
-# msg_step="Apply meta patches for ${l}"
-# echo_step_start
-# cd ${SRC_LAYER_DIR}/${l}
-#
-# # backup current branch
-# local_branch=$(git rev-parse --abbrev-ref HEAD)
-# git branch -m "${local_branch}_${TIMESTAMP}"
-# git checkout -b ${local_branch} ${local_branch##*-}
-#
-# for p in $(ls -1 ${SRC_META_PATCHES}/${l}); do
-# echo_info "Apllying patch: ${SRC_META_PATCHES}/${l}/${p}"
-# git am ${SRC_META_PATCHES}/${l}/${p}
-# done
-# echo_step_end
-# done
-}
-
-add_layer_stx_build () {
- msg_step="Add required layers to the StarlingX build project"
- echo_step_start
-
- source_env ${PRJ_BUILD_DIR}
- SRC_LAYERS=""
- for layer_url in ${SRC_YP_URL} ${SRC_STX_URL}; do
- layer_name=$(basename ${layer_url%%;commit*})
- case ${layer_name} in
- poky)
- continue
- ;;
- meta-openembedded)
- for sub_layer in ${SUB_LAYER_META_OE}; do
- SRC_LAYERS="${SRC_LAYERS} ${SRC_LAYER_DIR}/${layer_name}/${sub_layer}"
- done
- ;;
- meta-cloud-services)
- SRC_LAYERS="${SRC_LAYERS} ${SRC_LAYER_DIR}/${layer_name}"
- for sub_layer in ${SUB_LAYER_META_CLOUD_SERVICES}; do
- SRC_LAYERS="${SRC_LAYERS} ${SRC_LAYER_DIR}/${layer_name}/${sub_layer}"
- done
- ;;
- meta-starlingx)
- for sub_layer in ${SUB_LAYER_STX}; do
- SRC_LAYERS="${SRC_LAYERS} ${SRC_STX_DIR}/${sub_layer}"
- done
- ;;
- *)
- SRC_LAYERS="${SRC_LAYERS} ${SRC_LAYER_DIR}/${layer_name}"
- ;;
-
- esac
- done
- SRC_LAYERS="${SRC_LAYERS} ${SRC_ORAN_DIR}/rtp/meta-stx-oran"
-
-
- for src_layer in ${SRC_LAYERS}; do
- RUN_CMD="bitbake-layers add-layer ${src_layer}"
- echo_cmd "Add the ${src_layer} layer into the build project"
- ${RUN_CMD}
- done
-
- echo_step_end
-}
-
-add_configs_stx_build () {
- msg_step="Add extra configs into local.conf for StarlingX build"
- echo_step_start
-
- cd ${PRJ_BUILD_DIR}
- echo_info "Adding the following extra configs into local.conf"
- cat ${SRC_CONFIGS}/local-stx.conf | \
- sed -e "s/@BSP@/${BSP}/" | tee -a conf/local.conf
- cat ${SRC_CONFIGS}/local-mirrors.conf | tee -a conf/local.conf
-
- echo "DL_DIR = '${PRJ_SHARED_DL_DIR}'" | tee -a conf/local.conf
- echo "SSTATE_DIR = '${PRJ_SHARED_SS_DIR}'" | tee -a conf/local.conf
-
- if [ "${RM_WORK}" == "Yes" ]; then
- echo "INHERIT += 'rm_work'" | tee -a conf/local.conf
- echo "RM_WORK_EXCLUDE += '${IMG_STX}'" | tee -a conf/local.conf
- fi