david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

209 Commits

Author SHA1 Message Date
Michael Brown 84d406ccf4 [block] Allow use of a non-default EFI SAN boot filename
Some older operating systems (e.g. RHEL6) use a non-default filename
on the root disk and rely on setting an EFI variable to point to the
bootloader.  This does not work when performing a SAN boot on a
machine where the EFI variable is not present.

Fix by allowing a non-default filename to be specified via the
"sanboot --filename" option or the "san-filename" setting.  For
example:

  sanboot --filename \efi\redhat\grub.efi \
          iscsi:192.168.0.1::::iqn.2010-04.org.ipxe.demo:rhel6

or

  option ipxe.san-filename code 188 = string;
  option ipxe.san-filename "\\efi\\redhat\\grub.efi";
  option root-path "iscsi:192.168.0.1::::iqn.2010-04.org.ipxe.demo:rhel6";

Originally-implemented-by: Vishvananda Ishaya Abrams <vish.ishaya@oracle.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-04-12 15:58:05 +01:00
Michael Brown 7cfdd769aa [block] Describe all SAN devices via ACPI tables
Describe all SAN devices via ACPI tables such as the iBFT.  For tables
that can describe only a single device (i.e. the aBFT and sBFT), one
table is installed per device.  For multi-device tables (i.e. the
iBFT), all devices are described in a single table.

An underlying SAN device connection may be closed at the time that we
need to construct an ACPI table.  We therefore introduce the concept
of an "ACPI descriptor" which enables the SAN boot code to maintain an
opaque pointer to the underlying object, and an "ACPI model" which can
build tables from a list of such descriptors.  This separates the
lifecycles of ACPI descriptions from the lifecycles of the block
device interfaces, and allows for construction of the ACPI tables even
if the block device interface has been closed.

For a multipath SAN device, iPXE will wait until sufficient
information is available to describe all devices but will not wait for
all paths to connect successfully.  For example: with a multipath
iSCSI boot iPXE will wait until at least one path has become available
and name resolution has completed on all other paths.  We do this
since the iBFT has to include IP addresses rather than DNS names.  We
will commence booting without waiting for the inactive paths to either
become available or close; this avoids unnecessary boot delays.

Note that the Linux kernel will refuse to accept an iBFT with more
than two NIC or target structures.  We therefore describe only the
NICs that are actually required in order to reach the described
targets.  Any iBFT with at most two targets is therefore guaranteed to
describe at most two NICs.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-28 19:12:48 +03:00
Michael Brown bb5a54b79a [block] Add basic multipath support
Add basic support for multipath block devices.  The "sanboot" and
"sanhook" commands now accept a list of SAN URIs.  We open all URIs
concurrently.  The first connection to become available for issuing
block device commands is marked as the active path and used for all
subsequent commands; all other connections are then closed.  Whenever
the active path fails, we reopen all URIs and repeat the process.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-26 16:06:02 +03:00
Michael Brown 1e277ab062 [crypto] Add certstat() to display basic certificate information
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-08-31 15:41:15 +01:00
Michael Brown 829fedafcb [image] Use image_asn1() to extract data from CMS signature images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-29 15:03:20 +01:00
Michael Brown 3c61e11fe1 [cmdline] Add "ntp" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-06-13 15:57:16 +01:00
Michael Brown 80dd6cbcc4 [lotest] Add option to use broadcast packets for loopback testing
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-05-23 14:17:47 +01:00
Michael Brown ab5b3abbba [int13] Allow drive to be hooked using the natural drive number
Interpret the maximum drive number (0xff for hard disks, 0x7f for
floppy disks) as meaning "use natural drive number".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22 09:55:09 +00:00
Michael Brown 8290a10aba [ifmgmt] Include human-readable error message for configuration failure
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08 17:45:30 +00:00
Michael Brown 299fdabe48 [infiniband] Add "ibstat" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08 17:38:06 +00:00
Michael Brown 3c26ffafce [autoboot] Fix incorrect boolean logic
Commit 53d2d9e ("[uri] Generalise tftp_uri() to pxe_uri()") introduced
a regression in which an NFS root path would no longer be treated as
an unsupported root path, causing a boot with an NFS root path to fail
with a "Could not open SAN device" error.

Reported-by: David Evans <dave.evans55@googlemail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-19 08:16:17 +00:00
Michael Brown 53d2d9e3c3 [uri] Generalise tftp_uri() to pxe_uri()
Merge the functionality of parse_next_server_and_filename() and
tftp_uri() into a single pxe_uri(), which takes a server address
(IPv4/IPv6/none) and a filename, and produces a URI using the rule:

 - if the filename is a hierarchical absolute URI (i.e. includes a
   scheme such as "http://" or "tftp://") then use that URI and ignore
   the server address,

 - otherwise, if the server address is recognised (according to
   sa_family) then construct a TFTP URI based on the server address,
   port, and filename

 - otherwise fail.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-02 13:38:53 +01:00
Michael Brown 4e03af8ec2 [autoboot] Display image information as part of the default control flow
When booting without an embedded script, display the imgstat()
information immediately before executing the downloaded image.  This
allows potentially useful diagnostic information (such as the detected
image type) to be observed by the user without needing to enter the
iPXE shell and manually download the image.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-08-21 16:32:02 +01:00
Michael Brown f58ebbdfb5 [test] Allow self-tests to report exit status when running under Linux
Allow the return status from an embedded image to propagate out to the
eventual return status from main().  When running under Linux, this
allows the pass/fail result of unit tests to be observable without
having to visually inspect the console output.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-08-21 15:46:28 +01:00
Michael Brown f3812395a2 [netdevice] Add a generic concept of a "blocked link"
When Spanning Tree Protocol (STP) is used, there may be a substantial
delay (tens of seconds) from the time that the link goes up to the
time that the port starts forwarding packets.

Add a generic concept of a "blocked link" (i.e. a link which is up but
which is not expected to communicate successfully), and allow "ifstat"
to indicate when a link is blocked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-06-25 16:46:47 +01:00
Michael Brown 75d6fec6c4 [autoboot] Match against parent devices when matching by bus type and location
When using iPXE as an option ROM for a PCI USB controller (e.g. via
qemu's "-device nec-usb-xhci,romfile=..." syntax), the ROM prefix will
set the PCI bus:dev.fn address of the USB controller as the PCI
autoboot device.  This will cause iPXE to fail to boot from any
detected USB network devices, since they will not match the autoboot
bus type (or location).

Fix by allowing the autoboot bus type and location to match against
the network device or any of its parent devices.  This allows the
match to succeed for USB network devices attached to the selected PCI
USB controller.

Reported-by: Dan Ellis <Dan.Ellis@displaylink.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-17 02:30:06 +00:00
Michael Brown fbc4ba4b4e [build] Fix the REQUIRE_SYMBOL mechanism
At some point in the past few years, binutils became more aggressive
at removing unused symbols.  To function as a symbol requirement, a
relocation record must now be in a section marked with @progbits and
must not be in a section which gets discarded during the link (either
via --gc-sections or via /DISCARD/).

Update REQUIRE_SYMBOL() to generate relocation records meeting these
criteria.  To minimise the impact upon the final binary size, we use
existing symbols (specified via the REQUIRING_SYMBOL() macro) as the
relocation targets where possible.  We use R_386_NONE or R_X86_64_NONE
relocation types to prevent any actual unwanted relocation taking
place.  Where no suitable symbol exists for REQUIRING_SYMBOL() (such
as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to
generate a one-byte-long symbol to act as the relocation target.

If there are versions of binutils for which this approach fails, then
the fallback will probably involve killing off REQUEST_SYMBOL(),
redefining REQUIRE_SYMBOL() to use the current definition of
REQUEST_SYMBOL(), and postprocessing the linked ELF file with
something along the lines of "nm -u | wc -l" to check that there are
no undefined symbols remaining.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-05 00:59:38 +00:00
Michael Brown 86ae6e6c18 [build] Use REQUIRE_OBJECT() to drag in per-object configuration
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-05 00:57:44 +00:00
Michael Brown 2f020a8df3 [legal] Relicense files under GPL2_OR_LATER_OR_UBDL
These files cannot be automatically relicensed by util/relicense.pl
since they either contain unusual but trivial contributions (such as
the addition of __nonnull function attributes), or contain lines
dating back to the initial git revision (and so require manual
knowledge of the code's origin).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02 16:35:29 +00:00
Michael Brown b6ee89ffb5 [legal] Relicense files under GPL2_OR_LATER_OR_UBDL
Relicense files for which I am the sole author (as identified by
util/relicense.pl).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02 14:17:31 +00:00
Michael Brown 4b2800c7d5 [build] Allow product tag line to be customised via config/branding.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-11 14:22:43 +00:00
Michael Brown e1ce15ec3c [build] Allow product URI to be customised via config/branding.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-11 14:11:28 +00:00
Michael Brown 544a6a9769 [build] Use PRODUCT_SHORT_NAME for end-user visible strings
Use PRODUCT_SHORT_NAME instead of a hardcoded "iPXE" for strings which
are typically shown in the user interface.

Note that this only allows for customisation of the user interface.
Where the "iPXE" string serves a technical purpose (such as in the
HTTP User-Agent), the string cannot be customised.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-11 14:11:22 +00:00
Michael Brown 1c3fb3c61a [build] Move branding information to config/branding.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-11 12:51:58 +00:00
Michael Brown e2a26f76de [uri] Allow tftp_uri() to construct a URI with a custom port
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-06 12:18:18 +00:00
Michael Brown dea6a6c1a0 [ping] Allow "ping" command output to be inhibited
Originally-implemented-by: Cedric Levasseur <cyr-ius@ipocus.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-10-23 16:52:08 +01:00
Michael Brown 1c34ca70d1 [ping] Allow termination after a specified number of packets
Add the "-c <count>" option to the "ping" command, allowing for
automatic termination after a specified number of packets.

When a number of packets is specified:

  - if a serious error (i.e. length mismatch or content mismatch)
    occurs, then the ping will be immediately terminated with the relevant
    status code;

  - if at least one response is received successfully, and all errors
    are non-serious (i.e. timeouts or out-of-sequence responses), then
    the ping will be terminated after the final response (or timeout)
    with a success status;

  - if no responses are received successfully, then the ping will be
    terminated after the final timeout with ETIMEDOUT.

If no number of packets is specified, then the ping will continue
until manually interrupted.

Originally-implemented-by: Cedric Levasseur <cyr-ius@ipocus.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-10-23 16:39:42 +01:00
Michael Brown d1afe731ea [ping] Report timed-out pings via the callback function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-10-23 15:04:10 +01:00
Michael Brown 721a492020 [lotest] Discard packets arriving on the incorrect network device
Commit 24bbaf6 ("[lotest] Allow loopback testing on shared networks")
introduced a regression in which loopback testing packets would be
accepted from any network device.  This produces unexpected results,
such as VLAN loopback testing succeeding even when incorrectly using
the underlying trunk device as either transmitter or receiver.

Fix by discarding any loopback testing packets which arrive on a
network device other than the current loopback testing receiver.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-07-29 15:20:49 +01:00
Michael Brown 00c745e5ff [autoboot] Allow autoboot device to be identified by link-layer address
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-07-08 00:37:31 +01:00
Michael Brown 8290a95513 [build] Expose build timestamp, build name, and product names
Expose the build timestamp (measured in seconds since the Epoch) and
the build name (e.g. "rtl8139.rom" or "ipxe.efi"), and provide the
product name and product short name in a single centralised location.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-06-24 15:32:35 +01:00
Michael Brown 9f0b7f428a [ifmgmt] Do not sleep CPU while configuring network devices
iPXE currently calls cpu_nap() while performing DHCP, in order to
reduce CPU utilisation on virtual machines.  Under mild broadcast load
(~100 packets per second), this can cause received packets to be
dropped because the receive descriptor ring is overrun before the next
18Hz timer interrupt wakes up the CPU.  The result is that DHCP is
likely to intermittently fail on networks with appreciable amounts of
broadcast (or multicast) traffic.

This behaviour was introduced in the series of commits which
generalised the "dhcp" command to the "ifconf" command.  The earlier
code (which did not handle IPv6 configuration) had no call to
cpu_nap() and so did not suffer from this problem.

Fix by removing the call to cpu_nap() in ifpoller_progress().  This
has the undesirable side effect that CPU utilisation will remain at
100% while waiting for DHCP to complete (which can take several
seconds, if we have to wait around for potential ProxyDHCP offers to
arrive).

Reported-by: Alex Davies <adavies@jumptrading.com>
Reported-by: Christoffer Stokbæk <christoffers@easyspeedy.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-06-01 19:54:23 +01:00
Michael Brown 7c44fd68f0 [cmdline] Add "profstat" command to display profiling statistics
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-04-27 23:14:47 +01:00
Michael Brown bc8ca6b8ce [crypto] Generalise X.509 cache to a full certificate store
Expand the concept of the X.509 cache to provide the functionality of
a certificate store.  Certificates in the store will be automatically
used to complete certificate chains where applicable.

The certificate store may be prepopulated at build time using the
CERT=... build command line option.  For example:

  make bin/ipxe.usb CERT=mycert1.crt,mycert2.crt

Certificates within the certificate store are not implicitly trusted;
the trust list is specified using TRUST=... as before.  For example:

  make bin/ipxe.usb CERT=root.crt TRUST=root.crt

This can be used to embed the full trusted root certificate within the
iPXE binary, which is potentially useful in an HTTPS-only environment
in which there is no HTTP server from which to automatically download
cross-signed certificates or other certificate chain fragments.

This usage of CERT= extends the existing use of CERT= to specify the
client certificate.  The client certificate is now identified
automatically by checking for a match against the private key.  For
example:

  make bin/ipxe.usb CERT=root.crt,client.crt TRUST=root.crt KEY=client.key

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-28 17:09:40 +00:00
Michael Brown 24bbaf6a38 [lotest] Allow loopback testing on shared networks
Allow for extraneous packets to be received during loopback testing,
and so permit loopback tests to be performed when ports are connected
to a switch (rather than requiring ports to be directly connected with
a loopback cable).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-13 23:35:18 +00:00
Michael Brown 3f43c1354e [image] Add "--timeout" parameter to image downloading commands
iPXE will detect timeout failures in several situations: network
link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc.
This does not cover all possible circumstances.  For example, if a
connection to a web server is successfully established and the web
server acknowledges the HTTP request but never sends any data in
response, then no timeout will be triggered.  There is no timeout
defined within the HTTP specifications, and the underlying TCP
connection will not generate a timeout since it has no way to know
that the HTTP layer is expecting to receive data from the server.

Add a "--timeout" parameter to "imgfetch", "chain", etc.  If no
progress is made (i.e. no data is downloaded) within the timeout
period, then the download will be aborted.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-10 13:32:39 +00:00
Alex Williamson 123bae9d93 [autoboot] Enable infrastructure to specify an autoboot device location
iPXE will currently attempt to boot from every network device for
which it has a driver.  Where a system has more than one network
device supported by iPXE, this renders BIOS IPL lists ineffective.

Allow an autoboot device location to be specified.  If such a location
is specified, then only devices matching that location will be used as
part of the automatic boot sequence.  If no such location is
specified, then all devices will be used.

Note that this does not affect the "autoboot" command, which will
continue to use all devices.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-03 15:11:03 +00:00
Michael Brown f22c19f3fb [cmdline] Add the "ipstat" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-02 23:57:47 +00:00
Michael Brown c165e8d1fc [image] Ensure every image has a fully resolved URI
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-27 13:32:58 +00:00
Michael Brown 7667536527 [uri] Refactor URI parsing and formatting
Add support for parsing of URIs containing literal IPv6 addresses
(e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe").

Duplicate URIs by directly copying the relevant fields, rather than by
formatting and reparsing a URI string.  This relaxes the requirements
on the URI formatting code and allows it to focus on generating
human-readable URIs (e.g. by not escaping ':' characters within
literal IPv6 addresses).  As a side-effect, this allows relative URIs
containing parameter lists (e.g. "../boot.php##params") to function
as expected.

Add validity check for FTP paths to ensure that only printable
characters are accepted (since FTP is a human-readable line-based
protocol with no support for character escaping).

Construct TFTP next-server+filename URIs directly, rather than parsing
a constructed "tftp://..." string,

Add self-tests for URI functions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-27 13:32:53 +00:00
Michael Brown 259858950a [mucurses] Use centralised concept of colour pairs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:14 +00:00
Michael Brown b0942534eb [settings] Force settings into alphabetical order within sections
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 12:43:28 +00:00
Michael Brown 2f1c7e386b [ipv6] Add support for resolving IPv6 addresses via the "nslookup" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 01:53:25 +00:00
Michael Brown 22001cb206 [settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the
definition of the specified setting (e.g. to add missing type
information).  Clean up this interface by requiring callers to provide
an explicit buffer to contain the completed definition of the fetched
setting, if required.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 00:37:02 +00:00
Michael Brown 6b1eee0452 [ipv6] Separate the concepts of prefix and address creation
Allow for IPv6 routing table entries to be created for an on-link
prefix where a local address has not yet been assigned to the network
device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-15 15:22:54 +00:00
Michael Brown c99f9ee9df [dhcp] Remove obsolete dhcp() function
All functionality provided by dhcp() has now been obviated by the more
generic ifconf().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-05 17:42:55 +00:00
Michael Brown 2525e55c19 [autoboot] Use ifconf() to configure network device
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-05 17:42:50 +00:00
Michael Brown 26b87b221b [ifmgmt] Add ifconf() to carry out network device configuration
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-05 17:30:20 +00:00
Michael Brown 16d37102ca [ifmgmt] Rewrite iflinkwait() to use monojob_wait()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-05 17:15:24 +00:00
Michael Brown 170d493bf3 [autoboot] Fix shell banner timeout
Commit 5e1fa5c ("[parseopt] Add parse_timeout()") introduced a
regression causing the shell banner timeout value (calculated in
milliseconds) to be treated as a timer tick count, resulting in a
timeout of approximately two minutes rather than the intended two
seconds.

Reported-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-05 17:09:30 +00:00