summaryrefslogtreecommitdiff
path: root/sys-apps/memtest86+/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/memtest86+/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/memtest86+/files')
-rw-r--r--sys-apps/memtest86+/files/39_memtest86+67
-rw-r--r--sys-apps/memtest86+/files/39_memtest86+-r169
-rw-r--r--sys-apps/memtest86+/files/make-memtest86+-boot-floppy111
-rw-r--r--sys-apps/memtest86+/files/make-memtest86+-boot-floppy.139
-rw-r--r--sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch11
-rw-r--r--sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch30
-rw-r--r--sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch30
-rw-r--r--sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch30
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch33
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch16
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-io-extern-inline.patch31
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-no-C-headers.patch49
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-no-clean.patch19
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-no-scp.patch14
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-reboot-def.patch15
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-test-random-cflags.patch21
16 files changed, 585 insertions, 0 deletions
diff --git a/sys-apps/memtest86+/files/39_memtest86+ b/sys-apps/memtest86+/files/39_memtest86+
new file mode 100644
index 000000000000..9c9067a5e736
--- /dev/null
+++ b/sys-apps/memtest86+/files/39_memtest86+
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+. /usr/share/grub/grub-mkconfig_lib
+
+memtest=/boot/memtest86plus/memtest
+
+memtestbsd=/boot/memtest86plus/memtest.netbsd
+
+if [ -f "${memtest}" ] && [ -f "${memtestbsd}" ]; then
+ multiple_memtest=true
+fi
+
+submenu_indentation=""
+if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
+ submenu_indentation="${grub_tab}"
+ cat <<EOF
+submenu 'Memtest86+' {
+EOF
+fi
+
+if [ -f "${memtest}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${memtest}" >&2
+
+ device="$("${grub_probe}" --target=device "${memtest}")"
+ path="$(make_system_path_relative_to_its_root "${memtest}")"
+ cat <<EOF
+${submenu_indentation}menuentry 'Memtest86+' {
+EOF
+
+ if [ -n "{submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ cat <<EOF
+ ${submenu_indentation}linux16 "${path}"
+${submenu_indentation}}
+EOF
+fi
+
+if [ -f "${memtestbsd}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${memtestbsd}" >&2
+
+ device="$("${grub_probe}" --target=device "${memtestbsd}")"
+ path="$(make_system_path_relative_to_its_root "${memtestbsd}")"
+ cat <<EOF
+${submenu_indentation}menuentry 'Memtest86+ (netbsd)' {
+EOF
+
+ if [ -n "${submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ cat <<EOF
+ ${submenu_indentation}knetbsd "${path}"
+${submenu_indentation}}
+EOF
+fi
+
+if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
+ cat <<EOF
+}
+EOF
+fi
diff --git a/sys-apps/memtest86+/files/39_memtest86+-r1 b/sys-apps/memtest86+/files/39_memtest86+-r1
new file mode 100644
index 000000000000..20422b74d65a
--- /dev/null
+++ b/sys-apps/memtest86+/files/39_memtest86+-r1
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+. /usr/share/grub/grub-mkconfig_lib
+
+memtest=/boot/memtest86plus/memtest.bin
+
+memtestelf=/boot/memtest86plus/memtest
+
+if [ -f "${memtest}" ] && [ -f "${memtestelf}" ]; then
+ multiple_memtest=true
+fi
+
+submenu_indentation=""
+if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
+ submenu_indentation="${grub_tab}"
+ cat <<EOF
+submenu 'Memtest86+' {
+EOF
+fi
+
+if [ -f "${memtest}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${memtest}" >&2
+
+ device="$("${grub_probe}" --target=device "${memtest}")"
+ path="$(make_system_path_relative_to_its_root "${memtest}")"
+ cat <<EOF
+${submenu_indentation}menuentry 'Memtest86+' {
+EOF
+
+ if [ -n "{submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ cat <<EOF
+ ${submenu_indentation}linux16 "${path}"
+${submenu_indentation}}
+EOF
+fi
+
+if [ -f "${memtestelf}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${memtestelf}" >&2
+
+ device="$("${grub_probe}" --target=device "${memtestelf}")"
+ path="$(make_system_path_relative_to_its_root "${memtestelf}")"
+ cat <<EOF
+${submenu_indentation}menuentry 'Memtest86+ (ELF)' {
+EOF
+
+ if [ -n "${submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ # We use knetbsd as a lazy way of booting an ELF.
+ # It's not actually related to NetBSD at all.
+ cat <<EOF
+ ${submenu_indentation}knetbsd "${path}"
+${submenu_indentation}}
+EOF
+fi
+
+if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
+ cat <<EOF
+}
+EOF
+fi
diff --git a/sys-apps/memtest86+/files/make-memtest86+-boot-floppy b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy
new file mode 100644
index 000000000000..9c225c740bf4
--- /dev/null
+++ b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy
@@ -0,0 +1,111 @@
+#!/bin/sh
+#
+# Script for making a memtest86 boot floppy using GRUB as bootloader
+#
+
+# (c) 2003 Peter Loje Hansen <pl@2m.dk>
+# - original version
+# (c) 2004 Yann Dirson <dirson@debian.org>
+# - added parameters
+# - ability to work on a floppy image instead of a real floppy
+# - adapted patches from Martin Koeppe <martin@koeppe-net.de>, to use
+# mtools and install full grub
+
+# TODO:
+# - add a flag to generate a default boot entry for (hd0)
+
+set -e
+
+MEMTEST=/boot/memtest86plus/memtest.bin
+FLOPPYIMAGE=/dev/fd0
+GRUBBIN=/sbin/grub
+GRUBLIB=/lib/grub
+MFORMAT=/usr/bin/mformat
+
+arch=$(uname -m)
+
+case "$arch" in
+ i386|i486|i686) GRUBARCH=i386-pc;;
+ x86_64) GRUBARCH=x86_64-pc;;
+ *) error "Unsupported architecture: $arch";;
+esac
+
+error()
+{
+ echo >&2 "$0: $*"
+ exit 1
+}
+
+needsarg()
+{
+ [ $1 -ge 2 ] || error "syntax error"
+}
+
+[ -d $GRUBLIB ] || error "Can't find $GRUBLIB - did you install a recent grub package (0.95+cvs20040624 or later) ?"
+[ -x $MFORMAT ] || error "Can't find mformat - did you install the mtools package ?"
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ --help) echo "$0 [--memtest $MEMTEST] [--floppyimage $FLOPPYIMAGE]"; exit 0 ;;
+ --memtest) needsarg $#; MEMTEST="$2"; shift ;;
+ --floppyimage) needsarg $#; FLOPPYIMAGE="$2"; shift ;;
+ *) error "syntax error" ;;
+ esac
+ shift
+done
+
+MOUNTPOINT=$(mktemp -d)
+
+if [ -b "$FLOPPYIMAGE" ]
+then
+ FINALDEV="$FLOPPYIMAGE"
+ FLOPPYIMAGE="$(mktemp)"
+else
+ FINALDEV=""
+fi
+
+echo "* Creating msdos file system"
+echo
+if [ ! -s "$FLOPPYIMAGE" ]; then
+ # unless a non-empty image exists, create a blank one first
+ dd bs=1024 count=1440 if=/dev/zero of="$FLOPPYIMAGE"
+fi
+# FIXME: "-f 1440" should probably be dropped
+mformat -i $FLOPPYIMAGE -f 1440 ::
+
+mmd -i $FLOPPYIMAGE ::/boot
+mmd -i $FLOPPYIMAGE ::/boot/grub
+
+echo
+echo "* Installing GRUB files"
+mcopy -v -i "$FLOPPYIMAGE" - ::/boot/grub/menu.lst <<EOF
+color green/black light-green/black
+default 0
+timeout 10
+title memtest
+kernel (fd0)/boot/memtest.bin
+EOF
+mcopy -v -i "$FLOPPYIMAGE" $GRUBLIB/$GRUBARCH/* ::/boot/grub
+
+echo
+echo "* Installing $MEMTEST"
+mcopy -v -i "$FLOPPYIMAGE" "$MEMTEST" ::/boot/memtest.bin
+
+echo
+echo -n "* Installing GRUB"
+$GRUBBIN --batch --device-map=/dev/null <<EOF
+device (fd0) $FLOPPYIMAGE
+root (fd0)
+setup (fd0)
+quit
+EOF
+
+if [ -n "$FINALDEV" ]; then
+ echo
+ echo "Insert a writable floppy for $FINALDEV and press enter"
+ read FOO
+
+ dd bs=1024 if="$FLOPPYIMAGE" of="$FINALDEV"
+ rm "$FLOPPYIMAGE"
+fi
diff --git a/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1 b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1
new file mode 100644
index 000000000000..e1283e5efc8f
--- /dev/null
+++ b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1
@@ -0,0 +1,39 @@
+.\" Man page for make-memtest86+-boot-floppy
+
+.TH make-memtest86+-boot-floppy 1
+
+.SH NAME
+make-memtest86+-boot-floppy \- create a memtest86+ boot-floppy using GRUB.
+
+.SH SYNOPSIS
+
+.B make-memtest86+-boot-floppy [ \-\-memtest
+.I <path to memtest86+-image>
+.B ] [ \-\-floppyimage
+.I <path to floppyimage/device>
+.B ]
+
+.SH DESCRIPTION
+.B make-memtest86+-boot-floppy
+can create a memtest86+ boot floppy using GRUB as the bootloader.
+
+.SH OPTIONS
+
+.IP "\-\-memtest <path to the memtest-image>"
+Path to the memtest86+-image, default is /boot/memtest86+.bin.
+
+.IP "\-\-floppyimage <path to the floppyimage or device>"
+File or device where the boot-image should be written to, default is /dev/fd0.
+
+.IP "\-\-help"
+Display a short message about the options of the tool.
+
+.SH AUTHOR
+This man-page has been written by Thomas Schmidt <thomas@thsnet.de>
+.PP
+Permission is granted to copy, distribute and/or modify this document under
+the terms of the GNU General Public License, Version 2 any
+later version published by the Free Software Foundation.
+.PP
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common\-licenses/GPL.
diff --git a/sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch b/sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch
new file mode 100644
index 000000000000..5a9e06dc06d7
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch
@@ -0,0 +1,11 @@
+diff -Naurp memtest86+-1.70-orig/memtest_shared.lds memtest86+-1.70/memtest_shared.lds
+--- memtest86+-1.70-orig/memtest_shared.lds 2007-01-27 13:34:16.000000000 +0100
++++ memtest86+-1.70/memtest_shared.lds 2007-01-27 13:41:30.000000000 +0100
+@@ -18,6 +18,7 @@ SECTIONS {
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .hash : { *(.hash) }
++ .gnu.hash : { *(.gnu.hash) }
+ .dynamic : { *(.dynamic) }
+
+ .rel.text : { *(.rel.text .rel.text.*) }
diff --git a/sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch
new file mode 100644
index 000000000000..3b07731daadd
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch
@@ -0,0 +1,30 @@
+diff -Naurp memtest86+-2.01-orig/Makefile memtest86+-2.01/Makefile
+--- memtest86+-2.01-orig/Makefile 2008-03-11 21:04:28.000000000 +0100
++++ memtest86+-2.01/Makefile 2008-03-11 21:05:25.000000000 +0100
+@@ -8,10 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+-CFLAGS=-Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC
++CPPFLAGS=-m32
++CFLAGS=-Wall -m32 -march=i486 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++ASFLAGS=-32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o linuxbios.o memsize.o pci.o controller.o random.o extra.o \
+@@ -47,10 +46,10 @@ memtest.bin: memtest_shared.bin bootsect
+ memtest_shared.bin -o memtest.bin
+
+ reloc.o: reloc.c
+- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
++ $(CC) -c $(CFLAGS) -fno-strict-aliasing -fno-stack-protector reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie -nopie test.c
+
+ clean:
+ rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin
diff --git a/sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch
new file mode 100644
index 000000000000..f2950b64e807
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch
@@ -0,0 +1,30 @@
+diff -Nuar --exclude '*.orig' --exclude '*rej' --exclude '*~' memtest86+-4.00.orig/Makefile memtest86+-4.00/Makefile
+--- memtest86+-4.00.orig/Makefile 2009-09-21 17:35:46.000000000 -0700
++++ memtest86+-4.00/Makefile 2009-09-25 09:04:23.000000000 -0700
+@@ -8,10 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+-CFLAGS= -Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC
++CPPFLAGS=-m32
++CFLAGS=-Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++ASFLAGS=-32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o linuxbios.o memsize.o pci.o controller.o random.o spd.o \
+@@ -47,10 +46,10 @@
+ memtest_shared.bin -o memtest.bin
+
+ reloc.o: reloc.c
+- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
++ $(CC) -c $(CFLAGS) -fno-strict-aliasing -fno-stack-protector reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie -nopie test.c
+
+ clean:
+ rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin
diff --git a/sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch
new file mode 100644
index 000000000000..2eb750c8dd93
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch
@@ -0,0 +1,30 @@
+diff -Naurp memtest86+-4.10-orig/Makefile memtest86+-4.10/Makefile
+--- memtest86+-4.10-orig/Makefile 2010-06-24 00:27:22.864634431 +0200
++++ memtest86+-4.10/Makefile 2010-06-24 00:28:42.402478590 +0200
+@@ -8,10 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+-CFLAGS= -Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++CFLAGS=-Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++CPPFLAGS=-m32
++ASFLAGS=-32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o linuxbios.o memsize.o pci.o controller.o random.o spd.o \
+@@ -47,10 +46,10 @@ memtest.bin: memtest_shared.bin bootsect
+ memtest_shared.bin -o memtest.bin
+
+ reloc.o: reloc.c
+- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
++ $(CC) -c $(CFLAGS) -fno-strict-aliasing -fno-stack-protector reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie test.c
+
+ clean:
+ rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch b/sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch
new file mode 100644
index 000000000000..af011d67c705
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch
@@ -0,0 +1,33 @@
+http://forum.canardpc.com/threads/110950-fix-controller-loop-error
+
+--- memtest86+-5.01/controller.c
++++ memtest86+-5.01/controller.c
+@@ -292,7 +292,7 @@ static void setup_nhm(void)
+
+ /* First, locate the PCI bus where the MCH is located */
+
+- for(i = 0; i < sizeof(possible_nhm_bus); i++) {
++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
+ vid &= 0xFFFF;
+@@ -327,7 +327,7 @@ static void setup_nhm32(void)
+ ctrl.mode = ECC_NONE;
+
+ /* First, locate the PCI bus where the MCH is located */
+- for(i = 0; i < sizeof(possible_nhm_bus); i++) {
++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
+ vid &= 0xFFFF;
+--- memtest86+-5.01/Makefile
++++ memtest86+-5.01/Makefile
+@@ -12,7 +12,7 @@ FDISK=/dev/fd0
+ AS=as -32
+ CC=gcc
+
+-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
++CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
+ -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch
new file mode 100644
index 000000000000..f140a7fc6605
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch
@@ -0,0 +1,16 @@
+--- Makefile.orig 2015-02-01 01:08:33.000000000 +0300
++++ Makefile 2015-02-01 01:10:17.624757244 +0300
+@@ -9,11 +9,10 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+ CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
+ -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
++CPPFLAGS= -m32
++ASFLAGS= -32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o \
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-io-extern-inline.patch b/sys-apps/memtest86+/files/memtest86+-5.01-io-extern-inline.patch
new file mode 100644
index 000000000000..682dd5d01a1e
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-io-extern-inline.patch
@@ -0,0 +1,31 @@
+http://forum.canardpc.com/threads/110951-fix-build-with-newer-gcc-versions
+
+the meaning of extern inline changed between standards. use static inline
+for these tiny I/O functions everywhere to keep things simple.
+
+--- a/io.h
++++ b/io.h
+@@ -31,6 +31,6 @@
+ */
+
+ #define __OUT1(s,x) \
+-extern inline void __out##s(unsigned x value, unsigned short port) {
++static inline void __out##s(unsigned x value, unsigned short port) {
+
+ #define __OUT2(s,s1,s2) \
+@@ -43,6 +43,6 @@
+ __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; }
+
+ #define __IN1(s) \
+-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
++static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
+
+ #define __IN2(s,s1,s2) \
+@@ -55,6 +55,6 @@
+ __IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; return _v; }
+
+ #define __OUTS(s) \
+-extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
++static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
+ { __asm__ __volatile__ ("cld ; rep ; outs" #s \
+ : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-no-C-headers.patch b/sys-apps/memtest86+/files/memtest86+-5.01-no-C-headers.patch
new file mode 100644
index 000000000000..ce7f906a19d5
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-no-C-headers.patch
@@ -0,0 +1,49 @@
+http://forum.canardpc.com/threads/110955-PATCH-don-t-pull-in-system-headers
+
+avoid using C library headers as it'd mean we'd need 32-bit glibc files available
+
+https://bugs.gentoo.org/592638
+
+--- a/dmi.c
++++ b/dmi.c
+@@ -10,7 +10,7 @@
+
+
+ #include "test.h"
+-#include <stdint.h>
++#include "stdint.h"
+
+
+ #define round_up(x,y) (((x) + (y) - 1) & ~((y)-1))
+--- a/test.c
++++ b/test.c
+@@ -14,7 +14,28 @@
+ #include "stdint.h"
+ #include "cpuid.h"
+ #include "smp.h"
+-#include <sys/io.h>
++
++static inline unsigned char
++inb_p (unsigned short int __port)
++{
++ unsigned char _v;
++
++ __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
++ return _v;
++}
++
++static inline void
++outb (unsigned char __value, unsigned short int __port)
++{
++ __asm__ __volatile__ ("outb %b0,%w1": :"a" (__value), "Nd" (__port));
++}
++
++static inline void
++outb_p (unsigned char __value, unsigned short int __port)
++{
++ __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (__value),
++ "Nd" (__port));
++}
+
+ extern struct cpu_ident cpu_id;
+ extern volatile int mstr_cpu;
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-no-clean.patch b/sys-apps/memtest86+/files/memtest86+-5.01-no-clean.patch
new file mode 100644
index 000000000000..e9cbf10399c3
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-no-clean.patch
@@ -0,0 +1,19 @@
+http://forum.canardpc.com/threads/110954-PATCH-fix-parallel-build-issues
+
+
+don't run the clean target when building all as we run into parallel races:
+ - memtest kicks off building of a bunch of .o files
+ - clean runs in parallel which runs `rm` and deletes some of the new .o
+ - memtest goes to link and fails because objects are missing
+
+--- a/Makefile
++++ b/Makefile
+@@ -19,7 +19,7 @@
+ smp.o vmem.o random.o
+
+
+-all: clean memtest.bin memtest
++all: memtest.bin memtest
+
+ # Link it statically once so I know I don't have undefined
+ # symbols and then link it dynamically so I have full
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-no-scp.patch b/sys-apps/memtest86+/files/memtest86+-5.01-no-scp.patch
new file mode 100644
index 000000000000..8d830e297ec2
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-no-scp.patch
@@ -0,0 +1,14 @@
+http://forum.canardpc.com/threads/110953-PATCH-don-t-try-to-scp-after-building
+
+this makes no sense in a sane build world
+
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,6 @@
+
+
+ all: clean memtest.bin memtest
+- scp memtest.bin root@192.168.0.12:/srv/tftp/mt86plus
+
+ # Link it statically once so I know I don't have undefined
+ # symbols and then link it dynamically so I have full
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-reboot-def.patch b/sys-apps/memtest86+/files/memtest86+-5.01-reboot-def.patch
new file mode 100644
index 000000000000..f4b42feb5fb3
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-reboot-def.patch
@@ -0,0 +1,15 @@
+http://forum.canardpc.com/threads/110952-fix-build-due-to-missing-reboot-symbol
+
+the reboot func is used elsewhere, so don't mark it inline
+
+--- a/lib.c
++++ b/lib.c
+@@ -33,7 +33,7 @@ struct ascii_map_str {
+ int keycode;
+ };
+
+-inline void reboot(void)
++void reboot(void)
+ {
+
+ /* tell the BIOS to do a cold start */
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-test-random-cflags.patch b/sys-apps/memtest86+/files/memtest86+-5.01-test-random-cflags.patch
new file mode 100644
index 000000000000..dcdccb8c6e97
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-test-random-cflags.patch
@@ -0,0 +1,21 @@
+make sure we re-use the existing CFLAGS settings so that we get all the right
+flags (like -fno-stack-protector). just append the few changes we want (the
+optimization levels).
+
+https://bugs.gentoo.org/590974
+
+--- a/Makefile
++++ b/Makefile
+@@ -52,10 +52,10 @@ reloc.o: reloc.c
+ $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++test.o: CFLAGS += -O0 -fno-PIC
+
+ random.o: random.c
+- $(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
++random.o: CFLAGS += -O3 -fno-PIC
+
+ # rule for build number generation
+ build_number: