diff options
author | Alexander Stein <alexander.stein@systec-electronic.com> | 2011-06-20 09:15:02 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-20 20:04:03 +0200 |
commit | 5e954fbef00fedd66fdc9a0c98ef290265bf32a9 (patch) | |
tree | fa5a345234c99a98009a767f767648cb061726f6 | |
parent | 5af49fbde5c186cf82e6b340cc3fc2f098cf8f23 (diff) | |
download | ptxdist-5e954fbef00fedd66fdc9a0c98ef290265bf32a9.tar.gz ptxdist-5e954fbef00fedd66fdc9a0c98ef290265bf32a9.tar.xz |
memtest86+: added new package
In ptxdist it is called MEMTEST86P because + is not valid.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
[mol: build only for x86]
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch | 39 | ||||
-rwxr-xr-x | patches/memtest86+-4.20/serial_base.patch | 26 | ||||
-rw-r--r-- | patches/memtest86+-4.20/series | 2 | ||||
-rw-r--r-- | rules/memtest86p.in | 27 | ||||
-rw-r--r-- | rules/memtest86p.make | 81 |
5 files changed, 175 insertions, 0 deletions
diff --git a/patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch b/patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch new file mode 100644 index 000000000..4841b1d15 --- /dev/null +++ b/patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch @@ -0,0 +1,39 @@ +Subject: Remove hardcoded cc variable + +This patch is from Gentoo. +URL: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/memtest86+/files/memtest86+-4.10-hardcoded_cc.patch?revision=1.1 + +This patch cleans up the Makefile to allow overwrite CC and AS variable + +Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> + +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 -nopie test.c + + clean: + rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin diff --git a/patches/memtest86+-4.20/serial_base.patch b/patches/memtest86+-4.20/serial_base.patch new file mode 100755 index 000000000..ea18382d4 --- /dev/null +++ b/patches/memtest86+-4.20/serial_base.patch @@ -0,0 +1,26 @@ +Subject: Use serial port addresses provided by BIOS + +Using this patch memtest86+ uses the serial port addresses provided by BIOS rather hardcoded defaults. + +Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> + +--- memtest86+-4.20/lib.c 2011-01-23 19:11:04.000000000 +0100 ++++ memtest86+-4.20/lib.c 2011-03-30 09:31:38.519674571 +0200 +@@ -24,7 +24,7 @@ + #error Bad SERIAL_TTY. Only ttyS0 and ttyS1 are supported. + #endif + short serial_tty = SERIAL_TTY; +-const short serial_base_ports[] = {0x3f8, 0x2f8, 0x3e8, 0x2e8}; ++unsigned short serial_base_ports[] = {0x3f8, 0x2f8, 0x3e8, 0x2e8}; + + #if ((115200%SERIAL_BAUD_RATE) != 0) + #error Bad default baud rate +@@ -1112,6 +1112,8 @@ + serial_baud_rate = (int) baud_rate; + save_tty: + serial_tty = (short) tty; ++ /* fetch I/O port address from BIOS data area */ ++ serial_base_ports[serial_tty] = ((const unsigned short *) 0x0400)[serial_tty]; + serial_cons = 1; + } + diff --git a/patches/memtest86+-4.20/series b/patches/memtest86+-4.20/series new file mode 100644 index 000000000..70c0db89c --- /dev/null +++ b/patches/memtest86+-4.20/series @@ -0,0 +1,2 @@ +memtest86+-4.10-hardcoded_cc.patch +serial_base.patch diff --git a/rules/memtest86p.in b/rules/memtest86p.in new file mode 100644 index 000000000..7e0a3f42f --- /dev/null +++ b/rules/memtest86p.in @@ -0,0 +1,27 @@ +## SECTION=debug_tools + +menuconfig MEMTEST86P + tristate + prompt "memtest86+ " + help + Memory tester based on memtest86 + +if MEMTEST86P + +config MEMTEST86P_SERIAL + bool "serial support" + help + The default state of the serial console. + This is normally off since it slows down testing. + +if MEMTEST86P_SERIAL + +config MEMTEST86P_BAUDRATE + int "default serial baudrate" + default 115200 + help + Default baudrate for serial console. + +endif + +endif diff --git a/rules/memtest86p.make b/rules/memtest86p.make new file mode 100644 index 000000000..d385e6fe4 --- /dev/null +++ b/rules/memtest86p.make @@ -0,0 +1,81 @@ +# -*-makefile-*- +# +# Copyright (C) 2011 by Alexander Stein <alexander.stein@systec-electronic.com> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_ARCH_X86)-$(PTXCONF_MEMTEST86P) += memtest86p + +# +# Paths and names +# +MEMTEST86P_VERSION := 4.20 +MEMTEST86P := memtest86+-$(MEMTEST86P_VERSION) +MEMTEST86P_SUFFIX := tar.gz +MEMTEST86P_URL := http://www.memtest.org/download/$(MEMTEST86P_VERSION)/$(MEMTEST86P).$(MEMTEST86P_SUFFIX) +MEMTEST86P_SOURCE := $(SRCDIR)/$(MEMTEST86P).$(MEMTEST86P_SUFFIX) +MEMTEST86P_DIR := $(BUILDDIR)/$(MEMTEST86P) +MEMTEST86P_LICENSE := GPL-2 +MEMTEST86P_MD5 := ef62c2f5be616676c8c62066dedc46b3 + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +$(STATEDIR)/memtest86p.prepare: + @$(call targetinfo) + +ifdef PTXCONF_MEMTEST86P_SERIAL + sed -i -e 's/#define SERIAL_CONSOLE_DEFAULT 0/#define SERIAL_CONSOLE_DEFAULT 1/' $(MEMTEST86P_DIR)/config.h + sed -i -e 's/#define SERIAL_BAUD_RATE .*/#define SERIAL_BAUD_RATE $(PTXCONF_MEMTEST86P_BAUDRATE)/' $(MEMTEST86P_DIR)/config.h +else + @sed -i -e 's/#define SERIAL_CONSOLE_DEFAULT 1/#define SERIAL_CONSOLE_DEFAULT 0/' $(MEMTEST86P_DIR)/config.h +endif + # Don't prestrip generated files + sed -i -e 's/$$(LD) -s /$$(LD) /' $(MEMTEST86P_DIR)/Makefile + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +MEMTEST86P_PATH := PATH=$(CROSS_PATH) +MEMTEST86P_MAKE_OPT := $(CROSS_ENV_PROGS) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/memtest86p.install: + @$(call targetinfo) + install -D -m 644 $(MEMTEST86P_DIR)/memtest.bin \ + $(MEMTEST86P_PKGDIR)/boot/memtest86+.bin + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/memtest86p.targetinstall: + @$(call targetinfo) + + @$(call install_init, memtest86p) + @$(call install_fixup, memtest86p,PRIORITY,optional) + @$(call install_fixup, memtest86p,SECTION,base) + @$(call install_fixup, memtest86p,AUTHOR,"Alexander Stein <alexander.stein@systec-electronic.com>") + @$(call install_fixup, memtest86p,DESCRIPTION,missing) + + @$(call install_copy, memtest86p, 0, 0, 0644, -, /boot/memtest86+.bin) + + @$(call install_finish, memtest86p) + + @$(call touch) + +# vim: syntax=make |