Skip to content

Commit

Permalink
Merge pull request #20850 from rfan1/agama-powervm
Browse files Browse the repository at this point in the history
Add Agama installation support for powerVM
  • Loading branch information
rfan1 authored Dec 25, 2024
2 parents 1f48211 + 5c793b1 commit fbafeb5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 21 deletions.
30 changes: 20 additions & 10 deletions lib/bootloader_pvm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use testapi;
use bootloader_setup;
use registration 'registration_bootloader_params';
use utils qw(get_netboot_mirror type_string_slow enter_cmd_slow);
use version_utils 'is_upgrade';
use version_utils qw(is_agama is_upgrade);
use Utils::Backends;
use YuiRestClient;
use ntlm_auth;
Expand Down Expand Up @@ -123,19 +123,24 @@ sub enter_netboot_parameters {
record_info("Updated boot path for PPC64LE_GRUB_HTTP defined", $mntpoint);
}
my $ntlm_p = get_var('NTLM_AUTH_INSTALL') ? $ntlm_auth::ntlm_proxy : '';
if (get_var('AGAMA')) {
type_string_slow "linux $mntpoint/linux vga=normal root=live:http://" . get_var('OPENQA_HOSTNAME') . "/assets/iso/" . get_var('ISO');
type_string_slow " " . get_var('EXTRABOOTPARAMS');
if (is_agama) {
type_string_slow "linux $mntpoint/linux root=live:http://" . get_var('OPENQA_HOSTNAME') . "/assets/iso/" . get_var('ISO') . " live.password=$testapi::password";
# agama.auto and agama.install_url are defined in below function
specific_bootmenu_params;
type_string_slow " " . get_var('EXTRABOOTPARAMS') if (get_var('EXTRABOOTPARAMS'));
}
else {
type_string_slow "linux $mntpoint/linux vga=normal $ntlm_p install=$mirror ";
}
# Skipping this setup due to it triggers general code for openSUSE that breaks powerVM scenario
bootmenu_default_params unless get_var('AGAMA');
bootmenu_network_source;
specific_bootmenu_params;
registration_bootloader_params(utils::VERY_SLOW_TYPING_SPEED) unless get_var('NTLM_AUTH_INSTALL');
type_string_slow remote_install_bootmenu_params;
unless (is_agama) {
bootmenu_default_params;
bootmenu_network_source;
specific_bootmenu_params;
registration_bootloader_params(utils::VERY_SLOW_TYPING_SPEED) unless get_var('NTLM_AUTH_INSTALL');
type_string_slow remote_install_bootmenu_params;
}

type_string_slow " fips=1" if (get_var('FIPS_INSTALLATION'));
type_string_slow " UPGRADE=1" if (get_var('UPGRADE'));

Expand All @@ -159,7 +164,6 @@ sub prepare_pvm_installation {
enter_netboot_parameters;
enter_cmd "boot";
save_screenshot;
return if get_var('AGAMA');

# pvm has sometimes extrem performance issue, increase timeout for booting up after enter_netboot_parameters
assert_screen(["pvm-grub-menu", "novalink-successful-first-boot"], 300);
Expand All @@ -171,6 +175,12 @@ sub prepare_pvm_installation {
return (bootloader_pvm::prepare_pvm_installation $boot_attempt);
}

if (is_agama) {
record_info("Installing", "Please check the expected product is being installed");
assert_screen('agama-installer-live-root', 400);
return;
}

assert_screen("run-yast-ssh", 300);

if (!is_upgrade && !get_var('KEEP_DISKS')) {
Expand Down
4 changes: 4 additions & 0 deletions lib/bootloader_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,10 @@ sub specific_bootmenu_params {
push @params, "agama.auto=$url";
}

if (my $agama_install_url = get_var('AGAMA_INSTALL_URL')) {
push @params, "agama.install_url=$agama_install_url";
}

# Boot the system with the debug options if shutdown takes suspiciously long time.
# Please, see https://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1 for the details.
# Further actions for saving debug logs are done in 'shutdown/cleanup_before_shutdown' module.
Expand Down
29 changes: 18 additions & 11 deletions tests/installation/agama_reboot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# 3) workaround for no ability to disable grub timeout in agama
# https://github.com/openSUSE/agama/issues/1594
# grub_test() is too slow to catch boot screen for us
# 4) for ipmi backend, vnc access during the installation is not available now,
# 4) for ipmi/pvm backend, vnc access during the installation is not available now,
# we need to access to live root system to monitor installation process
# Maintainer: Lubos Kocman <[email protected]>,

Expand All @@ -26,7 +26,7 @@ use version_utils qw(is_leap is_sle);
use utils;
use Utils::Logging qw(export_healthcheck_basic);
use x11utils 'ensure_unlocked_desktop';
use Utils::Backends qw(is_ipmi);
use Utils::Backends qw(is_ipmi is_pvm);
use Utils::Architectures qw(is_aarch64);

sub upload_agama_logs {
Expand Down Expand Up @@ -57,7 +57,7 @@ sub verify_agama_auto_install_done_cmdline {
die "Install phase is not done, please check agama logs";
}

sub agama_system_prepare_ipmi {
sub agama_system_prepare {
# Mount the root disk after installation, and do some prepare tasks:
# Configure serial console, enable root ssh access, etc

Expand All @@ -71,13 +71,19 @@ sub agama_system_prepare_ipmi {
assert_script_run("mount ${root_partition} /mnt");
# Set correct serial console to be able to see login in first boot
record_info("Set serial console");
my $sol_console = (is_aarch64) ? get_var('SERIALCONSOLE', 'ttyAMA0') : get_var('SERIALCONSOLE', 'ttyS1');
assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/boot/grub2/grub.cfg");
# Upload original grub configuration
if (is_ipmi) {
my $sol_console = (is_aarch64) ? get_var('SERIALCONSOLE', 'ttyAMA0') : get_var('SERIALCONSOLE', 'ttyS1');
assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/boot/grub2/grub.cfg");
# Set permanent grub configuration
assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/etc/default/grub");
}
if (is_pvm) {
assert_script_run("sed -i 's/quiet/console=hvc0/g' /mnt/boot/grub2/grub.cfg");
assert_script_run("sed -i 's/quiet/console=hvc0/g' /mnt/etc/default/grub");
}
# Upload grub configuration files
upload_logs("/mnt/etc/default/grub", failok => 1);
upload_logs("/mnt/boot/grub2/grub.cfg", failok => 1);
# Set permanent grub configuration
assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/etc/default/grub");
# Enable root ssh access
record_info("Enable root ssh login");
assert_script_run("echo 'PermitRootLogin yes' > /mnt/etc/ssh/sshd_config.d/root.conf");
Expand All @@ -87,18 +93,19 @@ sub agama_system_prepare_ipmi {
sub run {
my ($self) = @_;

if (is_ipmi && get_var('AGAMA_AUTO')) {
if ((is_ipmi || is_pvm) && get_var('AGAMA_AUTO')) {
select_console('root-console');
record_info 'Wait for installation phase done';
verify_agama_auto_install_done_cmdline();
script_run('agama logs store -d /tmp');
upload_logs('/tmp/agama-logs.tar.gz');
record_info 'Prepare system before rebooting';
agama_system_prepare_ipmi();
agama_system_prepare();
record_info 'Reboot system to disk boot';
enter_cmd 'reboot';
# Swith back to sol console, then user can monitor the boot log
select_console 'sol', await_console => 0;
select_console 'sol', await_console => 0 if is_ipmi;
reconnect_mgmt_console if is_pvm;
wait_still_screen 10;
save_screenshot;
return;
Expand Down

0 comments on commit fbafeb5

Please sign in to comment.