2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 12:37:54 +00:00
Commit Graph

77 Commits

Author SHA1 Message Date
Vinícius Ferrão 7d3cd9bd6d fix(netboot): use the HTTP tftp alias 2026-09-01 10:50:24 -03:00
Vinícius Ferrão 6df52f9e8b style(mknb): keep the riscv64 comments to the local facts
Five comments in the discovery path explained a consequence chain or
justified the code to a reviewer rather than stating what is not visible
locally: the payload protocol the code below already shows, a rationale
for the missing boot loader message, the two Genesis compression
variants, the HTTP and TFTP entry pair, and the :noboot divergence from
the PXELINUX files. Say the non-obvious part once.

Comments only; no executable line changes.
2026-09-01 10:50:23 -03:00
Vinícius Ferrão f945775317 feat(mknb): fetch the Genesis discovery payload over HTTP
The grub2 discovery configuration loaded the Genesis kernel and initramfs
over TFTP, a lockstep protocol that acknowledges every block and runs one
server process per client. Fetching the same 79 MiB Genesis image from a
node on the lab network took 61.5 s over TFTP and 1.2 s over HTTP, and a
whole cluster discovering at once queues on the TFTP server.

Write two entries instead. The default one sets root to the HTTP server
of the management node on that network and loads the same files from
below the TFTP root, the way nodeset does for netboot=grub2-http; the
second keeps the TFTP paths for a management node that does not serve the
TFTP root over HTTP, and "set fallback=1" moves to it when GRUB cannot
fetch the payload over HTTP. site.httpport is honoured.
2026-09-01 10:50:22 -03:00
Vinícius Ferrão 033b16d522 feat(mknb): write grub2 discovery configs for riscv64
mknb only knew how to publish a discovery boot configuration for x86
(PXELINUX and xNBA) and POWER (petitboot). Any other architecture got a
Genesis kernel and initramfs under /tftpboot/xcat and nothing that would
make a firmware boot them, so riscv64 discovery could not start.

riscv64 nodes boot through UEFI and grub2. Write one grub2 configuration
per network, /tftpboot/boot/grub2/grub.cfg-<network hex prefix>, using
the same network keys as the PXELINUX files. A net-booted grub2.riscv64
searches grub.cfg-01-<mac>, grub.cfg-<8 hex ip> and then shorter prefixes
of the ip, so the per-node files that nodeset writes keep priority and
the network file is only reached by clients without a node configuration.
The file is regenerated from the published Genesis artifacts (lzma
preferred over gzip), guarded by $grub_cpu so other grub2 architectures
can share it later, carries the xcatd endpoint, the serial console and
BOOTIF=$net_default_mac, and is dropped for networks served by a
:noboot interface. It is written by name rather than into an existing
file, because on a /32 network nodeset's hard link for the node carries
the same name.

Publishing a Genesis image now also drops the other compression variant
of that architecture, so a leftover genesis.fs.<arch>.lzma can no longer
be paired with a freshly published kernel by this configuration or by
--configfileonly. And since these configurations are only reachable
through grub2.<arch>, which xCAT does not build, a missing boot loader is
reported instead of leaving the nodes to time out in firmware.

xcatconfig now also runs mknb riscv64 when xCAT-genesis-base-riscv64 is
installed, and the usage text lists the architecture.
2026-09-01 10:50:19 -03:00
Vinícius Ferrão 8e94cd157a fix(genesis): complete artifact cleanup
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-25 11:26:47 -03:00
Vinícius Ferrão a983faf736 fix(genesis): retire stale legacy initramfs
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-25 11:26:47 -03:00
Vinícius Ferrão 33124a1483 fix(genesis): preserve canonical ppc64 images 2026-08-25 11:26:46 -03:00
Vinícius Ferrão ca1b0cbd67 fix(genesis): protect Power architecture fallback 2026-08-25 11:26:46 -03:00
Vinícius Ferrão 719e5aecab fix(genesis): close consumer review gaps 2026-08-25 11:26:46 -03:00
Vinícius Ferrão ba2c1e75bc fix(genesis): finish consumer integration 2026-08-25 11:26:45 -03:00
Vinícius Ferrão f5d1bd8e73 fix(genesis): complete boot consumer wiring 2026-08-25 11:26:45 -03:00
Vinícius Ferrão 4457efbd1b feat(genesis): activate installed OpenEmbedded images 2026-08-25 11:26:44 -03:00
Vinícius Ferrão c390570e95 fix(mknb): compress the genesis image with xz when lzma is absent
The genesis image goes into a file whose name ends with .lzma. The plugin
writes that file only when /usr/bin/lzma is there, and it falls back to gzip
when it is not.

Red Hat ships no lzma binary. On AlmaLinux 9 and on AlmaLinux 10 that test
fails, the plugin falls back to gzip, and it gives no message that says why.
The image is larger on each run of mknb. Debian and Ubuntu ship lzma as a
second name for xz, so those systems still get the smaller image.

Ask xz for the same container when lzma is absent. The command
"xz --format=lzma" writes the same bytes as "lzma", so the file keeps its
name, its container and its size. Keep the gzip fallback for a system that
has neither program.

Recovered from the lenovobuild branch, which asked xz for the xz container.
That container is not the lzma container, and the name of the file says lzma.
2026-08-23 22:38:41 -03:00
Vinícius Ferrão 8f2c508950 fix(mknb): reject incomplete exports 2026-08-11 20:18:27 -03:00
Vinícius Ferrão 05e35a12e8 fix(mknb): identify exported Genesis images 2026-08-11 20:12:51 -03:00
Vinícius Ferrão 2ba1048f24 build(server): require Digest::SHA 2026-08-11 20:10:40 -03:00
Vinícius Ferrão 26b4aec340 feat(mknb): install exported Genesis images 2026-08-11 20:10:22 -03:00
Vinícius Ferrão aeb07dce85 fix(mknb): render Genesis boot paths correctly 2026-08-10 15:07:49 -03:00
Vinícius Ferrão 39f721713e fix(netboot): omit the default HTTP port from generated boot URLs
Boot URLs handed to nodes always carried an explicit :80 even when the HTTP
server listens on the default port. grub2.pm already omits the port when it is
80; make the xNBA, genesis and DHCP boot URLs consistent with it.

$portsuffix is empty when site.httpport is unset or 80 and ":<port>" otherwise,
so a non-default port is unchanged. Covers the ISC and Kea paths in dhcp.pm,
xnba.pm, mknb.pm, and the Kea xNBA client classes in BootPolicy.pm.

dhcp_boot_policy.t and mknb_xcatd_address.t follow the new URLs and gain cases
for a non-default and an unset port. The floating-address guard in
mknb_xcatd_address.t also drops :80 so that it keeps matching.

Recovered from the unmerged lenovobuild branch (cd61fd9d, a2f77ea9, 1035841b,
b7db0e2, 792fe6d).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-26 03:14:50 -03:00
Vinícius Ferrão 6da5efd29a fix(mknb): build the genesis image atomically to survive concurrent runs
mknb writes the compressed genesis filesystem by streaming cpio output
straight onto the final path in $tftpdir/xcat (genesis.fs.$arch.lzma or .gz).
When two mknb/nodeset runs target a shared $tftpdir at once, one run reads or
overwrites the other's half-written image, producing a corrupt genesis.fs and
failed netboots.

Write each image to a uniquely-suffixed temporary file
(xCAT::Utils::genpassword(24)) and File::Copy::move() it into place. move()
within the same directory is a rename, so the final path only ever appears
complete. Both modules are already imported by mknb.pm.

Recovered from the unmerged lenovobuild branch (originals c651e7b8 and its
fix da0723f2, which switched the suffix to genpassword after the first
attempt only produced a single character). master lacks the branch's xz
path, so only the lzma and gzip paths are adjusted here.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-21 16:24:08 -03:00
Vinícius Ferrão 3cd74bbab0 fix(mknb): avoid transient discovery addresses 2026-07-15 21:20:26 -03:00
Vinícius Ferrão 03a16dd081 fix: move kernel quiet flag from hardcoded to osimage default
The quiet kernel parameter was hardcoded in anaconda.pm and sles.pm,
making it impossible for admins to get verbose boot output without
editing plugin source code. The existing addkcmdline mechanism
(bootparams and linuximage tables) only appends to the kernel command
line, so there was no way to remove quiet.

Move quiet out of the plugin kcmdline construction and into the
linuximage.addkcmdline default set during copycds osimage creation.
Admins who want verbose boot for debugging can now remove it per
osimage:

    chdef -t osimage <image> addkcmdline=""

New osimages get addkcmdline="quiet" by default. Existing osimages
with a custom addkcmdline are not overwritten on re-run of copycds.

Genesis/discovery boot (mknb.pm) is unchanged as it does not use
osimage definitions.

Addresses #6916
2026-05-04 22:58:52 -03:00
davidmonro 661b579927 mknb: look for newer types of ssh keys to insert into the authorized keys file in the image (#7502) 2025-08-23 15:30:13 +02:00
besawn 89af19cecc Merge pull request #7249 from NCI-Cloud/mknb_initrd_file_fix
mknb: Correctly specify initrd file when generating netboot configs.
2022-11-14 16:27:09 -05:00
Mark Gurevich fc168cc9b8 Test lzma compression for genesis network boot 2022-11-08 14:46:00 -05:00
Simon Fowler 85a9e0abba Correctly specify initrd file for all netboot configs.
Previously the code which created the netboot config files was
incorrectly specifying the initrd file name in a number of places,
particularly in the xcat/xnba/nets/* files, using a hard-coded `.gz`
suffix even when a `.lzma` file had been created. This change ensures
that the initrd file name determined earlier in the code (either when
the image is created, or in the configonly case by checking the
filesystem) is used correctly when creating the netboot config files.
2022-09-12 13:37:29 +10:00
Mark Gurevich 42fbc2e063 Update BOOTIF 2021-11-02 14:53:23 -04:00
Mark Gurevich cf1e71445e Change uefi to not do elilo for network discovery boot 2021-11-01 15:06:50 -04:00
Yuan Bai 5db2dbd62c fix5209 nodeset cannot find pxelinux.0 (#5783)
* distro pxelinux.0 default path is changed in ubuntu 16.04
2018-11-09 17:03:58 +08:00
yangsbj 1889ec879d support site.httpport in nodeset and mknb 2018-11-01 23:29:01 -04:00
GONG Jie 6e096b05ad Remove trailing spaces in file xCAT-server/lib/xcat/plugins/mknb.pm 2017-12-31 23:59:59 +00:00
Jarrod Johnson 1dfc1ae80e Copy in hidden files to mknb
mknb was ignoring hidden files (e.g. .screenrc), fix this.
2017-11-07 11:52:16 -05:00
Bin Xu 7917678e39 Fix 3603, if using ppc64le/ppc64el for mknb, just use 'ppc64' as a substitude. 2017-08-03 15:52:25 +08:00
ertaozh 003290702e a syntax error within mknb.pm 2016-11-30 02:59:40 -05:00
Obihörnchen dc9ffa4307 Fix mknb: Undefined subroutine noderange
Add missing xCAT::NodeRange module
2016-11-18 15:47:47 -05:00
Victor Hu 263acbf5ce Based on Er Tao's comments, before going into the code for determining
the noboot nic names, parse out the interface names for the tagged vlans
without the physical name in the string
2016-11-15 16:48:45 -05:00
Victor Hu 2ca61ad9e8 Support noboot on interfaces that are tagged vlan on the mangement node 2016-11-14 13:31:48 -05:00
ertaozh 45c676e3a4 Fix issue 1881: Garrison boots genesis kernel when mutliple interfaces have dhcp dynamic ranges 2016-10-14 02:33:15 -04:00
Mark Gurevich 0a3fbd8d51 perltidy all perl files 2016-07-20 11:40:27 -04:00
Victor Hu 726d4d35f1 Fix the formatting of the file to use 3 spaces instead of tab 2016-06-07 13:49:13 -04:00
Victor Hu d73b02386a Adding quotes to the label and default tag. Without
this, petitboot menu does not count down by default
2016-06-07 13:40:11 -04:00
Victor Hu 9d7120d3c6 Add more information to the label to identify that the network
boot is the Genesis Kernel and the IP which is serving it
2016-05-26 15:53:41 -04:00
ertaozh 16d4e7de4a fix issue 1084: [FVT] 2.12 mknb failed on ubuntu 16.04 x86 env 2016-05-13 02:54:10 -04:00
Patrick Lundgren 850051bd75 removed keygen of rsa1 key and removed references / replaced with rsa key when appropriate 2016-04-12 09:50:16 -04:00
zhaoertao 754b22c710 enhance mknb <arch> -c command 2015-07-02 03:29:44 -04:00
zhaoertao c3a3b8083b add '-c' option for mknb to just create netboot configuration file 2015-07-01 04:33:14 -04:00
zhaoertao 32d389cbee add message for 'mknb' in ubuntu LE 2014-10-07 23:19:36 -07:00
mellor 3133cbeb3f 1. add xCAT depend on xcat-genesis-scripts, 2. fix mknb issue, 3. modify xcatconfig to call mknb <ppc64/x86_64> 2014-09-29 21:26:52 -07:00
mellor b06aa3afb0 enhance of creating default netboot configuration file for p8 hardware discovery 2014-09-24 20:23:20 -07:00
mellor 08e0ce42f0 correct the default configuration file for p8 hardware discovery 2014-09-24 02:41:55 -07:00