summaryrefslogtreecommitdiffstats
path: root/src/usr
Commit message (Collapse)AuthorAgeFilesLines
...
* [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>
* [ifmgmt] Move link-up status messages from autoboot() to iflinkwait()Joshua Oreman2009-06-242-12/+28
| | | | | | | | | | | | With the addition of link status codes, we can now display a detailed error indication if iflinkwait() fails. Putting the error output in iflinkwait avoids code duplication, and gains symmetry with the other interface management routines; ifopen() already prints an error directly if it cannot open its interface. Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Add mechanism for reporting detailed link status codesMichael Brown2009-06-241-0/+4
| | | | | | | | Expand the NETDEV_LINK_UP bit into a link_rc status code field, allowing specific reasons for link failure to be reported via "ifstat". Originally-authored-by: Joshua Oreman <oremanj@rwcr.net>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-186-0/+12
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [tables] Redefine methods for accessing linker tablesMichael Brown2009-03-131-8/+1Star
| | | | | | | | | | | | | | | Intel's C compiler (icc) chokes on the zero-length arrays that we currently use as part of the mechanism for accessing linker table entries. Abstract away the zero-length arrays, to make a port to icc easier. Introduce macros such as for_each_table_entry() to simplify the common case of iterating over all entries in a linker table. Represent table names as #defined string constants rather than unquoted literals; this avoids visual confusion between table names and C variable or type names, and also allows us to force a compilation error in the event of incorrect table names.
* [image] Redact password from URIs displayed by imgfetch()Michael Brown2009-02-171-1/+12
|
* [pxe] Allow Escape to abort PXE menu selectionsMichael Brown2009-02-171-2/+2
| | | | | | Other vendor PXE stacks tend to allow the Escape key to be used to abort menu selection. Allow Escape (as well as Ctrl-C) to abort selection.
* [image] Allow multiple embedded imagesMichael Brown2009-02-161-30/+0Star
| | | | | | | | | | This patch extends the embedded image feature to allow multiple embedded images instead of just one. gPXE now always boots the first embedded image on startup instead of doing the hardcoded DHCP boot (aka autoboot). Based heavily upon a patch by Stefan Hajnoczi <stefanha@gmail.com>.
* [pxe] Display the "Press F8" prompt rather than displaying menu with timeoutMichael Brown2009-02-051-58/+112
| | | | | | | | | | | The PXE spec dictates the rather ugly feature that we have to present a DHCP-specified prompt string to the user, then wait to see if they press F8 before displaying the menu. This seems to me to be a significant retrograde step from the current situation of displaying the menu with the timeout counting down against the default selected boot option, but apparently the lack of the "Press F8" prompt causes some confusion.
* [pxe] Obey lists of PXE Boot Servers and associated Discovery Control bitsMichael Brown2009-02-052-17/+4Star
| | | | | | | | Various combinations of options 43.6, 43.7 and 43.8 dictate which servers we send Boot Server Discovery requests to, and which servers we should accept responses from. Obey these options, and remove the explicit specification of a single Boot Server from start_pxebs() and dependent functions.
* [pxe] Skip PXE boot server discovery if directed to do soMichael Brown2009-02-051-6/+15
| | | | | Option 43.6 can direct us to skip PXE boot server discovery and just perform a standard DHCP filename boot.
* [pxe] Fall back to broadcast if no boot server multicast address existsMichael Brown2009-02-031-1/+2
| | | | | fetch_ipv4_setting() will zero its IPv4 address argument if no such setting exists, rather than leaving it untouched.
* [dhcp] Split PXE menuing code out of dhcp.cMichael Brown2009-02-013-2/+363
| | | | | | | | | The DHCP client code now implements only the mechanism of the DHCP and PXE Boot Server protocols. Boot Server Discovery can be initiated manually using the "pxebs" command. The menuing code is separated out into a user-level function on a par with boot_root_path(), and is entered in preference to a normal filename boot if the DHCP vendor class is "PXEClient" and the PXE boot menu option exists.
* [ui] Allow Ctrl-C to cancel wait for net device link-upMichael Brown2009-01-271-0/+9
| | | | | This really ought to be handled via monojob.c and the usual Ctrl-C mechanism that handles cancelling DHCP or file downloads.
* [i386] Move iSCSI and AoE boot code to arch/i386/interface/pcbiosMichael Brown2008-11-192-187/+0Star
|
* [netdevice] Retain and report detailed error breakdownsMichael Brown2008-11-081-2/+23
| | | | | | | | | | netdev_rx_err() and netdev_tx_complete_err() get passed the error code, but currently use it only in debug messages. Retain error numbers and frequencey counts for up to NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX. This allows the "ifstat" command to report the reasons for TX/RX errors in most cases, even in non-debug builds.
* [hacks] Improve the guess_boot_netdev() logicMichael Brown2008-10-312-6/+8
| | | | | | This function is a major kludge, but can be made slightly more accurate by ignoring net devices that aren't open. Eventually it needs to be removed entirely.
* [sanboot] Quick and dirty hack to make SAN boot protocols selectableMichael Brown2008-10-133-10/+28
|
* [autoboot] Retain initial-slash (if present) when constructing TFTP URIsMichael Brown2008-07-311-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we boot from a DHCP-supplied filename, we previously relied on the fact that the current working URI is set to tftp://[next-server]/ in order to resolve the filename into a full tftp:// URI. However, this process will eliminate the distinction between filenames with and without initial slashes: cwuri="tftp://10.0.0.1/" filename="vmlinuz" => URI="tftp://10.0.0.1/vmlinuz" cwuri="tftp://10.0.0.1/" filename="/vmlinuz" => URI="tftp://10.0.0.1/vmlinuz" This distinction is important for some TFTP servers. We now explicitly construct a string of the form "tftp://[next-server]/filename" so that a filename with an initial slash will result in a URI containing a double-slash, e.g. "tftp://10.0.0.1//vmlinuz" The TFTP code always strips a single initial slash, and so ends up presenting the correct path to the server. URIs entered explicitly by users at the command line must include a double slash if they want an initial slash presented to the TFTP server: "kernel tftp://10.0.0.1/vmlinuz" => filename="vmlinuz" "kernel tftp://10.0.0.1//vmlinuz" => filename="/vmlinuz"
* [iSCSI] Support Windows Server 2008 direct iSCSI installationMichael Brown2008-07-172-19/+55
| | | | | | | | | | | | | Add yet another ugly hack to iscsiboot.c, this time to allow the user to inhibit the shutdown/removal of the iSCSI INT13 device (and the network devices, since they are required for the iSCSI device to function). On the plus side, the fact that shutdown() now takes flags to differentiate between shutdown-for-exit and shutdown-for-boot means that another ugly hack (to allow returning via the PXE stack on BIOSes that have broken INT 18 calls) will be easier. I feel dirty.
* [image] Fail "imgexec"/"boot" if the image to execute is ambiguousMichael Brown2008-07-081-5/+9
| | | | | | | | | | | | | | | If there is more than one loaded image, refuse to automatically select the image to execute. There are at least two possible cases, with different "correct" answers: 1. User loads image A by mistake, then loads image B and types "boot". User wants to execute image B. 2. User loads image A, then loads image B (which patches image A), then types "boot". User wants to execute image A. If a user actually wants to load multiple images, they must explicitly specify which image is to be executed.
* [NETDEV] Add notion of link stateMichael Brown2008-04-222-1/+34
| | | | | | | | | | | Add ability for network devices to flag link up/down state to the networking core. Autobooting code will now wait for link-up before attempting DHCP. IPoIB reflects the Infiniband link state as the network device link state (which is not strictly correct; we also need a succesful IPoIB IPv4 broadcast group join), but is probably more informative.