dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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