summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* [monojob] Display percentage progress, if availableMichael Brown2011-03-081-6/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Allow iPXE's own command line to be executed as a scriptMichael Brown2011-03-076-1/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [main] Remove shell prompt when using an embedded imageMichael Brown2011-03-071-14/+13Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Use list_first_entry() to clarify logic in main()Michael Brown2011-03-072-5/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Add "prompt" commandMichael Brown2011-03-071-0/+67
| | | | | | | | | | | | | The "prompt" command exposes the prompt() function, allowing a script to prompt the user for a keypress and take action depending on the result. For example #!ipxe prompt -k 0x197e -t 2000 Press F12 to boot from network... || exit autoboot Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prompt] Replace shell_banner() with a generic prompt() functionMichael Brown2011-03-075-37/+64
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add a timeout parameter to getkey()Michael Brown2011-03-077-16/+13Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Avoid timer wraparound problems in getchar_timeout()Michael Brown2011-03-071-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Recognise scancodes for F5-F12 inclusiveMichael Brown2011-03-072-25/+31
| | | | | | | | | 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-073-36/+60
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Add an iPXE error URI to the "not in a script" messageMichael Brown2011-03-071-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Clear the command line rather than setting an empty command lineMichael Brown2011-03-071-3/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Allow image_set_cmdline() to clear the command lineMichael Brown2011-03-071-4/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Do not assume that image has a non-NULL command lineMichael Brown2011-03-071-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image managementMichael Brown2011-03-0720-501/+414Star
| | | | | | | | | | | 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>
* [spi] Reset device on each accessMichael Brown2011-03-041-0/+3
| | | | | | | | | | | | | | When chainloading rtl8139.pxe from an old Etherboot rtl8139.zrom, iPXE can end up misreading the first word of the MAC address from the EEPROM as being all zeroes. This is presumably because Etherboot has left the serial EEPROM in an unexpected state. Fix by using the chip select line to reset the SPI device before we start accessing it. Reported-by: Mandar U Jog <mandarjog@gmail.com> Tested-by: Mandar U Jog <mandarjog@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Refer to online documentation for command helpMichael Brown2011-03-0423-80/+46Star
| | | | | | | | | | 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>
* [arbel] Make driver 64-bit safeMichael Brown2011-03-041-2/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Make driver 64-bit safeMichael Brown2011-03-042-0/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Change default initiator IQNMichael Brown2011-03-033-241/+150Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [dns] Fix memory leak in settings applicatorMichael Brown2011-03-031-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make fetch_string_setting_copy() easier to useMichael Brown2011-03-031-1/+10
| | | | | | | | | | | | | Most callers of functions in the fetch_setting() family treat any errors as meaning "non-existent setting". In the case of fetch_string_setting_copy(), an existent setting can still result in an error due to memory allocation failure. Allow the caller to distinguish between a non-existent setting and an error in allocating memory for the copy, by returning success (and a NULL buffer pointer) for a non-existent setting. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Avoid fetch_string_setting_copy() leaving an uninitialised pointerMichael Brown2011-03-031-0/+2
| | | | | | | | For consistency with other functions in the fetch_setting() family, ensure that fetch_string_setting_copy() always initialises the pointer to the fetched setting even if fetching fails. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Add BOFM supportMichael Brown2011-03-033-58/+415
| | | | 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 support for BOFM under EFIMichael Brown2011-03-034-0/+347
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Add offline BOFM test facilityMichael Brown2011-03-032-0/+170
| | | | | | | | 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-034-0/+678
| | | | 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-024-19/+13Star
| | | | | | | | | 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>
* [int13] Automatically reopen underlying block device as neededMichael Brown2011-03-021-34/+50
| | | | | | | | | | | | | | | | We currently use INT 13,00 as an opportunity to reopen the underlying block device, which works well for callers such as DOS that will use INT 13,00 in response to any disk errors. However, some callers (such as Windows Server 2008) do not attempt to reset the disk, and so any failures become effectively permanent. Fix this by automatically reopening the underlying block device whenever we might want to access it. This makes direct installation of Windows to an iSCSI target much more reliable. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Set the "size" bit in the GDT entry for the flat data segmentMichael Brown2011-03-011-1/+1
| | | | | | | | | | | | The "size" bit (aka the D/B) bit should (as far as I can tell) be irrelevant for accesses to a non-code, non-stack, expand-upwards segment. However, VirtualBox fails on some accesses via this segment if this bit is not set. This change allows iPXE to boot under VirtualBox without having to disable VT-x/AMD-V support. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Add rudimentary debugging messages to libprefixMichael Brown2011-03-011-0/+40
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow DEBUG=... to affect builds of assembler source filesMichael Brown2011-03-012-6/+7
| | | | 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>
* [linux] Remove Linux-specific code from default (non-Linux) buildMichael Brown2011-02-252-2/+3
| | | | | | | | | | | Building the Linux-specific code (tap.o et al) requires external headers that have proven to be extremely variable across systems, causing frequent build failures. Until this situation is rectified, remove the Linux-specific code from the default (non-Linux build). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Clarify support for NOP-InMichael Brown2011-02-251-24/+9Star
| | | | | | | | | | After a more accurate reading of RFC 3720, it becomes clear how NOPs are supposed to work. The current implementation (which just ignores NOP-Ins) is sufficient to cope with NOP-Ins sent to update CmdSN, but will need to be extended before it can cope with NOP-Ins sent as iSCSI keepalives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Verify the correct tag in NOP-In PDUsMichael Brown2011-02-251-4/+4
| | | | | | | We should be checking the target transfer tag, rather than the initiator task tag. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Fix minor typo in ibft_set_ipaddr()Michael Brown2011-02-251-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Accept NOP-In PDUs sent by the targetMichael Brown2011-02-242-0/+84
| | | | | | | | | | | | 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>
* [build] Use unique entry symbols for each prefixMichael Brown2011-02-2317-34/+26Star
| | | | | | | | | | | | Some binutils versions will drag in an object to satisfy the entry symbol; some won't. Try to cope with this exciting variety of behaviour by ensuring that all entry symbols are unique. Remove the explicit inclusion of the prefix object on the linker command line, since the entry symbol now provides all the information needed to identify the prefix. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Ensure an entry point symbol exists in all buildsMichael Brown2011-02-237-3/+16
| | | | | | | | | | Commit 623469d ("[build] Eliminate unused sections at link-time") introduced a regression in several build formats, in which the prefix would end up being garbage-collected out of existence. Fix by ensuring that an entry symbol exists in each possible prefix, and is required by the linker script. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Disambiguate the expected target errors in the login responseMichael Brown2011-02-232-1/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Eliminate unused sections at link-timeMichael Brown2011-02-226-10/+37
| | | | | | | | | Use -ffunction-sections, -fdata-sections, and --gc-sections to automatically prune out any unreferenced sections. This saves around 744 bytes (uncompressed) from the rtl8139.rom build. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add missing "static" modifierMichael Brown2011-02-221-2/+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-177-288/+685
| | | | | | | | | | | | | | 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>