Blame SOURCES/0283-Support-i386-ieee1275-grub-mkrescue-and-make-check-o.patch

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