[systemd-devel] [PATCH 1/2] Autodetect both x64 and ia32 boot*.efi payloads

Darren Hart dvhart at linux.intel.com
Wed Aug 21 15:38:07 PDT 2013


The EFI specification documents /EFI/BOOT/bootx64.efi for x86_64
machines and /EFI/BOOT/bootia32.efi for ia32 machines. Update the auto
detection to allow for both.

Add the MACHINE_TYPE_NAME define to the efi/src build so we can use it
as the standard suffix for the EFI payloads (ia32 or x64).

Signed-off-by: Darren Hart <dvhart at linux.intel.com>
---
 Makefile.am         | 3 ++-
 src/efi/gummiboot.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2678ab3..062f83e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -80,7 +80,8 @@ efi_cppflags = \
 	$(EFI_CPPFLAGS) \
 	-I$(top_builddir) -include config.h \
 	-I$(EFI_INCDIR)/efi \
-	-I$(EFI_INCDIR)/efi/$(ARCH)
+	-I$(EFI_INCDIR)/efi/$(ARCH) \
+	-DMACHINE_TYPE_NAME=\"$(MACHINE_TYPE_NAME)\"
 
 efi_cflags = \
 	$(EFI_CFLAGS) \
diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c
index 9f2f31d..123433f 100644
--- a/src/efi/gummiboot.c
+++ b/src/efi/gummiboot.c
@@ -2197,9 +2197,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
         config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
                                      L"auto-windows", 'w', L"Windows Boot Manager", L"\\EFI\\Microsoft\\Boot\\bootmgfw.efi");
         config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
-                                     L"auto-efi-shell", 's', L"EFI Shell", L"\\shellx64.efi");
+                                     L"auto-efi-shell", 's', L"EFI Shell", L"\\shell" MACHINE_TYPE_NAME ".efi");
         config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
-                                     L"auto-efi-default", '\0', L"EFI Default Loader", L"\\EFI\\BOOT\\BOOTX64.EFI");
+                                     L"auto-efi-default", '\0', L"EFI Default Loader", L"\\EFI\\BOOT\\BOOT" MACHINE_TYPE_NAME ".EFI");
         config_entry_add_osx(&config);
         efivar_set(L"LoaderEntriesAuto", config.entries_auto, FALSE);
 
-- 
1.8.3.1



More information about the systemd-devel mailing list