dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0001-Fix-exit-back-to-EFI-firmware.patch

39700a
From a919488cc979e1c4f5bd468bb97c6e9562af0e5a Mon Sep 17 00:00:00 2001
39700a
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
39700a
Date: Fri, 15 Aug 2014 11:29:22 -0400
39700a
Subject: [PATCH] Fix exit back to EFI firmware
39700a
39700a
Arm/AArch64 machines set up a timer event which is not getting
39700a
canceled when returning to firmware. This is because grub_exit()
39700a
calls grub_efi_fini() instead of grub_machine_fini(). The latter
39700a
will shutdown the timer (and other machine-specific things) as
39700a
well as make the call to grub_efi_fini().
39700a
---
39700a
 grub-core/kern/arm/efi/init.c | 2 +-
39700a
 grub-core/kern/efi/efi.c      | 3 ++-
39700a
 2 files changed, 3 insertions(+), 2 deletions(-)
39700a
39700a
diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c
39700a
index 0c17d83..06df60e 100644
39700a
--- a/grub-core/kern/arm/efi/init.c
39700a
+++ b/grub-core/kern/arm/efi/init.c
39700a
@@ -67,7 +67,7 @@ grub_machine_fini (int flags)
39700a
 
39700a
   b = grub_efi_system_table->boot_services;
39700a
 
39700a
-  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0);
39700a
+  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0);
39700a
   efi_call_1 (b->close_event, tmr_evt);
39700a
 
39700a
   grub_efi_fini ();
39700a
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
39700a
index 394e9fd..1e96754 100644
39700a
--- a/grub-core/kern/efi/efi.c
39700a
+++ b/grub-core/kern/efi/efi.c
39700a
@@ -27,6 +27,7 @@
39700a
 #include <grub/term.h>
39700a
 #include <grub/kernel.h>
39700a
 #include <grub/mm.h>
39700a
+#include <grub/loader.h>
39700a
 
39700a
 /* The handle of GRUB itself. Filled in by the startup code.  */
39700a
 grub_efi_handle_t grub_efi_image_handle;
39700a
@@ -156,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle)
39700a
 void
39700a
 grub_exit (void)
39700a
 {
39700a
-  grub_efi_fini ();
39700a
+  grub_machine_fini (GRUB_LOADER_FLAG_NORETURN);
39700a
   efi_call_4 (grub_efi_system_table->boot_services->exit,
39700a
               grub_efi_image_handle, GRUB_EFI_LOAD_ERROR, 0, 0);
39700a
   for (;;) ;
39700a
-- 
39700a
1.9.3
39700a