Auto sync2gitlab import of memtest86+-5.01-20.el8.src.rpm

This commit is contained in:
James Antill 2022-05-26 11:21:42 -04:00
parent 6a2a2a3068
commit 4c9cdc5650
16 changed files with 1428 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/memtest86+-5.01.tar.gz

142
20_memtest86+ Normal file
View File

@ -0,0 +1,142 @@
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2011 Michal Ambroz <rebus@seznam.cz>
#
# you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the script. If not, see <http://www.gnu.org/licenses/>.
prefix=/usr
exec_prefix=/usr
bindir=/usr/bin
grublibdir=/usr/share/grub
. ${grublibdir}/grub-mkconfig_lib
export TEXTDOMAIN=grub
export TEXTDOMAINDIR=${prefix}/share/locale
CLASS=""
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=Memtest
else
OS="${GRUB_DISTRIBUTOR} Memtest"
fi
CONF_FILE="/etc/memtest86+.conf"
CONF_ELF_VAR="INSTALL_ELF"
MEMTEST86_ELF=`[ -r "$CONF_FILE" ] && sed -n "/^\s*${CONF_ELF_VAR}\s*=/ {s/^\s*${CONF_ELF_VAR}\s*=\s*\(.*\)$/\1/; T end; s/\s*\(\S\)*\s*/\1/; p; :end}" "$CONF_FILE" 2>/dev/null`
if [ "x${MEMTEST86_ELF}" = "x" ] || [ "x${MEMTEST86_ELF}" = "x1" ] || [ "x${MEMTEST86_ELF}" = "xtrue" ]; then
MEMTEST86_ELF=1
BANNER_SUFFIX=
IMAGE="elf-memtest"
else
MEMTEST86_ELF=0
IMAGE="memtest"
BANNER_SUFFIX=" (non-ELF)"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
/dev/loop/*|/dev/loop[0-9])
GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
;;
esac
if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
|| uses_abstraction "${GRUB_DEVICE}" lvm; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi
if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
rootsubvol="`make_system_path_relative_to_its_root /`"
rootsubvol="${rootsubvol#/}"
if [ "x${rootsubvol}" != x ]; then
GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
fi
fi
memtest_entry ()
{
os="$1"
version="$2"
recovery="$3"
args="$4"
title="$(gettext_quoted "%s %s")"
printf "menuentry '${title}${BANNER_SUFFIX}' {\n" "${os}" "${version}"
if [ x$dirname = x/ ]; then
if [ -z "${prepare_root_cache}" ]; then
prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_root_cache}"
else
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_boot_cache}"
fi
message="$(gettext_printf "Loading %s %s ..." "${os}" "${version}")"
if [ "x${MEMTEST86_ELF}" = "x1" ]; then
cat << EOF
insmod bsd
echo '$message'
knetbsd ${rel_dirname}/${basename}
}
EOF
else
cat << EOF
echo '$message'
linux16 ${rel_dirname}/${basename}
}
EOF
fi
}
case x`uname -m` in
xi?86 | xx86_64)
list=`for i in /boot/${IMAGE}* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done` ;;
*)
list=`for i in /boot/${IMAGE}* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done` ;;
esac
prepare_boot_cache=
prepare_root_cache=
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
echo "Found memtest image: $linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
memtest_entry "${OS}" "${version}" false \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done

1
EMPTY
View File

@ -1 +0,0 @@

83
README Normal file
View File

@ -0,0 +1,83 @@
Install memtest86+ into your grub menu by the following command:
# memtest-setup
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
This is not done automatically because it could overwrite any custom changes
in /boot/grub2/grub.cfg.
By default ELF version of memtest86+ is installed, which should work on most of
the systems. In case it doesn't work for you, you can try to install the non-ELF
version by running:
# memtest-setup -b
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
The non-ELF version is known to cause various problems and it may not work on
several systems. That's why the ELF version is installed by default.
In case of problems you can also try to install the non-ELF version of
memtest86+ on floppy disk or USB flash disk and boot the memtest86+ from it.
The following command installs the memtest86+ on floppy disk
(WARNING: all data previosly stored on the disk will be lost):
# dd if=/boot/memtest86+-VERSION of=/dev/fd0
For USB flash disk the command is the same, just change the 'of' device
appropriately (usually USB flash disk is /dev/sdb, but double check that
the device string matches your USB flash disk before you run the command,
wrong device string may cause significat harm, e.g. it can destroy content
of your system or data disks).
The memtest86+ now supports some command line parameters:
console= - serial console can be used for memtest86+ control/display,
example of usage:
console=ttyS0
console=ttyS0,115200
console=ttyS1,115200n8
Only ttyS0 and ttyS1 are supported.
btrace - enable boot trace.
maxcpus= - limit number of CPUs to use.
onepass - run one pass and exit if there are no errors.
tstlist= - setup a list of tests to run.
cpumask= - set a CPU (hexadecimal) mask to select CPU's to use for testing.
You can add memtest86+ command line parameters into grub like you are
used with kernel command line parameters, e.g.:
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
command line handling is currently not supported by grub for ELF images.
If you need to use serial console with ELF image, you need to recompile
memtest86+ and explicitly enable/configure serial line. In such case
edit the config.h in memtest86+ sources the following way:
#define SERIAL_CONSOLE_DEFAULT 1
#define SERIAL_TTY 0
#define SERIAL_BAUD_RATE 9600
and recompile memtest86+. This will explicitly enable serial console and
set it to use ttyS0,9600.
NOTE: explicitly enabled serial console may significantly slow down the memory
testing.

145
memtest-setup Executable file
View File

@ -0,0 +1,145 @@
#!/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"
# GRUB2 environment variable to control image type
CONF_VAR="INSTALL_ELF"
# whether to install ELF image
ELF=1
if [ "$1" = "--help" -o "$1" = "-h" ]; then
cat <<:EOF
usage: memtest-setup [OPTIONS]
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:
grub2-mkconfig -o $GRUB2CFG
This is not done automatically because it could overwrite any custom changes
in /boot/grub2/grub.cfg.
OPTIONS:
-e , --elf installs ELF image (the default)
-b , --bin installs binary image (non-ELF)
-h , --help show this help
:EOF
exit 0
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 "$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
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
echo "ERROR: unable to find GRUB 2 template."
exit 251
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
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
# update/add configuration variable to the configuration file
if grep -q "^\s*$CONF_VAR\s*=" "$CONF_FILE"
then
sed -i "/^\s*$CONF_VAR\s*=/ s/\(\s*$CONF_VAR\s*=[\"']\?\)[^\"']*\([\"']\?\s*\)/\1${ELF}\2/g" "$CONF_FILE"
else
echo "$CONF_VAR=\"$ELF\"" >> "$CONF_FILE"
fi
echo "Setup complete."

38
memtest-setup.8 Normal file
View File

@ -0,0 +1,38 @@
.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
\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
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

View File

@ -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"

View File

@ -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;

View File

@ -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 \

View File

@ -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 \

View File

@ -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

View File

@ -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;

10
memtest86+.conf Normal file
View File

@ -0,0 +1,10 @@
# If INSTALL_ELF is set to 1 or if it is unset/empty, the ELF version of the
# memtest86+ will be installed, otherwise the non-ELF version will be
# installed. If you change this variable, you will have to regenerate your
# grub.conf for the changed to take effect, it is usually done by the
# following command:
#
# grub2-mkconfig -o /boot/grub2/grub.cfg
#
# For details see memtest86+ package documentation.
INSTALL_ELF=1

488
memtest86+.spec Normal file
View File

@ -0,0 +1,488 @@
%bcond_with update_grub
# Prevent stripping
%global __spec_install_post /usr/lib/rpm/brp-compress
# Turn off debuginfo package
%global debug_package %{nil}
%global readme_suffix %{?rhel:redhat}%{!?rhel:fedora}
Name: memtest86+
Version: 5.01
Release: 20%{?dist}
License: GPLv2
Summary: Stand-alone memory tester for x86 and x86-64 computers
Group: System Environment/Base
Source0: http://www.memtest.org/download/%{version}/%{name}-%{version}.tar.gz
Source1: memtest-setup
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: %{_includedir}/gnu/stubs-32.h
Requires: grubby sed coreutils util-linux
ExclusiveArch: %{ix86} x86_64
%description
Memtest86+ is a thorough stand-alone memory test for x86 and x86-64
architecture computers. BIOS based memory tests are only a quick
check and often miss many of the failures that are detected by
Memtest86+.
The ELF version should be used for booting from grub,
and avoids the following errors:
"Error 7: Loading below 1MB is not supported"
"Error 13: Invalid or unsupported executable format"
"Error 28: Selected item cannot fit into memory"
The script '%{_sbindir}/memtest-setup' can be run (as root)
to add the %{name} entry to your GRUB boot menu.
%prep
%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
sed -i -e's,$(LD) -s -T memtest.lds,$(LD) -s -T memtest.lds -z max-page-size=0x1000,' Makefile
%endif
%build
# Regular build flags not wanted for this binary
# Note: i486 minimum runtime arch
# It makes no sense to use smp flags here.
make
%install
mkdir -p %{buildroot}/{boot,%{_sbindir}}
# the ELF (memtest) version.
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}/README
mkdir -p %{buildroot}%{_sysconfdir}/grub.d
touch %{buildroot}%{_sysconfdir}/grub.d/20_memtest86+
install -Dd %{buildroot}%{_datadir}/%{name}
install -m644 %{SOURCE3} %{buildroot}%{_datadir}/%{name}
# install manual page
install -Dpm 0644 %{SOURCE4} %{buildroot}%{_mandir}/man8/memtest-setup.8
# install configuration file
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+
%{_sbindir}/memtest-setup
%{_mandir}/man8/*.8.gz
%changelog
* Thu Oct 22 2020 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-20
- Fixed serial console
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
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Apr 5 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-15
- Various improvements to memtest-setup, e.g. now exits with error if
run by non root user
* Tue Feb 23 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-14
- Removed some spec artifacts (like buildroot cleaning)
- Fixed malformed "Loading" banner
- Not relocating memtest86+ above 1 MB
Related: rhbz#1303804
- Introduced new configuration file (/etc/memtest86+.conf)
- Introduced new memtest-setup switches for selecting ELF/non-ELF versions
Resolves: rhbz#1303804
* Fri Feb 12 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-13
- Updated distribution specific README
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.01-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jan 28 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-11
- Fixed memtest86+ binary (non-ELF) to run from floppy
* Fri Jan 8 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-10
- Fixed memtest86+ to run even if relocated above 1 MB
(by real-mode-reloc patch)
- Relocated memtest86+ above 1 MB (as we always did in Fedora)
- Fixed compilation of inline assembly with new gcc
(by fgnu89-inline patch)
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.01-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Oct 21 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-8
- More crash fixes (by crash-fix patch from David McInnis)
* Fri Sep 5 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-7
- Fixed typo in memtest-setup help, added its options to man / help
* Wed Sep 3 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-6
- Fixed memtest-setup script
* Tue Aug 26 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-5
- Added documentation regarding memtest-setup
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.01-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.01-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu Apr 3 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-2
- Switched back to latest distro gcc
* Mon Feb 17 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 5.01-1
- New version
Resolves: rhbz#1013110
- Switched to the gcc-34 due to upstream non-compatiblity with
the latest gccs (#1013110)
- Removed trailing whitespaces from the description
* Mon Sep 16 2013 Jaroslav Škarvada <jskarvad@redhat.com> - 4.20-11
- Fixed grubby requirement
- Fixed bogus dates in changelog (best effort)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.20-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.20-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Tue Jan 8 2013 Jaroslav Škarvada <jskarvad@redhat.com> - 4.20-8
- Fixed packaging regarding usrmove
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.20-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Mar 27 2012 Jaroslav Škarvada <jskarvad@redhat.com> - 4.20-6
- Fixed path in 20_memtest86+ not to generate error on grub2-mkconfig
Resolves: rhbz#805542
- Temporal fix for 7th test failure
Resolves: rhbz#805813
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.20-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Dec 7 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 4.20-4
- Used ELF format with grub2
* Wed Dec 7 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 4.20-3
- Renamed 20_memtest to 20_memtest86+
- Fixed ghost handling, 20_memtest86+ is properly removed now
* Mon Dec 5 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 4.20-2
- Added support for grub2, thanks to Michal Ambroz <rebus@seznam.cz>
* Mon Mar 07 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 4.20-1
- Update to new version (#682425)
- Removed fix-asciimap patch (not needed now)
- Removed make-gcc4-builds-work patch (not used)
* Mon Feb 21 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 4.10-5
- Deprecated nash replaceed by findfs (#671503)
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.10-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Jan 11 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 4.10-3
- Reduce max-page-size on x86_64 to fit into loader limits (#620846)
* Tue May 25 2010 Anton Arapov <anton@redhat.com> - 4.10-2
- Fix memory region to load. (#578966)
* Wed May 05 2010 Anton Arapov <anton@redhat.com> - 4.10-1
- Update to new upstream release, v4.10
* Tue Mar 30 2010 Anton Arapov <anton@redhat.com> - 4.00-4
- Fix ascii map of spd.c (#577469)
* Fri Dec 25 2009 Robert Scheck <robert@fedoraproject.org> - 4.00-3
- Removed obsolete build requirement to compat-gcc-34 (#442285)
* Tue Oct 13 2009 Jarod Wilson <jarod@redhat.com> - 4.00-2
- Fix memtest-setup on systems without a separate /boot
filesystem (#528651)
* Tue Sep 29 2009 Jarod Wilson <jarod@redhat.com> - 4.00-1
- Update to new upstream release, v4.00
- Drop gcc4.2+ patch, merged upstream
* Mon Aug 17 2009 Jarod Wilson <jarod@redhat.com> - 2.11-11
- Fix runtime operation when built with gcc4.2+ (#442285)
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Fri Apr 24 2009 Warren Togami <wtogami@redhat.com> - 2.11-9
- Fix uninstall to remove stanza from grub.conf
* Fri Apr 24 2009 Warren Togami <wtogami@redhat.com> - 2.11-8
- Bug #494157 rename elf binary so it doesn't accidentally copy the elf binary
during livecd-creator
- Put scripts into CVS
* Sun Apr 05 2009 Paulo Roma <roma@lcg.ufrj.br> - 2.11-7
- adapted the spec file for building the elf and
the bin versions #494157
* Thu Apr 02 2009 Paulo Roma <roma@lcg.ufrj.br> - 2.11-6
- grub.conf will not be updated by default. The user
will have to add and/or remove memtest86+ entries.
- No messages printed.
* Tue Mar 31 2009 Paulo Roma <roma@lcg.ufrj.br> - 2.11-5
- Changed postun for preun.
- Calling memtest-setup in case of updating grub.conf
* Wed Mar 11 2009 Paulo Roma <roma@lcg.ufrj.br> - 2.11-4
- Updated to 2.11
- Patched for booting from grub.
- Using memtest (ELF) instead of memtest.bin
- Changed memtest-setup for writing the correct grub entry.
- Removed obsolete patch memtest86+-2.10-fixflags.patch
- Created option update grub.conf
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Nov 12 2008 Warren Togami <wtogami@redhat.com> - 2.10-1
- 2.10
* Thu Apr 03 2008 Warren Togami <wtogami@redhat.com> - 2.01-3
- Build with gcc34 for F9 (#437701)
* Tue Mar 04 2008 Peter Jones <pjones@redhat.com> - 2.01-2
- Don't install memtest86+ in bootloader configs on EFI platforms.
* Thu Feb 21 2008 Warren Togami <wtogami@redhat.com> - 2.01-1
- 2.01 major bugfix release
* Mon Feb 11 2008 Michal Schmidt <mschmidt@redhat.com> - 2.00-2
- forgot to cvs add the compilation patch.
* Mon Feb 11 2008 Michal Schmidt <mschmidt@redhat.com> - 2.00-1
- New upstream release: 2.00.
- Dropped boot time console configuration patches (already upstream).
- Fixed compilation on x86_64.
* Wed Oct 24 2007 Peter Jones <pjones@redhat.com> - 1.70-4
- Fix for mactel.
* Thu Oct 18 2007 Warren Togami <wtogami@redhat.com> - 1.70-3
- one more patch from mschmidt to allow configuration of parity and bits
* Wed Oct 17 2007 Warren Togami <wtogami@redhat.com> - 1.70-2
- mschmidt's boot time configuration of serial console (#319631)
* Thu Feb 08 2007 Florian La Roche <laroche@redhat.com> - 1.70-1
- update to 1.70
* Sat Feb 03 2007 Warren Togami <wtogami@redhat.com> - 1.65-6
- some spec cleanups (#226135)
- remove old Obsoletes
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.65-4.1
- rebuild
* Tue Jun 27 2006 Florian La Roche <laroche@redhat.com> - 1.65-4
- make sure coreutils is installed for the preun script
* Thu Jun 08 2006 Jesse Keating <jkeating@redhat.com> - 1.65-3
- rebuilt for new buildsystem
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.65-2.2
- rebuilt for new gcc4.1 snapshot and glibc changes
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Sat Oct 15 2005 Florian La Roche <laroche@redhat.com>
- make sure 32bit glibc-devel is installed (#170614)
* Sat Oct 01 2005 Warren Togami <wtogami@redhat.com> - 1.65-1
- 1.65
* Wed Jun 29 2005 Warren Togami <wtogami@redhat.com> - 1.60-1
- 1.60
* Mon Mar 28 2005 Warren Togami <wtogami@redhat.com> - 1.55.1-1
- 1.55.1 fixes K8
* Sun Mar 27 2005 Warren Togami <wtogami@redhat.com> - 1.55-1
- 1.55
* Wed Mar 16 2005 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Sat Feb 19 2005 Warren Togami <wtogami@redhat.com> - 1.51-1
- 1.51
* Fri Jan 21 2005 Warren Togami <wtogami@redhat.com> - 1.50-1
- 1.50
* Sun Nov 28 2004 Warren Togami <wtogami@redhat.com> - 1.40-1
- 1.40
- remove arch patch, now upstream
* Tue Oct 26 2004 Warren Togami <wtogami@redhat.com> - 1.27-1
- 1.27
* Mon Oct 25 2004 Jeremy Katz <katzj@redhat.com> - 1.26-3
- allow building on all x86 arches
- pass appropriate compiler options to build on x86_64 as well (#136939)
* Thu Sep 02 2004 Warren Togami <wtogami@redhat.com> 1.26-1
- update to 1.26
* Sat Aug 28 2004 Warren Togami <wtogami@redhat.com> 1.25-1
- update to 1.25
* Mon Jun 28 2004 Warren Togami <wtogami@redhat.com>
- update to 1.20
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Sun May 16 2004 Warren Togami <wtogami@redhat.com> 1.15-1
- update to 1.15
* Sun Feb 29 2004 Warren Togami <wtogami@redhat.com> 1.11-2
- switch to memtest86+ 1.11
- add boot loader setup script
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Tue Oct 21 2003 Mike A. Harris <mharris@redhat.com> 3.0-3
- Pedantic spec file cleanups - s/Copyright/License/ and use _libdir instead of
/usr/lib everywhere (even though it's currently x86 only)
* Tue Oct 21 2003 Jeremy Katz <katzj@redhat.com> 3.0-2
- fix perms (#107610)
- doesn't really require dev86 to build
* Mon Jul 21 2003 Michael Fulbright <msf@redhat.com>
- initial integration into distribution. Removed the scripts to install a
entry in the boot loader for memtest for the moment, and relocated to under
/usr/lib.
* Thu Apr 17 2003 Joe Szep <jszep@bu.edu>
- rebuilt for Doolittle final
* Mon Feb 3 2003 Matthew Miller <mattdm@bu.edu>
- rebuild for doolittle
- patches to make build -- new gcc growing pains, I guess
* Tue Jul 30 2002 Matthew Miller <mattdm@bu.edu>
- added grubby stuff
* Tue Jul 30 2002 Dave Heistand <davidbh@bu.edu>
- updated source to v 3
* Thu Mar 7 2002 Dave Heistand <davidbh@bu.edu>
- updated source to 2.9, also changed setup -n
- to use %%{version}.
* Thu Nov 1 2001 Matthew Miller <mattdm@bu.edu>
- v 2.8a
- removed lilo-configuring scripts. need to figure out the best way to
work with grub and RH 7.2 / BU Linux 2.5
- group -> System Environment/Base
* Mon Aug 20 2001 Matthew Miller <mattdm@bu.edu>
- v 2.7
* Wed Feb 14 2001 Matthew Miller <mattdm@bu.edu>
- v 2.5
* Fri Oct 06 2000 Matthew Miller <mattdm@bu.edu>
- v 2.4
* Thu Mar 23 2000 Matthew Miller <mattdm@bu.edu>
- changed so that lilo.conf isn't written if it already exists. This is
important if you're including memtest86 in a distribution
- GPG key available from http://www.bu.edu/dsgsupport/linux/BULinux-GPG-KEY
- changed name of lilo.conf backup file to something less likely to conflict
with other backups
* Wed Mar 01 2000 Matthew Miller <mattdm@bu.edu>
- Updated to version 2.2
- Cosmetic changes to spec file
- updated Source: to reflect actual author's url
* Fri Dec 25 1998 Peter Soos <sp@osb.hu>
- Corrected the file attributes
* Mon Aug 17 1998 Peter Soos <sp@osb.hu>
- Moved to 1.4a
* Mon Jun 22 1998 Peter Soos <sp@osb.hu>
- Moved to 1.4
* Wed Dec 31 1997 Peter Soos <sp@osb.hu>
- Initial version

352
new-memtest-pkg Executable file
View File

@ -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

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (memtest86+-5.01.tar.gz) = d872db35ef733ec8f49094251f2bf6b98cc80eb06d04044be3aecf28d534f24ba293a08b9979b112dbd07cf27368148939a33a32c7010fc9581a3a5b150c94d7