
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 <Leonardo.FagundesLuzSerrano@windriver.com>
69 lines
2.1 KiB
Bash
69 lines
2.1 KiB
Bash
#!/bin/bash
|
|
|
|
#
|
|
# Copyright (c) 2024 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
set -e
|
|
source $(dirname "$0")/lib/job_utils.sh
|
|
|
|
require_job_env BUILD_HOME
|
|
require_job_env SW_VERSION
|
|
require_job_env PATCH_NUM
|
|
|
|
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"
|
|
declare_job_env PATCH_PREVIOUS_NAME "${PATCH_PREVIOUS:1}"
|
|
|
|
PREPATCHED_NAME="prepatched-iso-${SW_VERSION}.${PATCH_NUM}.iso"
|
|
DEFAULT_PATCH_OUTPUT="/localdisk/deploy/patch_output/"
|
|
|
|
# Collect every patches from the default patch output path
|
|
FULL_PATH_PATCH_OUTPUT="${BUILD_HOME}${DEFAULT_PATCH_OUTPUT}"
|
|
PATCHES_LIST=$(find $FULL_PATH_PATCH_OUTPUT -type f -name "*.patch" -printf '%f\n' | sort)
|
|
# 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}{}")
|
|
|
|
# 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.py \
|
|
-i ${BASE_ISO} \
|
|
-b /localdisk/deploy/ostree_base \
|
|
${PATCHES_FLAG[*]} \
|
|
-o /localdisk/deploy/${PREPATCHED_NAME} \
|
|
-si ${SECONDARY_ISO} \
|
|
${SECONDARY_CONTENT} \
|
|
-v"
|
|
|
|
if ! $DRY_RUN ; then
|
|
(
|
|
export MY_WORKSPACE=$WORKSPACE_ROOT
|
|
export PATH=$MY_REPO/build-tools:$PATH:/usr/local/bin
|
|
PREPATCHED_PATH="${BUILD_HOME}/localdisk/deploy/${PREPATCHED_NAME}"
|
|
maybe_run sign_iso_formal.sh "${PREPATCHED_PATH}" || die "failed to sign ISO"
|
|
)
|
|
notice "Formal signing done"
|
|
fi
|