Skip to content

Commit

Permalink
Merge pull request #20347 from okynos/167248-boot-s390x
Browse files Browse the repository at this point in the history
Boot agama in OSD in s390x with zVM
  • Loading branch information
jknphy authored Oct 9, 2024
2 parents b141881 + 1422514 commit f3dce2c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
23 changes: 19 additions & 4 deletions lib/susedistribution.pm
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,25 @@ sub init_consoles {
my $packed_ip = gethostbyname($s390_guest_fqdn);
die "Failed to get host by name for '$s390_guest_fqdn' (on " . hostname . ")" unless $packed_ip;
my $s390_guest_ip = inet_ntoa($packed_ip);
my $host_ip = get_var("AGAMA") ? 'hostip' : 'HostIP';
my $host_name = get_var("AGAMA") ? 'hostname' : 'Hostname';
$s390_params .= " $host_ip" . "=${s390_guest_ip}/${s390_guest_subnetmask}";
$s390_params .= " $host_name" . "=${s390_guest_hostname}";
if (get_var("AGAMA")) {
my @split = split(/\./, get_required_var("REPO_HOST"));
pop(@split);
my $s390_gateway_ip = join(".", @split, "254");
my $s390_device = "enca00";

@split = split(/\./, get_required_var("ZVM_GUEST"));
shift(@split);
my $s390_domain = join(".", @split);

if (is_sle()) {
$s390_device = "enc800";
}
$s390_params .= " ip=${s390_guest_ip}:${s390_guest_hostname}:${s390_gateway_ip}:${s390_guest_subnetmask}:${s390_domain}:${s390_device}:none";
}
else {
$s390_params .= " HostIP=${s390_guest_ip}/${s390_guest_subnetmask}";
$s390_params .= " Hostname" . "=${s390_guest_hostname}";
}
set_var("S390_NETWORK_PARAMS", $s390_params);

$hostname = $s390_guest_fqdn;
Expand Down
18 changes: 12 additions & 6 deletions tests/installation/bootloader_s390.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ sub prepare_parmfile {
}

$params .= specific_bootmenu_params;
$params .= registration_bootloader_cmdline if check_var('SCC_REGISTER', 'installation');
unless (get_var("AGAMA")) {
$params .= registration_bootloader_cmdline if check_var('SCC_REGISTER', 'installation');
}

# Pass autoyast parameter for s390x, shorten the url because of 72 columns limit in x3270 xedit
# If 'AUTOYAST_PREPARE_PROFILE' is true, shorten url directly, otherwise shorten url with data_url method
Expand Down Expand Up @@ -176,18 +178,22 @@ EO_frickin_boot_parms
## an empty line and a single "manual=1" at the bottom
## of the ftpboot parmfile. This may fail in obscure
## ways when that changes.
$s3270->sequence_3270(qw(String(BOTTOM) ENTER String(DELETE) ENTER));
$s3270->sequence_3270(qw(String(BOTTOM) ENTER String(DELETE) ENTER));
## In Agama The "manual=1" line is not present so it is not required to delete it.
unless (get_var('AGAMA')) {
$s3270->sequence_3270(qw(String(BOTTOM) ENTER String(DELETE) ENTER));
$s3270->sequence_3270(qw(String(BOTTOM) ENTER String(DELETE) ENTER));

$r = $s3270->expect_3270(buffer_ready => qr/X E D I T/);
$r = $s3270->expect_3270(buffer_ready => qr/X E D I T/);
}

# save the parmfile. ftpboot then starts the installation.
$s3270->sequence_3270(qw( String(FILE) ENTER ));

if (get_var('AGAMA')) {
my ($hostname) = split(/\./, get_required_var("ZVM_GUEST"));
$r = $s3270->expect_3270(
output_delim => qr/o3zvm003 login/,
timeout => 400
output_delim => qr/$hostname login/,
timeout => 300
) || die "Login was not found";
$s3270->sequence_3270(qw(String("root") ENTER));

Expand Down

0 comments on commit f3dce2c

Please sign in to comment.