summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2011-03-09 14:11:35 +0100
committerMichael Brown2011-03-09 14:11:35 +0100
commitd17a84a056a412f10a85985dc2c43b6fbedd0abd (patch)
treeb01b63c97beef21ee33ac541d86c600580c5a7ce
parent[monojob] Display percentage progress, if available (diff)
downloadipxe-d17a84a056a412f10a85985dc2c43b6fbedd0abd.tar.gz
ipxe-d17a84a056a412f10a85985dc2c43b6fbedd0abd.tar.xz
ipxe-d17a84a056a412f10a85985dc2c43b6fbedd0abd.zip
[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>
-rw-r--r--src/core/image.c39
-rw-r--r--src/include/ipxe/image.h2
-rw-r--r--src/include/usr/imgmgmt.h2
-rw-r--r--src/usr/imgmgmt.c39
4 files changed, 41 insertions, 41 deletions
diff --git a/src/core/image.c b/src/core/image.c
index 6caa02434..afb647d23 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -286,42 +286,3 @@ struct image * image_find_selected ( void ) {
}
return NULL;
}
-
-/**
- * Register and select an image
- *
- * @v image Executable image
- * @ret rc Return status code
- */
-int register_and_select_image ( struct image *image ) {
- int rc;
-
- if ( ( rc = register_image ( image ) ) != 0 )
- return rc;
-
- if ( ( rc = image_probe ( image ) ) != 0 )
- return rc;
-
- if ( ( rc = image_select ( image ) ) != 0 )
- return rc;
-
- return 0;
-}
-
-/**
- * Register and boot an image
- *
- * @v image Image
- * @ret rc Return status code
- */
-int register_and_boot_image ( struct image *image ) {
- int rc;
-
- if ( ( rc = register_and_select_image ( image ) ) != 0 )
- return rc;
-
- if ( ( rc = image_exec ( image ) ) != 0 )
- return rc;
-
- return 0;
-}
diff --git a/src/include/ipxe/image.h b/src/include/ipxe/image.h
index 96466ee40..539f8ca39 100644
--- a/src/include/ipxe/image.h
+++ b/src/include/ipxe/image.h
@@ -143,8 +143,6 @@ extern int image_probe ( struct image *image );
extern int image_exec ( struct image *image );
extern int image_select ( struct image *image );
extern struct image * image_find_selected ( void );
-extern int register_and_select_image ( struct image *image );
-extern int register_and_boot_image ( struct image *image );
/**
* Increment reference count on an image
diff --git a/src/include/usr/imgmgmt.h b/src/include/usr/imgmgmt.h
index 6660039c4..4299937fd 100644
--- a/src/include/usr/imgmgmt.h
+++ b/src/include/usr/imgmgmt.h
@@ -11,6 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/image.h>
+extern int register_and_select_image ( struct image *image );
+extern int register_and_boot_image ( struct image *image );
extern int imgdownload ( struct image *image, struct uri *uri,
int ( * action ) ( struct image *image ) );
extern int imgfetch ( struct image *image, const char *uri_string,
diff --git a/src/usr/imgmgmt.c b/src/usr/imgmgmt.c
index 6eefdfa5f..f375db868 100644
--- a/src/usr/imgmgmt.c
+++ b/src/usr/imgmgmt.c
@@ -36,6 +36,45 @@ FILE_LICENCE ( GPL2_OR_LATER );
*/
/**
+ * Register and select an image
+ *
+ * @v image Executable image
+ * @ret rc Return status code
+ */
+int register_and_select_image ( struct image *image ) {
+ int rc;
+
+ if ( ( rc = register_image ( image ) ) != 0 )
+ return rc;
+
+ if ( ( rc = image_probe ( image ) ) != 0 )
+ return rc;
+
+ if ( ( rc = image_select ( image ) ) != 0 )
+ return rc;
+
+ return 0;
+}
+
+/**
+ * Register and boot an image
+ *
+ * @v image Image
+ * @ret rc Return status code
+ */
+int register_and_boot_image ( struct image *image ) {
+ int rc;
+
+ if ( ( rc = register_and_select_image ( image ) ) != 0 )
+ return rc;
+
+ if ( ( rc = image_exec ( image ) ) != 0 )
+ return rc;
+
+ return 0;
+}
+
+/**
* Download an image
*
* @v image Image