Commit Graph

7343 Commits

Author SHA1 Message Date
Michael Brown 7a2817bbd7 [build] Drag in Xen and Hyper-V support via network device drivers
Include Xen and Hyper-V support in the all-drivers build by dragging
in the netfront and netvsc drivers, since these are the functional
drivers that provide network interfaces.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-11 22:02:23 +00:00
Michael Brown 99a9e6e431 [build] Construct driver rules for USB devices
Parse USB_ROM() lines to create build rules to allow for e.g.

  make bin/smsc9500.usb

(i.e. using the driver name as a build target, rather than having to
use the source file name).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-11 17:34:33 +00:00
Michael Brown e783adcfd4 [build] Construct driver lists for each bus type
Include the underlying bus type (e.g. "pci" or "isa") within the lists
constructed to describe the available drivers, to allow for the
possibility that platforms may want to define a platform-specific
subset of drivers to be present in the all-drivers build.  For
example, non-x86 platforms such as RISC-V SBI do not need to include
the ISA network drivers since the corresponding hardware cannot ever
be present on a RISC-V system.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-11 17:10:57 +00:00
Michael Brown 1523512198 [build] Allow PCI_ROM() and ISA_ROM() to span multiple lines
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-11 16:28:41 +00:00
Michael Brown 4d6c8ab443 [usb] Add USB_ROM() and USB_ID() macros
Add USB_ROM() and USB_ID() macros following the pattern for PCI_ROM()
and PCI_ID(), to allow for the possibility of including USB network
devices within the "all-drivers" build of iPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-11 16:07:12 +00:00
Michael Brown 481e043116 [librm] Work around two errata in the 386's "popal" instruction
Detailed experiments show that at least one model of 386 CPU has a
previously undocumented errata in the "popal" instruction.
Specifically: when the stack-address size is 16 bits and the operand
size is 32 bits, the "popal" instruction will erroneously load the
high 16 bits of %esp from the value stored on the stack.

The "movl -20(%esp), %esp" instruction near the end of virt_call()
currently relies on the assumption that the high 16 bits of %esp will
already be zero, since they were set to zero by the "movzwl %bp, %esp"
instruction at the end of prot_to_real() and will not have been
subsequently modified by the "popal".  This 386 CPU errata invalidates
that assumption, with the result that we end up loading the stack
pointer from an essentially undefined memory location.

Fix by inserting a "movzwl %sp, %esp" after the "popal" to explicitly
zero the high 16 bits of %esp.

Inserting this instruction also happens to work around another (known
and documented) errata in the 386, in which the CPU may malfunction if
"popal" is followed immediately by an instruction that uses a base
address register to form an effective address.

Debugged-by: Jaromir Capik <jaromir.capik@email.cz>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-10 10:29:54 +00:00
Michael Brown cd9b44e574 [syslog] Allow port number to be specified for encrypted syslog server
The original implementation in commit 943b300 ("[syslog] Add basic
support for encrypted syslog via TLS") was based on examples found in
the rsyslog documentation rather than on RFC 5425, and unfortunately
used the default syslog port number 514 rather than the syslog-tls
port number 6514 defined in the RFC.

Extend parsing of the syslog server name to allow for an optional port
number (in the relatively intuitive format "server[:port]").  Retain
the existing (and incorrect) default port number to avoid breaking
backwards compatibility with existing setups.

Reported-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-09 12:32:11 +00:00
Michael Brown 362b704f83 [ci] Include supported network device list in build artifacts
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-05 16:49:45 +00:00
Michael Brown 18fab8dd84 [loong64] Fix error identifier generation for LoongArch64
The initial code contribution from Loongson defined ASM_NO_PREFIX as
being "a" for this architecture.  This seems to result in small values
such as error line numbers being rendered as "$r0, <value>" rather
than just "<value>".

This seems to hit an undocumented behaviour path in the GNU assembler.
For some reason ".long $r0" is not treated as a syntax error but will
instead be treated as a zero value.  The net effect is therefore that
an extra zero value is emitted before the line number in the einfo
structure, which in turn causes the error information parser to see
all source code line numbers as zero.  (The overall structure remains
valid since the length and all string offsets are encoded within the
structure itself, so nothing breaks when a spurious extra integer
field is appended.)

Fix by setting ASM_NO_PREFIX to the empty string (as for RISC-V),
since there are no literal value prefixes anyway in LoongArch64
assembly.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-05 13:45:19 +00:00
Michael Brown 12b279b4c7 [ci] Include error identifier list in build artifacts
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-05 12:18:33 +00:00
Michael Brown 95e756569a [pci] Ignore invalid subordinate bus numbers
Some systems (observed on a Dell C6615) fail to correctly populate the
subordinate PCI bus number on some PCI bridges.  We do not currently
guard against this behaviour, causing us to subsequently scan through
a huge expanse of the PCI bus:dev.fn address range.

Fix by ignoring the subordinate bus number if it is lower than the
bridge's own bus number.

Reported-by: Anisse Astier <an.astier@criteo.com>
Reported-by: Ahmad Mahagna <ahmhad@nvidia.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-05 12:09:59 +00:00
Michael Brown aa06a76eb8 [ci] Show rolling release publication URL
Construct and show the URL for the workflow runs that are triggered to
publish the rolling release binaries.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-04 16:23:55 +00:00
Michael Brown c18d895704 [efi] Cache identified PCI root bridge I/O protocol handle
Reduce the overhead of PCI configuration space accesses (and the
verbosity of debug messages) by caching the identified PCI root bridge
I/O protocol handle for the most recently accessed PCI device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-04 14:10:27 +00:00
Christian Nilsson 30d162ddd1 [uri] Ensure "##params=" separator is correct
Signed-off-by: Christian Nilsson <nikize@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-03 19:21:12 +00:00
Michael Brown 59c67e1110 [ci] Run tests on pull requests
The automated tests that are run in the GitHub Actions workflow are
now as comprehensive as those that are run manually.  Run tests on
pull requests as well as pushes, since the results are now
meaningfully informative.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-03 19:04:38 +00:00
Michael Brown 5abbcab909 [build] Mark MS-CHAPv2 as permitted for UEFI Secure Boot
MS-CHAPv2 and the underlying DES algorithm are cryptographically
obsolete, but still relatively widely used.  There is no impact to
UEFI Secure Boot from using these obsolete algorithms: the only
untrusted inputs are the username, password, and received network
packets, and all of these are thoroughly validated before use.

Review these files and mark them as permitted for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-03 16:02:19 +00:00
Michael Brown 9106130f62 [build] Ensure dependencies of version.c are always rebuilt as expected
The core/version.c file is built into multiple objects (since it
incorporates the build target name such as "snponly.efi"), and is
handled separately from the standard build rules.

Add the missing line (taken from the standard build rules template) to
ensure that the dependency file is itself updated when the
dependencies change.

In particular, this ensures that the dependencies for core/version.c
will be updated when switching named configurations.

Reported-by: Christian I. Nilsson <ChristianN@2PintSoftware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-03 10:20:10 +00:00
Christian I. Nilsson a565e18f39 [build] Exclude local named config headers from annotation checks
Commit dee71adda ("[build] Exclude external files from annotation
checks") excluded local top-level config headers from annotation
checks, but not local named config headers.

These are generated if missing when building with CONFIG= and will
most of the time be empty.  Exclude these files from the list of
annotated files used to perform licensing and UEFI Secure Boot
eligibility checks.

Non-local named config headers intended to be used with Secure Boot
can be annotated with FILE_SECBOOT().

Signed-off-by: Christian I. Nilsson <ChristianN@2PintSoftware.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-03 09:59:42 +00:00
Michael Brown b05a045b41 [ci] Publish rolling release binaries via https://boot.ipxe.org
The boot.ipxe.org website is now hosted on GitHub Pages and built via
a GitHub Actions workflow.  The rolling release binaries are fetched
from the build artifacts created by this repository.

Remove the rolling release tag mechanism, and instead trigger a
workflow run on the boot.ipxe.org repository to publish the updated
binaries.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-02-01 23:05:40 +00:00
Michael Brown 74e0551ac2 [ci] Publish rolling release build artifacts with stable URLs
Publish the binaries built from commits on the master branch under
stable URLs such as:

  https://github.com/ipxe/ipxe/releases/download/rolling/bin/undionly.kpxe

Since filenames such as "ipxe.iso" may exist in each of several build
directories, we implement this as one release tag per build directory.
The GitHub Actions workflow automatically moves the tag to the most
recent commit and overwrites the existing release assets.

One downside of this is that running a local "git log" or similar may
show a large number of uninformative tags of the form "rolling/bin",
"rolling/bin-x86_64-efi", "rolling-arm64-efi", etc, all pointing at
the most recent commit.  This clutter may be hidden using:

  git config --local log.excludeDecoration refs/tags/rolling/*

To avoid the unintentional creation of rolling release tags on forks,
we skip the whole publication job unless the environment variable
ROLLING_PREFIX is defined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-30 00:03:35 +00:00
Michael Brown e855c4c642 [ci] Produce combined BIOS/UEFI ISO and USB images
Use util/genfsimg to combine the 64-bit BIOS and all UEFI builds into
a single multi-architecture image in both ISO and USB formats.

Include an editable autoexec.ipxe script (that matches the default
iPXE behaviour) in the USB image, so that users can just mount and
edit this file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-29 14:51:35 +00:00
Michael Brown 8e10974c8c [ci] Upload a selection of build artifacts from each run
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 20:44:04 +00:00
Michael Brown dee71adda8 [build] Exclude external files from annotation checks
External files such as embedded scripts or X.509 certificates are not
expected to include source file annotations such as FILE_LICENCE() or
FILE_SECBOOT().  Exclude these external files from the list of
annotated files used to perform licensing and UEFI Secure Boot
eligibility checks.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 19:44:09 +00:00
Michael Brown 301b1ecf2b [build] Mark compressed image tools as permitted for UEFI Secure Boot
Some older distributions (such as RHEL 8) provide their AArch64
kernels as gzip-compressed EFI binaries (with no self-decompressing
EFI stub present).  We therefore enable support for gzip images by
default for arm64 EFI builds.

Review the files used to implement the gzip (and zlib) formats and
mark these as permitted for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 16:34:57 +00:00
Michael Brown c07fb71a91 [build] Mark FDT management tools as permitted for UEFI Secure Boot
An EFI build of iPXE does not directly make use of a flattened device
tree (FDT) itself, but may pass on a device tree that the user chose
to download using the "fdt" command.

Review the simple files used to implement the "fdt" command and mark
these as permitted for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 16:20:51 +00:00
Michael Brown 6b17d320db [build] Mark core arm64 files as permitted for UEFI Secure Boot
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 15:44:58 +00:00
Michael Brown f1bcd160ac [xen] Update to latest stable release headers
Update to the headers from the latest Xen stable release, and mark all
imported headers as permitted for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 15:26:11 +00:00
Michael Brown 8e31ac9fc3 [build] Mark dummy architecture headers as permitted for UEFI Secure Boot
The dummy header files in include/bits/*.h are placeholders for
architectures that do not need to define any architecture-specific
functionality in these areas.  Mark these trivial files as permitted
for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 13:55:45 +00:00
Michael Brown 40c2db9d67 [build] Mark direct kernel loading as forbidden for UEFI Secure Boot
Our long-standing policy for EFI platforms is that we support invoking
binary executables only via the LoadImage() and StartImage() boot
services calls, so that all security policy decisions are delegated to
the platform firmware.

Most binary executable formats that we support are BIOS-only and
cannot in any case be linked in to an EFI executable.  The only
cross-platform format is the generic Linux kernel image format as used
for RISC-V (and potentially also for AArch64).

Mark all files associated with direct loading of a kernel binary as
explicitly forbidden for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 13:38:20 +00:00
Michael Brown 4db03054d5 [build] Mark GDB stub as forbidden for UEFI Secure Boot
Enabling the GDB debugger functionality would provide an immediate and
trivial Secure Boot exploit.  Mark all GDB-related files as explicitly
forbidden for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 13:20:38 +00:00
Michael Brown 03a906a9f3 [build] Mark Realtek driver as permitted for UEFI Secure Boot
The Realtek driver and its dependencies are cleanly structured, easy
to review, directly maintained, and very well tested.  Review these
files and mark them as permitted for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 13:04:07 +00:00
Michael Brown b7e7f62b87 [efi] Avoid dragging in IPv4, IPv6, and DNS support unconditionally
The efi_path_settings[] array includes symbol references to
&ip_setting, &ip6_setting, &dns_setting (and others) that currently
result in IPv4, IPv6, and DNS support being linked in even if disabled
in the build configuration.

Provide weak versions of these symbols to avoid the unconditional
inclusion of these features.

Reported-by: Pavitter Ghotra <pavitterghotra@yahoo.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-28 12:34:57 +00:00
Michael Brown e31dc79d40 [build] Mark EFI SNP/MNP driver wrappers as permitted for UEFI Secure Boot
The EFI SNP/MNP driver wrapper is a trivial layer that exists only to
allow for the separation of "snponly.efi" as a build target.  Review
this trivial wrapper and mark it as permitted for UEFI Secure Boot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-27 16:39:40 +00:00
Jaromir Capik 641ea020f1 [prefix] Make unlzma.S compatible with 386 class CPUs
Replace the bswap instruction with xchgb and roll and change the
module architecture from i486 to i386 to be consistent with the rest
of the project.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-25 16:15:32 +00:00
Michael Brown d0ea2b1bb8 [ci] Use prebuilt containers to build and test iPXE
Use the prebuilt containers from https://github.com/ipxe/ipxe-builder
to build BIOS, SBI, UEFI, and Linux userspace versions of iPXE for all
supported CPU architectures, and to run the Linux userspace test suite
(via valgrind or qemu as applicable).

This reduces the time taken for GitHub CI runs by around 80%, while
increasing the build coverage to include RISC-V SBI, RISC-V UEFI, and
LoongArch64 UEFI, and increasing the test coverage to include running
the Linux userspace test suite on all supported CPU architectures.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-25 15:52:16 +00:00
Michael Brown 207c99a475 [build] Allow GITVERSION to be specified as an environment variable
When using GitHub Actions with a job container that does not have the
git tools installed, the actions/checkout step will download a
snapshot instead of performing a git clone, and will therefore not
create a .git directory.  Allow the GITVERSION variable to be
specified externally, so that the test suite logs can still display
the commit of the build being tested.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-25 11:27:14 +00:00
Michael Brown 0abef79a29 [build] Do not use "git log" to construct build timestamp
Using "git log" to automatically construct the build timestamp is of
minimal value.  Reproducible builds should be using SOURCE_DATE_EPOCH
anyway, and for ad hoc builds it is arguable that the time at which
the build was performed is more relevant than the commit timestamp.
(For example, the user may be trying to deliberately use an older
version of iPXE in order to track down a regression via bisection.)

Remove the use of "git log", and thereby remove any requirement for
the git tools to be available at the point of building iPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-21 23:26:23 +00:00
Michael Brown faa42c8503 [build] Do not use "git describe" to construct version number
Using "git describe" to automatically construct the version number has
caused more problems than it has solved.  In particular, it causes
errors when building from a shallow clone of the repository, which is
a common scenario in modern automated build environments.

Define the base version number (currently 1.21.1+) as a set of
hardcoded constants within the Makefile, to be updated whenever a
release is made.

It is extremely useful to have the git commit ID present in the
startup banner.  End users tend to provide screenshots of failures,
and having the commit ID printed at startup makes it trivial to
identify which version of the code is in use.  Identify the git
version (if building from a git tree) by directly reading from
.git/HEAD and associated files.  This allows the git commit ID to
potentially be included even if the build environment does not have
the git tools installed.

Use the default shallow clone in the GitHub Actions workflow, since we
no longer require access to the full commit history.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-21 22:44:13 +00:00
Michael Brown a42a15ae91 [build] Allow for per-architecture sysroots
As done for CROSS_COMPILE in commit 8fc11d8 ("[build] Allow for
per-architecture cross-compilation prefixes"), allow a default sysroot
for each architecture to be specified via the SYSROOT_<arch>
variables.  These may then be provided as environment variables,
e.g. using

  export SYSROOT_riscv32=/usr/riscv32-linux-gnu/sys-root

This is particularly useful for architectures such as RISC-V where the
64-bit compiler is also used to build 32-bit binaries, since in those
cases the compiler will default to using the 64-bit sysroot.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-21 12:57:18 +00:00
Michael Brown 6eab3dbcd2 [ci] Update to ubuntu-24.04 GitHub actions runner
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-17 18:47:22 +00:00
Michael Brown 05cb930466 [build] Extend default configuration for non-BIOS builds
The current usage model for iPXE is that the default configuration is
relatively minimal to reduce code size, with users encouraged to build
from source if necessary to enable additional features.  This approach
is somewhat incompatible with the Secure Boot model, which by design
makes it prohibitively difficult for users to use their own compiled
binaries.  For published Secure Boot signed binaries to be useful,
they will have to already include all features that the majority of
users will need.

Extend the default configuration for EFI (and other non-BIOS
platforms) to include HTTPS support, framebuffer support, and a
selection of commands and features that are reasonably expected to be
used by large numbers of users.

The default configuration for BIOS platforms is deliberately left
unchanged, since BIOS binaries are typically subject to severe size
constraints.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 22:42:37 +00:00
Michael Brown 4157afc125 [usb] Drag in USB commands only when USB support is present
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 22:34:01 +00:00
Michael Brown f3abf2b9de [pci] Drag in PCI commands only when PCI support is present
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 22:32:36 +00:00
Michael Brown f7f685f8c9 [build] Canonicalise console type configuration
Move all console configuration from config/defaults/<platform>.h to
the top-level config/console.h, using indented conditional blocks to
clarify which console types are supported and enabled on each
platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 17:26:32 +00:00
Michael Brown ce6f574a9f [build] Canonicalise USB configuration
Move all USB configuration from config/defaults/<platform>.h to the
top-level config/usb.h, using indented conditional blocks to clarify
which options are supported and enabled on each platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 16:08:20 +00:00
Michael Brown 6ad6af198e [build] Canonicalise settings sources configuration
Move all settings source selection from config/defaults/<platform>.h
to the top-level config/settings.h, using indented conditional blocks
to clarify which sources are supported and enabled on each platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 15:27:26 +00:00
Michael Brown ff80a1758f [build] Sort general configuration in order of approachability
Reorder sections within config/general.h so that portions that are
easier to understand and more likely to be modified are towards the
top of the file, with more obscure and less frequently modified
options moved lower down.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 14:54:10 +00:00
Michael Brown 360c0f3363 [build] Canonicalise remaining portions of general configuration
Move remaining general configuration from config/defaults/<platform>.h
to the top-level config/general.h, using indented conditional blocks
to clarify which features are supported and enabled on each platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 14:31:07 +00:00
Michael Brown d27cf68e07 [build] Canonicalise SAN boot protocol configuration
Move all SAN boot protocol selection from config/defaults/<platform>.h
to the top-level config/general.h, using indented conditional blocks
to clarify which protocols are supported and enabled on each platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 14:02:35 +00:00
Michael Brown 464916f99d [build] Canonicalise download protocol configuration
Move all download protocol selection from config/defaults/<platform>.h
to the top-level config/general.h, using indented conditional blocks
to clarify which protocols are supported and enabled on each platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-16 13:37:36 +00:00