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

48 Commits

Author SHA1 Message Date
Michael Brown c3b4860ce3 [legal] Update FSF mailing address in GPL licence texts
Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 19:55:45 +01:00
Michael Brown 5d3c368efb [image] Add "--replace" option
Expose image tail-recursion to iPXE scripts via the "--replace"
option.  This functions similarly to exec() under Unix: the
currently-executing script is replaced with the new image (as opposed
to running the new image as a subroutine).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 12:45:15 +01:00
Michael Brown d3c660b671 [image] Add "--autofree" option
Allow images to be automatically freed after execution completes
(successfully or otherwise).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 12:44:40 +01:00
Michael Brown c124f21f56 [image] Avoid potential NULL pointer dereference
Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-08 21:05:25 +01:00
Michael Brown 275fdae9bb [image] Fix use-after-free in debug messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-30 20:50:25 +01:00
Michael Brown 730c972124 [image] Log image executions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-27 11:11:28 +01:00
Michael Brown 1c127a6962 [image] Simplify image management commands and internal API
Remove the name, cmdline, and action parameters from imgdownload() and
imgdownload_string().  These functions now simply download and return
an image.

Add the function imgacquire(), which will interpret a "name or URI
string" parameter and return either an existing image or a newly
downloaded image.

Use imgacquire() to merge similar image-management commands that
currently differ only by whether they take the name of an existing
image or the URI of a new image to download.  For example, "chain" and
"imgexec" can now be merged.

Extend imgstat and imgfree commands to take an optional list of
images.

Remove the arbitrary restriction on the length of image names.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-24 23:12:04 +00:00
Michael Brown 97dcc824bf [image] Add concept of trusted images
Trusted images may always be executed.  Untrusted images may be
executed only if the current image trust requirement allows untrusted
images.

Images can be marked as trusted using image_trust(), and marked as
untrusted using image_untrust().

The current image trust requirement can be changed using
image_set_trust().  It is possible to make the change permanent, in
which case any future attempts to change the image trust requirement
will fail.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 16:16:02 +00:00
Michael Brown 790035f78d [image] Eliminate the register_and_xxx_image() functions
All users of imgdownload() require registration of the image, so make
registration an integral part of imgdownload() itself and simplify the
"action" parameter to be one of image_select(), image_exec() et al.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-25 01:41:41 +01:00
Michael Brown 4562223420 [image] Avoid ending up with multiple selected images on re-registration
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-09 17:21:34 +00:00
Michael Brown 9fa4ac2e9a [image] Simplify use of imgdownload()
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>
2011-03-09 16:57:34 +00:00
Michael Brown ae92700fd4 [image] Generalise "currently-running script" to "currently-running image"
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-09 13:38:56 +00:00
Michael Brown d17a84a056 [image] Move the register_and_{select|boot}_image() functions to imgmgmt.c
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>
2011-03-09 13:11:35 +00:00
Michael Brown 659c55c1a9 [image] Allow image_set_cmdline() to clear the command line
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-07 02:43:56 +00:00
Michael Brown 34b6ecb2f1 [image] Simplify image management
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>
2011-03-07 00:37:50 +00:00
Piotr Jaroszyński fd312fcc78 [image] Fix a memory leak in free_image()
image_set_cmdline() strdup()s cmdline, which free_image() doesn't
clean up.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-11 15:55:04 +01:00
Michael Brown 4bfd5b52c1 [refcnt] Add ref_init() wrapper function
Standardise on using ref_init() to initialise an embedded reference
count, to match the coding style used by other embedded objects.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-06-22 14:26:40 +01:00
Michael Brown 8406115834 [build] Rename gPXE to iPXE
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>
2010-04-19 23:43:39 +01:00
Michael Brown c44a193d0d [legal] Add a selection of FILE_LICENCE declarations
Add FILE_LICENCE declarations to almost all files that make up the
various standard builds of gPXE.
2009-05-18 08:33:25 +01:00
Michael Brown 1266d7902b [tables] Redefine methods for accessing linker tables
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.
2009-03-13 02:06:30 +00:00
Michael Brown 14eafc5b8d [comboot] Fix reference counting on replacement images
When chaining COMBOOT images, the old images now get freed correctly.
2009-02-17 01:45:12 +00:00
Michael Brown 8904cd55f1 [comboot] Allow for tail recursion of COMBOOT images
Multi-level menus via COMBOOT rely on the COMBOOT program being able
to exit and invoke a new COMBOOT program (the next menu).  This works,
but rapidly (within about five iterations) runs out of space in gPXE's
internal stack, since each new image is executed in a new function
context.

Fix by allowing tail recursion between images; an image can now
specify a replacement image for itself, and image_exec() will perform
the necessary tail recursion.
2009-02-17 00:47:35 +00:00
Michael Brown 4f2861a376 [image] Revert "clear LOADED flag" patch
Clearing the LOADED flag actually prevents users from doing clever things
such as loading an image, then loading a patch image, then executing the
first image.  (image_exec() checks for IMAGE_LOADED, so this sequence of
operations will fail if the LOADED flag gets cleared.)

This reverts commit 14c080020f.
2008-07-08 03:15:02 +01:00
Michael Brown 14c080020f [image] Clear LOADED flag on all other images when loading a new image
Loading an image may overwrite part or all of any previously-loaded
images, so we should clear the LOADED flag for all images prior to
attempting to load a new image.
2008-07-08 03:03:48 +01:00
Michael Brown cfcc41d407 Set current working URI to be that of the executable image when
executing any image, not just a script.  (This will enable pxelinux to
use relative URIs, should it wish to.)
2007-08-07 06:50:12 -07:00
Michael Brown d4947c05b2 Allow images to hold references to the originating URI.
Some shuffling around of the image management code; this needs tidying up.
2007-08-02 20:18:32 +01:00
Holger Lubitz 1ccb6f9dc6 convert to zalloc 2007-07-06 21:08:21 +02:00
Michael Brown b256900d4f Scripts temporarily deregister themselves while executing. This
allows us to avoid execution loops without having to hack around the
image registration order.
2007-06-09 19:00:34 +01:00
Michael Brown 08e286714f Add reference counting to register/unregister procedure. 2007-06-09 17:32:27 +01:00
Michael Brown 73b09ecba6 Use stdio.h instead of vsprintf.h 2007-01-19 01:13:12 +00:00
Michael Brown 544fa25928 Rename e{malloc,realloc,free} to u{malloc,realloc,free}, to more obviously
reflect the fact that they allocate and deallocate user memory (i.e.
things reached through a userptr_t).
2007-01-16 08:36:42 +00:00
Michael Brown c1fd6e8dc7 Once image type has been set, do not autoprobe further 2007-01-14 15:25:23 +00:00
Michael Brown 7dc50167bb Allow load() and exec() methods to be NULL. 2007-01-14 14:59:36 +00:00
Michael Brown 5c72d9c4e0 Print image physical location in registration message. 2007-01-12 16:20:51 +00:00
Michael Brown e2c0055e23 Let ifmgmt.c take care of calling efree(), since it's the once which
took out the contract to eventually call efree() when it called fetch().

Maintain the most recently loaded image at the start of the list, so that
imgautoselect() will pick it.
2007-01-12 09:46:10 +00:00
Michael Brown eba3609e7f Add debug message 2007-01-12 08:57:51 +00:00
Michael Brown 475d6d1f7c fetch() now knows nothing about struct image; it simply loads a file and
returns the allocated buffer.
2007-01-12 08:02:27 +00:00
Michael Brown 742f242863 Add free_image 2007-01-12 06:26:59 +00:00
Michael Brown b9fea9cbac Added IMAGE_LOADED flag and find_image() 2007-01-12 06:03:02 +00:00
Michael Brown 7bf94b5ad6 Allow for named images. 2007-01-11 23:45:18 +00:00
Michael Brown f59ad50504 Provide registration mechanism for loaded images, so that we can e.g.
refer to them by name from the command line, or build them into a
multiboot module list.

Use setting image->type to disambiguate between "not my image" and "bad
image"; this avoids relying on specific values of the error code.
2007-01-11 23:43:29 +00:00
Michael Brown 4fc9333159 Move include/image.h to include/gpxe/image.h 2007-01-11 16:04:36 +00:00
Michael Brown e2dcd05b67 Update buffer-handling code to enable expandable buffers. 2007-01-11 03:50:47 +00:00
Michael Brown bb2024c6d6 Move include/buffer.h to include/gpxe/buffer.h 2007-01-11 01:47:26 +00:00
Marty Connor eb091f03e3 fix printf format args 2006-06-29 19:04:25 +00:00
Michael Brown 0afa9db2de Tear out old heap code, replace with code that simply allocates memory
for use by malloc().

This breaks the image-loading code (which previously used the heap to
allocate the buffer for downloading the image), but that's not a major
concern since I'm going to tear out all the image formats within the next
couple of days anyway.  Byebye, NBI!  :)
2006-05-16 15:00:36 +00:00
Michael Brown 0571dcdb05 Added print_images() and autoload(). 2005-05-17 13:38:24 +00:00
Michael Brown 58ee2c4b2e First versions 2005-05-09 18:01:50 +00:00