diff options
author | smb <smb@pkgsrc.org> | 2006-10-24 18:00:05 +0000 |
---|---|---|
committer | smb <smb@pkgsrc.org> | 2006-10-24 18:00:05 +0000 |
commit | 0dd1f0146ed33692a65a6e9ff1506e874569a04a (patch) | |
tree | 18ccf555a14f9e7fc933f8c01c2044ba763d21e2 /sysutils/memtestplus | |
parent | fcb35f696ac1508920c15a6990e2d215b99212fb (diff) | |
download | pkgsrc-0dd1f0146ed33692a65a6e9ff1506e874569a04a.tar.gz |
Add memtest+ 1.65 to pkgsrc, with options for serial console and .iso generation
Diffstat (limited to 'sysutils/memtestplus')
-rw-r--r-- | sysutils/memtestplus/DESCR | 6 | ||||
-rw-r--r-- | sysutils/memtestplus/MESSAGE | 20 | ||||
-rw-r--r-- | sysutils/memtestplus/Makefile | 36 | ||||
-rw-r--r-- | sysutils/memtestplus/PLIST | 7 | ||||
-rw-r--r-- | sysutils/memtestplus/distinfo | 7 | ||||
-rw-r--r-- | sysutils/memtestplus/options.mk | 23 | ||||
-rw-r--r-- | sysutils/memtestplus/patches/patch-aa | 22 | ||||
-rw-r--r-- | sysutils/memtestplus/patches/patch-ab | 59 |
8 files changed, 180 insertions, 0 deletions
diff --git a/sysutils/memtestplus/DESCR b/sysutils/memtestplus/DESCR new file mode 100644 index 00000000000..efa12ffd2d3 --- /dev/null +++ b/sysutils/memtestplus/DESCR @@ -0,0 +1,6 @@ +Memtest86+ is a thorough, stand alone memory test for i386 architecture +systems. BIOS-based memory tests are only a quick check and often miss +failures that are detected by Memtest86+. + +Memtest86+ is a descendant of Memtest86. Some people have found it +more comprehensive. diff --git a/sysutils/memtestplus/MESSAGE b/sysutils/memtestplus/MESSAGE new file mode 100644 index 00000000000..98b1afc501d --- /dev/null +++ b/sysutils/memtestplus/MESSAGE @@ -0,0 +1,20 @@ +=========================================================================== +$NetBSD: MESSAGE,v 1.1 2006/10/24 18:00:05 smb Exp $ + +Memtest86+ is a standalone program, it does not run within an operating +system. It has been designed to boot from a PC floppy disk. To install +Memtest86 on a floppy, insert a disk then type: + dd if=${PREFIX}/mdec/memtestplus.bin of=/dev/rfd0a conv=osync + +If you have built the optional .iso file, you can use cdrtools to +burn it to a CD. + +The documentation claims that the .bin file can be booted by LILO; I have +not tested that. + +Please read the documentation at: + ${PREFIX}/share/doc/memtestplus/README + ${PREFIX}/share/doc/memtestplus/FAQ + http://www.memtest.org + +=========================================================================== diff --git a/sysutils/memtestplus/Makefile b/sysutils/memtestplus/Makefile new file mode 100644 index 00000000000..e1709db3adf --- /dev/null +++ b/sysutils/memtestplus/Makefile @@ -0,0 +1,36 @@ +# $NetBSD: Makefile,v 1.1 2006/10/24 18:00:05 smb Exp $ +# + +DISTNAME= memtest86+-1.65 +PKGNAME= memtestplus-1.65 +CATEGORIES= sysutils +MASTER_SITES= http://www.memtest.org/download/1.65/ + +MAINTAINER= smb@NetBSD.org +HOMEPAGE= http://www.memtest.org/ +COMMENT= Thorough, stand alone memory test for x86 arch + +ONLY_FOR_PLATFORM= NetBSD-*-i386 Linux-*-i386 + +USE_TOOLS+= gmake + +SUBST_CLASSES+= delcr +SUBST_STAGE.delcr= post-build +SUBST_MESSAGE.delcr= Deleting CRs +SUBST_FILES.delcr= README +SUBST_SED.delcr= -e 's/.$$//g' + +.include "options.mk" + +do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/mdec + ${INSTALL_DATA} ${WRKSRC}/memtest.bin ${PREFIX}/mdec/memtestplus.bin + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/memtestplus + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/memtestplus + ${INSTALL_DATA} ${WRKSRC}/FAQ ${PREFIX}/share/doc/memtestplus +.if !empty(PKG_OPTIONS:Mmemtesplus-iso) + ${INSTALL_DATA} ${WRKSRC}/memtest.iso ${PREFIX}/mdec/memtestplus.iso +.endif + +.include "../../devel/binutils/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/memtestplus/PLIST b/sysutils/memtestplus/PLIST new file mode 100644 index 00000000000..2936023f932 --- /dev/null +++ b/sysutils/memtestplus/PLIST @@ -0,0 +1,7 @@ +@comment $NetBSD: PLIST,v 1.1 2006/10/24 18:00:05 smb Exp $ +mdec/memtestplus.bin +${HAVE_ISO}mdec/memtestplus.iso +share/doc/memtestplus/README +share/doc/memtestplus/FAQ +@unexec ${RMDIR} %D/mdec 2>/dev/null || ${TRUE} +@dirrm share/doc/memtestplus diff --git a/sysutils/memtestplus/distinfo b/sysutils/memtestplus/distinfo new file mode 100644 index 00000000000..070ded28e8d --- /dev/null +++ b/sysutils/memtestplus/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1 2006/10/24 18:00:05 smb Exp $ + +SHA1 (memtest86+-1.65.tar.gz) = f9c27f813cc9ada7efe98e6dc587ab6d2c496ba1 +RMD160 (memtest86+-1.65.tar.gz) = 629379f7660dbc6ab071a9d9839ce0528752dda8 +Size (memtest86+-1.65.tar.gz) = 146203 bytes +SHA1 (patch-aa) = db53250c1c2cef5b3dd369f55ea91981272d8530 +SHA1 (patch-ab) = defa256b698c32a40e4274597f3de79c1ea8eb10 diff --git a/sysutils/memtestplus/options.mk b/sysutils/memtestplus/options.mk new file mode 100644 index 00000000000..3b635e55502 --- /dev/null +++ b/sysutils/memtestplus/options.mk @@ -0,0 +1,23 @@ +# $NetBSD: options.mk,v 1.1 2006/10/24 18:00:05 smb Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.memtestplus +PKG_SUPPORTED_OPTIONS= memtesplus-iso memtesplus-serialconsole +PKG_SUGGESTED_OPTIONS= + +.include "../../mk/bsd.options.mk" + +.if !empty(PKG_OPTIONS:Mmemtesplus-iso) +BUILD_TARGET= memtest.iso +BUILD_DEPENDS+= cdrtools>=2.01:../../sysutils/cdrtools +PLIST_SUBST+= HAVE_ISO="" +.else +PLIST_SUBST+= HAVE_ISO="@comment " +.endif + +.if !empty(PKG_OPTIONS:Mmemtesplus-serialconsole) +SUBST_CLASSES+= serialopt +SUBST_STAGE.serialopt= post-patch +SUBST_MESSAGE.serialopt= Setting serial console option +SUBST_FILES.serialopt= config.h +SUBST_SED.serialopt= -e '/define.*SERIAL_CONSOLE_DEFAULT/s/0/1/' +.endif diff --git a/sysutils/memtestplus/patches/patch-aa b/sysutils/memtestplus/patches/patch-aa new file mode 100644 index 00000000000..77ed7538ec3 --- /dev/null +++ b/sysutils/memtestplus/patches/patch-aa @@ -0,0 +1,22 @@ +$NetBSD: patch-aa,v 1.1 2006/10/24 18:00:06 smb Exp $ + +--- Makefile.orig 2005-09-11 14:17:15.000000000 -0400 ++++ Makefile 2006-10-21 15:38:58.000000000 -0400 +@@ -6,7 +6,7 @@ + # + # Path for the floppy disk device + # +-FDISK=/dev/fd0 ++FDISK=/dev/fd0a + + CC=gcc + # +@@ -119,3 +119,8 @@ + + install-bin: + dd <precomp.bin >$(FDISK) bs=8192 ++ ++iso: memtest.iso ++ ++memtest.iso: memtest.bin ++ ./makeiso.sh diff --git a/sysutils/memtestplus/patches/patch-ab b/sysutils/memtestplus/patches/patch-ab new file mode 100644 index 00000000000..64da2da0e43 --- /dev/null +++ b/sysutils/memtestplus/patches/patch-ab @@ -0,0 +1,59 @@ +$NetBSD: patch-ab,v 1.1 2006/10/24 18:00:06 smb Exp $ + +--- test.c.orig 2005-09-11 14:17:15.000000000 -0400 ++++ test.c 2006-10-21 15:35:25.000000000 -0400 +@@ -11,7 +11,29 @@ + + #include "test.h" + #include "config.h" +-#include <sys/io.h> ++ ++static __inline void ++pkg_outb (unsigned char value, unsigned short int port) ++{ ++ __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port)); ++} ++ ++static __inline void ++pkg_outb_p (unsigned char value, unsigned short int port) ++{ ++ __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value), ++ "Nd" (port)); ++} ++ ++static __inline unsigned char ++pkg_inb_p (unsigned short int port) ++{ ++ unsigned char _v; ++ ++ __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port)); ++ return _v; ++} ++ + + + extern int segs, bail, beepmode; +@@ -1741,18 +1763,18 @@ + unsigned int count = 1193180 / frequency; + + // Switch on the speaker +- outb_p(inb_p(0x61)|3, 0x61); ++ pkg_outb_p(pkg_inb_p(0x61)|3, 0x61); + + // Set command for counter 2, 2 byte write +- outb_p(0xB6, 0x43); ++ pkg_outb_p(0xB6, 0x43); + + // Select desired Hz +- outb_p(count & 0xff, 0x42); +- outb((count >> 8) & 0xff, 0x42); ++ pkg_outb_p(count & 0xff, 0x42); ++ pkg_outb((count >> 8) & 0xff, 0x42); + + // Block for 100 microseconds + sleep(100, 1); + + // Switch off the speaker +- outb(inb_p(0x61)&0xFC, 0x61); ++ pkg_outb(pkg_inb_p(0x61)&0xFC, 0x61); + } |