mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-26 01:34:05 +00:00
Merge pull request #7876 from VersatusHPC/fix/mknb-bootif-hexhyp
fix(mknb): pass the boot MAC to BIOS Genesis on stock iPXE
This commit is contained in:
@@ -828,7 +828,7 @@ sub process_request {
|
||||
open($cfg, ">", "$tftpdir/xcat/xnba/nets/$net");
|
||||
print $cfg "#!gpxe\n";
|
||||
if ($invisibletouch) {
|
||||
print $cfg 'imgfetch -n kernel http://${next-server}'.$portsuffix.'/tftpboot/xcat/genesis.kernel.' . "$arch xcatd=" . $xcatd_address . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/machyp}' . "\n";
|
||||
print $cfg 'imgfetch -n kernel http://${next-server}'.$portsuffix.'/tftpboot/xcat/genesis.kernel.' . "$arch xcatd=" . $xcatd_address . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/mac:hexhyp}' . "\n";
|
||||
print $cfg 'imgfetch -n nbfs http://${next-server}'.$portsuffix . "$initrd_file\n";
|
||||
} else {
|
||||
print $cfg 'imgfetch -n kernel http://${next-server}'.$portsuffix.'/tftpboot/xcat/nbk.' . "$arch xcatd=" . $xcatd_address . ":$xcatdport $consolecmdline\n";
|
||||
|
||||
@@ -553,4 +553,32 @@ my $unsafe = xCAT_plugin::mknb::_select_genesis_source(
|
||||
);
|
||||
is($unsafe, undef, 'unsupported architecture names cannot escape the image root');
|
||||
|
||||
$::XCATROOT = "$tmpdir/openembedded-x86_64-xcatroot";
|
||||
prepare_export(
|
||||
"$::XCATROOT/share/xcat/netboot/genesis-openembedded/x86_64",
|
||||
'openembedded x86_64 kernel',
|
||||
'openembedded x86_64 initramfs',
|
||||
'x86_64',
|
||||
);
|
||||
$xCAT::TableUtils::tftpdir = "$tmpdir/openembedded-x86_64-tftpboot";
|
||||
@responses = ();
|
||||
xCAT_plugin::mknb::process_request(
|
||||
{ arg => ['x86_64'] },
|
||||
sub { push(@responses, @_); },
|
||||
);
|
||||
ok(
|
||||
!grep({ ref($_) eq 'HASH' && $_->{error} } @responses),
|
||||
'mknb installs an x86_64 OpenEmbedded export',
|
||||
);
|
||||
is(
|
||||
read_file("$xCAT::TableUtils::tftpdir/xcat/genesis.kernel.x86_64"),
|
||||
'openembedded x86_64 kernel',
|
||||
'mknb publishes the OpenEmbedded x86_64 kernel',
|
||||
);
|
||||
like(
|
||||
read_file("$xCAT::TableUtils::tftpdir/xcat/xnba/nets/192.0.2.0_24"),
|
||||
qr{^imgfetch -n kernel \S+/xcat/genesis\.kernel\.x86_64 .* BOOTIF=01-\$\{netX/mac:hexhyp\}$}m,
|
||||
'the OpenEmbedded BIOS Genesis script takes BOOTIF from mac:hexhyp',
|
||||
);
|
||||
|
||||
done_testing();
|
||||
|
||||
@@ -232,6 +232,20 @@ foreach my $relative_path (
|
||||
);
|
||||
}
|
||||
|
||||
my $bios_genesis = read_config(
|
||||
"$xCAT::TableUtils::tftpdir/xcat/xnba/nets/192.168.144.0_20"
|
||||
);
|
||||
like(
|
||||
$bios_genesis,
|
||||
qr{^imgfetch -n kernel \S+/xcat/genesis\.kernel\.x86_64 .* BOOTIF=01-\$\{netX/mac:hexhyp\}$}m,
|
||||
'the BIOS Genesis script takes BOOTIF from mac:hexhyp',
|
||||
);
|
||||
unlike(
|
||||
$bios_genesis,
|
||||
qr/machyp/,
|
||||
'the BIOS Genesis script does not use the xNBA-only machyp setting',
|
||||
);
|
||||
|
||||
use_reporter_address_maps();
|
||||
prepare_tftpdir($tmpdir, 'tftpboot-x86-legacy', 'x86_64', 'legacy');
|
||||
$responses = run_mknb('x86_64');
|
||||
|
||||
Reference in New Issue
Block a user