Compare commits

...

No commits in common. 'c9' and 'c8' have entirely different histories.
c9 ... c8

2
.gitignore vendored

@ -1 +1 @@
SOURCES/memtest86+-5.31b.tar.gz
SOURCES/memtest86+-5.01.tar.gz

@ -1 +1 @@
7f4c16c6b04eb894154347047226b6e79ebe3c03 SOURCES/memtest86+-5.31b.tar.gz
eb4b6d70114db3c9ed320785da44c0ba8349c10c SOURCES/memtest86+-5.01.tar.gz

@ -2,8 +2,8 @@ Install memtest86+ into your grub menu by the following command:
# memtest-setup
It will install 20_memtest86+ GRUB 2 template into /etc/grub.d and you will also
need to regenerate GRUB 2 config by running:
If you use GRUB 2 (the default) it will install 20_memtest86+ GRUB template
into /etc/grub.d and you will also need to regenerate GRUB 2 config by running:
# grub2-mkconfig -o /boot/grub2/grub.cfg
@ -16,12 +16,13 @@ version by running:
# memtest-setup -b
Or you can switch between ELF and non-ELF versions of memtest86+ by using
INSTALL_ELF variable from /etc/memtest86+.conf. Setting it to '1' will instruct
GRUB 2 to install ELF version of memtest86+ and setting it to '0' will instruct
GRUB 2 to install non-ELF version. If the variable is empty or unset, the ELF
version is installed (it's due to backward compatibility). For the change
to take effect you need to regenerate your GRUB 2 config by running:
Or with GRUB 2 you can switch between ELF and non-ELF versions of memtest86+
by using INSTALL_ELF variable from /etc/memtest86+.conf. Setting it to '1'
will instruct GRUB 2 to install ELF version of memtest86+ and setting it
to '0' will instruct GRUB2 to install non-ELF version. If the variable
is empty or unset, the ELF version is installed (it's due to backward
compatibility). For the change to take effect you need to regenerate your
GRUB 2 config by running:
# grub2-mkconfig -o /boot/grub2/grub.cfg
@ -61,7 +62,7 @@ The memtest86+ now supports some command line parameters:
You can add memtest86+ command line parameters into grub like you are
used with kernel command line parameters, e.g.:
linux16 /memtest86+-VERSION console=ttyS0
kernel /memtest86+-VERSION console=ttyS0
Unfortunately this is currently supported only with non-ELF memtest86+ image.
You cannot use the command line parameters with the ELF image, because the

@ -1,11 +1,26 @@
#!/bin/bash
# package name
PNAME="memtest86+"
# binary image
BNAME="memtest86+"
# ELF image
ELFNAME="elf-$BNAME"
# executable image to be installed
ENAME="$ELFNAME"
# GRUB 2 template
G2TEMPL="20_memtest86+"
# GRUB 2 environment file
CONF_FILE="/etc/memtest86+.conf"
# GRUB legacy configuration file
GRUBCONF="/boot/grub/grub.conf"
# GRUB2 configuration file
GRUB2CFG="/boot/grub2/grub.cfg"
@ -17,24 +32,22 @@ ELF=1
if [ "$1" = "--help" -o "$1" = "-h" ]; then
cat <<:EOF
Usage:
memtest-setup [-b|-e|-h]
memtest-setup [--bin|--elf|--help]
usage: memtest-setup [OPTIONS]
The memtest-setup utility installs Memtest86+ into GRUB 2 boot loader menu.
It installs GRUB 2 template into /etc/grub.d directory.
This utility installs Memtest86+ into your GRUB boot loader menu.
It supports both GRUB 2 and GRUB Legacy (i.e. GRUB 0.9x).
In case of GRUB 2 it installs GRUB 2 template into /etc/grub.d and GRUB 2
config needs to be regenerated manually by running:
GRUB 2 configuration file needs to be regenerated manually by running:
grub2-mkconfig -o $GRUB2CFG
grub2-mkconfig -o $GRUB2CFG
This is not done automatically because it could overwrite any custom changes
in GRUB 2 configuration file.
in /boot/grub2/grub.cfg.
Options:
-b, --bin Install a binary Memtest86+ image.
-e, --elf Install an ELF Memtest86+ image (the default).
-h, --help Print a help message and exit.
OPTIONS:
-e , --elf installs ELF image (the default)
-b , --bin installs binary image (non-ELF)
-h , --help show this help
:EOF
exit 0
@ -43,41 +56,83 @@ fi
[ "$1" = "-b" -o "$1" = "--bin" ] && ELF=0
[ "$1" = "-e" -o "$1" = "--elf" ] && ELF=1
if [ "$ELF" = 1 ]; then
# BANNER_SUFFIX needs to be simultaneously changed also in grub2 template
BANNER_SUFFIX=
ENAME="$ELFNAME"
else
ELF=0
BANNER_SUFIX="(non-ELF)"
ENAME="$BNAME"
fi
if [ -d /sys/firmware/efi ]; then
echo "ERROR: memtest86+ does not support EFI platforms."
exit 254
fi
if [ ! -r "$GRUB2CFG" ]; then
if [ ! -r "$GRUBCONF" -a ! -r "$GRUB2CFG" ]; then
echo "ERROR: unable to read grub configuration file. Do you have enough permissions?"
echo "Try to run as root."
exit 249
fi
# install GRUB 2 template
if [ ! -d /etc/grub.d ]; then
if [ -f "$GRUB2CFG" ]; then
echo "GRUB 2 detected, installing template..."
if [ ! -d /etc/grub.d ]; then
echo "ERROR: unable to find /etc/grub.d"
exit 253
fi
if [ ! -r /usr/share/memtest86+/$G2TEMPL ]; then
fi
if [ ! -r /usr/share/memtest86+/$G2TEMPL ]; then
echo "ERROR: unable to find GRUB 2 template."
exit 251
fi
if ! cp /usr/share/memtest86+/$G2TEMPL /etc/grub.d; then
fi
if ! cp /usr/share/memtest86+/$G2TEMPL /etc/grub.d; then
echo "ERROR: unable to copy GRUB 2 template, do you have write permission to"
echo "/etc/grub.d?"
# EX_IOERR
exit 74
fi
if [ ! -w "$CONF_FILE" ]
then
fi
if [ ! -w "$CONF_FILE" ]
then
echo "ERROR: file '$CONF_FILE' is not writable."
exit 250
fi
chmod a+x /etc/grub.d/$G2TEMPL
echo "GRUB 2 template installed."
echo "Do not forget to regenerate your grub.cfg by:"
echo " # grub2-mkconfig -o $GRUB2CFG"
else
MTVERSION=`rpm -q --qf '%{version}' $PNAME`
MTPATH="/boot/$ENAME-$MTVERSION"
if [ ! -r "$GRUBCONF" ]; then
echo "ERROR: $GRUBCONF not found or not readable."
exit 252
fi
MENT=`cat /boot/grub/grub.conf | grep "$ENAME-$MTVERSION"` &> /dev/null
if [ "$MENT" != "" ]; then
echo "$MTPATH is already configured. Exiting..."
exit 0
fi
if [ ! -f $MTPATH ]; then
echo "ERROR: $MTPATH does not exist."
exit 255
fi
/sbin/new-memtest-pkg --install $MTVERSION --banner="Memtest86+${BANNER_SUFFIX}" --kernel-name="$ENAME"
RETVAL="$?"
if [ "$RETVAL" != "0" ]; then
echo "ERROR: grubby failed to configure your bootloader for $MTPATH."
exit $RETVAL
else
[ "$ELF" = 1 ] && sed -i -e"s,kernel \(/boot\)\?/$ENAME,kernel --type=netbsd \1/$ENAME," /boot/grub/grub.conf
sed -i -e"s,/$ENAME-$MTVERSION.*,/$ENAME-$MTVERSION," /boot/grub/grub.conf
fi
fi
chmod a+x /etc/grub.d/$G2TEMPL
echo "GRUB 2 template installed."
echo "Do not forget to regenerate your grub.cfg by:"
echo " # grub2-mkconfig -o $GRUB2CFG"
# update/add configuration variable to the configuration file
if grep -q "^\s*$CONF_VAR\s*=" "$CONF_FILE"

@ -1,32 +1,38 @@
.TH MEMTEST-SETUP 8 2018-05-17 Memtest86+ "Memtest86+ Manual"
.SH NAME
memtest-setup \- install Memtest86+ into GRUB\ 2 boot loader menu
.SH SYNOPSIS
.BR memtest-setup " [" \-b | \-e | \-h ]
.br
.BR memtest-setup " [" \-\-bin | \-\-elf | \-\-help ]
.SH DESCRIPTION
.RB "The " memtest-setup " utility installs Memtest86+ into GRUB\ 2 boot"
loader menu.
.RI "It installs GRUB\ 2 template into " /etc/grub.d " directory."
.TH "MEMTEST\-SETUP" "8" "Aug 26, 2014" "memtest-setup" "Memtest86+ User Manual"
.nh
.ad l
.SH "NAME"
memtest\-setup \- Install Memtest86+ into your GRUB boot loader menu
.SH "SYNOPSIS"
.HP \w'\fBmemtest\-setup\fR\ 'u
.B memtest\-setup
.RI [ OPTIONS ]
.SH "DESCRIPTION"
.PP
GRUB\ 2 configuration file needs to be regenerated manually by running:
.IP
.RI "grub2-mkconfig -o " /boot/grub2/grub.cfg
.PP
This is not done automatically because it could overwrite any custom
changes in GRUB\ 2 configuration file.
.SH OPTIONS
.TP
.BR \-b ", " \-\-bin
Install a binary Memtest86+ image.
.TP
.BR \-e ", " \-\-elf
Install an ELF Memtest86+ image (the default).
\fBmemtest\-setup\fR
installs Memtest86+ into your GRUB boot loader menu. It supports both GRUB\ 2
and GRUB Legacy (i.e. GRUB 0.9x). In case of GRUB\ 2 it installs GRUB\ 2 template
into \fI/etc/grub.d\fR and GRUB\ 2 config needs to be regenerated manually by
running \fBgrub2-mkconfig\ -o\ \fI/boot/grub2/grub.cfg\fR under root.
This is not done automatically because it could overwrite any custom changes in
\fI/boot/grub2/grub.cfg\fR.
.SH "OPTIONS"
.SS
.TP
.BR \-h ", " \-\-help
Print a help message and exit.
Shows help.
.SH "AUTHOR"
.PP
\fBJaroslav Škarvada\fR <\&jskarvad@redhat\&.com\&>
.RS 4
Manpage author\&.
.RE
.SH "COPYRIGHT"
.BR
Copyright \(co 2014 Jaroslav Škarvada
.BR
.PP
Permission is granted to copy, distribute and/or modify this document under the terms of the
GNU
General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation\&.
.SP

@ -0,0 +1,20 @@
--- memtest86+-5.01/io.h~ 2013-08-10 02:01:58.000000000 +0000
+++ memtest86+-5.01/io.h 2014-01-08 01:29:12.404465515 +0000
@@ -31,7 +31,7 @@
*/
#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) \
__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
@@ -43,7 +43,7 @@
__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) \
__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"

@ -0,0 +1,99 @@
diff --git a/controller.c b/controller.c
index f4f7371..183e9c3 100644
--- a/controller.c
+++ b/controller.c
@@ -2,6 +2,8 @@
* MemTest86+ V5 Specific code (GPL V2.0)
* By Samuel DEMEULEMEESTER, sdemeule@memtest.org
* http://www.canardpc.com - http://www.memtest.org
+ *
+ * Edited by David McInnis Oct 4, 2014
*/
//#include "defs.h"
@@ -292,7 +294,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 +329,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;
@@ -1424,7 +1426,7 @@ static void poll_fsb_amd64(void) {
unsigned long dramchr;
float clockratio;
double dramclock;
- unsigned int dummy[3];
+ unsigned int dummy[4];
int ram_type;
float coef = 10;
@@ -2851,13 +2853,13 @@ static void poll_timings_nf4ie(void) {
static void poll_timings_i875(void) {
- ulong dev6, dev62;
+ ulong dev6;
ulong temp;
float cas;
int rcd, rp, ras, chan;
long *ptr, *ptr2;
- pci_conf_read( 0, 6, 0, 0x40, 4, &dev62);
+ pci_conf_read( 0, 6, 0, 0x40, 4, &dev6);
ptr2=(long*)(dev6+0x68);
/* Read the MMR Base Address & Define the pointer */
diff --git a/init.c b/init.c
index 754b8d7..5bd8b4f 100644
--- a/init.c
+++ b/init.c
@@ -7,6 +7,8 @@
*
* Released under version 2 of the Gnu Public License.
* By Chris Brady
+ *
+ * Edited by David McInnis October 4, 2014
*/
@@ -914,7 +916,6 @@ void cpu_type(void)
default:
cprint(0, COL_MID, "Unknown Intel");
break;
- break;
}
}
diff --git a/main.c b/main.c
index 0bc7ca0..613f811 100644
--- a/main.c
+++ b/main.c
@@ -422,7 +422,7 @@ void test_start(void)
//initialise_cpus();
btrace(my_cpu_num, __LINE__, "BeforeInit", 1, 0, 0);
/* Draw the screen and get system information */
- init();
+ init();
/* Set defaults and initialize variables */
set_defaults();
@@ -737,7 +737,7 @@ void test_start(void)
/* Do the same test for each CPU */
if (++cpu_sel >= act_cpus)
{
- cpu_sel = 0;
+ cpu_sel = 0;
next_test();
} else {
continue;

@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 7906d50..03eb50b 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ AS=as -32
CC=gcc
CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
- -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
+ -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector -fgnu89-inline
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 \

@ -0,0 +1,11 @@
--- memtest86+-5.01/Makefile~ 2014-01-08 01:30:11.355900076 +0000
+++ memtest86+-5.01/Makefile 2014-01-08 01:31:19.387555469 +0000
@@ -12,7 +12,7 @@
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 \

@ -0,0 +1,12 @@
diff --git a/Makefile b/Makefile
index bd55c1c..9909f07 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,6 @@ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
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

@ -0,0 +1,13 @@
diff --git a/lib.c b/lib.c
index a2b829d..6a7e210 100644
--- a/lib.c
+++ b/lib.c
@@ -1141,7 +1141,7 @@ void serial_console_setup(char *param)
end++;
- if (*end != '\0' || *end != ' ')
+ if (*end != '\0' && *end != ' ')
return; /* garbage at the end */
serial_bits = bits;

@ -1,13 +0,0 @@
diff --git a/lib.c b/lib.c
index a2b829d..6a7e210 100644
--- a/lib.c
+++ b/lib.c
@@ -1141,7 +1141,7 @@ void serial_console_setup(char *param)
end++;
- if (*end != '\0' || *end != ' ')
+ if (*end != '\0' && *end != ' ')
return; /* garbage at the end */
serial_bits = bits;

@ -0,0 +1,352 @@
#!/bin/bash
#
# Invoked upon installation or removal of a kernel package, the following
# tasks are/can be done here:
# creation/removal of initrd
# run of depmod/removal of depmod generated files
# addition/removal of kernel images from grub/lilo configuration (via grubby)
#
# Copyright (C) 2002, 2003 Red Hat, Inc.
#
PATH=/sbin:/bin:$PATH
lilo=/usr/sbin/lilo
# some defaults that are sane for most arches
kernelName=elf-memtest86+
if [ -x ./grubby ]; then
grubby=./grubby
else
grubby=/usr/sbin/grubby
fi
cfgGrub=""
cfgLilo=""
runLilo=""
grubConfig=""
ARCH=$(uname -m)
if [ $ARCH = 'ia64' ]; then
liloConfig=/boot/efi/EFI/redhat/elilo.conf
bootPrefix=/boot/efi/EFI/redhat
liloFlag=elilo
isx86=""
elif [ $ARCH = 'ppc64' -o $ARCH = 'ppc' ]; then
liloConfig=/etc/yaboot.conf
bootPrefix=/boot
lilo=/usr/sbin/ybin
kernelName=vmlinux
liloFlag=yaboot
runLilo="yes"
isx86=""
elif [ $ARCH = 'sparc' -o $ARCH = 'sparc64' ]; then
liloConfig=/etc/silo.conf
bootPrefix=/boot
liloFlag=silo
lilo=/usr/sbin/silo
isx86=""
elif [ $ARCH = 's390' -o $ARCH = 's390x' ]; then
liloConfig=/etc/zipl.conf
bootPrefix=/boot
liloFlag=zipl
lilo=/usr/sbin/zipl
runLilo="yes"
isx86=""
else
# this leaves i?86 and x86_64
liloConfig=/etc/lilo.conf
grubConfig=/boot/grub/grub.conf
bootPrefix=/boot
liloFlag=lilo
isx86="yes"
fi
mode=""
version=""
initrd=""
initrdfile=""
moddep=""
verbose=""
usage() {
echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd]" >&2
echo " [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2
echo " [--kernel-args=<args>] [--banner=<banner>]" >&2
echo " [--kernel-name=<kernel-name>]" >&2
echo " <--install | --remove> <kernel-version>" >&2
echo " (ex: `basename $0` --mkinitrd --depmod --install 2.4.7-2)" >&2
exit 1
}
install() {
# XXX kernel should be able to be specified also (or work right on ia64)
if [ ! -f $bootPrefix/$kernelName-$version ] ; then
[ -n "$verbose" ] && echo "kernel for $version does not exist, not running grubby"
return
fi
INITRD=""
if [ -f $initrdfile ]; then
[ -n "$verbose" ] && echo "found $initrdfile and using it with grubby"
INITRD="--initrd $initrdfile"
fi
# FIXME: is this a good heuristic to find out if we're on iSeries?
if [ -d /proc/iSeries ]; then
[ -n "$verbose" ] && echo "On an iSeries, just making img file"
if [ -z $initrdfile ]; then
[ -n "$verbose" ] && echo "No initrd, just adding system map"
/usr/sbin/addSystemMap $bootPrefix/System.map-$version $bootPrefix/$kernelName-$version $bootPrefix/vmlinitrd-$version
else
/usr/sbin/addSystemMap $bootPrefix/System.map-$version $bootPrefix/$kernelName-$version $bootPrefix/vmlinux.sm-$version
/usr/sbin/addRamDisk $initrdfile $bootPrefix/System.map-$version $bootPrefix/vmlinux.sm-$version $bootPrefix/vmlinitrd-$version 2>/dev/null
rm $bootPrefix/vmlinux.sm-$version
fi
return
fi
# get the root filesystem to use; if it's on a label/uuid make sure it's
# been configured. if not, get the root device from mount
rootdevice=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/fstab)
short=$(echo $rootdevice | cut -d= -f1)
if [ "$short" == "LABEL" -o "$short" == "UUID" ]; then
if ! /usr/sbin/findfs "$rootdevice" &> /dev/null; then
rootdevice=$(mount | awk '$3 == "/" { print $1 }')
fi
fi
if [ -n "$cfgGrub" ]; then
[ -n "$verbose" ] && echo "adding $version to $grubConfig"
if [ -n "$banner" ]; then
title="$banner ($version)"
elif [ -f /etc/redhat-release ]; then
title="$(sed 's/ release.*$//' < /etc/redhat-release) ($version)"
else
title="Red Hat Linux ($version)"
fi
# check whether grubby supports --grub argument
if /usr/sbin/grubby --help | grep -qe '--grub\W'; then
GRUB_ARG="--grub "
else
GRUB_ARG=
fi
/usr/sbin/grubby ${GRUB_ARG}--add-kernel=$bootPrefix/$kernelName-$version $INITRD \
--copy-default --title "$title" \
--args="root=$rootdevice $kernargs" \
--remove-kernel="TITLE=$title"
else
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby"
fi
if [ -n "$cfgLilo" ]; then
[ -n "$verbose" ] && echo "adding $version to $liloConfig"
/usr/sbin/grubby --add-kernel=$bootPrefix/$kernelName-$version $INITRD \
--copy-default --title $version \
--args="root=$rootdevice $kernargs" \
--remove-kernel="TITLE=$version" \
--$liloFlag
if [ -n "$runLilo" ]; then
[ -n "$verbose" ] && echo "running $lilo"
if [ ! -x $lilo ] ; then
[ -n "$verbose" ] && echo "$lilo does not exist"
else
$lilo > /dev/null
fi
fi
else
[ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby"
fi
}
remove() {
# FIXME: is this a good heuristic to find out if we're on iSeries?
if [ -d /proc/iSeries ]; then
[ -n "$verbose" ] && echo "On an iSeries, remove img file"
rm -f $bootPrefix/$kernelName-$version.img 2>/dev/null
return
fi
if [ -n "$cfgGrub" ]; then
[ -n "$verbose" ] && echo "removing $version from $grubConfig"
/usr/sbin/grubby --remove-kernel=$bootPrefix/$kernelName-$version
else
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby"
fi
if [ -n "$cfgLilo" ]; then
[ -n "$verbose" ] && echo "removing $version from $liloConfig"
/usr/sbin/grubby --remove-kernel=$bootPrefix/$kernelName-$version \
--$liloFlag
if [ -n "$runLilo" ]; then
[ -n "$verbose" ] && echo "running $lilo"
if [ ! -x $lilo ] ; then
[ -n "$verbose" ] && echo "$lilo does not exist"
else
$lilo > /dev/null
fi
fi
else
[ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby"
fi
}
mkinitrd() {
[ -n "$verbose" ] && echo "creating initrd $initrdfile using $version"
/usr/sbin/mkinitrd -f $initrdfile $version
rc=$?
if [ $rc != 0 ]; then
echo "mkinitrd failed" >&2
exit 1
fi
}
rminitrd() {
[ -n "$verbose" ] && echo "removing initrd $initrdfile"
[ -f $initrdfile ] && rm -f $initrdfile
}
doDepmod() {
[ -n "$verbose" ] && echo "running depmod for $version"
depmod -ae -F /boot/System.map-$version $version
}
doRmmoddep() {
[ -n "$verbose" ] && echo "removing modules.dep info for $version"
[ -d /lib/modules/$version ] && rm -f /lib/modules/$version/modules.*
}
while [ $# -gt 0 ]; do
case $1 in
--mkinitrd)
initrd="make"
;;
--rminitrd)
initrd="remove"
;;
--initrdfile*)
if echo $1 | grep '=' >/dev/null ; then
initrdfile=`echo $1 | sed 's/^--initrdfile=//'`
else
initrdfile=$2
shift
fi
;;
--kernel-args*)
if echo $1 | grep '=' >/dev/null ; then
kernargs=`echo $1 | sed 's/^--kernel-args=//'`
else
kernargs=$2
shift
fi
;;
--banner*)
if echo $1 | grep '=' >/dev/null ; then
banner=`echo $1 | sed 's/^--banner=//'`
else
banner=$2
shift
fi
;;
--kernel-name*)
if echo $1 | grep '=' >/dev/null ; then
kernelName=`echo $1 | sed 's/^--kernel-name=//'`
else
kernelName=$2
shift
fi
;;
--depmod)
moddep="make"
;;
--rmmoddep)
moddep="remove"
;;
-v)
verbose=-v
;;
*)
if [ -z "$mode" ]; then
mode=$1
elif [ -z "$version" ]; then
version=$1
else
usage
fi
;;
esac
shift
done
# make sure the mode is valid
if [ "$mode" != "--install" -a "$mode" != "--remove" ] ; then
usage
fi
if [ -z "$version" ]; then
usage
fi
# set the initrd file based on arch; ia64 is the only currently known oddball
if [ -z "$initrdfile" ]; then
if [ `uname -m` = "ia64" ]; then
initrdfile="/boot/efi/EFI/redhat/initrd-$version.img"
else
initrdfile="/boot/initrd-$version.img"
fi
fi
[ -n "$verbose" ] && echo "initrdfile is $initrdfile"
if [ "$moddep" == "make" ]; then
doDepmod
elif [ "$moddep" == "remove" ]; then
doRmmoddep
fi
if [ "$initrd" == "make" ]; then
mkinitrd
elif [ "$initrd" == "remove" ]; then
rminitrd
fi
if [ ! -x $grubby ] ; then
[ -n "$verbose" ] && echo "$grubby does not exist"
exit 0
fi
[ -n "$grubConfig" ] && [ -f "$grubConfig" ] && cfgGrub=1;
[ -n "$liloConfig" ] && [ -f "$liloConfig" ] && cfgLilo=1;
# if we have a lilo config on an x86 box, see if the default boot loader
# is lilo to determine if it should be run
if [ -n "$cfgLilo" -a -n "$isx86" ]; then
runLilo=$($grubby --bootloader-probe | grep lilo)
fi
if [ "$mode" == "--install" ]; then
install
elif [ "$mode" == "--remove" ]; then
remove
fi
exit 0

@ -7,28 +7,34 @@
%global readme_suffix %{?rhel:redhat}%{!?rhel:fedora}
%global prerel_short b
%global prerel_long beta
Name: memtest86+
Version: 5.31
Release: 0.4.%{?prerel_long}%{?dist}
Version: 5.01
Release: 20%{?dist}
License: GPLv2
Summary: Stand-alone memory tester for x86 and x86-64 computers
Source0: http://www.memtest.org/download/%{version}%{?prerel_short}/%{name}-%{version}%{?prerel_short}.tar.gz
Group: System Environment/Base
Source0: http://www.memtest.org/download/%{version}/%{name}-%{version}.tar.gz
Source1: memtest-setup
Source2: 20_memtest86+
Source3: memtest-setup.8
Source4: memtest86+.conf
Source5: README
# sent upstream
Patch0: memtest86+-5.31b-serial-console-fix.patch
Source2: new-memtest-pkg
Source3: 20_memtest86+
Source4: memtest-setup.8
Source5: memtest86+.conf
Source6: README
# reported upstream
Patch0: memtest86+-5.01-no-scp.patch
# patches to get memtest86+ working with gcc-4.7.2 or later + PCI scan fix
# these patches were taken from Mageia
# upstream report containing link to the patches:
# http://forum.canardpc.com/threads/83443-Memtest86-V5.01-crashes-with-gcc-4.7.2-or-later
Patch1: memtest86+-5.01-no-optimization.patch
Patch2: memtest86+-5.01-compile-fix.patch
Patch3: memtest86+-5.01-crash-fix.patch
Patch4: memtest86+-5.01-fgnu89-inline.patch
Patch5: memtest86+-5.01-serial-console-fix.patch
URL: http://www.memtest.org
# require glibc-devel.i386 via this file:
BuildRequires: make
BuildRequires: %{_includedir}/gnu/stubs-32.h
BuildRequires: gcc
Requires: sed coreutils
Requires: grubby sed coreutils util-linux
ExclusiveArch: %{ix86} x86_64
%description
@ -47,10 +53,14 @@ The script '%{_sbindir}/memtest-setup' can be run (as root)
to add the %{name} entry to your GRUB boot menu.
%prep
%setup -q -n %{name}-%{version}%{?prerel_short}
cp -p %{SOURCE5} README.%{readme_suffix}
%patch0 -p1 -b .serial-console-fix
%setup -q
cp -p %{SOURCE6} README.%{readme_suffix}
%patch0 -p1 -b .no-scp
%patch1 -p1 -b .no-optimization
%patch2 -p1 -b .compile-fix
%patch3 -p1 -b .crash-fix
%patch4 -p1 -b .fgnu89-inline
%patch5 -p1 -b .serial-console-fix
#sed -i -e's,0x10000,0x100000,' memtest.lds
%ifarch x86_64
@ -72,31 +82,40 @@ install -m644 memtest %{buildroot}/boot/elf-%{name}-%{version}
# the floppy (memtest.bin) version.
install -m644 memtest.bin %{buildroot}/boot/%{name}-%{version}
install -m755 %{SOURCE2} %{buildroot}%{_sbindir}/new-memtest-pkg
install -m755 %{SOURCE1} %{buildroot}%{_sbindir}/memtest-setup
sed -i 's/\r//' $RPM_BUILD_DIR/%{name}-%{version}%{?prerel_short}/README
sed -i 's/\r//' $RPM_BUILD_DIR/%{name}-%{version}/README
mkdir -p %{buildroot}%{_sysconfdir}/grub.d
touch %{buildroot}%{_sysconfdir}/grub.d/20_memtest86+
install -Dd %{buildroot}%{_datadir}/%{name}
install -m644 %{SOURCE2} %{buildroot}%{_datadir}/%{name}
install -m644 %{SOURCE3} %{buildroot}%{_datadir}/%{name}
# install manual page
install -Dpm 0644 %{SOURCE3} %{buildroot}%{_mandir}/man8/memtest-setup.8
install -Dpm 0644 %{SOURCE4} %{buildroot}%{_mandir}/man8/memtest-setup.8
# install configuration file
install -Dpm 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/memtest86+.conf
install -Dpm 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/memtest86+.conf
%post
%if %{with update_grub}
/usr/sbin/memtest-setup
%endif
%preun
if [ -f /boot/grub/grub.conf ]
then
sed -i -e's,kernel --type=netbsd /elf-%{name}-%{version},kernel /elf-%{name}-%{version},' /boot/grub/grub.conf
%{_sbindir}/new-memtest-pkg --remove %{version}
fi
%files
%doc README README.%{readme_suffix}
%config(noreplace) %{_sysconfdir}/memtest86+.conf
/boot/%{name}-%{version}
/boot/elf-%{name}-%{version}
%{_sbindir}/new-memtest-pkg
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/20_memtest86+
%ghost %attr(0755,-,-) %{_sysconfdir}/grub.d/20_memtest86+
@ -104,50 +123,9 @@ install -Dpm 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/memtest86+.conf
%{_mandir}/man8/*.8.gz
%changelog
* Fri Apr 16 2021 Brian Stinson <bstinson@redhat.com> - 5.31-0.4.beta
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.31-0.3.beta
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.31-0.2.beta
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed May 13 2020 Jaroslav Škarvada <jskarvad@redhat.com> - 5.31-0.1.beta
- New version
Resolves: rhbz#1758783
- Dropped no-scp, no-optimization, compile-fix, crash-fix patches (all upstreamed)
- Dropped fgnu89-inline patch (probably not needed)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Aug 2 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-27
- No more compat-gcc in rawhide, so switching to distro's gcc
Resolves: rhbz#1736106
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Apr 5 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-25
* Thu Oct 22 2020 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-20
- Fixed serial console
* Tue Feb 5 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-24
- Temporally switched to compat-gcc-34
Resolves: rhbz#1598922
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 20 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-22
- Fixed FTBFS by adding gcc-c++ requirement
Resolves: rhbz#1604814
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jun 28 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-20
- Dropped grub legacy support
Resolves: rhbz#1696877
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

Loading…
Cancel
Save