From cdc2129575b7720087af76b23b07f3d19e881330 Mon Sep 17 00:00:00 2001 From: Matheus Guilhermino Date: Tue, 16 Sep 2025 11:20:55 -0300 Subject: [PATCH] miniboot: ensure /opt/software/rel-* is created MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During miniboot installs the versioned USM release directory (/opt/software/rel-/bin) was not being created, unlike kickstart installs. This prevented USM operations (patching, upgrades, software-deploy) from functioning correctly on systems installed with miniboot. This change adds the missing logic from kickstart to miniboot’s %post --nochroot stage: - Create /opt/software/rel-./bin inside the target - Copy USM software-deploy scripts from /instboot into the release bin directory With this change, miniboot installs are aligned with kickstart installs and properly support patching and upgrade flows. Closes-bug: 2125233 Test Plan: PASS: boot ISO and install Central Cloud. PASS: Verify that /opt/software/rel-/bin exists PASS: Install and reinstall a subcloud PASS: Verify that /opt/software/rel-/bin exists on the subcloud after the reinstall Change-Id: I955ee4181cbc2d69c3c5f5281ed7a7f819aeb6cc Signed-off-by: Matheus Guilhermino Signed-off-by: Lindley Vieira --- kickstart/files/miniboot.cfg | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index 94394484..fc0fe8d8 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -3079,6 +3079,29 @@ if [ "${controller}" = true ] ; then fi fi +# Copy current release scripts to software directory +highest_patch_version="0" +# All patch metadata xml files were presumably copied to /opt/software/metadata/deployed/ by the code above +# The assumption allows us not retrieve the xml files from the source again +for metadata_file in ${IMAGE_ROOTFS}/var/rootdirs/opt/software/metadata/deployed/*; do + patch_version=$(grep "sw_version" $metadata_file | cut -d"." -f3 | cut -d'<' -f1) + if [ $patch_version -gt $highest_patch_version ]; then + highest_patch_version=$patch_version; + fi; +done; + +versioned_dir="/opt/software/rel-${sw_release}.${highest_patch_version}/bin" +ilog "Creating versioned USM scripts directory ${versioned_dir} for current release" +mkdir -p "${IMAGE_ROOTFS}/var/rootdirs/${versioned_dir}" +ilog "Creating USM upgrades directory in ${feed}" +mkdir -p "${feed}/upgrades" + +# miniboot always runs from ISO, so use /instboot +ilog "Copying USM software deploy scripts to ${IMAGE_ROOTFS}/var/rootdirs/${versioned_dir}" +cp -r /instboot/upgrades/software-deploy/* ${IMAGE_ROOTFS}/var/rootdirs/${versioned_dir} +ilog "Copying USM upgrades directory to ${feed}" +cp -r /instboot/upgrades/* ${feed}/upgrades + # Save the install scripts and kickstart logs mount /dev/mapper/cgts--vg-log--lv "${IMAGE_ROOTFS}/${LOG_DIR}" if [ ${?} -ne 0 ] ; then