From 6e24ea853b2ff09c6f40da54f95a6715b46d8973 Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Fri, 27 Dec 2024 14:21:26 -0300 Subject: [PATCH] patch-iso: Secondary ISO input To generate the pre-patched ISO, take some content from a secondary input ISO. Specifically, all ISO content should be taken from 24.09 GA, expect for the "patches", "kickstart" and "upgrades" folders. The ostree_repo remains the same as it is, being taken from "ostree_base" Test Plan: pass - Mock pipeline Story: 2011318 Task: 51506 Depends-On: https://review.opendev.org/c/starlingx/root/+/938229 Change-Id: I3cc5151c97cf374cf04586c29f76528f83bd6658 Signed-off-by: Leonardo Fagundes Luz Serrano --- pipelines/parts/patch-iso.Jenkinsfile | 6 ++++++ scripts/patch-iso.sh | 26 ++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/pipelines/parts/patch-iso.Jenkinsfile b/pipelines/parts/patch-iso.Jenkinsfile index 54939e3..9c0956a 100644 --- a/pipelines/parts/patch-iso.Jenkinsfile +++ b/pipelines/parts/patch-iso.Jenkinsfile @@ -43,6 +43,12 @@ pipeline { booleanParam( name: 'DRY_RUN' ) + string( + name: 'REMOTE_SERVER' + ) + string( + name: 'REMOTE_BUILD_HOME' + ) string( name: 'BUILD_HOME' ) diff --git a/scripts/patch-iso.sh b/scripts/patch-iso.sh index 530a169..a9483b1 100644 --- a/scripts/patch-iso.sh +++ b/scripts/patch-iso.sh @@ -17,6 +17,8 @@ load_build_env require_job_env SIGNING_SERVER require_job_env SIGNING_USER +require_job_env REMOTE_BUILD_HOME +require_job_env REMOTE_SERVER require_job_env BUILD_HOME declare_job_env MY_REPO "$REPO_ROOT/cgcs-root" @@ -31,13 +33,29 @@ PATCHES_LIST=$(find $FULL_PATH_PATCH_OUTPUT -type f -name "*.patch" -printf '%f\ # Prepare the patches list to be used in lat container, adding -p prefix and the path PATCHES_FLAG=$(printf '%s\n' ${PATCHES_LIST[*]} | xargs -I {} echo "-p ${DEFAULT_PATCH_OUTPUT}{}") -# We use the iso generated by build-iso step -ISO_BASE="/localdisk/deploy/starlingx-intel-x86-64-cd.iso" +# Base ISO +# We collect the iso from the remote build home to be used as base +REMOTE_ISO="${REMOTE_SERVER}/${REMOTE_BUILD_HOME}/localdisk/deploy/starlingx-intel-x86-64-cd.iso" +curl -L ${REMOTE_ISO} --output ${BUILD_HOME}/localdisk/starlingx-base.iso +BASE_ISO="/localdisk/starlingx-base.iso" + +# Secondary ISO +# And use the iso generated by build-iso step as a secondary source +SECONDARY_ISO="/localdisk/deploy/starlingx-intel-x86-64-cd.iso" + +# We need these contents from the secondary ISO +SECONDARY_CONTENT=" -sc kickstart -sc patches -sc upgrades " + # Create pre-patched ISO -stx_docker_cmd ${DRY_RUN_ARG} "--container=lat" "create-prepatched-iso -i ${ISO_BASE} \ +stx_docker_cmd ${DRY_RUN_ARG} "--container=lat" "create-prepatched-iso.py \ +-i ${BASE_ISO} \ -b /localdisk/deploy/ostree_base \ -${PATCHES_FLAG[*]} -o /localdisk/deploy/${PREPATCHED_NAME}" +${PATCHES_FLAG[*]} \ +-o /localdisk/deploy/${PREPATCHED_NAME} \ +-si ${SECONDARY_ISO} \ +${SECONDARY_CONTENT} \ +-v" if ! $DRY_RUN ; then (