mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-08 12:40:45 +00:00
fix(genesis): simplify s390x network IPL
This commit is contained in:
@@ -112,43 +112,22 @@ sub kea_s390x_network_classes {
|
||||
|
||||
my $network_id = "$opts{net}_$opts{prefix}";
|
||||
my $safe_network = $network_id;
|
||||
$safe_network =~ s{[^[:alnum:]_.-]}{_}gxms;
|
||||
$safe_network =~ s{[^A-Za-z0-9_.-]}{_}gxms;
|
||||
|
||||
my @classes;
|
||||
if ( $opts{qemu_config_present} ) {
|
||||
push @classes, {
|
||||
return [
|
||||
{
|
||||
name => "xcat-s390x-qemu-$safe_network",
|
||||
test => 'option[93].hex == 0x001f',
|
||||
additional_only => 1,
|
||||
'option-data' => [
|
||||
{
|
||||
name => 'conf-file',
|
||||
data => $network_id,
|
||||
'always-send' => 1,
|
||||
},
|
||||
{
|
||||
name => 'path-prefix',
|
||||
data => 'pxelinux.cfg/s390x/',
|
||||
data => "pxelinux.cfg/s390x/$network_id",
|
||||
'always-send' => 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
return \@classes;
|
||||
}
|
||||
|
||||
sub ensure_isc_path_prefix_definition {
|
||||
my ($class, $config) = @_;
|
||||
|
||||
foreach my $line ( @{$config} ) {
|
||||
if ( $line =~ m{^\s* option \s+ path-prefix \s+ code \s+ 210\b}xms ) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
my $index = @{$config} && $config->[0] =~ m{^\#xCAT}xms ? 1 : 0;
|
||||
splice @{$config}, $index, 0, "option path-prefix code 210 = text;\n";
|
||||
return 1;
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
sub isc_client_architecture_lines {
|
||||
@@ -184,11 +163,8 @@ sub isc_client_architecture_lines {
|
||||
" } else if option client-architecture = 00:1c { #riscv64 uefi http boot\n ",
|
||||
" option vendor-class-identifier \"HTTPClient\";\n",
|
||||
" filename \"http://$tftp$portsuffix/tftpboot/boot/grub2/grub2.riscv64\";\n",
|
||||
($opts{s390x_qemu_config_present} ? (
|
||||
" } else if option client-architecture = 00:1f { #QEMU s390x\n ",
|
||||
" option path-prefix = \"pxelinux.cfg/s390x/\";\n",
|
||||
" option conf-file = \"${net}_${maskbits}\";\n",
|
||||
) : ()),
|
||||
" } else if option client-architecture = 00:1f { #QEMU s390x\n ",
|
||||
" option conf-file = \"pxelinux.cfg/s390x/${net}_${maskbits}\";\n",
|
||||
" } else if option client-architecture = 00:0e { #OPAL-v3\n ",
|
||||
" option conf-file = \"http://$tftp$portsuffix/tftpboot/pxelinux.cfg/p/${net}_${maskbits}\";\n",
|
||||
" } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n",
|
||||
|
||||
@@ -2354,10 +2354,6 @@ sub process_request
|
||||
$restartdhcp = 1;
|
||||
newconfig();
|
||||
}
|
||||
if (!xCAT::Utils->isAIX() &&
|
||||
xCAT::DHCP::BootPolicy->ensure_isc_path_prefix_definition(\@dhcpconf)) {
|
||||
$restartdhcp = 1;
|
||||
}
|
||||
if ($usingipv6 and not $dhcp6conf[0]) {
|
||||
$restartdhcp6 = 1;
|
||||
newconfig6();
|
||||
@@ -3368,9 +3364,8 @@ sub kea_subnet4_intent
|
||||
};
|
||||
push @client_classes, @{
|
||||
xCAT::DHCP::BootPolicy->kea_s390x_network_classes(
|
||||
net => $net,
|
||||
prefix => $prefix,
|
||||
qemu_config_present => -f "$tftpdir/pxelinux.cfg/s390x/${net}_${prefix}",
|
||||
net => $net,
|
||||
prefix => $prefix,
|
||||
)
|
||||
};
|
||||
if (@client_classes) {
|
||||
@@ -3896,7 +3891,6 @@ sub kea_option_defs
|
||||
{
|
||||
return [
|
||||
{ name => 'conf-file', code => 209, type => 'string', space => 'dhcp4' },
|
||||
{ name => 'path-prefix', code => 210, type => 'string', space => 'dhcp4' },
|
||||
{ name => 'iscsi-initiator-iqn', code => 203, type => 'string', space => 'dhcp4' },
|
||||
{ name => 'cumulus-provision-url', code => 239, type => 'string', space => 'dhcp4' },
|
||||
];
|
||||
@@ -4535,8 +4529,6 @@ sub addnet
|
||||
tftpdir => $tftpdir,
|
||||
net => $net,
|
||||
prefix => $maskbits,
|
||||
s390x_qemu_config_present =>
|
||||
-f "$tftpdir/pxelinux.cfg/s390x/${net}_${maskbits}",
|
||||
) };
|
||||
|
||||
if ($range) {
|
||||
@@ -4806,7 +4798,6 @@ sub newconfig
|
||||
push @dhcpconf, "#xCAT generated dhcp configuration\n";
|
||||
push @dhcpconf, "\n";
|
||||
push @dhcpconf, "option conf-file code 209 = text;\n";
|
||||
push @dhcpconf, "option path-prefix code 210 = text;\n";
|
||||
push @dhcpconf, "option space isan;\n";
|
||||
push @dhcpconf, "option isan-encap-opts code 43 = encapsulate isan;\n";
|
||||
push @dhcpconf, "option isan.iqn code 203 = string;\n";
|
||||
|
||||
@@ -757,8 +757,7 @@ sub process_request {
|
||||
my $nicip = $normnets->{$net};
|
||||
my $xcatd_address = defined($xcatdnormnets->{$net}) ? $xcatdnormnets->{$net} : $nicip;
|
||||
$net =~ s/\//_/;
|
||||
if (defined $nobootnicips{$nicip}
|
||||
|| ($arch eq 's390x' && defined $nobootnicips{$xcatd_address})) {
|
||||
if (defined($nobootnicips{$nicip})) {
|
||||
if ($arch =~ /ppc/ and -r "$tftpdir/pxelinux.cfg/p/$net") {
|
||||
unlink("$tftpdir/pxelinux.cfg/p/$net");
|
||||
} elsif ($arch eq 's390x') {
|
||||
@@ -834,6 +833,9 @@ sub process_request {
|
||||
xcatd_address => $xcatd_address,
|
||||
xcatdport => $xcatdport,
|
||||
consolecmdline => $consolecmdline,
|
||||
kernel => $invisibletouch
|
||||
? "xcat/genesis.kernel.$arch"
|
||||
: "xcat/nbk.$arch",
|
||||
initrd => $initrd_file,
|
||||
);
|
||||
if ($config_error) {
|
||||
@@ -923,7 +925,7 @@ sub _write_s390x_discovery_config {
|
||||
my $qemu_config = "# pxelinux.cfg xCAT Genesis s390x\n"
|
||||
. "DEFAULT xCAT\n"
|
||||
. "LABEL xCAT\n"
|
||||
. " KERNEL xcat/genesis.kernel.s390x\n"
|
||||
. " KERNEL $args{kernel}\n"
|
||||
. " INITRD $initrd\n"
|
||||
. " APPEND $cmdline\n";
|
||||
my $error = _write_s390x_config($qemu_path, $qemu_config);
|
||||
|
||||
Reference in New Issue
Block a user