miniboot: ensure /opt/software/rel-* is created

During miniboot installs the versioned USM release directory
(/opt/software/rel-<release>/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-<release>.<patch>/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-<release>/bin exists
PASS: Install and reinstall a subcloud
PASS: Verify that /opt/software/rel-<release>/bin exists
	 on the subcloud after the reinstall

Change-Id: I955ee4181cbc2d69c3c5f5281ed7a7f819aeb6cc
Signed-off-by: Matheus Guilhermino <mmachado@windriver.com>
Signed-off-by: Lindley Vieira <lindley.vieira@windriver.com>
This commit is contained in:
Matheus Guilhermino
2025-09-16 11:20:55 -03:00
committed by Lindley Vieira
parent 2b9bc75588
commit cdc2129575

View File

@@ -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