From 2f160aea37f27c5d0a3c6fbfb44b7aeb21cdc1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Fri, 30 Oct 2026 15:55:05 -0300 Subject: [PATCH] fix(install): keep the riscv64 boot entries of other disks The EL10 riscv64 fix-up removed every UEFI boot entry for shimx64, grubx64 or grubriscv64, on any disk. The default partition layout installs to one disk and keeps the others, so an operating system on another disk lost its boot entry. The fix-up now removes only the entries on the ESP of the new install. Anaconda removes the entries with its own label before it adds its own, so an install that recreated the ESP leaves no old entry behind. When lsblk reports no partition GUID for the ESP, the fix-up removes nothing and still adds the new entry. --- .../share/xcat/install/scripts/post.rhels10.riscv64 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels10.riscv64 b/xCAT-server/share/xcat/install/scripts/post.rhels10.riscv64 index 3ede6003f7..78b11a78ca 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels10.riscv64 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels10.riscv64 @@ -34,12 +34,15 @@ if [ "$("$xcat_riscv_uname" -m)" = "riscv64" ] && [ -d "$xcat_riscv_install_root disk="$("$xcat_riscv_lsblk" -no PKNAME "$espdev" 2>/dev/null | head -1 | tr -d '[:space:]')" part="$("$xcat_riscv_lsblk" -no PARTN "$espdev" 2>/dev/null | head -1 | tr -d '[:space:]')" if [ -n "$disk" ] && [ -n "$part" ]; then + espuuid="$("$xcat_riscv_lsblk" -no PARTUUID "$espdev" 2>/dev/null | head -1 | tr -d '[:space:]' | tr 'A-F' 'a-f')" # drop the x86 entries anaconda created for this install, and any - # riscv64 entry a previous provisioning of this node left behind, so + # riscv64 entry a previous provisioning of this node left on this ESP, so # reinstalling does not fill the firmware variable store with copies - for bootnum in $("$xcat_riscv_efibootmgr" -v 2>/dev/null | awk '/\\EFI\\[^\\]+\\(shimx64|grubx64|grubriscv64)\.efi/ { sub(/^Boot/, "", $1); sub(/\*$/, "", $1); print $1 }'); do - "$xcat_riscv_efibootmgr" -q -b "$bootnum" -B || true - done + if [ -n "$espuuid" ]; then + for bootnum in $("$xcat_riscv_efibootmgr" -v 2>/dev/null | awk -v esp=",gpt,$espuuid," 'index(tolower($0), esp) && /\\EFI\\[^\\]+\\(shimx64|grubx64|grubriscv64)\.efi/ { sub(/^Boot/, "", $1); sub(/\*$/, "", $1); print $1 }'); do + "$xcat_riscv_efibootmgr" -q -b "$bootnum" -B || true + done + fi label="$(. "$xcat_riscv_install_root/etc/os-release" 2>/dev/null; echo "${NAME:-Linux}")" if "$xcat_riscv_efibootmgr" -q -c -d "/dev/$disk" -p "$part" -L "$label" -l "\\EFI\\$vendordir\\grubriscv64.efi"; then printf '%s\n' "riscv64: UEFI boot entry \"$label\" -> \\EFI\\$vendordir\\grubriscv64.efi on /dev/$disk part $part"