From 04e9723dbb8fc7185f608bdae2ccca72fbc0986c Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Sun, 20 Nov 2022 23:09:48 +0000 Subject: [PATCH] Remove normal/rollback toggle code from stx grub menu Modify the stx grub template file to remove the normal / rollback image switching/toggle algorithm. Also remove the temporary sed based method in the kickstart code. Effectively, this moved the previous change introduced by https://review.opendev.org/c/starlingx/metal/+/861461 ... to a grub.cfg 'code block remove' rather than 'on the fly sed modification' by the kickstart. Test Plan: PASS: Verify build and install PASS: Verify on target code removed from /boot/efi/EFI/BOOT/grub.cfg PASS: Verify normal image is selected after 10 back to back reboots Story: 2009968 Task: 46886 Signed-off-by: Eric MacDonald Change-Id: Id8799dff6eef7ef8aa6f66180d6ed971c005618d --- .../pxe-network-installer/grub.cfg.stx | 19 ++----------------- kickstart/files/kickstart.cfg | 8 -------- kickstart/files/miniboot.cfg | 8 -------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/installer/pxe-network-installer/pxe-network-installer/grub.cfg.stx b/installer/pxe-network-installer/pxe-network-installer/grub.cfg.stx index 9449f7d2..76dcac1a 100755 --- a/installer/pxe-network-installer/pxe-network-installer/grub.cfg.stx +++ b/installer/pxe-network-installer/pxe-network-installer/grub.cfg.stx @@ -20,23 +20,8 @@ fi if [ -e ${boot_env_path}/boot.env ]; then load_env -s -f ${boot_env_path}/boot.env - - if [ "${boot_tried_count}" -eq "0" ]; then - set boot_tried_count="1" - elif [ "${boot_tried_count}" -eq "1" ]; then - set boot_tried_count="2" - elif [ "${boot_tried_count}" -eq "2" ]; then - set boot_tried_count="3" - elif [ "${boot_tried_count}" -eq "3" ]; then - if [ "${default}" -eq "1" ]; then - set default="0" - else - set default="1" - fi - save_env -f ${boot_env_path}/boot.env default - set boot_tried_count="0" - fi - save_env -f ${boot_env_path}/boot.env boot_tried_count + set default="0" + save_env -f ${boot_env_path}/boot.env default fi search --no-floppy --label --set=avol ${boot_part}${boot_mode} diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 209bdf06..d8b712b6 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -2342,14 +2342,6 @@ else wlog "no kernel options added" fi -wlog "Disable LAT's automatic image selection toggle algorithm" -sed -i '/^search --no-floppy/i \ -set default="0" \ -save_env -f ${boot_env_path}/boot.env default \ -set boot_tried_count="0" \ -save_env -f ${boot_env_path}/boot.env boot_tried_count \ -' /boot/efi/EFI/BOOT/grub.cfg - ilog "Override LAT grub file" GRUB_PATH_N_FILE="/boot/efi/EFI/BOOT/grub.cfg" if [ ! -e ${GRUB_PATH_N_FILE}.lat ] ; then diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index b73ff227..94f3bed9 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -2484,14 +2484,6 @@ else wlog "no kernel options added" fi -wlog "Disable LAT's automatic image selection toggle algorithm" -sed -i '/^search --no-floppy/i \ -set default="0" \ -save_env -f ${boot_env_path}/boot.env default \ -set boot_tried_count="0" \ -save_env -f ${boot_env_path}/boot.env boot_tried_count \ -' /boot/efi/EFI/BOOT/grub.cfg - ilog "Override LAT grub file" GRUB_PATH_N_FILE="/boot/efi/EFI/BOOT/grub.cfg" if [ ! -e ${GRUB_PATH_N_FILE}.lat ] ; then