a5bd9f6
From 5aa38752440cb6871b83eb1d36947c514acfc559 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
a5bd9f6
Date: Wed, 24 Apr 2013 14:02:58 +0200
a5bd9f6
Subject: [PATCH 336/364] 	* util/grub-mkrescue.in: Add mips-arc support.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog             |  4 ++++
a5bd9f6
 Makefile.util.def     | 13 +------------
a5bd9f6
 util/grub-mkrescue.in | 22 +++++++++++++++++++++-
a5bd9f6
 3 files changed, 26 insertions(+), 13 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 598d16c..c2d56f1 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,9 @@
a5bd9f6
 2013-04-24  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
 
a5bd9f6
+	* util/grub-mkrescue.in: Add mips-arc support.
a5bd9f6
+
a5bd9f6
+2013-04-24  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
+
a5bd9f6
 	* grub-core/kern/dl.c (grub_dl_resolve_symbols): Handle malloc failure.
a5bd9f6
 
a5bd9f6
 2013-04-24  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
diff --git a/Makefile.util.def b/Makefile.util.def
a5bd9f6
index ed7b412..4fa37bc 100644
a5bd9f6
--- a/Makefile.util.def
a5bd9f6
+++ b/Makefile.util.def
a5bd9f6
@@ -464,18 +464,7 @@ script = {
a5bd9f6
   name = grub-mkrescue;
a5bd9f6
   common = util/grub-install_header;
a5bd9f6
   common = util/grub-mkrescue.in;
a5bd9f6
-  enable = i386_pc;
a5bd9f6
-  enable = i386_efi;
a5bd9f6
-  enable = x86_64_efi;
a5bd9f6
-  enable = i386_qemu;
a5bd9f6
-  enable = i386_multiboot;
a5bd9f6
-  enable = i386_coreboot;
a5bd9f6
-  enable = i386_ieee1275;
a5bd9f6
-  enable = mips_qemu_mips;
a5bd9f6
-  enable = mips_loongson;
a5bd9f6
-  enable = ia64_efi;
a5bd9f6
-  enable = powerpc_ieee1275;
a5bd9f6
-  enable = sparc64_ieee1275;
a5bd9f6
+  enable = noemu;
a5bd9f6
 };
a5bd9f6
 
a5bd9f6
 script = {
a5bd9f6
diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in
a5bd9f6
index 5a5d4e3..634318b 100644
a5bd9f6
--- a/util/grub-mkrescue.in
a5bd9f6
+++ b/util/grub-mkrescue.in
a5bd9f6
@@ -45,6 +45,7 @@ efi32_dir="${libdir}/@PACKAGE@/i386-efi"
a5bd9f6
 efi64_dir="${libdir}/@PACKAGE@/x86_64-efi"
a5bd9f6
 ia64_dir="${libdir}/@PACKAGE@/ia64-efi"
a5bd9f6
 sparc64_dir="${libdir}/@PACKAGE@/sparc64-ieee1275"
a5bd9f6
+arcs_dir="${libdir}/@PACKAGE@/mips-arc"
a5bd9f6
 ppc_dir="${libdir}/@PACKAGE@/powerpc-ieee1275"
a5bd9f6
 rom_directory=
a5bd9f6
 override_dir=
a5bd9f6
@@ -91,7 +92,8 @@ usage () {
a5bd9f6
     print_option_help "--label-bgcolor=$(gettext "COLOR")" "$(gettext "use COLOR for label background")"
a5bd9f6
     print_option_help "--product-name=$(gettext "STR")" "$(gettext "use STR as product")"
a5bd9f6
     print_option_help "--product-version=$(gettext "STR")" "$(gettext "use STR as product version")"
a5bd9f6
-    print_option_help "--sparc-boot" "$(gettext "enable sparc boot. Disables HFS+, APM and boot as disk image for i386-pc")"
a5bd9f6
+    print_option_help "--sparc-boot" "$(gettext "enable sparc boot. Disables HFS+, APM, ARCS and boot as disk image for i386-pc")"
a5bd9f6
+    print_option_help "--arcs-boot" "$(gettext "enable ARCS (big-endian mips machines, mostly SGI) boot. Disables HFS+, APM, sparc64 and boot as disk image for i386-pc")"
a5bd9f6
     echo
a5bd9f6
     gettext_printf "%s generates a bootable rescue image with specified source files, source directories, or mkisofs options listed by the output of \`%s'\n" "xorriso -as mkisofs -help" "$self" | grub_fmt
a5bd9f6
     echo
a5bd9f6
@@ -154,6 +156,9 @@ do
a5bd9f6
     --sparc-boot)
a5bd9f6
         system_area=sparc64 ;;
a5bd9f6
 
a5bd9f6
+    --arcs-boot)
a5bd9f6
+        system_area=arcs ;;
a5bd9f6
+
a5bd9f6
     --product-name)
a5bd9f6
         product_name=`argument $option "$@"`; shift ;;
a5bd9f6
     --product-name=*)
a5bd9f6
@@ -273,6 +278,8 @@ if [ "${override_dir}" = "" ] ; then
a5bd9f6
 	    system_area=common;
a5bd9f6
 	elif test -e "${sparc64_dir}" ; then
a5bd9f6
 	    system_area=sparc64;
a5bd9f6
+	elif test -e "${arcs_dir}" ; then
a5bd9f6
+	    system_area=arcs;
a5bd9f6
 	fi
a5bd9f6
     fi
a5bd9f6
     if test -e "${multiboot_dir}" ; then
a5bd9f6
@@ -314,6 +321,9 @@ if [ "${override_dir}" = "" ] ; then
a5bd9f6
     if test -e "${sparc64_dir}" ; then
a5bd9f6
         process_input_dir "${sparc64_dir}" sparc64-ieee1275
a5bd9f6
     fi
a5bd9f6
+    if test -e "${arcs_dir}" ; then
a5bd9f6
+        process_input_dir "${arcs_dir}" mips-arc
a5bd9f6
+    fi
a5bd9f6
 else
a5bd9f6
     . "${override_dir}"/modinfo.sh
a5bd9f6
     process_input_dir "${override_dir}" ${grub_modinfo_target_cpu}-${grub_modinfo_platform}
a5bd9f6
@@ -330,6 +340,7 @@ else
a5bd9f6
     ppc_dir=
a5bd9f6
     i386_ieee1275_dir=
a5bd9f6
     sparc64_dir=
a5bd9f6
+    arcs_dir=
a5bd9f6
     case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
a5bd9f6
         i386-multiboot) multiboot_dir="${override_dir}" ;;
a5bd9f6
         i386-coreboot) coreboot_dir="${override_dir}" ;;
a5bd9f6
@@ -343,6 +354,7 @@ else
a5bd9f6
 	mips-qemu_mips) mips_qemu_dir="${override_dir}" ;;
a5bd9f6
 	powerpc-ieee1275) ppc_dir="${override_dir}"; system_area=common ;;
a5bd9f6
 	sparc64-ieee1275) sparc64_dir="${override_dir}"; system_area=sparc64 ;;
a5bd9f6
+	mips-arc) arcs_dir="${override_dir}"; system_area=arcs ;;
a5bd9f6
 	i386-ieee1275) i386_ieee1275_dir="${override_dir}" ;;
a5bd9f6
     esac
a5bd9f6
 fi
a5bd9f6
@@ -470,6 +482,14 @@ if [ -e "${iso9660_dir}"/boot/grub/sparc64-ieee1275/core.img ] && [ "$system_are
a5bd9f6
    grub_mkisofs_arguments="${grub_mkisofs_arguments} -G $sysarea_img -B , --grub2-sparc-core /boot/grub/sparc64-ieee1275/core.img"
a5bd9f6
 fi
a5bd9f6
 
a5bd9f6
+make_image "${arcs_dir}" mips-arc "${iso9660_dir}/boot/grub/mips-arc/core.img" ""
a5bd9f6
+if [ -e "${iso9660_dir}/boot/grub/mips-arc/core.img" ]; then
a5bd9f6
+   grub_mkisofs_arguments="${grub_mkisofs_arguments} /boot/grub/mips-arc/grub=${iso9660_dir}/boot/grub/mips-arc/core.img /boot/grub/mips-arc/sashARCS=${iso9660_dir}/boot/grub/mips-arc/core.img"
a5bd9f6
+fi
a5bd9f6
+if [ -e "${iso9660_dir}/boot/grub/mips-arc/core.img" ] && [ "$system_area" = arcs ]; then
a5bd9f6
+   grub_mkisofs_arguments="${grub_mkisofs_arguments} -mips-boot /boot/grub/mips-arc/sashARCS -mips-boot /boot/grub/mips-arc/grub"
a5bd9f6
+fi
a5bd9f6
+
a5bd9f6
 make_image "${mipsel_qemu_dir}" mipsel-qemu_mips-elf "${iso9660_dir}/boot/mipsel-qemu_mips.elf" "pata"
a5bd9f6
 if [ -e "${iso9660_dir}/boot/mipsel-qemu_mips.elf" ] && [ -d "${rom_directory}" ]; then
a5bd9f6
     cp "${iso9660_dir}/boot/mipsel-qemu_mips.elf" "${rom_directory}/mipsel-qemu_mips.elf"
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6