2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-28 21:32:20 +00:00
Commit Graph

92 Commits

Author SHA1 Message Date
Vinícius Ferrão bb8bc944dd fix(boot): stop node-template expansion on unsupported keys 2026-10-22 21:09:32 -03:00
Vinícius Ferrão c76f53a826 refactor(boot): centralize node-template expansion 2026-10-22 20:53:11 -03:00
Daniel Hilst 9329aea4c2 Merge master into feat/secureboot-ipxe
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-16 11:03:31 -03:00
Vinícius Ferrão 937f6895f0 refactor(http): share port suffix formatting across boot callers 2026-10-14 13:29:22 -03:00
Daniel Hilst c10c30d342 fix(xcat-core): verify the Genesis kernel with the shim of ipxe-xcat
setstate writes the Genesis kernel into the UEFI script of a node for the
shell, discover, standby and runcmd destinies. It asked for a shim with the os
of the node, so a management node that ran copycds named the shim of that
install source. That shim trusts the vendor certificate of the distribution,
which signs no Genesis kernel, and the node stops at the same Security Policy
Violation.

shim_url_path takes the kernel of the boot script. A Genesis kernel skips the
install source and takes the shim of ipxe-xcat, which reads the MOK list. An
osimage kernel keeps the install source first. mknb already named the loader
shim, because it passes no os.

Two assertions of twelve in secureboot_ipxe_node_shim.t fail without this
change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-07 14:52:03 -03:00
Daniel Hilst 022a80f351 feat(xcat-core): load the kernel of an ipxe node through a Secure Boot shim
This PR adds a shim to the UEFI boot scripts of netboot=ipxe nodes, so a node
with Secure Boot on reaches its kernel.

The firmware signature database does not hold the keys of a Linux
distribution. A UEFI node with netboot=ipxe loads snponly-shim.efi and
snponly.efi, both signed, and then stops at the kernel with "Verification
failed: Security Policy Violation".

xCAT::SecureBoot::shim_url_path names a shim for one node. The shim of the
install source comes first, because its vendor certificate signs the kernel of
its own distribution. copycds keeps the names of the DVD, so the module tries
EFI/BOOT/BOOTX64.EFI, EFI/BOOT/bootx64.efi and EFI/boot/bootx64.efi: EL and
openEuler ship the first, openSUSE the second and Ubuntu the third. When no
install source carries a shim, the module names the shim of ipxe-xcat, which
verifies a kernel that a MOK key signs.

xnba.pm writes the shim line after imgload in the UEFI script of an ipxe node,
and mknb.pm writes it in the UEFI discovery scripts. iPXE fetches the shim only
when it cannot load the kernel itself, so a node with Secure Boot off reads no
shim. netboot=xnba is unchanged: no key signs xnba.efi.

The elilo and ESXi paths and the Genesis kernel stay unsigned, and the iPXE
documentation now says so. The validation matrix gets a row for a UEFI install,
a netboot image and discovery with Secure Boot on.

secureboot_ipxe_node_shim.t and secureboot_genesis_shim.t drive nodeset and
mknb into a scratch TFTP root. Four assertions of ten and two of seven fail
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-07 11:57:07 -03:00
Vinícius Ferrão 80418f2f73 feat(netboot): add the ipxe netboot method
xCAT boots x86 nodes through iPXE with netboot=xnba, which names the
xNBA fork that xCAT retires. netboot=ipxe is the method for the upstream
iPXE loaders of the ipxe-xcat package.

The ipxe plugin runs the xnba code, with the boot scripts under
xcat/ipxe/nodes instead of xcat/xnba/nodes. nodeset stat, the osimage
check of nodeset and rinstall, and the install check of Postage accept
the new value. The noderes.netboot description lists it and marks xnba
deprecated. The z/VM and FSM builds of xCAT-server leave the ipxe plugin
out with the xnba and pxe plugins. netboot=xnba does not change, and
makedhcp does not serve the new method yet.
2026-10-02 20:11:18 -03:00
Vinícius Ferrão 63e80a3734 fix(xnba): correct ownership checks in disjoint DHCP mode 2026-09-19 04:18:18 -03:00
Vinícius Ferrão 9bec1bff0e refactor(netboot): centralize volatile kernel arguments 2026-09-01 16:15:41 -03:00
Daniel Hilst cf159d31aa Merge pull request #7691 from VersatusHPC/harvest/pxelinux
fix(xnba): warn instead of failing when pxelinux.0 is unavailable
2026-07-28 11:03:39 -03:00
Vinícius Ferrão 42e8ef64cc fix(xnba): warn only when pxelinux is required
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-27 15:22:12 -03:00
Daniel Hilst d4d9d5c859 Merge pull request #7690 from VersatusHPC/harvest/port80
fix(netboot): omit the default HTTP port from generated boot URLs
2026-07-27 15:15:18 -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 40f754d657 fix(xnba): warn instead of failing when pxelinux.0 is unavailable
nodeset aborted with "Unable to find pxelinux.0 from syslinux" when neither
the copy under the tftp directory nor the one under XCATROOT existed. Only
legacy BIOS clients chain pxelinux and not every distribution still ships
syslinux, so a UEFI-only environment could not run nodeset at all.

Copy pxelinux.0 when it is available and warn, rather than fail, when it is not.

Recovered from the unmerged lenovobuild branch (4f0a5106), which skipped
silently; warn so the missing loader is still reported.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 16:53:25 -03:00
Vinícius Ferrão 0b804c7913 fix(xnba): use the iPXE-native MAC format on the BIOS boot path
The BIOS (pcfg) boot config writes the kernel BOOTIF as `${netX/machyp}`, a
legacy gPXE spelling, while the UEFI (ucfg) config for the same node already
uses the iPXE-native `${netX/mac:hexhyp}`. xNBA is built from iPXE, whose
documented format is `mac:hexhyp`.

This is a consistency / standards-compliance alignment, not a fix for broken
behaviour: the shipped xNBA still honours the old `machyp` alias -- confirmed
by a real legacy-BIOS PXE boot, which came up fine with the stock spelling.
The change brings the BIOS path in line with the UEFI path and the documented
iPXE syntax, so both paths use one form and neither relies on a deprecated
gPXE alias.

Validated on a throwaway EL9 xCAT cluster: a legacy-BIOS client PXE-booted
with the patched config and genesis came up.

Recovered from the unmerged lenovobuild branch (original 85ce5b7e).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 18:50:50 -03:00
Vinícius Ferrão c8b21c1cca fix: strip R:: prefix from netboot config when all options are persistent
When all addkcmdline options have R:: prefix (persistent options for
the installed OS), the volatile check in xnba.pm and pxe.pm would fail
because volatile was undefined. This left the original R::-prefixed
string in the netboot config instead of stripping it.

The fix ensures we always use the volatile portion after calling
splitkcmdline, even if it's empty. Persistent (R::) options are
handled separately by Template.pm via PERSKCMDLINE for the installed
OS bootloader.

Fixes #7442
2026-05-08 02:18:40 -03:00
Vinícius Ferrão 9f33b19214 fix: restore legacy SLES provisioning paths 2026-05-05 17:09:37 -03:00
Vinícius Ferrão 1babd7b0e4 fix: improve Ubuntu LTS provisioning support 2026-04-29 18:19:12 -03:00
Jarrod Johnson 6b7cde63e4 Fix support for non-efistub kernels 2020-07-20 08:39:28 -04:00
Jarrod Johnson eae0a64348 Have xnba conditionally do elilo if needed
CentOS 6 and RHEL 6 for example do not support direct iPXE
boot.  For those platforms, auto-use elilo for uefi boot.
2020-07-20 08:37:36 -04:00
Jarrod Johnson 76a57eaae2 Remove use of elilo
iPXE can directly execute all but the most ancient Linux kernels
directly in UEFI boot.  Remove the elilo intermediate step.
2020-07-20 08:37:28 -04:00
yangsbj 1889ec879d support site.httpport in nodeset and mknb 2018-11-01 23:29:01 -04:00
Bin Xu 863c36c83f Make disjoint mode working when service node up (inittime=1) (#5553)
* Make disjoint mode working when service node up (inittime=1), and in the time not run in parallel to avoid access DB too much

* For shared tftp, nothing need to be done in AAsn
2018-09-11 09:22:08 +08:00
GONG Jie 9265693a0c Remove trailing spaces in file xCAT-server/lib/xcat/plugins/xnba.pm 2017-12-31 23:59:59 +00:00
cxhong 2bf8108af6 build xnba config files from boottarget table (#5296) 2018-06-21 13:40:41 +08:00
Bin Xu 7da8844f82 1, enhance error handling for grub2 plugin; 2, move grub2 configuration business logic into 'setstate' 2017-09-30 17:49:29 +08:00
Bin Xu a717283a28 make xnba plugin error hanlding better for batch operation 2017-09-30 13:05:40 +08:00
Bin Xu 8a66d84381 Fix 3930, 1, only re-distribute to accessible dhcpsrv; 2, for non-sharedtftp mode, run makedhcp -d -l for offline (#3954) 2017-09-19 15:35:59 +08:00
Bin Xu 254cf2b2bf Fix 3787, code error when missing -l option for makedhcp in nodeset (#3788) 2017-08-28 17:07:20 +08:00
Bin Xu 0d85cd441b 1, Make the function header and comments more clear 2017-08-02 14:39:28 +08:00
Bin Xu 770d947c94 Using networks.dhcpserver as one accept whole noderange for nodeset. 2017-07-28 16:36:15 +08:00
Bin Xu 31ba541657 Forwarding to MN if the request is accepted by SN 2017-07-27 15:55:30 +08:00
Bin Xu 53d3b1bced 1, use 'disjointdhcps' for nodeset disjoint mode
2, handle 'disjoint' in preprocess method, to make sure that no request will be sent to SN which does not manage the nodes.
3, refine 'stat' to make sure it could query unmanaged nodes on-demand.
2017-07-24 13:36:49 +08:00
Bin Xu 9dd5c3e986 Fix typo 2017-07-17 19:49:39 +08:00
Bin Xu 9b2f597ec2 Polish the code according to the review comments 2017-07-17 14:44:34 +08:00
Bin Xu 47b92c193f Fix #3088, introduce 'disjointnetboot' site attribute to make nodeset
request will only be handled for managed nodes on SN.
2017-07-14 14:42:43 +08:00
Bin Xu fe6b771add Fix #3087: nodeset improvement - using multi-process to parallelize (#3118)
* Fix #3087: nodeset improvement - using multi-process to parallelize
 - before deliver the request to xcatd, we can split the request to multiple sub-requests which contains different noderange
 - in that, xcatd could hanle those sub-requests in parallel, just like some issue multiple commands.

* refine according to the review comments:
 - not using POSIX::ceil
 - Callback is reserved for filter method

* refine codes according review comments

* make the comments right and more readable.
2017-06-01 04:22:22 -05:00
yangsong 5c4dd31844 fix issue [fvt]2.13.4 nodeset osimage have no right output if command wrong #2971 (#3147)
* fix issue#2971:  one CLI arguments validation issue is not correct for nodeset/rinstall/winstall
2017-05-31 17:36:09 +08:00
Bin Xu 230a4dbb79 Fix issue #2794, Nodeset fails to generate /tftpboot config files if … (#2982)
* Fix issue #2794, Nodeset fails to generate /tftpboot config files if ip attribute is not set
  - Report error when the node cannot be handled by its xcatmaster/servicenode (sharedtftp=0)

*  - using determinehostname to get the current server name, it will reduce the time when many service nodes.
2017-05-07 21:13:59 -05:00
chenglch 97f9d4da8f Do not update bootparams table when running nodeset
With the nytprof tool, the buttleneck is the time to update the bootparams
table.To optimize the performance on large scale nodes, this patch tranfer
the bootparams hash through variable reference.

posible impact: getdestiny can not get the information about bootparams.

partial-issue: #2024
2016-12-23 13:45:20 +08:00
Mark Gurevich 0a3fbd8d51 perltidy all perl files 2016-07-20 11:40:27 -04:00
Mark Gurevich 97a159d47a More fixes due to review comments 2016-07-12 09:13:40 -04:00
Mark Gurevich 05f2832e7d Remove dhcp entry for x86_64 node when nodeset offline is issued 2016-07-11 15:12:13 -04:00
XuWei f2b9f6e94a to fix Issue 302, modified my_ip_facing and related functions 2015-11-12 00:33:03 -05:00
huweihua a81a5e1a45 fix the indent issue and combine trace message 2015-08-18 04:11:59 -04:00
huweihua a35ca71281 add trace information 2015-08-13 23:31:30 -04:00
Jarrod Johnson 4aa46e7eca Further ESXi6 fixes
Fix ESXi6 in a number aways around netboot/install
2015-08-05 16:15:48 -04:00
ligc 4322c2b553 remove install|statelite|netboot from usage statements 2015-05-14 04:11:52 -04:00
immarvin 43ec8b55ef support persistent kernel cmdline after diskful installation 2015-04-10 02:54:01 -07:00
mellor 48a0eedb88 defect 4147 - allow nodeset to continue if prescript errors 2014-06-03 14:20:05 -04:00