summaryrefslogtreecommitdiffstats
path: root/src/usr/imgmgmt.c
Commit message (Collapse)AuthorAgeFilesLines
* [image] Omit URI query string and fragment from download progress messagesMichael Brown2017-12-281-6/+7
| | | | | | | | | | | | | | The URIs printed as part of download progress messages are intended to provide a quick visual progress indication to the user. Very long query strings can render this visual indication useless in practice, since the most important information (generally the URI host and path) is drowned out by multiple lines of human-illegible URI-encoded data. Omit the query string entirely from the download progress message. For consistency and brevity, also omit the URI fragment along with the username and password (which was previously redacted anyway). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--timeout" parameter to image downloading commandsMichael Brown2014-03-101-6/+12
| | | | | | | | | | | | | | | | | | iPXE will detect timeout failures in several situations: network link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc. This does not cover all possible circumstances. For example, if a connection to a web server is successfully established and the web server acknowledges the HTTP request but never sends any data in response, then no timeout will be triggered. There is no timeout defined within the HTTP specifications, and the underlying TCP connection will not generate a timeout since it has no way to know that the HTTP layer is expecting to receive data from the server. Add a "--timeout" parameter to "imgfetch", "chain", etc. If no progress is made (i.e. no data is downloaded) within the timeout period, then the download will be aborted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Ensure every image has a fully resolved URIMichael Brown2014-02-271-12/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Refactor URI parsing and formattingMichael Brown2014-02-271-12/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | Add support for parsing of URIs containing literal IPv6 addresses (e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe"). Duplicate URIs by directly copying the relevant fields, rather than by formatting and reparsing a URI string. This relaxes the requirements on the URI formatting code and allows it to focus on generating human-readable URIs (e.g. by not escaping ':' characters within literal IPv6 addresses). As a side-effect, this allows relative URIs containing parameter lists (e.g. "../boot.php##params") to function as expected. Add validity check for FTP paths to ensure that only printable characters are accepted (since FTP is a human-readable line-based protocol with no support for character escaping). Construct TFTP next-server+filename URIs directly, rather than parsing a constructed "tftp://..." string, Add self-tests for URI functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [monojob] Add timeout parameter to monojob_wait()Michael Brown2013-11-011-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--autofree" optionMichael Brown2012-07-201-0/+2
| | | | | | | Allow images to be automatically freed after execution completes (successfully or otherwise). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image management commands and internal APIMichael Brown2012-03-251-43/+36Star
| | | | | | | | | | | | | | | | | | | | | | 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>
* [image] Add concept of trusted imagesMichael Brown2012-03-221-0/+2
| | | | | | | | | | | | | | | | 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>
* [image] Eliminate the register_and_xxx_image() functionsMichael Brown2011-10-251-110/+24Star
| | | | | | | | 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>
* [image] Use image_set_name() only if name != NULLPiotr Jaroszyński2011-03-271-1/+2
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify use of imgdownload()Michael Brown2011-03-091-13/+91
| | | | | | | 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] Move the register_and_{select|boot}_image() functions to imgmgmt.cMichael Brown2011-03-091-0/+39
| | | | | | | | 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>
* [image] Simplify image managementMichael Brown2011-03-071-49/+3Star
| | | | | | | | | | | 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>
* [image] Allow download job to complete before acting upon imageMichael Brown2011-03-021-7/+11
| | | | | | | | | 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>
* [autoboot] Connect SAN disk during a filename boot, if applicableMichael Brown2011-01-271-14/+37
| | | | | | | | | | | | | | | | | | | 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>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-5/+5
| | | | | | | | | | | 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>
* [uri] Decode/encode URIs when parsing/unparsingJoshua Oreman2010-01-211-1/+1
| | | | | | | | | | | | | | | Currently, handling of URI escapes is ad-hoc; escaped strings are stored as-is in the URI structure, and it is up to the individual protocol to unescape as necessary. This is error-prone and expensive in terms of code size. Modify this behavior by unescaping in parse_uri() and escaping in unparse_uri() those fields that typically handle URI escapes (hostname, user, password, path, query, fragment), and allowing unparse_uri() to accept a subset of fields to print so it can be easily used to generate e.g. the escaped HTTP path?query request. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [image] Redact password from URIs displayed by imgfetch()Michael Brown2009-02-171-1/+12
|
* [image] Fail "imgexec"/"boot" if the image to execute is ambiguousMichael Brown2008-07-081-5/+9
| | | | | | | | | | | | | | | If there is more than one loaded image, refuse to automatically select the image to execute. There are at least two possible cases, with different "correct" answers: 1. User loads image A by mistake, then loads image B and types "boot". User wants to execute image B. 2. User loads image A, then loads image B (which patches image A), then types "boot". User wants to execute image A. If a user actually wants to load multiple images, they must explicitly specify which image is to be executed.
* Display name and status of each file as it is downloaded.Michael Brown2007-08-031-1/+1
|
* Allow images to hold references to the originating URI.Michael Brown2007-08-021-20/+14Star
| | | | Some shuffling around of the image management code; this needs tidying up.
* Removed debugging statements that should not have been checked in.Michael Brown2007-06-281-2/+0Star
|
* Quick hack to get image booting working againMichael Brown2007-06-281-37/+23Star
|
* Scripts temporarily deregister themselves while executing. ThisMichael Brown2007-06-091-1/+2
| | | | | allows us to avoid execution loops without having to hack around the image registration order.
* Keep HTTP progress updated, and display a progress indicator during theMichael Brown2007-01-291-3/+4
| | | | download
* Use stdio.h instead of vsprintf.hMichael Brown2007-01-191-1/+1
|
* HTTP/DNS now working fully asynchronously. HTTP/IP addresses and anyMichael Brown2007-01-181-5/+8
| | | | other protocol won't work at the moment.
* Rename e{malloc,realloc,free} to u{malloc,realloc,free}, to more obviouslyMichael Brown2007-01-161-3/+3
| | | | | reflect the fact that they allocate and deallocate user memory (i.e. things reached through a userptr_t).
* Let ifmgmt.c take care of calling efree(), since it's the once whichMichael Brown2007-01-121-3/+13
| | | | | | | 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.
* fetch() now knows nothing about struct image; it simply loads a file andMichael Brown2007-01-121-1/+1
| | | | returns the allocated buffer.
* Allow "imgexec" with no arguments to boot the file that was loaded withMichael Brown2007-01-121-0/+16
| | | | "kernel".
* Cleaner separation between imgXXX() functions and image_cmd.cMichael Brown2007-01-121-2/+75
|
* Add basic "fetch" and "imgstat" commands.Michael Brown2007-01-121-0/+45