summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* [main] Add the "scriptlet" settingMichael Brown2011-03-281-1/+8
| | | | | | | | | | | | | | | | | | | A scriptlet is a single iPXE command that can be stored in non-volatile option storage and used to override the default "autoboot" behaviour without having to reflash the iPXE image. For example, a scriptlet could contain autoboot || reboot to instruct iPXE to reboot the system if booting fails. Unlike an embedded image, the presence of a scriptlet does not inhibit the initial "Press Ctrl-B..." prompt. This allows the user to recover from setting a faulty scriptlet. Originally-implemented-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Make malloc and linux_umalloc valgrindablePiotr Jaroszyński2011-03-271-1/+6
| | | | | | | | | | Make the allocators used by malloc and linux_umalloc valgrindable. Include valgrind headers in the codebase to avoid a build dependency on valgrind. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add support for boolean optionsMichael Brown2011-03-271-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Impose a fixed order on settingsMichael Brown2011-03-232-18/+36
| | | | | | | 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>
* [settings] Display canonical setting name in "config" user interfaceMichael Brown2011-03-221-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display canonical setting name in output of "show" commandMichael Brown2011-03-221-1/+3
| | | | | | | | | | | | | | | | | | Enable the "show" command to display the full, canonicalised name of the fetched setting. For example: iPXE> show mac net0/mac:hex = 52:54:00:12:34:56 iPXE> dhcp && show ip DHCP (net0 52:54:00:12:34:56)... ok net0.dhcp/ip:ipv4 = 10.0.0.168 iPXE> show net0/6 net0.dhcp/dns:ipv4 = 10.0.0.6 Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Provide fetch_setting_origin()Michael Brown2011-03-221-0/+2
| | | | | Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose settings_name()Glenn Brown2011-03-221-0/+1
| | | | | | | | Expose settings_name(), shrink the unnecessarily large static buffer, properly name root settings block, and simplify. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use concat_args() in "set" commandMichael Brown2011-03-221-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Formalise notion of setting applicabilityMichael Brown2011-03-224-4/+90
| | | | | | | | | | | | | | | Expose a function setting_applies() to allow a caller to determine whether or not a particular setting is applicable to a particular settings block. Restrict DHCP-backed settings blocks to accepting only DHCP-based settings. Restrict network device settings blocks to accepting only DHCP-based settings and network device-specific settings such as "mac". Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Avoid spurious unused-but-set-variable warnings in gcc 4.6Michael Brown2011-03-161-1/+2
| | | | | | | | | | The __table_entries() construction seems to trigger a false positive warning in gcc 4.6 relating to variables which are set but never used. Add __attribute__((unused)) to inhibit this warning. Reported-by: Ralph Giles <giles@thaumas.net> Tested-by: Ralph Giles <giles@thaumas.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add facility for rudimentary keyboard mappingMichael Brown2011-03-161-0/+30
| | | | | | | Allow for remapping of ASCII characters returned by the BIOS, using a map consisting of (from,to) pairs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Mark SNP devices as children of EFI PCI deviceMichael Brown2011-03-151-0/+6
| | | | | | | | | | | | | Re-open the EFI_PCI_IO_PROTOCOL specifying an Attributes value of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER. This causes the SNP devices to be marked as children of the EFI PCI device (as shown in the "devtree" command). On at least one IBM blade system, this is required in order to have the relevant drivers automatically attach to the SNP controller at device creation time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Add support for sending console output to a syslog serverMichael Brown2011-03-101-0/+36
| | | | | Originally-implemented-by: Anselm Martin Hoffmeister <anselm@hoffmeister.be> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move include/console.h to include/ipxe/console.hMichael Brown2011-03-092-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify use of imgdownload()Michael Brown2011-03-092-4/+12
| | | | | | | 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] Generalise "currently-running script" to "currently-running image"Michael Brown2011-03-091-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Move the register_and_{select|boot}_image() functions to imgmgmt.cMichael Brown2011-03-092-2/+2
| | | | | | | | 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>
* [prefix] Allow iPXE's own command line to be executed as a scriptMichael Brown2011-03-072-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Some prefixes (e.g. .lkrn) allow a command line to be passed in to iPXE. At present, this command line is ignored. If a command line is provided, treat it as an embedded script (without an explicit "#!ipxe" magic marker). This allows for patterns of invocation such as title iPXE kernel /boot/ipxe.lkrn dhcp && \ sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage Here GRUB is instructed to load ipxe.lkrn with an embedded script equivalent to #!ipxe dhcp sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage This can be used to effectively vary the embedded script without having to rebuild ipxe.lkrn. Originally-implemented-by: Dave Hansen <dave@sr71.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Use list_first_entry() to clarify logic in main()Michael Brown2011-03-071-0/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prompt] Replace shell_banner() with a generic prompt() functionMichael Brown2011-03-073-14/+15
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add a timeout parameter to getkey()Michael Brown2011-03-071-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Recognise scancodes for F5-F12 inclusiveMichael Brown2011-03-071-0/+7
| | | | | | | | | The function keys F5-F12 all conform to the same ANSI pattern as the other "special" keys that we currently recognise. Add these key definitions, and shrink the representation of the ANSI sequences in bios_console.c to compensate. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add generic concat_args() functionMichael Brown2011-03-071-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image managementMichael Brown2011-03-073-47/+51
| | | | | | | | | | | 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>
* [parseopt] Refer to online documentation for command helpMichael Brown2011-03-041-6/+4Star
| | | | | | | | | | The online documentation (e.g. http://ipxe.org/cmd/ifopen), though not yet complete, is far more comprehensive than could be provided within the iPXE binary. Save around 200 bytes (compressed) by removing the command descriptions from the interactive help, and instead referring users directly to the web page describing the relevant command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Change default initiator IQNMichael Brown2011-03-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default initiator IQN is "iqn.2000-09.org.etherboot:UNKNOWN". This is problematic for two reasons: a) the etherboot.org domain (and hence the associated IQN namespace) is not under the control of the iPXE project, and b) some targets (correctly) refuse to allow concurrent connections from different initiators using the same initiator IQN. Solve both problems by changing the default initiator IQN to be iqn.2010-04.org.ipxe:<hostname> if a hostname is set, or iqn.2010-04.org.ipxe:<uuid> if no hostname is set. Explicit initiator IQNs set via DHCP option 203 are not affected by this change. Unfortunately, this change is likely to break some existing configurations, where ACL rules have been put in place referring to the old default initiator IQN. Users may need to update ACLs, or force the use of the old IQN using an iPXE script line such as set initiator-iqn iqn.2000-09.org.etherboot:UNKNOWN or a dhcpd.conf option such as option iscsi-initiator-iqn "iqn.2000-09.org.etherboot:UNKNOWN" Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Allow garbage collection of BOFM code in non-BOFM buildsMichael Brown2011-03-031-1/+10
| | | | | | | | | Most builds will not have BOFM enabled. In these builds, allow all BOFM code (including BOFM-only code within the individual drivers) to be garbage-collected at link time in order to save space in the final binary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Add offline BOFM test facilityMichael Brown2011-03-031-0/+1
| | | | | | | | Testing BOFM involves gaining access to an IBM blade chassis, which is often not practical. Provide a facility for testing BOFM functionality outside of a real IBM blade context. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Add core BOFM libraryMichael Brown2011-03-032-0/+342
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Allow download job to complete before acting upon imageMichael Brown2011-03-022-3/+2Star
| | | | | | | | | 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>
* [build] Allow DEBUG=... to affect builds of assembler source filesMichael Brown2011-03-011-6/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Accept NOP-In PDUs sent by the targetMichael Brown2011-02-241-0/+34
| | | | | | | | | | | | Some iSCSI targets (observed with a Synology DS207+ NAS) send unsolicited NOP-Ins to the initiator. RFC 3720 is remarkably unclear and possibly self-contradictory on how NOPs are supposed to work, but it seems as though we can legitimately just ignore any unsolicited NOP-In PDU. Reported-by: Marc Lecuyer <marc@maxiscreen.com> Originally-implemented-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Disambiguate the expected target errors in the login responseMichael Brown2011-02-231-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide space for storing the EFI driver nameMichael Brown2011-02-221-1/+1
| | | | | | | | Commit d7736fb ("[efi] Allow EFI to control PCI bus enumeration") introduced a bug in which the EFI driver name became an (uninitialised) pointer rather than an array. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow EFI to control PCI bus enumerationMichael Brown2011-02-173-1/+89
| | | | | | | | | | | | | | EFI performs its own PCI bus enumeration. Respect this, and start controlling devices only when instructed to do so by EFI. As a side benefit, we should now correctly create multiple SNP instances for multi-port devices. This should also fix the problem of failing to enumerate devices because the PCI bridges have not yet been enabled at the time the iPXE driver is loaded. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Rename efi_pci.h to efi_pci_api.hMichael Brown2011-02-172-6/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Modularise PCI device supportMichael Brown2011-02-171-0/+28
| | | | | | | | Some operating environments require (or at least prefer) that we do not perform our own PCI bus scan, but deal only with specified devices. Modularise the PCI core to allow for this. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Make driver PCI ID a property of the PCI deviceMichael Brown2011-02-172-9/+5Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Replace pci_max_bus() with pci_num_bus()Michael Brown2011-02-172-7/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Use single "busdevfn" field in struct pci_deviceMichael Brown2011-02-171-11/+10Star
| | | | | | | Merge the "bus" and "devfn" fields into a single "busdevfn" field, to match the format used by the majority of external code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bitops] Add missing __attribute__ (( packed ))Michael Brown2011-02-171-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Add uri_has_path()Michael Brown2011-02-011-0/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Generalise expand_command() to expand_settings()Michael Brown2011-01-281-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Connect SAN disk during a filename boot, if applicableMichael Brown2011-01-273-3/+8
| | | | | | | | | | | | | | | | | | | 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-273-14/+36
| | | | | | | | 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>
* [xfer] Expose xfer_uri_opener()Michael Brown2011-01-271-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow devices to indicate that interrupts are not supportedMichael Brown2011-01-251-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Auto-resize VPD fields used for non-volatile storageMichael Brown2011-01-192-8/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Add ability to resize a VPD fieldMichael Brown2011-01-191-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>