From 9aced2a3d3ef43e84c69a7c934eb777e452fc05c Mon Sep 17 00:00:00 2001 From: Russell Bunch Date: Tue, 21 Jan 2025 16:26:41 -0600 Subject: [PATCH] CASMTRIAGE-7709 Fix script location Despite removing `/var/www/boot/script.ipxe` in this hotfix, the `zypper update` command was still resulting in `metal-ipxe-2.4.101-1`'s script getting named `script.ipxe.rpmsave`. To correct this behavior, we will fully remove `metal-ipxe`, purge its scripts, and then cleanly install the updated `metal-ipxe`. This will result in the new `script.ipxe` landing with the right name, so it may be picked up by `set-sqfs-links.sh`. --- .../README.md | 2 ++ .../install-hotfix.sh | 14 +++++++++++++- .../lib/version.sh | 4 ++-- csm-1.5/CASMTRIAGE-7232-kdump/README.md | 4 ++-- .../hotfix-fresh-install.sh | 17 ++++++++++++++--- csm-1.5/CASMTRIAGE-7232-kdump/lib/version.sh | 4 ++-- 6 files changed, 35 insertions(+), 10 deletions(-) diff --git a/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/README.md b/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/README.md index fd14d45..6a73360 100644 --- a/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/README.md +++ b/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/README.md @@ -8,6 +8,8 @@ of the CSM tarball on the PIT. Specifically, after step 3 of section 2 in the [p This hotfix will: * Copy a new `metal-ipxe` package into an extracted CSM tarball. * Recreate/update the repodata in the extracted tarball. +* Uninstall and purge the old `metal-ipxe` RPM. +* Install the new, fixed `metal-ipxe` package. After running this hotfix continue installation as usual. diff --git a/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/install-hotfix.sh b/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/install-hotfix.sh index ae0d0df..11e60dc 100755 --- a/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/install-hotfix.sh +++ b/csm-1.5/CASMTRIAGE-6796-csm-pre-install-metal-ipxe/install-hotfix.sh @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2024 Hewlett Packard Enterprise Development LP +# (C) Copyright 2024-2025 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -86,6 +86,7 @@ fi createrepo "$repository" +echo 'Cleaning up metal-ipxe scripts ... ' boot_script="$(rpm -q --filesbypkg metal-ipxe | awk '/script\.ipxe/{print $NF}')" if [ -z "$boot_script" ]; then # No boot script to remove, metal-ipxe is not installed. @@ -94,6 +95,17 @@ elif [ -f "$boot_script" ]; then rm -f "$boot_script" fi +echo 'Uninstalling metal-ipxe ... ' +if ! rpm -e metal-ipxe ; then + echo 'metal-ipxe was already uninstalled.' +else + echo 'Uninstalled metal-ipxe.' +fi + +echo 'Installing hotfixed metal-ipxe ... ' +zypper --plus-repo "${CSM_PATH}/rpm/cray/csm/noos" --no-gpg-checks install -y metal-ipxe +echo 'Done.' + clean-install-deps cat >&2 </dev/null diff --git a/csm-1.5/CASMTRIAGE-7232-kdump/README.md b/csm-1.5/CASMTRIAGE-7232-kdump/README.md index 53cf58b..d4e3c93 100644 --- a/csm-1.5/CASMTRIAGE-7232-kdump/README.md +++ b/csm-1.5/CASMTRIAGE-7232-kdump/README.md @@ -1,8 +1,8 @@ # CSM 1.5 Kdump This hotfix should be ran in one of three places depending on the state of the machine: -- During a fresh install, before booting NCNs. -- On a running, installed system before an upgrade. +- During a fresh install, before booting NCNs. +- On a running, installed system before an upgrade. - On a running, installed system with a rolling reboot of the NCNs After running this hotfix continue installation as usual. diff --git a/csm-1.5/CASMTRIAGE-7232-kdump/hotfix-fresh-install.sh b/csm-1.5/CASMTRIAGE-7232-kdump/hotfix-fresh-install.sh index 55a6ef4..cc70707 100755 --- a/csm-1.5/CASMTRIAGE-7232-kdump/hotfix-fresh-install.sh +++ b/csm-1.5/CASMTRIAGE-7232-kdump/hotfix-fresh-install.sh @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2024 Hewlett Packard Enterprise Development LP +# (C) Copyright 2024-2025 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -87,15 +87,26 @@ fi echo "Updating repodata for $repository ... " createrepo "$repository" +echo 'Cleaning up metal-ipxe scripts ... ' boot_script="$(rpm -q --filesbypkg metal-ipxe | awk '/script\.ipxe/{print $NF}')" if [ -z "$boot_script" ]; then - # No old boot script to remove, metal-ipxe is not installed. + # No boot script to remove, metal-ipxe is not installed. : elif [ -f "$boot_script" ]; then - # Remove the old boot script to prevent `metal-ipxe` from installing its new script as `script.ipxe.rpmnew` rm -f "$boot_script" fi +echo 'Uninstalling metal-ipxe ... ' +if ! rpm -e metal-ipxe ; then + echo 'metal-ipxe was already uninstalled.' +else + echo 'Uninstalled metal-ipxe.' +fi + +echo 'Installing hotfixed metal-ipxe ... ' +zypper --plus-repo "${CSM_PATH}/rpm/cray/csm/noos" --no-gpg-checks install -y metal-ipxe +echo 'Done.' + echo "Cleaning up ... " clean-install-deps diff --git a/csm-1.5/CASMTRIAGE-7232-kdump/lib/version.sh b/csm-1.5/CASMTRIAGE-7232-kdump/lib/version.sh index c843ffd..e801eb3 100755 --- a/csm-1.5/CASMTRIAGE-7232-kdump/lib/version.sh +++ b/csm-1.5/CASMTRIAGE-7232-kdump/lib/version.sh @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2024 Hewlett Packard Enterprise Development LP +# (C) Copyright 2024-2025 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -22,7 +22,7 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # -: "${RELEASE:="${RELEASE_NAME:="CASMTRIAGE-7232-kdump"}-${RELEASE_VERSION:="1"}"}" +: "${RELEASE:="${RELEASE_NAME:="CASMTRIAGE-7232-kdump"}-${RELEASE_VERSION:="2"}"}" # return if sourced return 0 2> /dev/null