From 8003735fb361529cc33829a88795144882a4dfd6 Mon Sep 17 00:00:00 2001 From: Luis Sampaio Date: Mon, 13 Mar 2023 10:35:32 -0700 Subject: [PATCH] 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 Change-Id: I667525c6343b6bd97866953b2373654e6c2d29ac --- kickstart/files/kickstart.cfg | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index f262e623..54554b0b 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -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