Index: grub-2.00/gentpl.py
===================================================================
--- grub-2.00.orig/gentpl.py
+++ grub-2.00/gentpl.py
@@ -605,7 +605,7 @@ def module(defn, platform):
     var_set(cname(defn) + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_MODULE) " + platform_ccasflags(defn, platform))
     var_set(cname(defn) + "_DEPENDENCIES", "$(TARGET_OBJ2ELF) " + platform_dependencies(defn, platform))
 
-    gvar_add("dist_noinst_DATA", extra_dist(defn))
+    gvar_add("EXTRA_DIST", extra_dist(defn))
     gvar_add("BUILT_SOURCES", "$(nodist_" + cname(defn) + "_SOURCES)")
     gvar_add("CLEANFILES", "$(nodist_" + cname(defn) + "_SOURCES)")
 
@@ -633,7 +633,7 @@ def kernel(defn, platform):
     var_set(cname(defn) + "_STRIPFLAGS", "$(AM_STRIPFLAGS) $(STRIPFLAGS_KERNEL) " + platform_stripflags(defn, platform))
     var_set(cname(defn) + "_DEPENDENCIES", "$(TARGET_OBJ2ELF)")
 
-    gvar_add("dist_noinst_DATA", extra_dist(defn))
+    gvar_add("EXTRA_DIST", extra_dist(defn))
     gvar_add("BUILT_SOURCES", "$(nodist_" + cname(defn) + "_SOURCES)")
     gvar_add("CLEANFILES", "$(nodist_" + cname(defn) + "_SOURCES)")
 
@@ -666,7 +666,7 @@ def image(defn, platform):
     var_set(cname(defn) + "_OBJCOPYFLAGS", "$(OBJCOPYFLAGS_IMAGE) " + platform_objcopyflags(defn, platform))
     # var_set(cname(defn) + "_DEPENDENCIES", platform_dependencies(defn, platform) + " " + platform_ldadd(defn, platform))
 
-    gvar_add("dist_noinst_DATA", extra_dist(defn))
+    gvar_add("EXTRA_DIST", extra_dist(defn))
     gvar_add("BUILT_SOURCES", "$(nodist_" + cname(defn) + "_SOURCES)")
     gvar_add("CLEANFILES", "$(nodist_" + cname(defn) + "_SOURCES)")
 
@@ -701,7 +701,7 @@ def library(defn, platform):
     var_add(cname(defn) + "_CCASFLAGS", first_time(defn, "$(AM_CCASFLAGS) $(CCASFLAGS_LIBRARY) ") + platform_ccasflags(defn, platform))
     # var_add(cname(defn) + "_DEPENDENCIES", platform_dependencies(defn, platform) + " " + platform_ldadd(defn, platform))
 
-    gvar_add("dist_noinst_DATA", extra_dist(defn))
+    gvar_add("EXTRA_DIST", extra_dist(defn))
     if name not in seen_target:
         gvar_add("BUILT_SOURCES", "$(nodist_" + cname(defn) + "_SOURCES)")
         gvar_add("CLEANFILES", "$(nodist_" + cname(defn) + "_SOURCES)")
@@ -743,13 +743,14 @@ def program(defn, platform, test=False):
     var_set(cname(defn) + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_PROGRAM) " + platform_ccasflags(defn, platform))
     # var_set(cname(defn) + "_DEPENDENCIES", platform_dependencies(defn, platform) + " " + platform_ldadd(defn, platform))
 
-    gvar_add("dist_noinst_DATA", extra_dist(defn))
+    gvar_add("EXTRA_DIST", extra_dist(defn))
     gvar_add("BUILT_SOURCES", "$(nodist_" + cname(defn) + "_SOURCES)")
     gvar_add("CLEANFILES", "$(nodist_" + cname(defn) + "_SOURCES)")
 
 def data(defn, platform):
-    var_add("dist_" + installdir(defn) + "_DATA", platform_sources(defn, platform))
-    gvar_add("dist_noinst_DATA", extra_dist(defn))
+    gvar_add("dist_noinst_DATA", platform_sources(defn, platform))
+    gvar_add("EXTRA_DIST", extra_dist(defn))
+    var_add(installdir(defn) + "_DATA", platform_sources(defn, platform))
 
 def script(defn, platform):
     name = defn['name']
Index: grub-2.00/util/grub-mkimagexx.c
===================================================================
--- grub-2.00.orig/util/grub-mkimagexx.c
+++ grub-2.00/util/grub-mkimagexx.c
@@ -63,7 +63,7 @@
 #endif
 
 static void
-SUFFIX (generate_elf) (const struct grub_install_image_target_desc *image_target,
+SUFFIX (generate_elf) (struct image_target_desc *image_target,
 		       int note, char **core_img, size_t *core_size,
 		       Elf_Addr target_addr, grub_size_t align,
 		       size_t kernel_size, size_t bss_size)
Index: grub-2.00/grub-core/io/offset.c
===================================================================
--- grub-2.00.orig/grub-core/io/offset.c
+++ grub-2.00/grub-core/io/offset.c
@@ -18,6 +18,7 @@
 
 #include <grub/file.h>
 #include <grub/dl.h>
+#include <grub/mm.h>
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
@@ -98,7 +99,7 @@ grub_file_offset_open (grub_file_t paren
     if (grub_file_filters_enabled[filter])
       {
 	last_off_file = off_file;
-	off_file = grub_file_filters_enabled[filter] (off_file, parent->name);
+	off_file = grub_file_filters_enabled[filter] (off_file);
       }
 
   if (!off_file)
Index: grub-2.00/grub-core/loader/i386/xen.c
===================================================================
--- grub-2.00.orig/grub-core/loader/i386/xen.c
+++ grub-2.00/grub-core/loader/i386/xen.c
@@ -416,7 +416,7 @@ grub_cmd_xen (grub_command_t cmd __attri
   if (!file)
     return grub_errno;
 
-  elf = grub_xen_file (file);
+  elf = grub_xen_file (file, argv[0]);
   if (!elf)
     goto fail;
 
Index: grub-2.00/grub-core/loader/i386/xen_file.c
===================================================================
--- grub-2.00.orig/grub-core/loader/i386/xen_file.c
+++ grub-2.00/grub-core/loader/i386/xen_file.c
@@ -18,15 +18,16 @@
 
 #include <grub/xen_file.h>
 #include <grub/i386/linux.h>
+#include <grub/mm.h>
 
 grub_elf_t
-grub_xen_file (grub_file_t file)
+grub_xen_file (grub_file_t file, const char *filename)
 {
   grub_elf_t elf;
   struct linux_kernel_header lh;
   grub_file_t off_file;
 
-  elf = grub_elf_file (file, file->name);
+  elf = grub_elf_file (file, filename);
   if (elf)
     return elf;
   grub_errno = GRUB_ERR_NONE;
@@ -62,7 +63,7 @@ grub_xen_file (grub_file_t file)
   if (!off_file)
     goto fail;
 
-  elf = grub_elf_file (off_file, file->name);
+  elf = grub_elf_file (off_file, filename);
   if (elf)
     return elf;
   grub_file_offset_close (off_file);
Index: grub-2.00/grub-core/loader/i386/xen_fileXX.c
===================================================================
--- grub-2.00.orig/grub-core/loader/i386/xen_fileXX.c
+++ grub-2.00/grub-core/loader/i386/xen_fileXX.c
@@ -17,6 +17,7 @@
  */
 
 #include <grub/xen_file.h>
+#include <grub/mm.h>
 
 static grub_err_t
 parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
@@ -35,8 +36,7 @@ parse_xen_guest (grub_elf_t elf, struct
     {
       if (grub_errno)
 	return grub_errno;
-      return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
-			 elf->file->name);
+      return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"));
     }
   xi->has_xen_guest = 1;
   for (ptr = buf; ptr && ptr - buf < (grub_ssize_t) sz;
@@ -172,8 +172,7 @@ parse_note (grub_elf_t elf, struct grub_
     {
       if (grub_errno)
 	return grub_errno;
-      return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
-			 elf->file->name);
+      return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"));
     }
   for (ptr = buf; ptr - buf < (grub_ssize_t) (sz / sizeof (grub_uint32_t));)
     {
@@ -314,8 +313,7 @@ grub_xen_get_infoXX (grub_elf_t elf, str
     {
       if (grub_errno)
 	return grub_errno;
-      return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
-			 elf->file->name);
+      return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"));
     }
 
   s = (Elf_Shdr *) ((char *) s0 + elf->ehdr.ehdrXX.e_shstrndx * shentsize);
Index: grub-2.00/include/grub/xen_file.h
===================================================================
--- grub-2.00.orig/include/grub/xen_file.h
+++ grub-2.00/include/grub/xen_file.h
@@ -23,7 +23,7 @@
 #include <grub/elf.h>
 #include <grub/elfload.h>
 
-grub_elf_t grub_xen_file (grub_file_t file);
+grub_elf_t grub_xen_file (grub_file_t file, const char *filename);
 
 struct grub_xen_file_info
 {
Index: grub-2.00/grub-core/kern/xen/init.c
===================================================================
--- grub-2.00.orig/grub-core/kern/xen/init.c
+++ grub-2.00/grub-core/kern/xen/init.c
@@ -557,15 +557,15 @@ grub_machine_fini (int flags __attribute
 }
 
 grub_err_t
-grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
+grub_machine_mmap_iterate (grub_memory_hook_t hook)
 {
   grub_uint64_t total_pages = grub_xen_start_page_addr->nr_pages;
   grub_uint64_t usable_pages = grub_xen_start_page_addr->pt_base >> 12;
-  if (hook (0, page2offset (usable_pages), GRUB_MEMORY_AVAILABLE, hook_data))
+  if (hook (0, page2offset (usable_pages), GRUB_MEMORY_AVAILABLE))
     return GRUB_ERR_NONE;
 
   hook (page2offset (usable_pages), page2offset (total_pages - usable_pages),
-	GRUB_MEMORY_RESERVED, hook_data);
+	GRUB_MEMORY_RESERVED);
 
   return GRUB_ERR_NONE;
 }
Index: grub-2.00/grub-core/disk/xen/xendisk.c
===================================================================
--- grub-2.00.orig/grub-core/disk/xen/xendisk.c
+++ grub-2.00/grub-core/disk/xen/xendisk.c
@@ -51,7 +51,7 @@ static grub_size_t vdiskcnt;
 struct virtdisk *compat_head;
 
 static int
-grub_virtdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
+grub_virtdisk_iterate (int (*hook) (const char *name),
 		       grub_disk_pull_t pull)
 {
   grub_size_t i;
@@ -60,7 +60,7 @@ grub_virtdisk_iterate (grub_disk_dev_ite
     return 0;
 
   for (i = 0; i < vdiskcnt; i++)
-    if (hook (virtdisks[i].fullname, hook_data))
+    if (hook (virtdisks[i].fullname))
       return 1;
   return 0;
 }
Index: grub-2.00/grub-core/term/xen/console.c
===================================================================
--- grub-2.00.orig/grub-core/term/xen/console.c
+++ grub-2.00/grub-core/term/xen/console.c
@@ -85,7 +85,8 @@ struct grub_terminfo_input_state grub_co
 
 struct grub_terminfo_output_state grub_console_terminfo_output = {
   .put = put,
-  .size = {80, 24}
+  .width = 80,
+  .height = 24
 };
 
 static struct grub_term_input grub_console_term_input = {
Index: grub-2.00/grub-core/Makefile.core.def
===================================================================
--- grub-2.00.orig/grub-core/Makefile.core.def
+++ grub-2.00/grub-core/Makefile.core.def
@@ -603,7 +603,12 @@ module = {
   name = boot;
   common = commands/boot.c;
   i386_pc = lib/i386/pc/biosnum.c;
-  enable = videomodules;
+  enable = x86;
+  enable = emu;
+  enable = sparc64_ieee1275;
+  enable = powerpc_ieee1275;
+  enable = mips_arc;
+  enable = ia64_efi;
 };
 
 module = {
