Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASMTRIAGE-7709 Fix script location #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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.
Expand All @@ -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 <<EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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-6796-csm-pre-install-metal-ipxe"}-${RELEASE_VERSION:="2"}"}"
: "${RELEASE:="${RELEASE_NAME:="CASMTRIAGE-6796-csm-pre-install-metal-ipxe"}-${RELEASE_VERSION:="3"}"}"

# return if sourced
return 0 2>/dev/null
Expand Down
4 changes: 2 additions & 2 deletions csm-1.5/CASMTRIAGE-7232-kdump/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
17 changes: 14 additions & 3 deletions csm-1.5/CASMTRIAGE-7232-kdump/hotfix-fresh-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions csm-1.5/CASMTRIAGE-7232-kdump/lib/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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
Expand Down