summaryrefslogtreecommitdiffstats
path: root/src/hci/commands
Commit message (Collapse)AuthorAgeFilesLines
* [cmdline] Add "profstat" command to display profiling statisticsMichael Brown2014-04-281-0/+70
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--timeout" parameter to image downloading commandsMichael Brown2014-03-104-9/+22
| | | | | | | | | | | | | | | | | | 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>
* [cmdline] Add the "ipstat" commandMichael Brown2014-03-031-0/+70
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [params] Use reference counters for form parameter listsMichael Brown2014-02-271-2/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Always clear screen after reconfiguring consoleMichael Brown2014-01-221-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add margin options to the "console" commandMichael Brown2014-01-221-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Rename "console" command's --bpp option to --depthMichael Brown2014-01-221-2/+2
| | | | | | | | | | Rename the "--bpp" option to "--depth", to free up the single-letter option "-b" for "--bottom" in preparation for adding margin support. This does not break backwards compatibility with documented features, since the "console" command has not yet been documented. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add the "colour" and "cpair" commandsMichael Brown2013-12-091-0/+125
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-052-14/+13Star
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "console" command to configure consoleMichael Brown2013-11-281-0/+125
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Generate command option help text automaticallyMichael Brown2013-11-0716-67/+69
| | | | | | | Generate the command option help text automatically from the list of defined options. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Make "dhcp" command a synonym for "ifconf"Michael Brown2013-11-052-49/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "ifconf" commandMichael Brown2013-11-051-0/+59
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Allow "if<xxx>" commands to take optionsMichael Brown2013-11-054-52/+121
| | | | | | | Allow commands implemented using ifcommon_exec() to accept command-specific options. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Rewrite "sync" command to use monojob_wait()Michael Brown2013-11-011-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add parse_timeout()Michael Brown2013-11-013-11/+9Star
| | | | | | | | Parsing a timeout value (specified in milliseconds) into an internal timeout value measured in timer ticks is a common operation. Provide a parse_timeout() value to carry out this conversion automatically. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "ping" commandMichael Brown2013-10-211-0/+100
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "nstat" commandMichael Brown2013-09-251-0/+69
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "params" and "param" commands to manage form parameter listsMichael Brown2013-08-191-0/+162
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "pciscan" command to allow iteration over PCI devicesMichael Brown2013-08-051-0/+114
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "inc" commandMichael Brown2013-08-011-0/+72
| | | | | | | | The "inc" command allows the numeric value of a setting to be incremented, allowing for the construction of simple loops within an iPXE script. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate calls to {fetch,store}f_named_setting() in NVO commandsMichael Brown2013-07-221-40/+56
| | | | | | | | | | | | | | | | | A deliberate side effect of this commit is that the "read" command will now preserve the type of the setting, if the setting name contains no type information. For example: iPXE> set foo:ipv4 192.168.0.1 iPXE> read foo 192.168.0.100 iPXE> show foo foo:ipv4 = 192.168.0.100 rather than the arguably unexpected behaviour of resetting the type to "string". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate call to storef_named_setting() in choose_exec()Michael Brown2013-07-221-5/+12
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Move parse_settings() to parseopt.cMichael Brown2013-07-221-22/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Allow parsed option to be modifiedMichael Brown2013-07-224-10/+9Star
| | | | | | | Parsing a setting name requires the ability to modify the text being parsed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Avoid relying on global variable within ifcommon_exec()Michael Brown2013-07-151-4/+3Star
| | | | | | | | | | | | | | | The getopt API defines optind as a global variable. When used by the "autoboot" command, the payload function passed to ifcommon_exec() may result in a new iPXE script being executed; the commands therein would then overwrite the value of optind. On returning, ifcommon_exec() would continue processing the list of interfaces from an undefined point. Fix by using a local variable to hold the index within the list of interfaces. Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "poweroff" commandMarin Hannache2013-07-151-0/+72
| | | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add ability to perform a warm rebootMichael Brown2013-03-221-4/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add "reboot" command for EFIMichael Brown2013-03-221-0/+67
| | | | | | | | | Abstract out the ability to reboot the system to a separate reboot() function (with platform-specific implementations), add an EFI implementation, and make the existing "reboot" command available under EFI. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [readline] Allow readline_history() to return a meaningful statusMichael Brown2012-10-251-5/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Prefill existing setting value in "read" commandMichael Brown2012-10-251-8/+22
| | | | | | | | When prompting the user to enter a setting value via the "read" command, prefill the input buffer with the setting's current value. Requested-by: Ján Ondrej (SAL) <ondrejj@salstar.ks> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add standalone "nslookup" commandPatrick Plenefisch2012-09-101-0/+79
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use a generic setting's own type as its default typeMichael Brown2012-09-102-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When fetching a named setting using a name that does not explicitly specify a type, default to using the type stored when the setting was created, rather than always defaulting to "string". This allows the behaviour of user-defined settings to match the behaviour of predefined settings (which have a sensible default type). For example: set server:ipv4 192.168.0.1 echo ${server} will now print "192.168.0.1", rather than trying to print out the raw IPv4 address bytes as a string. The downside of this change is that existing tricks for printing special characters within scripts may require (backwards-compatible) modification. For example, the "clear screen" sequence: set esc:hex 1b set cls ${esc}[2J echo ${cls} will now have to become set esc:hex 1b set cls ${esc:string}[2J # Must now explicitly specify ":string" echo ${cls} Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-2019-19/+38
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--replace" optionMichael Brown2012-07-201-5/+54
| | | | | | | | | 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>
* [image] Add "--autofree" optionMichael Brown2012-07-201-3/+12
| | | | | | | Allow images to be automatically freed after execution completes (successfully or otherwise). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Increase resolution of "time" commandMichael Brown2012-06-271-3/+6
| | | | | | | | | A reasonably large (512MB) file transferred via HTTP over Gigabit Ethernet should complete in around 4.6 seconds. Increase the resolution of the "time" command to tenths of a second, to allow such transfers to be meaningfully measured. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "sync" commandMichael Brown2012-06-091-0/+82
| | | | | | | 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>
* [menu] Add "--default" option to "choose" commandMichael Brown2012-04-291-3/+7
| | | | | Suggested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Add menu commandsMichael Brown2012-03-291-0/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [image] Add the "imgtrust" and "imgverify" commandsMichael Brown2012-03-251-0/+172
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image management commands and internal APIMichael Brown2012-03-252-225/+173Star
| | | | | | | | | | | | | | | | | | | | | | 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] Eliminate the register_and_xxx_image() functionsMichael Brown2011-10-251-6/+3Star
| | | | | | | | 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>
* [cmdline] Make "sleep" command available by defaultMichael Brown2011-10-241-40/+0Star
| | | | | | | | | | | | | | | The "sleep" command is generally useful to have. For example: :dhcp_retry dhcp && goto dhcp_done sleep 5 goto dhcp_retry :dhcp_done Make the "sleep" command available by default, leaving TIME_CMD controlling only the (fairly specialist) "time" command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sanboot] Add "sanhook" and "sanunhook" commandsMichael Brown2011-04-241-20/+114
| | | | | | | Expose the multiple-SAN-drive capability of the iPXE core via the iPXE command line by adding commands to hook and unhook additional drives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Remove redundant call to basename()Michael Brown2011-03-271-3/+0Star
| | | | | | | | | There is no need to explicitly call basename() to construct an image name in imgfetch_core_exec(), since image_set_uri() will do so automatically anyway (and will do so without getting confused by URIs with query strings). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add "read" commandMichael Brown2011-03-271-39/+88
| | | | | | | | | | | | The "read" command allows a script to prompt a user to enter a setting. For example: echo -n Static IP address: read net0/ip Total cost: 17 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display canonical setting name in output of "show" commandMichael Brown2011-03-221-4/+6
| | | | | | | | | | | | | | | | | | Enable the "show" command to display the full, canonicalised name of the fetched setting. For example: iPXE> show mac net0/mac:hex = 52:54:00:12:34:56 iPXE> dhcp && show ip DHCP (net0 52:54:00:12:34:56)... ok net0.dhcp/ip:ipv4 = 10.0.0.168 iPXE> show net0/6 net0.dhcp/dns:ipv4 = 10.0.0.6 Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use concat_args() in "set" commandMichael Brown2011-03-221-24/+20Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify use of imgdownload()Michael Brown2011-03-091-56/+55Star
| | | | | | | 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>