summaryrefslogtreecommitdiffstats
path: root/src/usr
Commit message (Collapse)AuthorAgeFilesLines
* [fc] Maintain a list of Fibre Channel upper-layer protocol usersMichael Brown2011-06-281-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sanboot] Add "sanhook" and "sanunhook" commandsMichael Brown2011-04-242-44/+57
| | | | | | | Expose the multiple-SAN-drive capability of the iPXE core via the iPXE command line by adding commands to hook and unhook additional drives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [device] Make driver name a generic device propertyMichael Brown2011-04-081-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Use image_set_name() only if name != NULLPiotr Jaroszyński2011-03-271-1/+2
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Match terminology in online documentationMichael Brown2011-03-231-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Impose a fixed order on settingsMichael Brown2011-03-231-2/+2
| | | | | | | Improve the appearance of the "config" user interface by ensuring that settings appear in some kind of logical order. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move include/console.h to include/ipxe/console.hMichael Brown2011-03-095-5/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify use of imgdownload()Michael Brown2011-03-092-25/+92
| | | | | | | Allow imgdownload() to be called without first having to allocate (and so keep track of) an image. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Move the register_and_{select|boot}_image() functions to imgmgmt.cMichael Brown2011-03-091-0/+39
| | | | | | | | These functions are used only as the "action" parameters to imgdownload() or imgfetch(), and so belong in imgmgmt.c rather than image.c Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prompt] Replace shell_banner() with a generic prompt() functionMichael Brown2011-03-071-0/+66
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add a timeout parameter to getkey()Michael Brown2011-03-071-5/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image managementMichael Brown2011-03-072-50/+4Star
| | | | | | | | | | | Refactor the {load,exec} image operations as {probe,exec}. This makes the probe mechanism cleaner, eliminates some forward declarations, avoids holding magic state in image->priv, eliminates the possibility of screwing up between the "load" and "exec" stages, and makes the documentation simpler since the concept of "loading" (as distinct from "executing") no longer needs to be explained. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Allow a SAN boot as a fallback if a filename boot returnsMichael Brown2011-03-021-6/+23
| | | | | | | | | | | | | | | Currently, if both a filename and root-path are present, iPXE will hook the SAN device but will only attempt to boot from the filename. Change this behaviour so that both are attempted. Users who want to avoid booting from the SAN as a fallback can do so via the existing "skip-san-boot" setting. This allows for seamless deployment to a SAN target using Windows Deployment Services (and similar products). A user simply has to define the root-path option in DHCP and then use WDS to deploy the system. No further configuration should be required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Tidy up output following NBP executionMichael Brown2011-03-021-1/+7
| | | | | | | | If the NBP returns, then always print a trailing newline, since some NBPs (e.g. wdsnbp.com) leave the cursor in a random position halfway across the screen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Allow download job to complete before acting upon imageMichael Brown2011-03-021-7/+11
| | | | | | | | | Allow the monojob controlling the download to complete before calling register_image() and friends. This allows the trailing "ok" from monojob.c to be printed before the image starts executing (and possibly printing output of its own). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Use a custom error number for "nothing to boot"Michael Brown2011-02-281-1/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Add an iPXE error URI to the "nothing to boot" messageMichael Brown2011-02-281-1/+1
| | | | | | | Change the message "No filename or root path specified" to include an iPXE error URI. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Cope properly with empty DHCP filenamesMichael Brown2011-02-011-3/+3
| | | | | | | This (hopefully) fixes a regression introduced in commit e088892 ("[autoboot] Connect SAN disk during a filename boot, if applicable"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Avoid using uri_dup() for constructed TFTP URIMichael Brown2011-02-011-6/+6
| | | | | | | uri_dup() chokes on duplicating a URI with a path that does not begin with a slash. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Allow setting expansions in filename and root-pathMichael Brown2011-01-281-10/+32
| | | | | | | | | | Allow the DHCP filename and root-path to contain settings expansions, such as http://boot.ipxe.org/demo/boot.php?mac=${mac:hexhyp} Originally-implemented-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Connect SAN disk during a filename boot, if applicableMichael Brown2011-01-273-152/+233
| | | | | | | | | | | | | | | | | | | For performing installations direct to a SAN target, it can be very useful to hook a SAN disk and then proceed to perform a filename boot. For example, the user may wish to hook the (empty) SAN installation disk and then boot into the OS installer via TFTP. This provides an alternative mechanism to using "keep-san" and relying on the BIOS to fall through to boot from the installation media, which is unreliable on many BIOSes. When a root-path is specified in addition to a boot filename, attempt to hook the root-path as a SAN disk before booting from the specified filename. Since the root-path may be used for non-SAN purposes (e.g. an NFS root mount point), ignore the root-path if it contains a URI scheme that we do not support. Originally-implemented-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [init] Remove concept of "shutdown exit flags"Michael Brown2011-01-271-4/+0Star
| | | | | | | | Remove the concept of shutdown exit flags, and replace it with a counter used to keep track of exposed interfaces that require devices to remain active. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use Ethernet-compatible chaddr, if possibleMichael Brown2010-12-151-7/+9
| | | | | | | | | | | | | | | For IPoIB, we currently use the hardware address (i.e. the eight-byte GUID) as the DHCP chaddr. This works, but some PXE servers (notably Altiris RDP) refuse to respond if the chaddr field is anything other than six bytes in length. We already have the notion of an Ethernet-compatible link-layer address, which is used in the iBFT (the design of which similarly fails to account for non-Ethernet link layers). Use this as the first preferred alternative to the actual link-layer address when constructing the DHCP chaddr field. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Merge "netboot" command into "autoboot"Michael Brown2010-11-221-18/+19
| | | | | | | | | | Allow "autoboot" to accept an optional list of network devices, and remove the "netboot" command. This saves around 130 bytes. The "netboot" command has existed for approximately 48 hours, so its removal should not cause backwards compatibility issues for anyone. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Use generic option-parsing libraryMichael Brown2010-11-211-3/+5
| | | | | | Total saving: 32 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Add "netboot" commandMichael Brown2010-11-201-1/+1
| | | | | Originally-implemented-by: michael-dev@fami-braun.de Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Fix endianness in status messageMichael Brown2010-11-201-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Use network device receive queue freezingMichael Brown2010-11-201-2/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Move lotest.h to correct directoryMichael Brown2010-11-191-15/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Introduce "skip-san-boot" optionDave Hansen2010-10-221-4/+17
| | | | | | | | | | | | | For some install-to-SAN scenarios, the OS needs to be able to reboot to reread the partition table. On this second boot attempt, the SAN disk will not be empty and so iPXE will attempt to boot from it, rather than falling back to the OS' installation media. Work around this problem by introducing the "skip-san-boot" option, similar in spirit to "keep-san". Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Improve visibility of error messagesMichael Brown2010-10-221-27/+34
| | | | | | | Improve the visibility of error messages by removing the redundant final printing of the URL being booted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Use port WWN rather than node WWN as the primary Fibre Channel nameMichael Brown2010-10-151-6/+5Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Pass both link-layer addresses in net_tx() and net_rx()Michael Brown2010-10-071-2/+4
| | | | | | | | | FCoE requires the use of fabric-provided MAC addresses, which breaks the assumption that the net device's MAC address is implicitly the source address for net_tx() and the (unicast) destination address for net_rx(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Add loopback testing commandsMichael Brown2010-09-212-0/+225
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Add Fibre Channel management commandsMichael Brown2010-09-151-0/+117
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Replace gPXE block-device API with an iPXE asynchronous interfaceMichael Brown2010-09-141-8/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block device interface used in gPXE predates the invention of even the old gPXE data-transfer interface, let alone the current iPXE generic asynchronous interface mechanism. Bring this old code up to date, with the following benefits: o Block device commands can be cancelled by the requestor. The INT 13 layer uses this to provide a global timeout on all INT 13 calls, with the result that an unexpected passive failure mode (such as an iSCSI target ACKing the request but never sending a response) will lead to a timeout that gets reported back to the INT 13 user, rather than simply freezing the system. o INT 13,00 (reset drive) is now able to reset the underlying block device. INT 13 users, such as DOS, that use INT 13,00 as a method for error recovery now have a chance of recovering. o All block device commands are tagged, with a numerical tag that will show up in debugging output and in packet captures; this will allow easier interpretation of bug reports that include both sources of information. o The extremely ugly hacks used to generate the boot firmware tables have been eradicated and replaced with a generic acpi_describe() method (exploiting the ability of iPXE interfaces to pass through methods to an underlying interface). The ACPI tables are now built in a shared data block within .bss16, rather than each requiring dedicated space in .data16. o The architecture-independent concept of a SAN device has been exposed to the iPXE core through the sanboot API, which provides calls to hook, unhook, boot, and describe SAN devices. This allows for much more flexible usage patterns (such as hooking an empty SAN device and then running an OS installer via TFTP). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-311-18/+0Star
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-271-1/+8
| | | | | | | | | | | | | | | This removes the need for inline safety wrappers, marginally reducing the size penalty of weak functions, and works around an apparent binutils bug that causes undefined weak symbols to not actually be NULL when compiling with -fPIE (as EFI builds do). A bug in versions of binutils prior to 2.16 (released in 2005) will cause same-file weak definitions to not work with those toolchains. Update the README to reflect our new dependency on binutils >= 2.16. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-207-28/+28
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add netdev_is_open() wrapper functionMichael Brown2010-03-233-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [uri] Decode/encode URIs when parsing/unparsingJoshua Oreman2010-01-212-4/+8
| | | | | | | | | | | | | | | Currently, handling of URI escapes is ad-hoc; escaped strings are stored as-is in the URI structure, and it is up to the individual protocol to unescape as necessary. This is error-prone and expensive in terms of code size. Modify this behavior by unescaping in parse_uri() and escaping in unparse_uri() those fields that typically handle URI escapes (hostname, user, password, path, query, fragment), and allowing unparse_uri() to accept a subset of fields to print so it can be easily used to generate e.g. the escaped HTTP path?query request. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [config] Make PXE stack a compile-time optionJoshua Oreman2010-01-201-1/+1
| | | | | | | | | | For extremely tight space requirements and specific applications, it is sometimes desirable to create gPXE images that cannot provide the PXE API functionality to client programs. Add a configuration header option, PXE_STACK, that can be removed to remove this stack. Also add PXE_MENU to control the PXE boot menu, which most uses of gPXE do not need. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [dhcp] Add generic facility for using cached network settingsJoshua Oreman2010-01-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | When a DHCP session is started (using autoboot or a command-line `dhcp net0'), check whether the new setting use-cached (DHCP option 175.178) is TRUE; if so, skip DHCP and rely on currently registered settings. This lets one combine a static IP with autoboot. Before checking the use-cached setting, call a weak get_cached_dhcpack() hook that can be implemented by particular builds of gPXE supporting some fashion of retrieving a cached DHCPACK packet. If one is available, it is registered as an options source, and then either that packet's option 175.178 or the user's prior manual use-cached setting can allow skipping duplicate DHCP. Using cached packets is not the default because DHCP servers are often configured to give gPXE different options than they give a vendor PXE client; in order to break the infinite loop of PXE chaining, one would need to load a gPXE with an embedded image that does something more than autoboot. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [iwmgmt] Add wireless management commands and text for common errorsJoshua Oreman2010-01-051-0/+244
| | | | | | | | Add commands `iwstat' (to list 802.11-specific status information for 802.11 devices) and `iwlist' (to scan for available networks and print a list along with security information). Signed-off-by: Marty Connor <mdc@etherboot.org>
* [pxebs] Consistently interpret PXE type field as little-endianJoshua Oreman2009-11-211-1/+1
| | | | | | | | The PXE menu code also treated the type as big-endian, which went unnoticed until the first fix because its ntohs() was matched by a htons() in the PXE boot server discovery code. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [autoboot] Ensure that an error message is always printed for a boot failureMichael Brown2009-11-181-14/+16
| | | | | | | The case of an unsupported SAN protocol will currently not result in any error message. Fix by printing the error message at the top level using strerror(), rather than using hard-coded error messages in the error paths.
* [ipv4] Use a zero address to indicate "no gateway", rather than INADDR_NONEMichael Brown2009-11-161-1/+1
| | | | | | | | | | | | | | | ipv4.c uses a gateway address of INADDR_NONE to represent "no gateway". It initialises the gateway address to INADDR_NONE before calling fetch_ipv4_setting() to retrieve the configured gateway address (if any). However, as of commit 612f4e7 "[settings] Avoid returning uninitialised data on error in fetch_xxx_setting()", fetch_ipv4_setting() will zero the IP address if the setting does not exist, rather than leaving it unaltered. Fix by using a zero IP address to indicate "no gateway", so that a non-existent gateway address setting will be treated as such.
* [dhcp] Fall back to using the hardware address to populate the chaddr fieldMichael Brown2009-08-121-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | For IPoIB, the chaddr field is too small (16 bytes) to contain the 20-byte IPoIB link-layer address. RFC4390 mandates that we should pass an empty chaddr field and rely on the DHCP client identifier instead. This has many problems, not least of which is that a client identifier containing an IPoIB link-layer address is not very useful from the point of view of creating DHCP reservations, since the QPN component is assigned at runtime and may vary between boots. Leave the DHCP client identifier as-is, to avoid breaking existing setups as far as possible, but expose the real hardware address (the port GUID) via the DHCP chaddr field, using the broadcast flag to instruct the DHCP server not to use this chaddr value as a link-layer address. This makes it possible (at least with ISC dhcpd) to create DHCP reservations using host declarations such as: host duckling { fixed-address 10.252.252.99; hardware unknown-32 00:02:c9:02:00:25:a1:b5; }
* [netdevice] Separate out the concept of hardware and link-layer addressesMichael Brown2009-08-122-2/+2
| | | | | | | | | | | The hardware address is an intrinsic property of the hardware, while the link-layer address can be changed at runtime. This separation is exposed via APIs such as PXE and EFI, but is currently elided by gPXE. Expose the hardware and link-layer addresses as separate properties within a net device. Drivers should now fill in hw_addr, which will be used to initialise ll_addr at the time of calling register_netdev().
* [dhcp] Await link-up before starting DHCPJoshua Oreman2009-06-242-7/+6Star
| | | | | Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>