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 comma separated values from AGAMA_INSTALL_URL
* Agama boot entry finally done through needle match
  • Loading branch information
lkocman committed Aug 28, 2024
1 parent 4979498 commit 3e853e2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
18 changes: 16 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,18 @@ 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" };
if (get_var('AGAMA_INSTALL_URL')) {
my $url = data_url(get_var('AGAMA_INSTALL_URL'));
push @params,"agama.install_url=$url";
}
}
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 3e853e2

Please sign in to comment.