[syslinux:firmware] efi: update derivative info on boot

syslinux-bot for Matt Fleming matt.fleming at intel.com
Wed Jul 3 04:27:06 PDT 2013


Commit-ID:  b63e0f20f7f6717eaca978a0c499b953949c6dd2
Gitweb:     http://www.syslinux.org/commit/b63e0f20f7f6717eaca978a0c499b953949c6dd2
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Wed, 3 Jul 2013 11:41:24 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 3 Jul 2013 12:12:18 +0100

efi: update derivative info on boot

Various bits of Syslinux use the filesystem type of the derivative info
structure to figure out how we were booted. Update this for SYSLINUX and
PXELINUX.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 efi/derivative.c | 15 +++++++--------
 efi/efi.h        |  3 +++
 efi/main.c       |  5 ++++-
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/efi/derivative.c b/efi/derivative.c
index 4391d4c..ca43b98 100644
--- a/efi/derivative.c
+++ b/efi/derivative.c
@@ -1,10 +1,3 @@
-/*
- * We don't have separate boot loader derivatives under EFI, rather,
- * the derivative info reflects the capabilities of the machine. For
- * instance, if we have the PXE Base Code Protocol, then we support
- * PXELINUX, if we have the Disk I/O Protocol, we support SYSLINUX,
- * etc.
- */
 #include <syslinux/config.h>
 
 /*
@@ -14,7 +7,13 @@
 struct syslinux_ipinfo IPInfo;
 uint16_t APIVer;		/* PXE API version found */
 
+static enum syslinux_filesystem __filesystem;
+
+void efi_derivative(enum syslinux_filesystem fs)
+{
+    __filesystem = fs;
+}
 __export void get_derivative_info(union syslinux_derivative_info *di)
 {
-	di->disk.filesystem = SYSLINUX_FS_SYSLINUX;
+	di->disk.filesystem = __filesystem;
 }
diff --git a/efi/efi.h b/efi/efi.h
index 9bb0e20..72d08e1 100644
--- a/efi/efi.h
+++ b/efi/efi.h
@@ -1,6 +1,7 @@
 #ifndef _SYSLINUX_EFI_H
 #define _SYSLINUX_EFI_H
 
+#include <syslinux/config.h>
 #include <core.h>
 #include <sys/types.h>	/* needed for off_t */
 //#include <syslinux/version.h> /* avoid redefinition of __STDC_VERSION__ */
@@ -61,4 +62,6 @@ efi_setup_event(EFI_EVENT *ev, EFI_EVENT_NOTIFY func, void *ctx)
     return status;
 }
 
+extern void efi_derivative(enum syslinux_filesystem fs);
+
 #endif /* _SYSLINUX_EFI_H */
diff --git a/efi/main.c b/efi/main.c
index 757cf32..f21b66e 100644
--- a/efi/main.c
+++ b/efi/main.c
@@ -1202,9 +1202,12 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table)
 			goto out;
 		}
 
+		efi_derivative(SYSLINUX_FS_SYSLINUX);
 		ops[0] = &vfat_fs_ops;
-	} else
+	} else {
+		efi_derivative(SYSLINUX_FS_PXELINUX);
 		ops[0] = &pxe_fs_ops;
+	}
 
 	/* setup timer for boot menu system support */
 	status = setup_default_timer(&timer_ev);


More information about the Syslinux-commits mailing list