]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Add loongson tests.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 15 Jun 2012 17:42:25 +0000 (19:42 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 15 Jun 2012 17:42:25 +0000 (19:42 +0200)
* tests/util/grub-shell.in: Handle loongson.
* tests/partmap_test.in: Add loongson to the list of platform using ATA
drivers.
* grub-core/tests/boot/linux.init-mips.S (SHUTDOWN_MAGIC3) [REBOOT]:
Reboot instead of shutdown if REBOOT is defined.

ChangeLog
Makefile.am
grub-core/tests/boot/linux.init-mips.S
tests/partmap_test.in
tests/util/grub-shell.in

index a87c472b62f61374ceb243e813bdfa35e6f045ed..546cddcc9d9c95ad825e08633d9dd27c97935a38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-06-15  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Add loongson tests.
+
+       * tests/util/grub-shell.in: Handle loongson.
+       * tests/partmap_test.in: Add loongson to the list of platform using ATA
+       drivers.
+       * grub-core/tests/boot/linux.init-mips.S (SHUTDOWN_MAGIC3) [REBOOT]:
+       Reboot instead of shutdown if REBOOT is defined.
+
 2012-06-15  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/lib/mips/loongson/reboot.c (grub_reboot): Use 32-bit
index 391cd19bb15bfbb0aae4be3656ae09dcda1ac561..db9e930fff046f1f06f00746a457f83a6c7b11d1 100644 (file)
@@ -168,6 +168,9 @@ linux.init.ppc: $(srcdir)/grub-core/tests/boot/linux.init-ppc.S
 linux.init.mipsel: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
        $(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
 
+linux.init.loongson: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
+       $(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -DREBOOT=1
+
 multiboot.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
        $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -DTARGET_MULTIBOOT=1 -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
 
@@ -219,6 +222,9 @@ linux-initramfs.ppc: linux.init.ppc Makefile
 linux-initramfs.mipsel: linux.init.mipsel Makefile
        TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
 
+linux-initramfs.loongson: linux.init.loongson Makefile
+       TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
+
 linux-initramfs.i386: linux.init.i386 Makefile
        TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
 
@@ -288,13 +294,16 @@ bootcheck-linux-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64
        timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
 
 bootcheck-linux-mips: linux-initramfs.mips $(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
-       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-mips --files=/initrd=linux-initramfs.mips --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
+       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.mips --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
 
 bootcheck-linux-ppc: linux-initramfs.ppc $(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
-       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-ppc --files=/initrd=linux-initramfs.ppc --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
+       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.ppc --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
 
 bootcheck-linux-mipsel: linux-initramfs.mipsel $(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
-       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-mipsel --files=/initrd=linux-initramfs.mipsel --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
+       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.mipsel --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
+
+bootcheck-linux-loongson: linux-initramfs.loongson $(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
+       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.loongson --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
 
 bootcheck-linux16-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
        timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
@@ -349,12 +358,20 @@ if COND_i386_pc
 BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 bootcheck-pc-chainloader bootcheck-ntldr bootcheck-linux16-i386 bootcheck-linux16-x86_64 bootcheck-knetbsd-i386
 endif
 
+if COND_mips_loongson
+BOOTCHECKS = bootcheck-linux-loongson
+endif
+
 if COND_mipsel
+if COND_mips_qemu_mips
 BOOTCHECKS = bootcheck-linux-mipsel
 endif
+endif
 if COND_mipseb
+if COND_mips_qemu_mips
 BOOTCHECKS = bootcheck-linux-mips
 endif
+endif
 
 if COND_powerpc_ieee1275
 BOOTCHECKS = bootcheck-linux-ppc
index 731f38130152d0218fd7cd97e93e97166ffa6a1e..5ef4c37948226fff3625b1bf0fa24ecdfe599c96 100644 (file)
 #define STDOUT 1
 #define SHUTDOWN_MAGIC1 0xfee1dead
 #define SHUTDOWN_MAGIC2 0x28121969
+#ifdef REBOOT
+#define SHUTDOWN_MAGIC3 0x01234567
+#else
 #define SHUTDOWN_MAGIC3 0x4321fedc
-
+#endif
        .text
        .global start, _start, __start
 __start:       
index 1eb2868b9cb5280a9998054de89fcbaece7df3d0..15072202606429c8c840dd9efb6927278927d88f 100644 (file)
@@ -56,7 +56,7 @@ list_parts () {
 }
 
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
-    mips-qemu_mips | mipsel-qemu_mips | i386-qemu | i386-multiboot | i386-coreboot)
+    mips-qemu_mips | mipsel-qemu_mips | i386-qemu | i386-multiboot | i386-coreboot | mipsel-loongson)
        disk=ata0
        ;;
     powerpc-ieee1275)
index a1bf084d115cb35e1e9c7a765da03d27700366c7..25a7e8d1f5541308f73a59dd14ba9ff45cf35abe 100644 (file)
@@ -61,6 +61,7 @@ EOF
 qemuopts="${GRUB_QEMU_OPTS}"
 serial_port=com0
 serial_null=
+hald_cmd=halt
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     powerpc-ieee1275)
        boot=cd
@@ -82,6 +83,14 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
        qemuopts="$qemuopts -M mips"
        console=vga_text
        ;;
+    mipsel-loongson)
+       boot=mipsel_fulong2e
+       qemu=qemu-system-mips64el
+       qemuopts="$qemuopts -no-reboot -M fulong2e"
+       console=
+       halt_cmd=reboot
+       trim=1
+       ;;
     i386-coreboot)
        boot=coreboot
        qemu=qemu-system-i386
@@ -157,7 +166,8 @@ for option in "$@"; do
        elif [ "$dev" = "qemu" ] ; then boot=qemu;
        elif [ "$dev" = "coreboot" ] ; then boot=coreboot;
        elif [ "$dev" = "mips_qemu" ] ; then boot=mips_qemu;
-       elif [ "$dev" = "mipsel_qemu" ] ; then boot=mips_qemu;
+       elif [ "$dev" = "mipsel_qemu" ] ; then boot=mipsel_qemu;
+       elif [ "$dev" = "mipsel_fulong2e" ] ; then boot=mipsel_fulong2e;
        else
            echo "Unrecognized boot method \`$dev'" 1>&2
            usage
@@ -211,9 +221,11 @@ done
 cat <<EOF >>${cfgfile}
 source /boot/grub/testcase.cfg
 # Stop serial output to suppress "ACPI shutdown failed" error.
-terminal_output $console
-halt
 EOF
+if [ x$console != x ]; then
+    echo "terminal_output $console" >>${cfgfile}
+fi
+echo "$halt_cmd" >>${cfgfile}
 
 isofile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
 if [ x$boot != xnet ]; then
@@ -245,6 +257,11 @@ if [ x$boot = xmipsel_qemu ]; then
     device=cdrom
 fi
 
+if [ x$boot = xmipsel_fulong2e ]; then
+    bootdev="-kernel ${rom_directory}/mipsel-loongson.elf -append machtype=lemote-fuloong-2e"
+    device=cdrom
+fi
+
 if [ x$boot = xmips_qemu ]; then
     bootdev="-kernel ${rom_directory}/mips-qemu_mips.elf"
     device=cdrom