summaryrefslogtreecommitdiffstats
path: root/src/usr/imgmgmt.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-12 08:32:46 +0100
committerMichael Brown2007-01-12 08:32:46 +0100
commit2876197306df09f003024784feb197d7ef14b0f8 (patch)
treec2e1aad526a44e59d6cf35be6535c23b07ebb74e /src/usr/imgmgmt.c
parentCleaner separation between imgXXX() functions and image_cmd.c (diff)
downloadipxe-2876197306df09f003024784feb197d7ef14b0f8.tar.gz
ipxe-2876197306df09f003024784feb197d7ef14b0f8.tar.xz
ipxe-2876197306df09f003024784feb197d7ef14b0f8.zip
Allow "imgexec" with no arguments to boot the file that was loaded with
"kernel".
Diffstat (limited to 'src/usr/imgmgmt.c')
-rw-r--r--src/usr/imgmgmt.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/usr/imgmgmt.c b/src/usr/imgmgmt.c
index de71dee1..2c949ae2 100644
--- a/src/usr/imgmgmt.c
+++ b/src/usr/imgmgmt.c
@@ -91,6 +91,22 @@ int imgexec ( struct image *image ) {
}
/**
+ * Identify the first loaded image
+ *
+ * @ret image Image, or NULL
+ */
+struct image * imgautoselect ( void ) {
+ struct image *image;
+
+ for_each_image ( image ) {
+ if ( image->flags & IMAGE_LOADED )
+ return image;
+ }
+
+ return NULL;
+}
+
+/**
* Display status of an image
*
* @v image Executable/loadable image