diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-05-04 14:21:42 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-05-05 14:54:20 +0100 |
commit | f9beb20e99abbfcbea7cf222ba692aa3cbf10df7 (patch) | |
tree | 337aef1fa6a9a454a36fd54f278db82791c69394 /src/arch | |
parent | f93e6b712ff2beb7ea4e169a681b8144785f3e49 (diff) | |
download | ipxe-f9beb20e99abbfcbea7cf222ba692aa3cbf10df7.tar.gz |
[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/arch')
-rw-r--r-- | src/arch/x86/image/bzimage.c | 4 | ||||
-rw-r--r-- | src/arch/x86/image/multiboot.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/arch/x86/image/bzimage.c b/src/arch/x86/image/bzimage.c index b15bd5563..2c776147d 100644 --- a/src/arch/x86/image/bzimage.c +++ b/src/arch/x86/image/bzimage.c @@ -355,6 +355,10 @@ static size_t bzimage_load_initrd ( struct image *image, size_t offset; size_t pad_len; + /* Skip hidden images */ + if ( initrd->flags & IMAGE_HIDDEN ) + return 0; + /* Create cpio header for non-prebuilt images */ offset = cpio_header ( initrd, &cpio ); diff --git a/src/arch/x86/image/multiboot.c b/src/arch/x86/image/multiboot.c index c1c63bc97..cada021ab 100644 --- a/src/arch/x86/image/multiboot.c +++ b/src/arch/x86/image/multiboot.c @@ -204,6 +204,10 @@ static int multiboot_add_modules ( struct image *image, physaddr_t start, break; } + /* Skip hidden images */ + if ( module_image->flags & IMAGE_HIDDEN ) + continue; + /* Page-align the module */ start = ( ( start + 0xfff ) & ~0xfff ); |