[ipxe-devel] [PATCH 6/6] [multiboot2] add support for probing mb2 images on EFI

Doug Goldstein cardoe at cardoe.com
Thu Jan 26 21:35:01 UTC 2017


From: Jonathan Creekmore <jonathan at thecreekmores.org>

This adds support for probing for multiboot2 images when booting from
EFI.

Signed-off-by: Jonathan Creekmore <jonathan at thecreekmores.org>
---
 src/config/config.c       |  3 +++
 src/config/defaults/efi.h |  1 +
 src/include/ipxe/image.h  | 15 ++++++++++++---
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/config/config.c b/src/config/config.c
index faf9aef..98f10f3 100644
--- a/src/config/config.c
+++ b/src/config/config.c
@@ -156,6 +156,9 @@ REQUIRE_OBJECT ( elfboot );
 #ifdef IMAGE_MULTIBOOT
 REQUIRE_OBJECT ( multiboot );
 #endif
+#ifdef IMAGE_MULTIBOOT2
+REQUIRE_OBJECT ( multiboot2 );
+#endif
 #ifdef IMAGE_PXE
 REQUIRE_OBJECT ( pxe_image );
 #endif
diff --git a/src/config/defaults/efi.h b/src/config/defaults/efi.h
index 2e4c283..6c57d27 100644
--- a/src/config/defaults/efi.h
+++ b/src/config/defaults/efi.h
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #define	IMAGE_EFI		/* EFI image support */
 #define	IMAGE_SCRIPT		/* iPXE script image support */
+#define	IMAGE_MULTIBOOT2		/* Multiboot2 image support */
 
 #define	SANBOOT_PROTO_ISCSI	/* iSCSI protocol */
 #define	SANBOOT_PROTO_AOE	/* AoE protocol */
diff --git a/src/include/ipxe/image.h b/src/include/ipxe/image.h
index 2e7eb4c..f0bc8c5 100644
--- a/src/include/ipxe/image.h
+++ b/src/include/ipxe/image.h
@@ -116,17 +116,26 @@ struct image_type {
 };
 
 /**
+ * Multiboot2 image probe priority
+ *
+ * Multiboot2 images are also valid executables in another format
+ * (e.g. ELF) AND might also have multiboot headers on them, so we
+ * must perform the multiboot2 probe first.
+ */
+#define PROBE_MULTIBOOT2 01
+
+/**
  * Multiboot image probe priority
  *
  * Multiboot images are also valid executables in another format
  * (e.g. ELF), so we must perform the multiboot probe first.
  */
-#define PROBE_MULTIBOOT	01
+#define PROBE_MULTIBOOT	02
 
 /**
  * Normal image probe priority
  */
-#define PROBE_NORMAL 02
+#define PROBE_NORMAL 03
 
 /**
  * PXE image probe priority
@@ -134,7 +143,7 @@ struct image_type {
  * PXE images have no signature checks, so will claim all image files.
  * They must therefore be tried last in the probe order list.
  */
-#define PROBE_PXE 03
+#define PROBE_PXE 04
 
 /** Executable image type table */
 #define IMAGE_TYPES __table ( struct image_type, "image_types" )
-- 
git-series 0.9.1



More information about the ipxe-devel mailing list