-create_build_docker () {
- msg_step="Create build environment docker container"
- echo_step_start
-
- cd ${MY_REPO_ROOT_DIR}/stx-tools/
- export PATH=$PATH:$PWD
-
- echo "MYUNAME=${USER}" > localrc
- echo "PROJECT=${PRJ_NAME}" >> localrc
- echo "HOST_PREFIX=${WORKSPACE}" >> localrc
- echo "HOST_MIRROR_DIR=${WORKSPACE}/mirror" >> localrc
- echo "LAYER=${LAYER}" >> localrc
- echo "MY_EMAIL=jackie.huang@windriver.com" >> localrc
-
- # workarounds
- #git checkout master
- #sed -i 's/docker /sudo docker /' tb.sh
-
- #RUN_CMD="tb.sh create"
- #run_cmd "Create build environment docker image"
-
- RUN_CMD="tb.sh run"
- run_cmd "Create build environment docker container"
+patch_src () {
+ echo_step_start "Some source codes need to be patched for INF project"
+
+ sed -i "s|/import/mirrors|${STX_MIRROR_DIR}|" \
+ $MY_REPO/stx/metal/installer/pxe-network-installer/centos/build_srpm.data
+
+ # Apply meta patches
+ cd ${SRC_META_PATCHES}
+ src_dirs=$(find . -type f -printf "%h\n"|uniq)
+ for d in ${src_dirs}; do
+ cd ${MY_REPO_ROOT_DIR}/${d}
+
+ # backup current branch
+ local_branch=$(git rev-parse --abbrev-ref HEAD)
+ if [ "${local_branch}" = "HEAD" ]; then
+ git checkout ${STX_SRC_BRANCH}
+ local_branch=$(git rev-parse --abbrev-ref HEAD)
+ fi
+ git branch -m "${local_branch}_${TIMESTAMP}"
+ git checkout ${STX_SRC_BRANCH}
+
+ for p in $(ls -1 ${SRC_META_PATCHES}/${d}); do
+ echo_info "Apllying patch: ${SRC_META_PATCHES}/${d}/${p}"
+ git am ${SRC_META_PATCHES}/${d}/${p}
+ done
+ done