Merge "Copy USM scripts to software dir on fresh install"

This commit is contained in:
Zuul 2024-03-22 19:59:24 +00:00 committed by Gerrit Code Review
commit 8111d098fc
1 changed files with 14 additions and 0 deletions

View File

@ -3148,6 +3148,20 @@ else
fi
fi
# Copy current release scripts to software directory
highest_patch_version="0"
for metadata_file in /instboot/patches/*; 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}"
cp -r /instboot/upgrades/software-deploy/* ${IMAGE_ROOTFS}/var/rootdirs/${versioned_dir}
# Save the install scripts and kickstart logs
mount /dev/mapper/cgts--vg-log--lv "${IMAGE_ROOTFS}/${LOG_DIR}"
if [ ${?} -ne 0 ] ; then