dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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