grub2/0337-util-grub-mkrescue.in-Add-mips-arc-support.patch
2013-06-07 14:03:56 -04:00

135 lines
5.4 KiB
Diff

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