Skip to content

Commit

Permalink
Utilize agama.install_url
Browse files Browse the repository at this point in the history
* Introduced in agama-project/agama#1545
* Pass REPO_0 as a param to it agama supports, comma separated list
  as agama.install_url boot param
* Agama boot entry finally done through needle match
  • Loading branch information
lkocman committed Sep 4, 2024
1 parent 9639444 commit 42dcf03
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
21 changes: 19 additions & 2 deletions lib/bootloader_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,11 @@ sub boot_into_snapshot {
sub select_bootmenu_option {
my ($timeout) = @_;
assert_screen 'inst-bootmenu', $timeout;

# Special handling for Agama
if (get_var('AGAMA')) {
return 1;
send_key_until_needlematch 'boot-agama-installation', 'up', 11, 5;
return 0;
}
if (get_var('LIVECD')) {
# live CDs might have a very short timeout of the initial bootmenu
Expand All @@ -342,7 +345,6 @@ sub select_bootmenu_option {
boot_local_disk;
return 3;
}

if (get_var('UPGRADE')) {
# OFW has contralily oriented menu behavior
send_key_until_needlematch 'inst-onupgrade', get_var('OFW') ? 'up' : 'down', 11, 5;
Expand Down Expand Up @@ -581,6 +583,21 @@ sub bootmenu_default_params {
}
push @params, "Y2DEBUG=1";
}
elsif (get_var('AGAMA')) {
wait_screen_change { send_key "e" };
send_key "down";
send_key "down";
send_key "down";
send_key "down";
wait_screen_change { send_key "end" };
# REPO_0 should be set everywhere where we rsync repo (aside from iso)
if (get_var('REPO_0')) {
my $host = get_var('OPENQA_HOST', 'https://openqa.opensuse.org');
my $repo = get_var('REPO_0');
# agama.install_url supports comma separated list if more repos are needed ...
push @params, "agama.install_url=$host/assets/repo/$repo";
}
}
else {
# On JeOS and MicroOS we don't have YaST installer.
push @params, "Y2DEBUG=1" unless is_jeos || is_microos || is_selfinstall || (is_sle_micro && get_var('BOOT_HDD_IMAGE'));
Expand Down
9 changes: 9 additions & 0 deletions tests/installation/agama.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ use testapi;
use version_utils qw(is_leap is_sle);
use utils;

# Borrowed from grub2_tests.pm
sub edit_cmdline {
send_key 'e';
my $jump_down = is_sle('<15-sp4') ? '12' : '8';
for (1 .. $jump_down) { send_key 'down'; }
send_key_until_needlematch 'grub2-edit-linux-line', 'down';
send_key 'end';
}

sub agama_set_root_password_dialog
{
wait_still_screen 5;
Expand Down
8 changes: 5 additions & 3 deletions tests/installation/bootloader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ sub run {
my $boot_cmd = 'ret';
# Tumbleweed livecd has been switched to grub with kiwi 9.17.41 except 32bit
# when LIVECD_LOADER has set grub2 then change the boot command for grub2
if (get_var('AGAMA')) {
return;
}
if (is_livecd && check_var('LIVECD_LOADER', 'grub2')) {
$boot_cmd = 'ctrl-x';
uefi_bootmenu_params;
}
# Agama gets extra param from bootmenu_default_params
# including agama.install_url
if (get_var('AGAMA')) {
$boot_cmd = 'ctrl-x';
}
my @params;
push @params, bootmenu_default_params;
push @params, bootmenu_network_source;
Expand Down

0 comments on commit 42dcf03

Please sign in to comment.