From abfe94a90ad72f4be2055f3ad21f09ab081cc250 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 21 Aug 2015 16:15:24 +0100 Subject: [image] Detect image type when image is first registered The current usage pattern of image_probe() is a legacy from the time before commit 34b6ecb ("[image] Simplify image management") when loading an image to its executable location in memory was a separate action from actually executing the image. Call image_probe() as soon as an image is registered. This allows "imgstat" to display image type information for all images and allows image-consuming code to assume that image->type is already set correctly. Ignore failures if image_probe() does not recognise the image, since we do expect to handle unrecognised images (initrds, modules, etc). Unrecognised images will be left with a NULL image->type, which image-consuming code can easily check. Signed-off-by: Michael Brown --- src/include/ipxe/image.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/include') diff --git a/src/include/ipxe/image.h b/src/include/ipxe/image.h index 5d003842a..6abd7a2d2 100644 --- a/src/include/ipxe/image.h +++ b/src/include/ipxe/image.h @@ -163,7 +163,6 @@ extern int image_set_cmdline ( struct image *image, const char *cmdline ); extern int register_image ( struct image *image ); extern void unregister_image ( struct image *image ); struct image * find_image ( const char *name ); -extern int image_probe ( struct image *image ); extern int image_exec ( struct image *image ); extern int image_replace ( struct image *replacement ); extern int image_select ( struct image *image ); -- cgit v1.2.3-55-g7522