kickstart update for patched iso

This commit copies the patch xml metadata
if the patches directory exists in a pxeboot
installation and copies the xml content to the
patch repository at /opt/patching.

* Currently this only works for USB Install.

Test:
Pass: Install via pxeboot and sw-patch query works

Story: 2009969
Task: 46467
Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I667525c6343b6bd97866953b2373654e6c2d29ac
This commit is contained in:
Luis Sampaio 2023-03-13 10:35:32 -07:00
parent 37c5910a62
commit 8003735fb3
1 changed files with 20 additions and 7 deletions

View File

@ -2863,6 +2863,13 @@ ilog "IMAGE_ROOTFS=${IMAGE_ROOTFS}"
get_variable "ostree_repo_fetched"
OSTREE_REPO_FETCHED=$?
# Check for noverifyssl
if grep -q noverifyssl /proc/cmdline; then
NOVERIFYSSL_WGET_OPT="--no-check-certificate"
else
NOVERIFYSSL_WGET_OPT=""
fi
# Fetch ostree
sw_release="xxxPLATFORM_RELEASExxx" # updated by the build
if [ "${controller}" = true ] ; then
@ -2955,13 +2962,6 @@ if [ "${controller}" = true ] ; then
mkdir -p "${pxeboot}/EFI/BOOT"
# Check for noverifyssl
if grep -q noverifyssl /proc/cmdline; then
NOVERIFYSSL_WGET_OPT="--no-check-certificate"
else
NOVERIFYSSL_WGET_OPT=""
fi
# handle USB install
if is_usb_install -eq 0 ; then
cp -a /instboot/efi.img ${pxeboot}
@ -3018,6 +3018,19 @@ if [ -d "/instboot/patches" ]; then
ilog "Creating patching metadata directories"
mkdir -p ${IMAGE_ROOTFS}/var/rootdirs/opt/patching/metadata/{committed,available,applied}
cp -a /instboot/patches/* ${IMAGE_ROOTFS}/var/rootdirs/opt/patching/metadata/committed/
else
# Prepatch iso pxeboot
patches_url="${insturl/ostree_repo/patches}"
wget ${NOVERIFYSSL_WGET_OPT} -q --spider ${patches_url}/
if [ $? -eq 0 ]; then
ilog "Prepatched iso from pxeboot"
ilog "Creating patching metadata directories"
mkdir -p ${IMAGE_ROOTFS}/var/rootdirs/opt/patching/metadata/{committed,available,applied}
cd ${IMAGE_ROOTFS}/var/rootdirs/opt/patching/metadata/committed
wget ${NOVERIFYSSL_WGET_OPT} --recursive --no-parent --no-host-directories --no-clobber \
--accept='*.xml' -o /${LAT_DIR}/wget_prepatch_metadata.log -nd ${patches_url}/
ilog "Metadata files copied"
fi
fi
# Save the install scripts and kickstart logs