[console] Try to avoid problems caused by keycode 86
The "us" keyboard layout contains a mapping for keycode 86 (which
seems not to correspond to any physical key on many US keyboards) to
the ASCII character '<'. This mapping causes conflicts with the
mapping for keycode 51, which also maps (with shift) to '<'.
Change the keyboard mapping generator to choose the lowest keycode for
each ASCII character as indicating the relevant mapping to use, on the
basis that a lower keycode roughly indicates a "more normal" key. On
a German keyboard, which has keys for both keycode 51 and keycode 86
present, this causes '<' to be remapped to ';', which is a closer
match to typical user expectations.
Reported-by: Sven Dreyer <sven@dreyer-net.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Inspired by LILO's keytab-lilo.pl, genkeymap.pl uses "loadkeys -b" to
obtain a Linux keyboard map, and generates a file keymap_xx.c in
hci/keymap.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
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 help
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>
[autoboot] Connect SAN disk during a filename boot, if applicable
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>
[cmdline] Match user expectations for &&, ||, goto, and exit
The && and || operators should be left-associative, since that is how
they are treated in most other languages (including C and Unix
shell). For example, in the command:
dhcp net0 && goto dhcp_ok || echo No DHCP on net0
if the "dhcp net0" fails then the "echo" should be executed.
After an "exit" or a successful "goto", further commands on the same
line should never be executed. For example:
goto somewhere && echo This should never be printed
exit 0 && echo This should never be printed
exit 1 && echo This should never be printed
An "exit" should cause the current shell or script to terminate and
return the specified exit status to its caller. For example:
chain test.ipxe && echo Success || echo Failure
[in test.ipxe]
#!ipxe
exit 0
should echo "Success".
Signed-off-by: Michael Brown <mcb30@ipxe.org>
The "shell" command allows a script to enter an interactive shell,
which is potentially useful for troubleshooting.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[settings] Allow "set" command to take an empty value
Allow "set <variable>" to be used to set the variable to an empty
value, if permitted by the setting type. Note that some settings
backends do not differentiate between an empty value and a
non-existent value, so this may or may not be equivalent to "clear
<variable>".
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[autoboot] Merge "netboot" command into "autoboot"
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>
There are several points in the iPXE codebase where
list_for_each_entry() is (ab)used to extract only the first entry from
a list. Add a macro list_first_entry() to make this code easier to
read.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[hci] Use http://ipxe.org/<errno> instead of raw error numbers
Users tend to gloss over cryptic-looking error messages such as
"Boot failed: Exec format error (Error 0x2e852001)"
In particular, users tend not to report the error number, which is the
single most useful piece of diagnostic information in an iPXE error
message. Try replacing the "Error 0x2e852001" portion with a URL,
giving
"Boot failed: Exec format error (http://ipxe.org/2e852001)"
in the hope that users will, upon seeing something that is
recognisably a URL, try viewing it in a web browser. Such users will
be greeted by a web page containing a more detailed description of the
error (automatically generated from the einfo text), including links
to each line of code that might generate the error, and a section for
additional user-contributed notes. At the time of writing, a user who
visits http://ipxe.org/2e852001 would see a note saying
"This error usually indicates that the SAN disk is empty, and does
not yet contain a bootable operating system."
which may be more useful than "Exec format error (Error 0x2e852001)".
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[settings] Modify "set" command to allow space separated values
Allow multiple, space separated values (such as kernel arguments,
passed via DHCP) to be assigned to an identifier using the "set"
command.
Originally-implemented-by: Aaron Brooks <aaron@brooks1.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Support qemu-like arguments for network setup:
--net driver_name[,setting=value]*
and global settings:
--settings setting=value[,setting=value]*
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
The "dhcp" command now accepts a list of interfaces to try until one
succeeds. For example:
iPXE> dhcp net0 net1 net2
If no interfaces are specified, all interfaces will be tried.
Note that interfaces that fail to DHCP are closed in order to avoid
memory exhaustion. This behavior differs from the previous "dhcp"
command implementation but should not affect any existing scripts
since a "dhcp" command failure would in any case cause the script to
abort.
Originally-implemented-by: Lars Kellogg-Stedman <lars@oddbit.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[hci] Continue processing while prompting for shell banner
Continue calling step() while displaying the shell banner. This
potentially allows TCP connections to close gracefully after a failed
boot attempt.
Inspired-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Make Ctrl-D delete a setting, because the Text User Interface (tui)
previously provided no way to delete a setting. Also, update the
on-screen instructions to describe the new feature. Deleting settings
is especially important for settings stored in precious nonvolatile
storage.
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Implement jump scrolling with "..." displayed where the settings list
continues off-screen, because there are now too many settings to fit
on screen in the "config ..." text user interface.
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
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>
[iwmgmt] Add wireless management commands and text for common errors
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>