david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

63 Commits

Author SHA1 Message Date
Michael Brown 7054468d56 [shell] Enable "shell" command even when BANNER_TIMEOUT is zero
Setting BANNER_TIMEOUT to zero removes the only symbol reference to
shell.o, causing the "shell" command to become unavailable.

Add SHELL_CMD in config/general.h (enabled by default) which will
explicitly drag in shell.o regardless of the value of BANNER_TIMEOUT.

Reported-by: Julian Brost <julian@0x4a42.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-08-01 20:25:28 +01:00
Michael Brown 356f6c1b64 [acpi] Expose ACPI tables via settings mechanism
Allow values to be read from ACPI tables using the syntax

  ${acpi/<signature>.<index>.0.<offset>.<length>}

where <signature> is the ACPI table signature as a 32-bit hexadecimal
number (e.g. 0x41504093 for the 'APIC' signature on the MADT), <index>
is the index into the array of tables matching this signature,
<offset> is the byte offset within the table, and <length> is the
field length in bytes.

Numeric values are returned in reverse byte order, since ACPI numeric
values are usually little-endian.

For example:

  ${acpi/0x41504943.0.0.0.0}           - entire MADT table in raw hex
  ${acpi/0x41504943.0.0.0x0a.6:string} - MADT table OEM ID
  ${acpi/0x41504943.0.0.0x24.4:uint32} - local APIC address

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-05-23 18:48:06 +01:00
Michael Brown eed1258038 [cmdline] Add certificate management commands
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-08-31 17:11:14 +01:00
Michael Brown 2afd66eb55 [pixbuf] Enable PNG format by default
Enable IMAGE_PNG (but not IMAGE_PNM) by default, and drag in the
relevant objects only when image_pixbuf() is present in the binary.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-29 16:04:09 +01:00
Michael Brown 942b798c8d [crypto] Enable both DER and PEM formats by default
Enable both IMAGE_DER and IMAGE_PEM by default, and drag in the
relevant objects only when image_asn1() is present in the binary.

This allows "imgverify" to transparently use either DER or PEM
signature files.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-29 15:40:39 +01:00
Michael Brown 84add97ce9 [crypto] Add PEM image format
Add PEM-encoded ASN.1 as an image format.  We accept as PEM any image
containing a line starting with a "-----BEGIN" boundary marker.

We allow for PEM files containing multiple ASN.1 objects, such as a
certificate chain produced by concatenating individual certificate
files.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-29 01:13:27 +01:00
Michael Brown eb7188d04b [crypto] Add DER image format
Add DER-encoded ASN.1 as an image format.  There is no fixed signature
for DER files.  We treat an image as DER if it comprises a single
valid SEQUENCE object covering the entire length of the image.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-29 01:12:58 +01:00
Michael Brown 3c61e11fe1 [cmdline] Add "ntp" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-06-13 15:57:16 +01:00
Michael Brown 4b7443d132 [build] Generalise CONSOLE_VESAFB to CONSOLE_FRAMEBUFFER
The name "vesafb" is intrinsically specific to a BIOS environment.
Generalise the build configuration option CONSOLE_VESAFB to
CONSOLE_FRAMEBUFFER, in preparation for adding EFI framebuffer
support.

Existing configurations using CONSOLE_VESAFB will continue to work.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-16 16:38:39 +01:00
Michael Brown 518a98eb56 [http] Rewrite HTTP core to support content encodings
Rewrite the HTTP core to allow for the addition of arbitrary content
encoding mechanisms, such as PeerDist and gzip.

The core now exposes http_open() which can be used to create requests
with an explicitly selected HTTP method, an optional requested content
range, and an optional request body.  A simple wrapper provides the
preexisting behaviour of creating either a GET request or an
application/x-www-form-urlencoded POST request (if the URI includes
parameters).

The HTTP SAN interface is now implemented using the generic block
device translator.  Individual blocks are requested using http_open()
to create a range request.

Server connections are now managed via a connection pool; this allows
for multiple requests to the same server (e.g. for SAN blocks) to be
completely unaware of each other.  Repeated HTTPS connections to the
same server can reuse a pooled connection, avoiding the per-connection
overhead of establishing a TLS session (which can take several seconds
if using a client certificate).

Support for HTTP SAN booting and for the Basic and Digest
authentication schemes is now optional and can be controlled via the
SANBOOT_PROTO_HTTP, HTTP_AUTH_BASIC, and HTTP_AUTH_DIGEST build
configuration options in config/general.h.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-08-17 13:24:33 +01:00
Michael Brown 2a696ab963 [serial] Use new UART abstraction in serial console driver
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-06-29 11:04:10 +01:00
Michael Brown 3ec8b67818 [int13con] Add basic ability to log to a local disk via INT 13
Several popular public cloud providers do not provide any sensible
mechanism for obtaining debug output from an OS which is failing to
boot.  For example, Amazon EC2 provides the "Get System Log" facility,
which occasionally deigns to report a random subset of the characters
emitted via the VM's serial port, but usually returns only a blank
screen.  (Amazingly, this is still superior to the debugging
facilities provided by Azure.)

Work around these shortcomings by adding a console type which sends
output to a magically detected raw disk partition, and including such
a partition within any iPXE .usb-format image.

To use this facility:

 - build an iPXE .usb image with CONSOLE_INT13 enabled

 - boot the cloud VM from this image

 - after the boot fails, attach the VM's boot disk to a second VM

 - from this second VM, use "less -f -R /dev/sdb3" (or similar) to
   view the iPXE output.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-19 12:58:03 +01:00
Michael Brown a25a16d4ad [vram] Add "vram" built-in setting to dump video RAM
The "vram" setting returns the (Base64-encoded) contents of video RAM,
and can be used to capture a screenshot.  For example: after running
memtest.0 and encountering an error, the output can be captured and
sent to a remote server for later diagnosis:

  #!ipxe
  chain -a http://server/memtest.0 && goto ok || goto bad
  :bad
  params
  param errno ${errno}
  param vram ${vram}
  chain -a http://server/report.php##params
  :ok

Inspired-by: Christian Nilsson <nikize@gmail.com>
Originally-implemented-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-24 16:27:47 +01:00
Michael Brown fbc4ba4b4e [build] Fix the REQUIRE_SYMBOL mechanism
At some point in the past few years, binutils became more aggressive
at removing unused symbols.  To function as a symbol requirement, a
relocation record must now be in a section marked with @progbits and
must not be in a section which gets discarded during the link (either
via --gc-sections or via /DISCARD/).

Update REQUIRE_SYMBOL() to generate relocation records meeting these
criteria.  To minimise the impact upon the final binary size, we use
existing symbols (specified via the REQUIRING_SYMBOL() macro) as the
relocation targets where possible.  We use R_386_NONE or R_X86_64_NONE
relocation types to prevent any actual unwanted relocation taking
place.  Where no suitable symbol exists for REQUIRING_SYMBOL() (such
as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to
generate a one-byte-long symbol to act as the relocation target.

If there are versions of binutils for which this approach fails, then
the fallback will probably involve killing off REQUEST_SYMBOL(),
redefining REQUIRE_SYMBOL() to use the current definition of
REQUEST_SYMBOL(), and postprocessing the linked ELF file with
something along the lines of "nm -u | wc -l" to check that there are
no undefined symbols remaining.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-05 00:59:38 +00:00
Michael Brown 04c1ea8170 [build] Remove obsolete and unused portions of config.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-04 14:49:43 +00:00
Michael Brown 2f020a8df3 [legal] Relicense files under GPL2_OR_LATER_OR_UBDL
These files cannot be automatically relicensed by util/relicense.pl
since they either contain unusual but trivial contributions (such as
the addition of __nonnull function attributes), or contain lines
dating back to the initial git revision (and so require manual
knowledge of the code's origin).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02 16:35:29 +00:00
Michael Brown 5e95a79241 [legal] Include full licence text for all GPL2_OR_LATER files
Add the standard warranty disclaimer and Free Software Foundation
address paragraphs to the licence text where these are not currently
present.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-26 17:59:53 +00:00
Michael Brown 7c44fd68f0 [cmdline] Add "profstat" command to display profiling statistics
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-04-27 23:14:47 +01:00
Michael Brown f22c19f3fb [cmdline] Add the "ipstat" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-02 23:57:47 +00:00
Michael Brown c6c8078964 [png] Add support for PNG images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:16 +01:00
Michael Brown aa2e04fe1c [vesafb] Add VESA frame buffer console
The VESA frame buffer console uses the VESA BIOS extensions (VBE) to
enumerate video modes, selects an appropriate mode, and then hands off
to the generic frame buffer code.

The font is extracted from the VGA BIOS, avoiding the need to provide
an external font file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-28 05:55:45 +00:00
Michael Brown 0b81be823d [cmdline] Add "console" command to configure console
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-28 05:55:45 +00:00
Michael Brown 0ee89338dd [pnm] Add support for PNM images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-27 11:27:51 +00:00
Michael Brown 6f43ba411d [cmdline] Add "ping" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21 15:21:37 +01:00
Michael Brown 7405685df2 [cmdline] Add "nstat" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-25 14:36:36 +01:00
Michael Brown f7f3087cc5 [ipv6] Replace IPv6 stack
Replace the existing partially-implemented IPv6 stack with a fresh
implementation.

This implementation is not yet complete.  The IPv6 transmit and
receive datapaths are functional (including fragment reassembly and
parsing of arbitrary extension headers).  NDP neighbour solicitations
and advertisements are supported.  ICMPv6 echo is supported.

At present, only link-local addresses may be used, and there is no way
to specify an IPv6 address as part of a URI (either directly or via
a DNS lookup).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03 16:30:46 +01:00
Michael Brown 430c3fb900 [cmdline] Add "params" and "param" commands to manage form parameter lists
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-19 17:22:58 +01:00
Michael Brown c692a690da [settings] Expose memory map via settings mechanism
Allow memory map entries to be read using the syntax

  ${memmap/<region>.<properties>.<scale>}

where <region> is the index of the memory region, <properties> is a
bitmask where bit 0 represents the start address and bit 1 represents
the length (allowing the end address to be encoded by having both bits
0 and 1 set), and <scale> is the number of bits by which to shift the
result.

This allows for several values of interest to be encoded.  For
example:

  ${memmap/<region>.1.0:hexraw}   # 64-bit start address of <region>
  ${memmap/<region>.2.0:hexraw}   # 64-bit length of <region>, in bytes
  ${memmap/<region>.3.0:hexraw}   # 64-bit end address of <region>
  ${memmap/<region>.2.10:int32}   # Length of <region>, in kB
  ${memmap/<region>.2.20:int32}   # Length of <region>, in MB

The numeric encoding is slightly more sophisticated than described
here, allowing a single encoding to cover multiple regions.  (See the
source code for details.)  The primary use case for this feature is to
provide the total system memory size (in MB) via the "memsize"
predefined setting.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-12 22:00:36 +01:00
Michael Brown 55201e2d0e [settings] Expose CPUID instruction via settings mechanism
Allow CPUID values to be read using the syntax

  ${cpuid/<register>.<function>}

For example, ${cpuid/2.0x80000001} will give the value of %ecx after
calling CPUID with %eax=0x80000001.  Values for <register> are encoded
as %eax=0, %ebx=1, %ecx=2, %edx=3.

The numeric encoding is more sophisticated than described above,
allowing for settings such as the CPU model (obtained by calling CPUID
with %eax=0x80000002-0x80000004 inclusive and concatenating the values
returned in %eax:%ebx:%ecx:%edx).  See the source code for details.

The "cpuvendor" and "cpumodel" settings provide easy access to these
more complex CPUID settings.

This functionality is intended to complement the "cpuid" command,
which allows for testing individual CPUID feature bits.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-07 12:06:28 +01:00
Michael Brown b76885165e [cmdline] Add "pciscan" command to allow iteration over PCI devices
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-05 13:51:21 +01:00
Marin Hannache 30de9e8300 [nfs] Add support for NFS protocol
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-15 17:56:29 +02:00
Marin Hannache c0af8c0433 [cmdline] Add "poweroff" command
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-15 13:49:48 +02:00
Michael Brown dbfa13ff2c [settings] Expose PCI configuration space via settings mechanism
Allow values to be read from PCI configuration space using the syntax

  ${pci/<busdevfn>.<offset>.<length>}

where <busdevfn> is the bus:dev.fn address of the PCI device
(expressed as a single integer, as returned by ${net0/busloc}),
<offset> is the offset within PCI configuration space, and <length> is
the length within PCI configuration space.

Values are returned in reverse byte order, since PCI configuration
space is little-endian by definition.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-13 12:46:18 +02:00
Michael Brown 258195242b [settings] Add config/settings.h
Move VMWARE_SETTINGS build configuration option from config/sideband.h
to a new config/settings.h.

Existing instances of config/local/sideband.h will not be affected,
since config.c still #includes config/sideband.h.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-13 12:44:48 +02:00
Michael Brown 117fc61738 [console] Add support for the bochs/qemu debug port console
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-09-10 15:58:02 +01:00
Patrick Plenefisch 8e4faa0948 [cmdline] Add standalone "nslookup" command
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-09-10 15:31:14 +01:00
Michael Brown e6427b7ee1 [sdi] Add support for SDI images
Add support (disabled by default) for booting .sdi images as used by
Windows XP Embedded.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-09-05 14:11:01 +01:00
Michael Brown addf699c86 [cmdline] Add "sync" command
Add "sync" command (loosely based on the Unix "sync"), which will wait
for any pending operations to complete.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-06-09 19:00:04 +01:00
Michael Brown 591541af66 [cmdline] Add "cpuid" command
Allow x86 CPU feature flags (such as support for 64-bit mode) to be
checked using the "cpuid" command.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-06-07 00:37:04 +01:00
Marin Hannache 7865ae0dea [image] Remove non-working image loaders
The WinCE, a.out and FreeBSD loaders are designed to be #included by
core/loader.c, which no longer exists.  These old loaders are not
usable anymore and cause compilation failures when enabled in
config/general.h.

Signed-off-by: Marin Hannache <mareo@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 11:39:55 +01:00
Michael Brown a9cf527641 [vmware] Allow settings to be specified in the VMware .vmx file
Allow iPXE settings to be specified in the .vmx file via the VMware
GuestInfo mechanism.  For example:

    guestinfo.ipxe.filename = "http://boot.ipxe.org/demo/boot.php"
    guestinfo.ipxe.dns = "192.168.0.1"
    guestinfo.ipxe.net0.ip = "192.168.0.15"
    guestinfo.ipxe.net0.netmask = "255.255.255.0"
    guestinfo.ipxe.net0.gateway = "192.168.0.1"

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-17 17:47:33 +01:00
Marin Mareo Hannache 6ab98fa9f7 [tftp] Remove configuration option for tftm
DOWNLOAD_PROTO_TFTM is now useless as tftm support has been merged
into tftp.c.  DOWNLOAD_PROTO_TFTP should be used instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 20:32:50 +01:00
Michael Brown 943b3003bd [syslog] Add basic support for encrypted syslog via TLS
Encrypted syslog seems not yet to be standardised, but is supported by
some existing syslog servers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 11:54:31 +01:00
Michael Brown 3425726cf3 [menu] Add menu commands
Allow iPXE scripts to create menus.  For example:

    #!ipxe

    menu iSCSI boot demonstration
    item install         Install Fedora to ${root-path}
    item --default boot  Boot from ${root-path}
    item shell           Enter iPXE shell
    item exit            Exit to BIOS
    choose label && goto ${label}

    :boot
    sanboot ${root-path}

    :install
    sanhook ${root-path}
    chain http://${next-server}/fedora.ipxe

    :shell
    shell

    :exit

Inspired-by: Robin Smidsrød <robin@smidsrod.no>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-29 14:02:02 +01:00
Michael Brown b35d454422 [console] Remove unused "btext" console
The "btext" console has been disabled by a "#if 0" since 2007.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 15:47:34 +01:00
Michael Brown d1465f7b0b [image] Add the "imgtrust" and "imgverify" commands
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-25 00:11:43 +00:00
Michael Brown fa538bdbc6 [vmware] Add VMware logfile console (CONSOLE_VMWARE)
Allow iPXE console output to be sent to the VMware logfile via the
GuestRPC mechanism.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:02 +00:00
Michael Brown ddad96cd23 [console] Add keyboard map selection
The active keyboard map may be selected by editing KEYBOARD_MAP in
config/console.h.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 12:03:00 +00:00
Michael Brown 85eefad90c [bofm] Add support for BOFM under EFI
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-03 02:40:04 +00:00
Michael Brown a4bb95599c [cmdline] Add "reboot" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-12-09 13:08:39 +00:00