mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
ktest: Fail when grub menu not found
Currently if the grub menu that is supplied is not found, it will just boot into the last grub menu in menu.lst. Fail instead of confusing the user why their kernel is not booting. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
2728be418d
commit
eaa1fe25ea
1 changed files with 4 additions and 1 deletions
|
@ -862,9 +862,12 @@ sub get_grub_index {
|
|||
open(IN, "$ssh_grub |")
|
||||
or die "unable to get menu.lst";
|
||||
|
||||
my $found = 0;
|
||||
|
||||
while (<IN>) {
|
||||
if (/^\s*title\s+$grub_menu\s*$/) {
|
||||
$grub_number++;
|
||||
$found = 1;
|
||||
last;
|
||||
} elsif (/^\s*title\s/) {
|
||||
$grub_number++;
|
||||
|
@ -873,7 +876,7 @@ sub get_grub_index {
|
|||
close(IN);
|
||||
|
||||
die "Could not find '$grub_menu' in /boot/grub/menu on $machine"
|
||||
if ($grub_number < 0);
|
||||
if (!$found);
|
||||
doprint "$grub_number\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue