summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2023-05-04 15:21:42 +0200
committerMichael Brown2023-05-05 15:54:20 +0200
commitf9beb20e99abbfcbea7cf222ba692aa3cbf10df7 (patch)
tree337aef1fa6a9a454a36fd54f278db82791c69394 /src/include
parent[efi] Show original filenames in debug messages (diff)
downloadipxe-f9beb20e99abbfcbea7cf222ba692aa3cbf10df7.tar.gz
ipxe-f9beb20e99abbfcbea7cf222ba692aa3cbf10df7.tar.xz
ipxe-f9beb20e99abbfcbea7cf222ba692aa3cbf10df7.zip
[image] Allow for images to be hidden from lists of all images
When invoking a kernel via the UEFI shim, the kernel (and potentially also a helper binary such as GRUB) must be accessible via the virtual filesystem exposed via EFI_SIMPLE_FILE_SYSTEM_PROTOCOL but must not be present in the magic initrd constructed from all registered images. Allow for images to be flagged as hidden, which will cause them to be excluded from API-level lists of all images such as the virtual filesystem directory contents, the magic initrd, or the Multiboot module list. Hidden images remain visible to iPXE commands including "imgstat", which will show a "[HIDDEN]" flag for such images. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/image.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/include/ipxe/image.h b/src/include/ipxe/image.h
index 9e0c0f22..e00af82e 100644
--- a/src/include/ipxe/image.h
+++ b/src/include/ipxe/image.h
@@ -72,6 +72,9 @@ struct image {
/** Image will be automatically unregistered after execution */
#define IMAGE_AUTO_UNREGISTER 0x0008
+/** Image will be hidden from enumeration */
+#define IMAGE_HIDDEN 0x0010
+
/** An executable image type */
struct image_type {
/** Name of this image type */
@@ -162,15 +165,6 @@ extern struct image *current_image;
list_for_each_entry_safe ( (image), (tmp), &images, list )
/**
- * Test for existence of images
- *
- * @ret existence Some images exist
- */
-static inline int have_images ( void ) {
- return ( ! list_empty ( &images ) );
-}
-
-/**
* Retrieve first image
*
* @ret image Image, or NULL