On Thu, Jun 16, 2011 at 05:17:17PM +0200, Alexander Stein wrote:
> In ptxdist it is called MEMTEST86P because + is not valid.
> 
> Signed-off-by: Alexander Stein <[email protected]>
> ---
>  .../memtest86+-4.10-hardcoded_cc.patch             |   32 ++++++++
>  patches/memtest86+-4.20/serial_base.patch          |   23 ++++++
>  patches/memtest86+-4.20/series                     |    2 +
>  rules/memtest86p.in                                |   28 +++++++
>  rules/memtest86p.make                              |   84 
> ++++++++++++++++++++
>  5 files changed, 169 insertions(+), 0 deletions(-)
>  create mode 100644 patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch
>  create mode 100755 patches/memtest86+-4.20/serial_base.patch
>  create mode 100644 patches/memtest86+-4.20/series
>  create mode 100644 rules/memtest86p.in
>  create mode 100644 rules/memtest86p.make
> 
> 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 0000000..55ab153
> --- /dev/null
> +++ b/patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch
> @@ -0,0 +1,32 @@
> +This patch is from Gentoo
> +

Add a proper patch header please.

> +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 0000000..6d59be6
> --- /dev/null
> +++ b/patches/memtest86+-4.20/serial_base.patch
> @@ -0,0 +1,23 @@
> +
> +Read the actual I/O ports from BIOS

dito.

> +
> +--- memtest86+-4.20/lib.c    2011-01-23 19:11:04.000000000 +0100
> ++++ memtest86+-4.20_dk/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 0000000..70c0db8
> --- /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 0000000..17db781
> --- /dev/null
> +++ b/rules/memtest86p.in
> @@ -0,0 +1,28 @@
> +## SECTION=debug_tools
> +
> +menuconfig MEMTEST86P
> +     tristate
> +     prompt "memtest86+                    "
> +     help
> +       Memory tester based on memtest86
> +
> +if MEMTEST86P
> +
> +config MEMTEST86P_SERIAL
> +     bool "serial support"
> +     default n

'n' is always the default. Remove.

> +     help
> +       The default state of the serial console.
> +       This is normally off since it slows down testing.
> +
> +if MEMTEST86P_SERIAL
> +
> +config MEMTEST86P_BAUDRATE
> +     int "serial baudrate"
> +     default 115200
> +     help
> +       Default baudrate for serial console.

Default, as in 'it can be changed at runtime'? Then the prompt should be
'default serial baudrate'

> +
> +endif
> +
> +endif
> diff --git a/rules/memtest86p.make b/rules/memtest86p.make
> new file mode 100644
> index 0000000..6e06bc7
> --- /dev/null
> +++ b/rules/memtest86p.make
> @@ -0,0 +1,84 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2011 by Alexander Stein 
> <[email protected]>
> +#
> +# 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_MEMTEST86P) += memtest86p
> +
> +#
> +# Paths and names
> +#
> +MEMTEST86P_VERSION   := 4.20

MEMTEST86P_MD5 is missing.

> +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
> +
> +# 
> ----------------------------------------------------------------------------
> +# Prepare
> +# 
> ----------------------------------------------------------------------------
> +
> +MEMTEST86P_CONF_ENV  := $(CROSS_ENV)

remove.

> +
> +$(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_CC) \
> +     $(CROSS_ENV_CPP) \
> +     $(CROSS_ENV_AS) \
> +     $(CROSS_ENV_LD)

use $(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 
> <[email protected]>")
> +     @$(call install_fixup, memtest86p,DESCRIPTION,missing)
> +
> +     @$(call install_copy, memtest86p, 0, 0, 0644, 
> $(MEMTEST86P_DIR)/memtest.bin, /boot/memtest86+.bin)

        @$(call install_copy, memtest86p, 0, 0, 0644, -, /boot/memtest86+.bin)

Michael

> +
> +     @$(call install_finish, memtest86p)
> +
> +     @$(call touch)
> +
> +# vim: syntax=make
> -- 
> 1.7.3.4
> 
> 
> -- 
> ptxdist mailing list
> [email protected]
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
[email protected]

Reply via email to