Skip to content

Commit

Permalink
Agama boot handling improvement
Browse files Browse the repository at this point in the history
* Ensure that USB boot with agama goes for boot local
  after installation

* Unlike with LIVE expect password on agama-installer which
  otherwise behaves a lot like live

* Ensure that we boot local on zdup case with agama-installer
  • Loading branch information
lkocman committed Sep 12, 2024
1 parent 1a067a5 commit 8aad341
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/grub_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ sub handle_installer_medium_bootup {
assert_screen 'inst-bootmenu', 180;

# Layout of live is different from installation media
my $key = is_livecd() ? 'down' : 'up';
# Agama has same layout of live
my $key = is_livecd() || get_var("AGAMA") ? 'down' : 'up';
send_key_until_needlematch 'inst-bootmenu-boot-harddisk', $key;
send_key 'ret';

Expand Down
2 changes: 1 addition & 1 deletion lib/opensusebasetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ When bootloader appears, make sure to boot from local disk when it is on aarch64
sub wait_grub_to_boot_on_local_disk {
# assuming the cursor is on 'installation' by default and 'boot from
# harddisk' is above
my $switch_key = (is_opensuse && get_var('LIVECD')) ? 'down' : 'up';
my $switch_key = (is_opensuse && get_var('LIVECD')) || get_var('AGAMA') ? 'down' : 'up';
send_key_until_needlematch 'inst-bootmenu-boot-harddisk', "$switch_key";
boot_local_disk;
my @tags = qw(grub2 tianocore-mainmenu);
Expand Down
4 changes: 3 additions & 1 deletion lib/susedistribution.pm
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,8 @@ sub activate_console {
# Select configure serial and redirect to root-ssh instead
return use_ssh_serial_console if (get_var('BACKEND', '') =~ /ikvm|ipmi|spvm|pvm_hmc/ && $console =~ m/^(root-console|install-shell|log-console)$/);
if ($console eq 'install-shell') {
if (get_var("LIVECD")) {
# Agama behaves similarly as LIVE but we set a fixed password there
if (get_var("LIVECD") && !get_var('AGAMA')) {
# LIVE CDs do not run inst-consoles as started by inst-linux (it's regular live run, auto-starting yast live installer)
my $vt = get_root_console_tty();
assert_screen "tty${vt}-selected", 10;
Expand Down Expand Up @@ -1009,3 +1010,4 @@ sub console_selected {
}

1;

3 changes: 3 additions & 0 deletions tests/installation/agama.pm
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ sub run {
diag("left total await_install timeout: $timeout");
if (!$ret) {
# Handle any error dialogs that could happen
send_key "down"; # ensure screen doesn't get black shortly after we hit congratulations
last;
}
}
# Let's end at agama-congratulations screens
assert_screen('agama-congratulations');
}

=head2 post_fail_hook
Expand Down
2 changes: 1 addition & 1 deletion tests/installation/agama_reboot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sub run {
# workaround for lack of disable bootloader timeout
# https://github.com/openSUSE/agama/issues/1594
# simply send space until we hit grub2
send_key_until_needlematch("bootloader-grub2", 'spc', 50, 3);
send_key_until_needlematch("grub2", 'spc', 50, 3);

}

Expand Down

0 comments on commit 8aad341

Please sign in to comment.