summaryrefslogtreecommitdiffstats
path: root/src/usr
Commit message (Collapse)AuthorAgeFilesLines
* [image] Omit URI query string and fragment from download progress messagesMichael Brown2017-12-281-6/+7
| | | | | | | | | | | | | | The URIs printed as part of download progress messages are intended to provide a quick visual progress indication to the user. Very long query strings can render this visual indication useless in practice, since the most important information (generally the URI host and path) is drowned out by multiple lines of human-illegible URI-encoded data. Omit the query string entirely from the download progress message. For consistency and brevity, also omit the URI fragment along with the username and password (which was previously redacted anyway). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Allow use of a non-default EFI SAN boot filenameMichael Brown2017-04-122-7/+45
| | | | | | | | | | | | | | | | | | | | | | | 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>
* [block] Describe all SAN devices via ACPI tablesMichael Brown2017-03-281-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [block] Add basic multipath supportMichael Brown2017-03-262-7/+9
| | | | | | | | | | | 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>
* [crypto] Add certstat() to display basic certificate informationMichael Brown2016-08-311-0/+63
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Use image_asn1() to extract data from CMS signature imagesMichael Brown2016-07-291-12/+10Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "ntp" commandMichael Brown2016-06-131-0/+57
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Add option to use broadcast packets for loopback testingMichael Brown2016-05-231-4/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Allow drive to be hooked using the natural drive numberMichael Brown2016-03-221-4/+6
| | | | | | | 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>
* [ifmgmt] Include human-readable error message for configuration failureMichael Brown2016-03-081-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add "ibstat" commandMichael Brown2016-03-081-0/+62
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Fix incorrect boolean logicMichael Brown2016-01-191-2/+2
| | | | | | | | | | 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>
* [uri] Generalise tftp_uri() to pxe_uri()Michael Brown2015-09-021-57/+32Star
| | | | | | | | | | | | | | | | | | 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>
* [autoboot] Display image information as part of the default control flowMichael Brown2015-08-211-0/+1
| | | | | | | | | | 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>
* [test] Allow self-tests to report exit status when running under LinuxMichael Brown2015-08-211-7/+11
| | | | | | | | | 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>
* [netdevice] Add a generic concept of a "blocked link"Michael Brown2015-06-251-1/+2
| | | | | | | | | | | | 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>
* [autoboot] Match against parent devices when matching by bus type and locationMichael Brown2015-03-171-2/+7
| | | | | | | | | | | | | | | | | 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>
* [build] Fix the REQUIRE_SYMBOL mechanismMichael Brown2015-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [build] Use REQUIRE_OBJECT() to drag in per-object configurationMichael Brown2015-03-051-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-022-2/+10
| | | | | | | | | | 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>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-0215-15/+75
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow product tag line to be customised via config/branding.hMichael Brown2015-02-111-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow product URI to be customised via config/branding.hMichael Brown2015-02-111-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use PRODUCT_SHORT_NAME for end-user visible stringsMichael Brown2015-02-111-3/+5
| | | | | | | | | | | 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>
* [build] Move branding information to config/branding.hMichael Brown2015-02-111-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Allow tftp_uri() to construct a URI with a custom portMichael Brown2015-02-061-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ping] Allow "ping" command output to be inhibitedMichael Brown2014-10-231-4/+6
| | | | | Originally-implemented-by: Cedric Levasseur <cyr-ius@ipocus.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ping] Allow termination after a specified number of packetsMichael Brown2014-10-231-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [ping] Report timed-out pings via the callback functionMichael Brown2014-10-231-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Discard packets arriving on the incorrect network deviceMichael Brown2014-07-291-6/+6
| | | | | | | | | | | | | 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>
* [autoboot] Allow autoboot device to be identified by link-layer addressMichael Brown2014-07-081-9/+59
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Expose build timestamp, build name, and product namesMichael Brown2014-06-241-2/+2
| | | | | | | | 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>
* [ifmgmt] Do not sleep CPU while configuring network devicesMichael Brown2014-06-011-4/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [cmdline] Add "profstat" command to display profiling statisticsMichael Brown2014-04-281-0/+44
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Generalise X.509 cache to a full certificate storeMichael Brown2014-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [lotest] Allow loopback testing on shared networksMichael Brown2014-03-141-36/+53
| | | | | | | | | 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>
* [image] Add "--timeout" parameter to image downloading commandsMichael Brown2014-03-102-7/+13
| | | | | | | | | | | | | | | | | | 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>
* [autoboot] Enable infrastructure to specify an autoboot device locationAlex Williamson2014-03-031-17/+26
| | | | | | | | | | | | | | | | | | 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>
* [cmdline] Add the "ipstat" commandMichael Brown2014-03-031-0/+62
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Ensure every image has a fully resolved URIMichael Brown2014-02-271-12/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Refactor URI parsing and formattingMichael Brown2014-02-272-23/+11Star
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* [mucurses] Use centralised concept of colour pairsMichael Brown2013-12-091-8/+3Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Force settings into alphabetical order within sectionsMichael Brown2013-12-051-3/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add support for resolving IPv6 addresses via the "nslookup" commandMichael Brown2013-12-051-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-053-29/+33
| | | | | | | | | | 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>
* [ipv6] Separate the concepts of prefix and address creationMichael Brown2013-11-151-1/+3
| | | | | | | | 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>
* [dhcp] Remove obsolete dhcp() functionMichael Brown2013-11-051-24/+0Star
| | | | | | | All functionality provided by dhcp() has now been obviated by the more generic ifconf(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Use ifconf() to configure network deviceMichael Brown2013-11-051-3/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Add ifconf() to carry out network device configurationMichael Brown2013-11-051-2/+87
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Rewrite iflinkwait() to use monojob_wait()Michael Brown2013-11-053-43/+98
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>