diff options
Diffstat (limited to 'system/memtest86+')
17 files changed, 165 insertions, 490 deletions
diff --git a/system/memtest86+/20_memtest86+ b/system/memtest86+/20_memtest86+ new file mode 100644 index 0000000000..f585a71cec --- /dev/null +++ b/system/memtest86+/20_memtest86+ @@ -0,0 +1,82 @@ +#!/bin/sh +set -e + +prefix="/usr" +exec_prefix="/usr" +datarootdir="/usr/share" + +. "$pkgdatadir/grub-mkconfig_lib" + +CLASS="--class memtest86 --class gnu --class tool" + +prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + +memtest_entry () +{ + image="$1" + args="$2" + rel_image="$(make_system_path_relative_to_its_root ${image})" + + # Apply some heuristics to show some images only on particular platforms. + basename="$(basename ${image})" + ftype="$(file ${image} | cut -d: -f2)" + if echo "${basename}" | grep -q ".elf\$" || echo "${ftype}" | grep -q "ELF"; then + protocol="knetbsd" + platform="pc" + #platform="" # Uncomment to show on EFI platforms; see below. + elif echo "${basename}" | grep -q ".efi\$" || echo "${ftype}" | grep -q "EFI"; then + protocol="chainloader" + platform="efi" + else # .bin, DOS/MBR boot sector + protocol="linux16" + platform="pc" + #platform="" # Uncomment to show on EFI platforms; see below. + fi + + # All images listed above should boot on EFI platforms, but many (those + # marked with platform="pc") will likely run without graphics and appear to + # the casual user to not work, so are hidden by default. (Some versions + # beep at startup, verifying it booted, but the display will be blank.) + # Serial consoles may still be useful. + # + # Uncomment this to un-hide all images on EFI platforms, or selectively edit + # the platform lines above to un-hide particular images. + #if [ "$platform" = "pc" ]; then + # platform="" + #fi + + if echo "${ftype}" | grep -q "Linux"; then # Linux kernel x86 boot executable + # .efi or .bin images may also present themselves as a Linux kernel image. + # When booted using the "linux" protocol, these images can be used on + # either "pc" or "efi" platform, and on EFI platforms they may have better + # or native resolution graphics. + protocol="linux" + #platform="" # Uncomment to discard platform constraint chosen above. + fi + + # TODO: Detect multiboot images, use protocol="multiboot" + + # Emit the menuentry. + platform_indent="" + if [ -n "${platform}" ]; then + echo "if [ x\$grub_platform = x${platform} ]; then" + platform_indent="${grub_tab}" + fi + echo "${platform_indent}menuentry \"Memory Tester (${basename})\" ${CLASS} {" + if [ "${protocol}" = "linux" -o "${protocol}" = "knetbsd" ]; then + echo "${platform_indent}${grub_tab}load_video" + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/${platform_indent}/" + echo "${platform_indent}${grub_tab}${protocol} ${rel_image} ${args}" + echo "${platform_indent}}" + if [ -n "${platform}" ]; then + echo "fi" + fi +} + +for image in $(find /boot -maxdepth 1 -type f -regex '/boot/memtest86\+.*' | sort -Vr); do + if is_path_readable_by_grub "${image}" ; then + gettext_printf "Found memtest86 image: %s\n" "${image}" >&2 + memtest_entry "${image}" "${GRUB_CMDLINE_MEMTEST86}" + fi +done diff --git a/system/memtest86+/README b/system/memtest86+/README index e1c23ed9d5..5aa50f6a31 100644 --- a/system/memtest86+/README +++ b/system/memtest86+/README @@ -1,5 +1,5 @@ Memtest86+ is thorough, stand alone memory test for Intel/AMD x86 -architecture systems. BIOS based memory tests are only a quick check +architecture systems. BIOS based memory tests are only a quick check and often miss failures that are detected by Memtest86+. This package installs a bootable image to /boot/memtest86+.bin @@ -15,19 +15,44 @@ Then run `/sbin/lilo` to update the boot loader. Don't forget to re-run `/sbin/lilo` if you upgrade this package. -GRUB 2 users: Append something like this to your /etc/grub.d/40_custom: +ELILO users: Append this to your /boot/efi/EFI/Slackware/elilo.conf: - menuentry 'memtest86+' { - linux16 (hd0,1)/boot/memtest86+.bin - } + image = memtest86+.bin + label = memtest86+ + +Next, copy memtest86+.bin alongside ELILO in your ESP partition: +`cp /boot/memtest86+.bin /boot/efi/EFI/Slackware/memtest86+.bin` +(Alternatively, use the .efi file instead of the .bin file; both should +work identically. Just ensure that "image" refers to an existing file.) -Then run `grub-mkconfig -o /boot/grub/grub.cfg` to update the boot menu. +When ELILO starts, press tab to show the available options. Increase +the delay parameter in elilo.conf if necessary to give yourself enough +time to make a selection. -GRUB Legacy users: Append something like this to your /boot/grub/menu.lst: +GRUB Legacy users: Append something like this to your +/boot/grub/menu.lst: title memtest86+ kernel (hd0,0)/boot/memtest86+.bin -See /usr/doc/memtest86+-$VERSION/README for more info. +GRUB 2 users: Auto-detected by the /etc/grub.d/20_memtest86+ script. +Run `grub-mkconfig -o /boot/grub/grub.cfg` to update the boot menu. + + +rEFInd users: Auto-detected, no additional steps required. +You may wish to copy /boot/memtest86+-$EFIARCH-$VERSION.efi +to /boot/efi/EFI/tools/memtest86.efi so that it will appear on the tools +line as a memory tester tool. If at this point it appears on both +lines, edit the "dont_scan_files" setting in your refind.conf to hide +the extra entries, or just remove this package. + + +It is possible to build an IA32 EFI image on Slackware64, if you have a +need for it, using `ARCH=i586 ./memtest86+.SlackBuild`. Compilation +will fail due to missing /usr/include/gnu/stubs-32.h from glibc. Copy +that file from stubs-64.h in the same directory (or create a symlink), +and you may delete your copy/symlink after you have created the package. + +See /usr/doc/memtest86+-$VERSION/README.md for more info. diff --git a/system/memtest86+/doinst.sh b/system/memtest86+/doinst.sh new file mode 100644 index 0000000000..26cd3dea88 --- /dev/null +++ b/system/memtest86+/doinst.sh @@ -0,0 +1,14 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/grub.d/20_memtest86+.new diff --git a/system/memtest86+/memtest86+.SlackBuild b/system/memtest86+/memtest86+.SlackBuild index cc9d2156ff..5b60123281 100644 --- a/system/memtest86+/memtest86+.SlackBuild +++ b/system/memtest86+/memtest86+.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for memtest86+ -# Copyright 2013-2019 Kyle Guinn <elyk03@gmail.com> +# Copyright 2013-2024 Kyle Guinn <elyk03@gmail.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,72 +22,54 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=memtest86+ -VERSION=${VERSION:-5.01} +SRCNAM=memtest86plus +VERSION=${VERSION:-7.00} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +# i586 or x86_64 only. Modify the Makefile at your own risk :-) +ARCH=${ARCH:-$(uname -m)} +case $ARCH in + i?86) BUILDDIR=build32; EFIARCH=ia32; ARCH=i586 ;; + x86_64) BUILDDIR=build64; EFIARCH=x64 ;; + *) echo "$ARCH is not supported." >&2; exit 1 ;; +esac -# i486 only. Modify the Makefile at your own risk :-) -ARCH=i486 +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi -CWD=$(pwd) TMP=${TMP:-/tmp/SBo} -PKG=$TMP/package-$PRGNAM-$VERSION +PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -DOCS="FAQ README* changelog" +DOCS="LICENSE README.md" set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -cd $PRGNAM-$VERSION +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.gz +cd $SRCNAM-$VERSION chown -R root:root . chmod -R u+w,go-w,a+rX-st . -# Upstream is dead. Lots of patches courtesy of Debian and Gentoo. -# If these get out-of-hand, consider switching to coreboot's fork: -# https://review.coreboot.org/cgit/memtest86plus.git/ - -# https://sources.debian.org/patches/memtest86+/5.01-3/ -# Last 3 are covered or made unnecessary by Gentoo's patches. -# Multiboot is disabled due to it being experimental and -# possibly not working correctly: https://bugs.debian.org/568176 -# Note that we aren't installing the multiboot image (memtest_shared). -# Note that patches multiboot and memtest86+-5.01-hardcoded_cc.patch conflict. -patch -p1 < $CWD/patches/doc-serialconsole -#patch -p1 < $CWD/patches/multiboot -#patch -p1 < $CWD/patches/memtest86+-5.01-O0.patch -#patch -p1 < $CWD/patches/memtest86+-5.01-array-size.patch -#patch -p1 < $CWD/patches/gcc-5 - -# https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-apps/memtest86+/files -patch -p1 < $CWD/patches/memtest86+-5.01-gcc-473.patch -patch -p1 < $CWD/patches/memtest86+-5.01-hardcoded_cc.patch -patch -p1 < $CWD/patches/memtest86+-5.01-no-scp.patch -patch -p1 < $CWD/patches/memtest86+-5.01-io-extern-inline.patch -patch -p1 < $CWD/patches/memtest86+-5.01-reboot-def.patch -patch -p1 < $CWD/patches/memtest86+-5.01-no-clean.patch -patch -p1 < $CWD/patches/memtest86+-5.01-no-C-headers.patch -patch -p1 < $CWD/patches/memtest86+-5.01-test-random-cflags.patch - -# More CFLAGS/CPPFLAGS cleanup, inspired by the previous patch. -patch -p1 < $CWD/patches/makefile.diff - -# https://bugs.debian.org/795421 -patch -p1 < $CWD/patches/memtest86+-test-7-smp.patch - -# https://bugs.debian.org/629506 -patch -p1 < $CWD/patches/bug_629506_message_15.mbox - +cd $BUILDDIR make -install -D -m 0755 memtest $PKG/boot/$PRGNAM-$VERSION +install -D -m 0755 memtest.efi $PKG/boot/$PRGNAM-$EFIARCH-$VERSION.efi install -D -m 0644 memtest.bin $PKG/boot/$PRGNAM-$VERSION.bin -ln -s $PRGNAM-$VERSION $PKG/boot/$PRGNAM -ln -s $PRGNAM-$VERSION.bin $PKG/boot/$PRGNAM.bin +ln -s $PRGNAM-$EFIARCH-$VERSION.efi $PKG/boot/$PRGNAM-$EFIARCH.efi +ln -s $PRGNAM-$VERSION.bin $PKG/boot/$PRGNAM.bin +cd .. + +install -D -m 0755 $CWD/20_memtest86+ $PKG/etc/grub.d/20_memtest86+.new mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION @@ -95,6 +77,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/memtest86+/memtest86+.info b/system/memtest86+/memtest86+.info index 0b3b6e3dde..9c6b4819cb 100644 --- a/system/memtest86+/memtest86+.info +++ b/system/memtest86+/memtest86+.info @@ -1,8 +1,8 @@ PRGNAM="memtest86+" -VERSION="5.01" +VERSION="7.00" HOMEPAGE="https://www.memtest.org/" -DOWNLOAD="https://www.memtest.org/download/5.01/memtest86+-5.01.tar.gz" -MD5SUM="43c5832baa919e1206e251e735cdee2d" +DOWNLOAD="https://github.com/memtest86plus/memtest86plus/archive/v7.00/memtest86plus-7.00.tar.gz" +MD5SUM="237418238fd499509edca8b21c3cc9c5" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/system/memtest86+/patches/bug_629506_message_15.mbox b/system/memtest86+/patches/bug_629506_message_15.mbox deleted file mode 100644 index 0b9362728f..0000000000 --- a/system/memtest86+/patches/bug_629506_message_15.mbox +++ /dev/null @@ -1,142 +0,0 @@ -From viro@ftp.linux.org.uk Fri Feb 27 20:21:34 2015 -Received: (at 629506) by bugs.debian.org; 27 Feb 2015 20:21:34 +0000 -X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02 - (2014-02-07) on buxtehude.debian.org -X-Spam-Level: -X-Spam-Status: No, score=-2.3 required=4.0 tests=BAYES_00,FOURLA,MONEY, - MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED,STOCKLIKE,T_RP_MATCHES_RCVD autolearn=no - autolearn_force=no version=3.4.0-bugs.debian.org_2005_01_02 -X-Spam-Bayes: score:0.0000 Tokens: new, 43; hammy, 150; neutral, 234; spammy, - 0. spammytokens: hammytokens:0.000-+--UD:patch, 0.000-+--H*u:1.5.21, - 0.000-+--H*UA:1.5.21, 0.000-+--H*u:2010-09-15, 0.000-+--H*UA:2010-09-15 -Return-path: <viro@ftp.linux.org.uk> -Received: from zeniv.linux.org.uk ([195.92.253.2]) - by buxtehude.debian.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) - (Exim 4.80) - (envelope-from <viro@ftp.linux.org.uk>) - id 1YRRPi-0007QW-72 - for 629506@bugs.debian.org; Fri, 27 Feb 2015 20:21:34 +0000 -Received: from viro by ZenIV.linux.org.uk with local (Exim 4.76 #1 (Red Hat Linux)) - id 1YRQyr-0000Hl-OS - for 629506@bugs.debian.org; Fri, 27 Feb 2015 19:53:49 +0000 -Date: Fri, 27 Feb 2015 19:53:49 +0000 -From: Al Viro <viro@ZenIV.linux.org.uk> -To: 629506@bugs.debian.org -Subject: memtest86+.bin crashes if loader ends up putting it not at 9000:0000 -Message-ID: <20150227195349.GN29656@ZenIV.linux.org.uk> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.5.21 (2010-09-15) -Sender: Al Viro <viro@ftp.linux.org.uk> -X-Greylist: delayed 1658 seconds by postgrey-1.34 at buxtehude; Fri, 27 Feb 2015 20:21:33 UTC - - FWIW, the effects described in this bug report are 100% reproducible -on any version, as long as the loader (lilo, grub, whatever) ends up putting -the bootsect+setup in any location below 9000:0000. - - zImage-type images consist of 3 parts - bootsect, setup and -payload. Payload is loaded at 1000:0, bootsect and setup - n:0 and -n+2:0 resp., near the top of lowmem. Payload is protected mode code, -setup - real mode one. Bootsect isn't executed at all; when the -same image is booted directly it would've been the only part loaded -by BIOS and it would copy itself and read the rest of the image to -expected locations and pass control to setup. Values in it can be -used by setup, though, so it must be present even when the image had been -brought in by a loader. - - The thing is, we can't be guaranteed n == 0x9000. E.g. ACPI and -SMM have every right to use _anything_ in range 512K..1M for their -state, declaring it reserved. That's what BIOS int 0x12 is for - it -reports how high (in kilobytes) can you go in lowmem without running into -reserved areas. And while having it report 512K is rare, something like -20K reserved just below the VRAM (i.e. report 620K) is nothing unusual. - - I hadn't looked into details of GRUB behaviour, but LILO puts its -secondary loader as high in lowmem as it can, then puts the bootsect and -setup parts of image below that. It tries to load at 9000:0 if possible, -but if there's no space, it'll go lower. With the sizes it uses 20K reserved -below 640K is enough to push bootsect + setup combination (just) below 9000:0. -And memtest86+ setup has that 0x9000 hardwired - this -gdt_48: - .word 0x800 # gdt limit=2048, 256 GDT entries - .word 512+gdt - start,0x9 # gdt base = 0X9xxxx -in setup.S really depends on 'start' (entry to setup) loaded at -0x90200 physical. Have it loaded at any other address and you'll trigger -an exception as soon as you try to assign any segment register after you switch -to protected mode. Which will escalate to triple-fault and reboot the -damn thing immediately. - - GRUB might be better or worse in triggering that "load not at -9000:0" situation, but it can't possibly avoid it in all cases. If nothing -else, 9000:0 might be within one of the reserved areas. It simply isn't -guaranteed to be available, period. - - Another issue is that setup of memtest86+ expects to see in %dx -the value left there by the bootsect of memtest86+. Fortunately, it's -not critical - in - movw $INITSEG, %ax - movw %ax, %ds - movw %ax, %es - movw %ax, %fs - movw %ax, %ss # reset the stack to INITSEG:0x4000-12. - movw %dx, %sp - push %cs - pop %ds -we really need only the last two instructions. The stack footprint -of what follows is fairly low *and* these values are not used past the -reload of segment registers immediately after protected mode switch. - -It's not the only problem in there - the bits after -# start from grub-a20.patch -are clearly cargo-culted from grub, badly. There it was a part of a function -that expects an argument on stack (it can turn A20 both on and off) and that -got blindly copied, nevermind that the value on stack is random or that -we follow it with (unconditional) use of 8042-based method anyway. I'd rather -see upstream opinion on that particular piece of code first, though. - -Anyway, the patch below fixes dependency on being loaded at 9000:0 and it -seems to work here without regressions. Have fun... - ---- memtest86+-5.01/setup.S 2013-08-09 22:01:58.000000000 -0400 -+++ fixed/setup.S 2015-02-27 14:18:47.000000000 -0500 -@@ -26,14 +26,13 @@ - # APs also execute this code - #ljmp $INITSEG, $(reload - start + 0x200) - reload: -- movw $INITSEG, %ax -- movw %ax, %ds -- movw %ax, %es -- movw %ax, %fs -- movw %ax, %ss # reset the stack to INITSEG:0x4000-12. -- movw %dx, %sp -+ xorl %eax, %eax - push %cs -- pop %ds -+ pop %ax -+ movw %ax, %ds -+ shll $4, %eax -+ addl %eax, (gdt_48 - start + 2) -+ - lidt idt_48 - start # load idt with 0,0 - lgdt gdt_48 - start # load gdt with whatever appropriate - -@@ -88,6 +87,7 @@ - movw %ax, %ds - movw %ax, %es - movw %ax, %ss -+ xorl %esp, %esp # 32bit code will set it then - movw %ax, %fs - movw %ax, %gs - -@@ -144,7 +144,7 @@ - - gdt_48: - .word 0x800 # gdt limit=2048, 256 GDT entries -- .word 512+gdt - start,0x9 # gdt base = 0X9xxxx -+ .word gdt - start,0 # gdt base, needs to be adjusted - - msg1: - .asciz "Setup.S\r\n" - - diff --git a/system/memtest86+/patches/doc-serialconsole b/system/memtest86+/patches/doc-serialconsole deleted file mode 100644 index c124e7a383..0000000000 --- a/system/memtest86+/patches/doc-serialconsole +++ /dev/null @@ -1,27 +0,0 @@ -commit 03867c811369be70cd81a42d150e0a250c9d1248 -Author: Yann Dirson <dirson@debian.org> -Date: Tue Sep 29 23:40:15 2009 +0200 - - git-debimport memtest86+_4.00-1.diff.gz - -Index: memtest86+/README -=================================================================== ---- memtest86+.orig/README -+++ memtest86+/README -@@ -89,12 +89,10 @@ To create a boot-disk with this pre-buil - ================= - Memtest86 can be used on PC's equipped with a serial port for the console. - By default serial port console support is not enabled since it slows --down testing. To enable change the SERIAL_CONSOLE_DEFAULT define in --config.h from a zero to a one. The serial console baud rate may also --be set in config.h with the SERIAL_BAUD_RATE define. The other serial --port settings are no parity, 8 data bits, 1 stop bit. All of the features --used by memtest86 are accessible via the serial console. However, the --screen sometimes is garbled when the online commands are used. -+down testing. -+ -+To activate it, add a console parameter on the memtest86+ -+command-line, like: "/boot/memtest86+.bin console=ttyS0,115200n8". - - - 5) Online Commands diff --git a/system/memtest86+/patches/makefile.diff b/system/memtest86+/patches/makefile.diff deleted file mode 100644 index 83bc8b5ff1..0000000000 --- a/system/memtest86+/patches/makefile.diff +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/Makefile b/Makefile ---- a/Makefile -+++ b/Makefile -@@ -11,7 +11,6 @@ - - CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \ - -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector --CPPFLAGS= -m32 - ASFLAGS= -32 - - # This reverts a change introduced with recent binutils (post -@@ -34,7 +33,7 @@ - $(LD) -shared -Bsymbolic -T memtest_shared.lds -o $@ $(OBJS) - - memtest_shared.bin: memtest_shared -- objcopy -O binary $< memtest_shared.bin -+ objcopy -O binary $< $@ - - memtest: memtest_shared.bin memtest.lds - $(LD) -s -T memtest.lds -b binary memtest_shared.bin -o $@ -@@ -50,10 +49,10 @@ - - memtest.bin: memtest_shared.bin bootsect.o setup.o memtest.bin.lds - $(LD) -T memtest.bin.lds bootsect.o setup.o -b binary \ -- memtest_shared.bin -o memtest.bin -+ memtest_shared.bin -o $@ - - reloc.o: reloc.c -- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c -+reloc.o: CFLAGS += -fno-strict-aliasing - - test.o: test.c - test.o: CFLAGS += -O0 -fno-PIC diff --git a/system/memtest86+/patches/memtest86+-5.01-gcc-473.patch b/system/memtest86+/patches/memtest86+-5.01-gcc-473.patch deleted file mode 100644 index af011d67c7..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-gcc-473.patch +++ /dev/null @@ -1,33 +0,0 @@ -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/system/memtest86+/patches/memtest86+-5.01-hardcoded_cc.patch b/system/memtest86+/patches/memtest86+-5.01-hardcoded_cc.patch deleted file mode 100644 index 21b51c5b7f..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-hardcoded_cc.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/Makefile.orig 2015-02-01 01:08:33.000000000 +0300 -+++ b/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/system/memtest86+/patches/memtest86+-5.01-io-extern-inline.patch b/system/memtest86+/patches/memtest86+-5.01-io-extern-inline.patch deleted file mode 100644 index 682dd5d01a..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-io-extern-inline.patch +++ /dev/null @@ -1,31 +0,0 @@ -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/system/memtest86+/patches/memtest86+-5.01-no-C-headers.patch b/system/memtest86+/patches/memtest86+-5.01-no-C-headers.patch deleted file mode 100644 index ce7f906a19..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-no-C-headers.patch +++ /dev/null @@ -1,49 +0,0 @@ -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/system/memtest86+/patches/memtest86+-5.01-no-clean.patch b/system/memtest86+/patches/memtest86+-5.01-no-clean.patch deleted file mode 100644 index e9cbf10399..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-no-clean.patch +++ /dev/null @@ -1,19 +0,0 @@ -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/system/memtest86+/patches/memtest86+-5.01-no-scp.patch b/system/memtest86+/patches/memtest86+-5.01-no-scp.patch deleted file mode 100644 index 8d830e297e..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-no-scp.patch +++ /dev/null @@ -1,14 +0,0 @@ -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/system/memtest86+/patches/memtest86+-5.01-reboot-def.patch b/system/memtest86+/patches/memtest86+-5.01-reboot-def.patch deleted file mode 100644 index f4b42feb5f..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-reboot-def.patch +++ /dev/null @@ -1,15 +0,0 @@ -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/system/memtest86+/patches/memtest86+-5.01-test-random-cflags.patch b/system/memtest86+/patches/memtest86+-5.01-test-random-cflags.patch deleted file mode 100644 index dcdccb8c6e..0000000000 --- a/system/memtest86+/patches/memtest86+-5.01-test-random-cflags.patch +++ /dev/null @@ -1,21 +0,0 @@ -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: diff --git a/system/memtest86+/patches/memtest86+-test-7-smp.patch b/system/memtest86+/patches/memtest86+-test-7-smp.patch deleted file mode 100644 index 424a88dcfd..0000000000 --- a/system/memtest86+/patches/memtest86+-test-7-smp.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/test.c -+++ b/test.c -@@ -1202,7 +1202,7 @@ void block_move(int iter, int me) - } else { - pe = end; - } -- if (pe >= end) { -+ if ((pe >= end && end != 0) || (pe < p && end == 0)) { - pe = end; - done++; - } -@@ -1280,7 +1280,7 @@ void block_move(int iter, int me) - } else { - pe = end; - } -- if (pe >= end) { -+ if ((pe >= end && end != 0) || (pe < p && end == 0)) { - pe = end; - done++; - } -@@ -1359,7 +1359,7 @@ void block_move(int iter, int me) - } else { - pe = end; - } -- if (pe >= end) { -+ if ((pe >= end && end != 0) || (pe < p && end == 0)) { - pe = end; - done++; - } |