a5bd9f6
From 6a2668284e0bf240c50cdff8540573a9150106d1 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
a5bd9f6
Date: Fri, 12 Apr 2013 01:29:45 +0200
a5bd9f6
Subject: [PATCH 282/364] 	Support i386-ieee1275 grub-mkrescue and make
a5bd9f6
 check on it.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog                                | 4 ++++
a5bd9f6
 Makefile.util.def                        | 1 +
a5bd9f6
 grub-core/tests/boot/qemu-shutdown-x86.S | 9 +++++++++
a5bd9f6
 tests/grub_script_expansion.in           | 2 +-
a5bd9f6
 tests/partmap_test.in                    | 8 +++++++-
a5bd9f6
 tests/util/grub-shell.in                 | 7 ++++---
a5bd9f6
 util/grub-mkrescue.in                    | 8 ++++++++
a5bd9f6
 7 files changed, 34 insertions(+), 5 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 0d62509..c137b5f 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,9 @@
a5bd9f6
 2013-04-11  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
 
a5bd9f6
+	Support i386-ieee1275 grub-mkrescue and make check on it.
a5bd9f6
+
a5bd9f6
+2013-04-11  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
+
a5bd9f6
 	Merge powerpc grub-mkrescue flavour with common. Use xorriso HFS+
a5bd9f6
 	feature for it.
a5bd9f6
 
a5bd9f6
diff --git a/Makefile.util.def b/Makefile.util.def
a5bd9f6
index bd286fc..373c25b 100644
a5bd9f6
--- a/Makefile.util.def
a5bd9f6
+++ b/Makefile.util.def
a5bd9f6
@@ -470,6 +470,7 @@ script = {
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
diff --git a/grub-core/tests/boot/qemu-shutdown-x86.S b/grub-core/tests/boot/qemu-shutdown-x86.S
a5bd9f6
index 8f794fc..9f8bc40 100644
a5bd9f6
--- a/grub-core/tests/boot/qemu-shutdown-x86.S
a5bd9f6
+++ b/grub-core/tests/boot/qemu-shutdown-x86.S
a5bd9f6
@@ -1,3 +1,12 @@
a5bd9f6
+	movl $0x80000b80, %eax
a5bd9f6
+	movw $0xcf8, %dx
a5bd9f6
+	outl  %eax, %dx
a5bd9f6
+	movl $0x1001, %eax
a5bd9f6
+	movw $0xcfc, %dx
a5bd9f6
+	inb  %al, %dx
a5bd9f6
+	orb  $1, %al
a5bd9f6
+	outb  %al, %dx
a5bd9f6
+
a5bd9f6
 	movl $0x80000b40, %eax
a5bd9f6
 	movw $0xcf8, %dx
a5bd9f6
 	outl  %eax, %dx
a5bd9f6
diff --git a/tests/grub_script_expansion.in b/tests/grub_script_expansion.in
a5bd9f6
index c476390..03dc510 100644
a5bd9f6
--- a/tests/grub_script_expansion.in
a5bd9f6
+++ b/tests/grub_script_expansion.in
a5bd9f6
@@ -35,7 +35,7 @@ done
a5bd9f6
 
a5bd9f6
 other=`echo insmod regexp\; echo '(*)' | @builddir@/grub-shell`
a5bd9f6
 for d in $disks; do
a5bd9f6
-    if ! echo "$other" | grep "$d" >/dev/null; then
a5bd9f6
+    if ! echo "$other" | grep -F "$d" >/dev/null; then
a5bd9f6
 	echo "$d missing from (*) expansion" >&2
a5bd9f6
 	exit 1
a5bd9f6
     fi
a5bd9f6
diff --git a/tests/partmap_test.in b/tests/partmap_test.in
a5bd9f6
index 1507220..a0beb2a 100644
a5bd9f6
--- a/tests/partmap_test.in
a5bd9f6
+++ b/tests/partmap_test.in
a5bd9f6
@@ -49,7 +49,7 @@ list_parts () {
a5bd9f6
     outfile="$1"
a5bd9f6
     shift
a5bd9f6
 
a5bd9f6
-    echo ls | "${grubshell}" --qemu-opts="-hda ${imgfile}" \
a5bd9f6
+    echo ls | "${grubshell}" --qemu-opts="-$qemudisk ${imgfile}" \
a5bd9f6
 	--modules=$mod | tr -d "\n\r" > "${outfile}"
a5bd9f6
     cat "${outfile}"
a5bd9f6
     echo
a5bd9f6
@@ -58,12 +58,18 @@ list_parts () {
a5bd9f6
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
a5bd9f6
     mips-qemu_mips | mipsel-qemu_mips | i386-qemu | i386-multiboot | i386-coreboot | mipsel-loongson)
a5bd9f6
 	disk=ata0
a5bd9f6
+	qemudisk=hda
a5bd9f6
 	;;
a5bd9f6
     powerpc-ieee1275)
a5bd9f6
 	disk=ieee1275//pci@80000000/mac-io@4/ata-3@20000/disk@0
a5bd9f6
+	qemudisk=hda
a5bd9f6
 	# QEMU firmware has bugs which prevent it from accessing hard disk.
a5bd9f6
 	exit 0
a5bd9f6
 	;;
a5bd9f6
+    i386-ieee1275)
a5bd9f6
+	disk=ieee1275/d
a5bd9f6
+	qemudisk=hdb
a5bd9f6
+	;;
a5bd9f6
     *)
a5bd9f6
 	disk=hd0
a5bd9f6
 	;;
a5bd9f6
diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in
a5bd9f6
index 04e64da..c6d1cd7 100644
a5bd9f6
--- a/tests/util/grub-shell.in
a5bd9f6
+++ b/tests/util/grub-shell.in
a5bd9f6
@@ -100,10 +100,11 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
a5bd9f6
 	console=vga_text;;
a5bd9f6
 
a5bd9f6
     i386-ieee1275)
a5bd9f6
-	boot=cd
a5bd9f6
+	boot=hd
a5bd9f6
 	qemu=qemu-system-i386
a5bd9f6
-	console=console;;
a5bd9f6
-
a5bd9f6
+	console=console
a5bd9f6
+	trim=1
a5bd9f6
+	;;
a5bd9f6
     i386-qemu)
a5bd9f6
 	boot=qemu
a5bd9f6
 	qemu=qemu-system-i386
a5bd9f6
diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in
a5bd9f6
index a6e4de6..510d95f 100644
a5bd9f6
--- a/util/grub-mkrescue.in
a5bd9f6
+++ b/util/grub-mkrescue.in
a5bd9f6
@@ -40,6 +40,7 @@ mipsel_qemu_dir="${libdir}/@PACKAGE@/mipsel-qemu_mips"
a5bd9f6
 loongson_dir="${libdir}/@PACKAGE@/mipsel-loongson"
a5bd9f6
 mips_qemu_dir="${libdir}/@PACKAGE@/mips-qemu_mips"
a5bd9f6
 pc_dir="${libdir}/@PACKAGE@/i386-pc"
a5bd9f6
+i386_ieee1275_dir="${libdir}/@PACKAGE@/i386-ieee1275"
a5bd9f6
 efi32_dir="${libdir}/@PACKAGE@/i386-efi"
a5bd9f6
 efi64_dir="${libdir}/@PACKAGE@/x86_64-efi"
a5bd9f6
 ia64_dir="${libdir}/@PACKAGE@/ia64-efi"
a5bd9f6
@@ -256,6 +257,9 @@ if [ "${override_dir}" = "" ] ; then
a5bd9f6
     if test -e "${pc_dir}" ; then
a5bd9f6
         process_input_dir "${pc_dir}" i386-pc
a5bd9f6
     fi
a5bd9f6
+    if test -e "${i386_ieee1275_dir}" ; then
a5bd9f6
+	process_input_dir "${i386_ieee1275_dir}" i386-ieee1275
a5bd9f6
+    fi
a5bd9f6
     if test -e "${efi32_dir}" ; then
a5bd9f6
         process_input_dir "${efi32_dir}" i386-efi
a5bd9f6
     fi
a5bd9f6
@@ -291,6 +295,7 @@ else
a5bd9f6
     mips_qemu_dir=
a5bd9f6
     loongson_dir=
a5bd9f6
     ppc_dir=
a5bd9f6
+    i386_ieee1275_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
@@ -303,6 +308,7 @@ else
a5bd9f6
 	mipsel-loongson) loongson_dir="${override_dir}" ;;
a5bd9f6
 	mips-qemu_mips) mips_qemu_dir="${override_dir}" ;;
a5bd9f6
 	powerpc-ieee1275) ppc_dir="${override_dir}" ;;
a5bd9f6
+	i386-ieee1275) i386_ieee1275_dir="${override_dir}" ;;
a5bd9f6
     esac
a5bd9f6
 fi
a5bd9f6
 
a5bd9f6
@@ -336,6 +342,8 @@ fi
a5bd9f6
 # build multiboot core.img
a5bd9f6
 make_image "${multiboot_dir}" i386-multiboot "${iso9660_dir}/boot/multiboot.img" "pata ahci at_keyboard"
a5bd9f6
 
a5bd9f6
+make_image "${i386_ieee1275_dir}" i386-ieee1275 "${iso9660_dir}/boot/ofwx86.elf" ""
a5bd9f6
+
a5bd9f6
 if test -e "${efi64_dir}" || test -e "${efi32_dir}" || test -e "${ia64_dir}"; then
a5bd9f6
     efi_dir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
a5bd9f6
     mkdir -p "${efi_dir}/efi/boot"
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6