From b4eb93be866282eb0f6efe8a5740319f25872db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 24 Sep 2026 02:33:01 -0300 Subject: [PATCH 1/2] fix(mknb): pass the boot MAC to BIOS Genesis on stock iPXE mknb wrote BOOTIF=01-${netX/machyp} into the BIOS Genesis script. machyp is an xNBA setting, and stock iPXE expands it to an empty string. Without the boot MAC, the legacy Genesis stops with "Unable to find boot device" after at least 10 minutes. The OpenEmbedded Genesis fails at once with BOOT_INTERFACE_NOT_FOUND. Use ${netX/mac:hexhyp}, as the UEFI Genesis script and xnba.pm do. xNBA expands both settings to the same value, so boot with xNBA is unchanged. --- xCAT-server/lib/xcat/plugins/mknb.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index 01ddc5b95..baaac6e97 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -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"; From 43e008cf996e7b3903b4a01ef8f0c0355a31a97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 24 Sep 2026 02:33:01 -0300 Subject: [PATCH 2/2] test(mknb): cover the BIOS Genesis BOOTIF format Check both paths that write the script: mknb --configfileonly on an installed Genesis, and a full mknb run from an x86_64 OpenEmbedded export. --- xCAT-test/unit/mknb_exported_genesis.t | 28 ++++++++++++++++++++++++++ xCAT-test/unit/mknb_xcatd_address.t | 14 +++++++++++++ 2 files changed, 42 insertions(+) diff --git a/xCAT-test/unit/mknb_exported_genesis.t b/xCAT-test/unit/mknb_exported_genesis.t index 5f523a9bf..3fd26df00 100644 --- a/xCAT-test/unit/mknb_exported_genesis.t +++ b/xCAT-test/unit/mknb_exported_genesis.t @@ -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(); diff --git a/xCAT-test/unit/mknb_xcatd_address.t b/xCAT-test/unit/mknb_xcatd_address.t index 0a69dd2e0..281a1af8a 100644 --- a/xCAT-test/unit/mknb_xcatd_address.t +++ b/xCAT-test/unit/mknb_xcatd_address.t @@ -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');