From acf7dac1aa5fdcf76ffa7ebd4a8c8872125cafba Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 4 Apr 2022 16:34:26 -0400 Subject: [PATCH] For SLES15 or higher --- xCAT-server/lib/xcat/plugins/grub2.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 2dcd5ea2f..c98679b05 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -285,8 +285,15 @@ sub setstate { chdir("$bootloader_root"); if ($cref->{currstate} eq "offline" or $cref->{currstate} eq "boot") { unlink("grub2-$node"); - } elsif ($cref->{currstate} eq "standby" and $nodeos =~ /^sle15/i) { - unlink("grub2-$node"); #Make sure SLES15 can still boot from disk in "standby" state + } elsif ($cref->{currstate} eq "standby" and $nodeos =~ /^sle/i) { + my $os_version = $nodeos; + $os_version =~ s/sles//i; # Strip sles if there + $os_version =~ s/sle//i; # String sle if there + if ($os_version ge "15") { + # Make sure for SLES15 or higher can still boot + # from disk in "standby" state + unlink("grub2-$node"); + } } elsif (! -e "grub2-$node") { symlink("grub2." . $nodearch, "grub2-$node"); }