nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0001-fix-EFI-detection-on-Windows.patch

28f7f8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
39700a
From: Andrey Borzenkov <arvidjaar@gmail.com>
39700a
Date: Wed, 25 Dec 2013 22:36:28 +0400
28f7f8
Subject: [PATCH] fix EFI detection on Windows
39700a
39700a
We are on legacy BIOS if GetFirmwareEnvironmentVariable fails (returns
39700a
zero) *and* extended error information is ERROR_INVALID_FUNCTION.
39700a
39700a
Cf. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724325%28v=vs.85%29.aspx
39700a
---
39700a
 grub-core/osdep/windows/platform.c | 2 +-
28f7f8
 ChangeLog                          | 5 +++++
39700a
 2 files changed, 6 insertions(+), 1 deletion(-)
39700a
39700a
diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c
28f7f8
index f2b9d714329..d217efe1704 100644
39700a
--- a/grub-core/osdep/windows/platform.c
39700a
+++ b/grub-core/osdep/windows/platform.c
39700a
@@ -100,7 +100,7 @@ get_platform (void)
39700a
 
39700a
   if (!func_GetFirmwareEnvironmentVariableW (L"BootOrder", GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR,
39700a
 					     buffer, sizeof (buffer))
39700a
-      && GetLastError () != ERROR_INVALID_FUNCTION)
39700a
+      && GetLastError () == ERROR_INVALID_FUNCTION)
39700a
     {
39700a
       platform = PLAT_BIOS;
39700a
       return;
28f7f8
diff --git a/ChangeLog b/ChangeLog
28f7f8
index 41bcebfb321..21ec1c77c57 100644
28f7f8
--- a/ChangeLog
28f7f8
+++ b/ChangeLog
28f7f8
@@ -1,3 +1,8 @@
28f7f8
+2013-12-25  Andrey Borzenkov <arvidjaar@gmail.com>
28f7f8
+
28f7f8
+	* grub-core/osdep/windows/platform.c (get_platform): Fix EFI
28f7f8
+	detection.
28f7f8
+
28f7f8
 2013-12-24  Vladimir Serbinenko  <phcoder@gmail.com>
28f7f8
 
28f7f8
 	* configure.ac: Set version to 2.02~beta2.