]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
OpenBSD64 bootcheck
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 28 Aug 2010 13:05:26 +0000 (15:05 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 28 Aug 2010 13:05:26 +0000 (15:05 +0200)
Makefile.am
grub-core/tests/boot/kbsd.init-x86_64.S [moved from grub-core/tests/boot/knetbsd.init-x86_64.S with 95% similarity]

index 35f93bfb652ff3450ea2b8aad194707f9f580f63..53439fd42933e01936ac12e905797af692e23ef4 100644 (file)
@@ -150,8 +150,11 @@ knetbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S
 kopenbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S
        $(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DTARGET_OPENBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
 
-knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/knetbsd.init-x86_64.S
-       $(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
+knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S
+       $(TARGET_CC) -o $@ $< -m64 -DTARGET_NETBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
+
+kopenbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S
+       $(TARGET_CC) -o $@ $< -m64 -DTARGET_OPENBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
 
 linux-initramfs.i386: linux.init.i386 Makefile
        TDIR=`mktemp -d`; cp $< $$TDIR/init; (cd $$TDIR; echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@; rm -rf $$TDIR
@@ -168,6 +171,9 @@ knetbsd.image.i386: knetbsd.init.i386 $(srcdir)/grub-core/tests/boot/kbsd.spec.t
 kopenbsd.image.i386: kopenbsd.init.i386 $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt
        TDIR=`mktemp -d` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 128k -f 10 -o minfree=0,version=1 $@ $$TDIR && bsdlabel -f -R $@ $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt && rm -rf $$TDIR || rm -f $@
 
+kopenbsd.image.x86_64: kopenbsd.init.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt
+       TDIR=`mktemp -d` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 128k -f 10 -o minfree=0,version=1 $@ $$TDIR && bsdlabel -f -R $@ $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt && rm -rf $$TDIR || rm -f $@
+
 knetbsd.miniroot-image.i386.img: knetbsd.image.i386 $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.i386
        $(OBJCOPY) --add-section=miniroot=$< $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.i386 $@
 
@@ -203,6 +209,9 @@ bootcheck-knetbsd-i386: knetbsd.miniroot-image.i386.gz $(GRUB_PAYLOADS_DIR)/knet
 bootcheck-kopenbsd-i386: kopenbsd.image.i386 $(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell
        timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=$(QEMU32) --files=/ramdisk=kopenbsd.image.i386 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
 
+bootcheck-kopenbsd-x86_64: kopenbsd.image.x86_64 $(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell
+       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=qemu-system-x86_64 --files=/ramdisk=kopenbsd.image.x86_64 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
+
 knetbsd.miniroot-image.x86_64.gz: knetbsd.miniroot-image.x86_64.img
        gzip < $< > $@
 
@@ -236,6 +245,8 @@ if COND_i386_pc
 BOOTCHECKS += bootcheck-pc-chainloader
 endif
 
+BOOTCHECKS += bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64
+
 BOOTCHECKS += bootcheck-multiboot bootcheck-multiboot2
 
 BOOTCHECKS += bootcheck-linux16-i386 bootcheck-linux16-x86_64
similarity index 95%
rename from grub-core/tests/boot/knetbsd.init-x86_64.S
rename to grub-core/tests/boot/kbsd.init-x86_64.S
index 1a19f360353002da1fb82f704b6acf667f79f3e9..58400db0d88a3809d6b4cbeef9da88000ea0fdf2 100644 (file)
 #define FLAGS_NONE 0
 #define SYSCALL_OPEN 5
 #define SYSCALL_WRITE 4
+#ifdef TARGET_NETBSD
 #define SYSCALL_RESET 208
+#elif defined (TARGET_OPENBSD)
+#define SYSCALL_RESET 55
+#else
+#error unknown target
+#endif
 #define SYSCALL_EXIT 1
 #define SYSCALL_ARCH 165
 #define SYSCALL_INT 0x80