Blame SOURCES/0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch

6b3c76
From 05a567228906c64062e4cbaa66245e15aea1b39d Mon Sep 17 00:00:00 2001
a85e8e
From: Vladimir Serbinenko <phcoder@gmail.com>
a85e8e
Date: Sat, 28 Dec 2013 17:25:14 +0100
6b3c76
Subject: [PATCH 008/261] Don't abort() on unavailable coreboot tables if not
6b3c76
 running on coreboot.
a85e8e
a85e8e
---
6b3c76
 ChangeLog                              | 4 ++++
a85e8e
 grub-core/kern/i386/coreboot/cbtable.c | 2 +-
a85e8e
 grub-core/kern/i386/coreboot/init.c    | 5 +++++
a85e8e
 3 files changed, 10 insertions(+), 1 deletion(-)
a85e8e
6b3c76
diff --git a/ChangeLog b/ChangeLog
6b3c76
index 0401f6154..ed6d77cc8 100644
6b3c76
--- a/ChangeLog
6b3c76
+++ b/ChangeLog
6b3c76
@@ -1,3 +1,7 @@
6b3c76
+2013-12-28  Vladimir Serbinenko  <phcoder@gmail.com>
6b3c76
+
6b3c76
+	Don't abort() on unavailable coreboot tables if not running on coreboot.
6b3c76
+
6b3c76
 2013-12-28  Andrey Borzenkov <arvidjaar@gmail.com>
6b3c76
 
6b3c76
 	* grub-core/kern/emu/misc.c: Remove unused error.h; fixes compilation
a85e8e
diff --git a/grub-core/kern/i386/coreboot/cbtable.c b/grub-core/kern/i386/coreboot/cbtable.c
6b3c76
index e3bb7b2e0..1669bc0ca 100644
a85e8e
--- a/grub-core/kern/i386/coreboot/cbtable.c
a85e8e
+++ b/grub-core/kern/i386/coreboot/cbtable.c
a85e8e
@@ -55,7 +55,7 @@ grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t,
a85e8e
     if (check_signature (table_header))
a85e8e
       goto signature_found;
a85e8e
 
a85e8e
-  grub_fatal ("Could not find coreboot table\n");
a85e8e
+  return 0;
a85e8e
 
a85e8e
 signature_found:
a85e8e
 
a85e8e
diff --git a/grub-core/kern/i386/coreboot/init.c b/grub-core/kern/i386/coreboot/init.c
6b3c76
index 6b150b47d..3314f027f 100644
a85e8e
--- a/grub-core/kern/i386/coreboot/init.c
a85e8e
+++ b/grub-core/kern/i386/coreboot/init.c
a85e8e
@@ -51,6 +51,7 @@ grub_exit (void)
a85e8e
 
a85e8e
 grub_addr_t grub_modbase = GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR;
a85e8e
 static grub_uint64_t modend;
a85e8e
+static int have_memory = 0;
a85e8e
 
a85e8e
 /* Helper for grub_machine_init.  */
a85e8e
 static int
a85e8e
@@ -82,6 +83,8 @@ heap_init (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
a85e8e
 
a85e8e
   grub_mm_init_region ((void *) (grub_addr_t) begin, (grub_size_t) (end - begin));
a85e8e
 
a85e8e
+  have_memory = 1;
a85e8e
+
a85e8e
   return 0;
a85e8e
 }
a85e8e
 
a85e8e
@@ -97,6 +100,8 @@ grub_machine_init (void)
a85e8e
   grub_vga_text_init ();
a85e8e
 
a85e8e
   grub_machine_mmap_iterate (heap_init, NULL);
a85e8e
+  if (!have_memory)
a85e8e
+    grub_fatal ("No memory found");
a85e8e
 
a85e8e
   grub_video_coreboot_fb_late_init ();
a85e8e
 
6b3c76
-- 
6b3c76
2.13.5
6b3c76