From d24e48e490acfaf361a2c7bbc28ef42faef71d20 Mon Sep 17 00:00:00 2001 From: Salman Rana Date: Wed, 4 Oct 2023 05:56:50 -0400 Subject: [PATCH] Fix kickstarts patching Ostree doesn't manage the /var filesystem. Anything installed there during initial filesystem setup becomes unpatchable [1]. As a result, the kickstart install dir /var/www/pages/feed/rel-${platform_release}/kickstart is not updated according to patch changes. /var/www/pages/feed/rel-${platform_release}/kickstart is currently only used for PXE boot installs. Subcloud remote installations are using the miniboot.cfg kickstart from the load-imported ISO (we may want to change this in some future commit). This commit adds kickstart update support to pxeboot-feed.service (pxeboot_feed.sh) so that /var/www/pages/feed/rel-${platform_release}/kickstarts is refreshed based on the kickstart dir from /ostree (i.e., the patched changes). [1] https://review.opendev.org/c/starlingx/ha/+/890918 Test Plan: 1. PASS: Verify Debian build and DC system install (virtual lab - disk and pxe installs) 2. PASS: Verify pxe install (DC remote install) with patched kickstart 3. PASS: Create a patch with changes to kickstart feed: - modify an existing kickstart - create a new kickstart file - delete an existing file - create a new kickstart sub-directory - modify centos subdir verify patch apply, ensure that changes are correctly applied to: /var/www/pages/feed/rel-${platform_release}/kickstarts 4. PASS: Revert the patch from test #3 and ensure changes are correctly undone in the feed dir Closes-Bug: 2034753 Change-Id: I74804bff23a74512db6a95fa514c84a1a6ea54a8 Signed-off-by: Salman Rana --- .../pxe-network-installer/pxeboot_feed.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/installer/pxe-network-installer/pxe-network-installer/pxeboot_feed.sh b/installer/pxe-network-installer/pxe-network-installer/pxeboot_feed.sh index 5fdc7e42..2efa5674 100755 --- a/installer/pxe-network-installer/pxe-network-installer/pxeboot_feed.sh +++ b/installer/pxe-network-installer/pxe-network-installer/pxeboot_feed.sh @@ -11,6 +11,9 @@ # # ... with the kernel, initrd and other images and signature files from /boot # +# This utility is also used to sync the /var/www/pages/feed/rel-xx.xx/kickstart +# directory with the kickstart directory from /ostree. +# ############################################################################# # # chkconfig: 2345 98 2 @@ -215,5 +218,17 @@ done # rsync efi.img file rsync_if_not_equal "${pxeboot}/efi.img" "${feed}/efi.img" +# Refresh the kickstarts feed +kickstarts_feed="${feed}/kickstart" +kickstarts_deploy="/ostree/1""${kickstarts_feed}" + +if [ ! -d "${kickstarts_deploy}" ] ; then + ilog "Error: deploy path '${kickstarts_deploy}' does not exist" + exit ${RETVAL} +fi + +ilog "syncing ${kickstarts_deploy} to ${kickstarts_feed}" +rsync -a --delete "${kickstarts_deploy}/" "${kickstarts_feed}" + RETVAL=0 exit ${RETVAL}