summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hesse2015-06-29 12:24:57 +0200
committerChristian Hesse2015-06-29 12:24:57 +0200
commite0e6c8a38bae89f5a73f03a7abd07ee8fe6c2b3f (patch)
treefd79663989179d9049762ac631f424efcbe671d2
downloadaur-e0e6c8a38bae89f5a73f03a7abd07ee8fe6c2b3f.tar.gz
initial import of grubinvaders 1.0.0-3
-rw-r--r--.SRCINFO24
-rw-r--r--0001-gcc_binutils_bugfix.patch46
-rw-r--r--0002-reboot-on-esc.patch38
-rw-r--r--0003-no-stack-protector.patch13
-rw-r--r--0004-x86_64_envfix.patch14
-rw-r--r--PKGBUILD49
-rw-r--r--grub25
-rw-r--r--grubinvaders.install14
8 files changed, 223 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..54ca1b868642
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = grubinvaders
+ pkgdesc = multi boot compliant game for i386 and compatible x86_64
+ pkgver = 1.0.0
+ pkgrel = 3
+ url = http://www.erikyyy.de/invaders/
+ install = grubinvaders.install
+ arch = any
+ license = GPL2
+ makedepends = gcc
+ source = http://www.erikyyy.de/invaders/invaders-1.0.0.tar.gz
+ source = 0001-gcc_binutils_bugfix.patch
+ source = 0002-reboot-on-esc.patch
+ source = 0003-no-stack-protector.patch
+ source = 0004-x86_64_envfix.patch
+ source = grub
+ sha256sums = 304c8b0f82eaec54b07250b0f39886e1d9fa23c48075213bf87c8f375781a845
+ sha256sums = c0c15db81101b6ffce3c6d142e207358155eac37970ddd3b31d4ebe42b703515
+ sha256sums = 36ff7d4a546b9e1f15f62683120f7b7428d14a5ef15b4923e8179cd0ffcc9b99
+ sha256sums = 46819946a00a81f8b8346a52778dd1c4f35ebc6ae82937e3eebde7b25dc4b3f4
+ sha256sums = a21caf867c156a664779a40f5139ca895f4d7915a22a7a792dffc0976a8c8c5b
+ sha256sums = fc36e67c91515aa619ca9616f517116d5cfd1f257fc142703a5ff01ec5dcfdab
+
+pkgname = grubinvaders
+
diff --git a/0001-gcc_binutils_bugfix.patch b/0001-gcc_binutils_bugfix.patch
new file mode 100644
index 000000000000..75f5d0e4601a
--- /dev/null
+++ b/0001-gcc_binutils_bugfix.patch
@@ -0,0 +1,46 @@
+diff -ur invaders/clean.sh invaders-fixed/clean.sh
+--- invaders/clean.sh 2001-05-21 22:43:13.000000000 +0200
++++ invaders-fixed/clean.sh 2009-04-13 17:03:14.000000000 +0200
+@@ -2,4 +2,4 @@
+
+ set -e
+ set -v
+-rm -f *.o *~ invaders.exec
++rm -f *.o *~ invaders.exec invaders
+diff -ur invaders/compile.sh invaders-fixed/compile.sh
+--- invaders/compile.sh 2001-05-21 22:26:46.000000000 +0200
++++ invaders-fixed/compile.sh 2009-04-13 16:59:44.000000000 +0200
+@@ -4,7 +4,7 @@
+ set -v
+
+ CFLAGS="-fno-builtin -nostdinc -O2 -I. -Wall -Werror"
+-LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000"
++LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -Wl,--build-id=none"
+ gcc $CFLAGS -c keyboard.c
+ gcc $CFLAGS -c delay.c
+ gcc $CFLAGS -c common.c
+diff -ur invaders/video.c invaders-fixed/video.c
+--- invaders/video.c 2001-05-13 15:56:33.000000000 +0200
++++ invaders-fixed/video.c 2009-04-13 17:01:22.000000000 +0200
+@@ -36,7 +36,7 @@
+ video_putchar(x+1,y,hextab[hex&15]);
+ };
+
+-void video_putstring(int32 x, int32 y, uint8 *str)
++void video_putstring(int32 x, int32 y, char *str)
+ {
+ while (*str) video_putchar(x++,y,*(str++));
+ };
+diff -ur invaders/video.h invaders-fixed/video.h
+--- invaders/video.h 2001-05-13 15:56:33.000000000 +0200
++++ invaders-fixed/video.h 2009-04-13 17:01:05.000000000 +0200
+@@ -8,7 +8,7 @@
+ void video_putchar(int32 x, int32 y, uint8 code);
+ void video_fill(int32 x, int32 y, int32 width, int32 height, uint8 code);
+ void video_puthex8(int32 x, int32 y, uint8 hex);
+-void video_putstring(int32 x, int32 y, uint8 *str);
++void video_putstring(int32 x, int32 y, char *str);
+
+ // immediate effect
+ void video_update();
+
diff --git a/0002-reboot-on-esc.patch b/0002-reboot-on-esc.patch
new file mode 100644
index 000000000000..6b49123e40ec
--- /dev/null
+++ b/0002-reboot-on-esc.patch
@@ -0,0 +1,38 @@
+Reboot the machine when the ESC key is pressed (taken from memtest86_3.5-2).
+
+--- invaders-1.0.0.orig/game.c
++++ invaders-1.0.0/game.c
+@@ -2,6 +2,7 @@
+ #include "keyboard.h"
+ #include "sound.h"
+ #include "delay.h"
++#include "io.h"
+
+ struct shot_t {
+ int8 x,y; // x==-1 -> inactive shot
+@@ -19,6 +20,13 @@
+
+ static bool gameover, winner;
+
++inline void reboot()
++{
++ /* tell the BIOS to do a warm start */
++ *((unsigned short *)0x472) = 0x1234;
++ outb(0xfe,0x64);
++};
++
+ void resetgame()
+ {
+ gameover=false;
+@@ -120,6 +128,11 @@
+ break;
+ case 'x':
+ return;
++ case '@':
++ if (pressed) {
++ reboot();
++ }
++ break;
+ };
+ };
+ };
diff --git a/0003-no-stack-protector.patch b/0003-no-stack-protector.patch
new file mode 100644
index 000000000000..20fefcabb790
--- /dev/null
+++ b/0003-no-stack-protector.patch
@@ -0,0 +1,13 @@
+diff --git a/compile.sh b/compile.sh
+index cf379e5..cc6119d 100755
+--- a/compile.sh
++++ b/compile.sh
+@@ -3,7 +3,7 @@
+ set -e
+ set -v
+
+-CFLAGS="-fno-builtin -nostdinc -O2 -I. -Wall -Werror"
++CFLAGS="-fno-builtin -fno-stack-protector -nostdinc -O2 -I. -Wall -Werror"
+ LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -Wl,--build-id=none"
+ gcc $CFLAGS -c keyboard.c
+ gcc $CFLAGS -c delay.c
diff --git a/0004-x86_64_envfix.patch b/0004-x86_64_envfix.patch
new file mode 100644
index 000000000000..067f3585733c
--- /dev/null
+++ b/0004-x86_64_envfix.patch
@@ -0,0 +1,14 @@
+diff -u -r invaders~/compile.sh invaders/compile.sh
+--- invaders~/compile.sh 2010-03-27 17:56:13.000000000 +0100
++++ invaders/compile.sh 2010-03-27 22:41:37.000000000 +0100
+@@ -3,8 +3,8 @@
+ set -e
+ set -v
+
+-CFLAGS="-fno-builtin -fno-stack-protector -nostdinc -O2 -I. -Wall -Werror"
+-LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -Wl,--build-id=none"
++CFLAGS="-fno-builtin -fno-stack-protector -nostdinc -O2 -I. -Wall -Werror -m32"
++LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -Wl,--build-id=none -m32"
+ gcc $CFLAGS -c keyboard.c
+ gcc $CFLAGS -c delay.c
+ gcc $CFLAGS -c common.c
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..23ee4835e8bc
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+# Maintainer: Christian Hesse <mail@eworm.de>
+
+pkgname=grubinvaders
+pkgver=1.0.0
+pkgrel=3
+pkgdesc="multi boot compliant game for i386 and compatible x86_64"
+arch=('any')
+url="http://www.erikyyy.de/invaders/"
+license=('GPL2')
+makedepends=('gcc')
+source=("http://www.erikyyy.de/invaders/invaders-${pkgver}.tar.gz"
+ '0001-gcc_binutils_bugfix.patch'
+ '0002-reboot-on-esc.patch'
+ '0003-no-stack-protector.patch'
+ '0004-x86_64_envfix.patch'
+ 'grub')
+install=${pkgname}.install
+
+prepare() {
+ cd ${srcdir}/invaders/
+
+ patch -Np1 -i "${srcdir}/0001-gcc_binutils_bugfix.patch"
+ patch -Np1 -i "${srcdir}/0002-reboot-on-esc.patch"
+ patch -Np1 -i "${srcdir}/0003-no-stack-protector.patch"
+
+ [ "${CARCH}" = "x86_64" ] && patch -Np1 -i "${srcdir}/0004-x86_64_envfix.patch" || true
+
+ sed -i -e '/gcc $LDFLAGS/s/gcc/ld/' -e 's/-Wl,-N//' -e 's/-Wl,-Ttext//' -e 's/-Wl,100000//' -e 's/-Wl,--build-id=none//' compile.sh
+}
+
+build() {
+ cd ${srcdir}/invaders/
+
+ ./compile.sh
+}
+
+package() {
+ cd ${srcdir}/invaders/
+
+ install -m0644 -D ${srcdir}/invaders/invaders ${pkgdir}/boot/${pkgname}/invaders.bin
+ install -m0755 -D ${srcdir}/grub ${pkgdir}/etc/grub.d/50_grubinvaders
+}
+
+sha256sums=('304c8b0f82eaec54b07250b0f39886e1d9fa23c48075213bf87c8f375781a845'
+ 'c0c15db81101b6ffce3c6d142e207358155eac37970ddd3b31d4ebe42b703515'
+ '36ff7d4a546b9e1f15f62683120f7b7428d14a5ef15b4923e8179cd0ffcc9b99'
+ '46819946a00a81f8b8346a52778dd1c4f35ebc6ae82937e3eebde7b25dc4b3f4'
+ 'a21caf867c156a664779a40f5139ca895f4d7915a22a7a792dffc0976a8c8c5b'
+ 'fc36e67c91515aa619ca9616f517116d5cfd1f257fc142703a5ff01ec5dcfdab')
diff --git a/grub b/grub
new file mode 100644
index 000000000000..b6991d0cce89
--- /dev/null
+++ b/grub
@@ -0,0 +1,25 @@
+#! /bin/sh -e
+########################################################
+# This script generates an Invaders entry on grub.cfg #
+# if grubinvaders is installed on the system. #
+########################################################
+
+prefix="/usr"
+exec_prefix="${prefix}"
+
+datarootdir="/usr/share"
+datadir="${datarootdir}"
+
+. "${datadir}/grub/grub-mkconfig_lib"
+
+INVADERS_IMAGE="/boot/grubinvaders/invaders.bin"
+CLASS="--class game"
+
+if [ -e ${INVADERS_IMAGE} ] && is_path_readable_by_grub ${INVADERS_IMAGE}; then
+ # image exists, create menu entry
+ echo "Found Invaders image: ${INVADERS_IMAGE}" >&2
+ echo "menuentry "Grub Invaders" ${CLASS} {"
+ prepare_grub_to_access_device $(${grub_probe} --target=device ${INVADERS_IMAGE}) | sed -e "s/^/\t/"
+ echo -e "\tmultiboot $(make_system_path_relative_to_its_root ${INVADERS_IMAGE})"
+ echo "}"
+fi
diff --git a/grubinvaders.install b/grubinvaders.install
new file mode 100644
index 000000000000..282d18ff3174
--- /dev/null
+++ b/grubinvaders.install
@@ -0,0 +1,14 @@
+post_install() {
+ cat << EOF
+> If you are using Grub everything is fine as GRUBinvaders is detected
+> automagically. Just run grub-mkconfig.
+> For any other bootloader please add your configuration manually. Make
+> sure /boot/grubinvaders/invaders.bin is loaded.
+EOF
+}
+
+post_remove() {
+ cat << EOF
+> Please remove your additions from your bootloaders.
+EOF
+}