From 331d278737735507b8eb265db08559a80314b3ad Mon Sep 17 00:00:00 2001 From: Paulo Roma Cavalcanti Date: Fri, 13 Mar 2009 19:43:54 +0000 Subject: [PATCH] Updated to 2.11 and using memtest (ELF) instead of memtest.bin --- import.log | 1 + memtest-setup | 3 ++ memtest86+-2.10-fixflags.patch | 12 ----- memtest86+.spec | 89 ++++++++++++++++++++++++++-------- 4 files changed, 74 insertions(+), 31 deletions(-) create mode 100644 import.log delete mode 100644 memtest86+-2.10-fixflags.patch diff --git a/import.log b/import.log new file mode 100644 index 0000000..de3aa8f --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +memtest86+-2_11-4_fc10:HEAD:memtest86+-2.11-4.fc10.src.rpm:1236973348 diff --git a/memtest-setup b/memtest-setup index c183615..b2798b4 100755 --- a/memtest-setup +++ b/memtest-setup @@ -25,6 +25,9 @@ RETVAL="$?" if [ "$RETVAL" != "0" ]; then echo "ERROR: grubby failed to configure your bootloader for $MTPATH." exit $RETVAL +else + sed -i -e's,kernel /memtest86+,kernel --type=netbsd /memtest86+,' /boot/grub/grub.conf + sed -i -e"s,/memtest86+-$MTVERSION.*,/memtest86+-$MTVERSION," /boot/grub/grub.conf fi echo "Setup complete." diff --git a/memtest86+-2.10-fixflags.patch b/memtest86+-2.10-fixflags.patch deleted file mode 100644 index 7b103e8..0000000 --- a/memtest86+-2.10-fixflags.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urN memtest86+-2.10.orig/Makefile memtest86+-2.10/Makefile ---- memtest86+-2.10.orig/Makefile 2008-10-24 22:43:43.000000000 -0400 -+++ memtest86+-2.10/Makefile 2008-11-17 22:38:29.000000000 -0500 -@@ -11,7 +11,7 @@ - AS=as -32 - CC=gcc - --CFLAGS= -fno-stack-protector -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -+CFLAGS= -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC - - 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 extra.o \ diff --git a/memtest86+.spec b/memtest86+.spec index a516cd0..6150598 100644 --- a/memtest86+.spec +++ b/memtest86+.spec @@ -2,15 +2,16 @@ %define __spec_install_post /usr/lib/rpm/brp-compress # Turn off debuginfo package %define debug_package %{nil} +%bcond_with update-grub.conf Summary: Stand-alone memory tester for x86 and x86-64 computers Name: memtest86+ Version: 2.11 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 ExclusiveArch: %{ix86} x86_64 Group: System Environment/Base -Source0: http://www.memtest.org/download/%{version}/memtest86+-%{version}.tar.gz +Source0: http://www.memtest.org/download/%{version}/%{name}-%{version}.tar.gz URL: http://www.memtest.org Source1: new-memtest-pkg Source2: memtest-setup @@ -20,17 +21,21 @@ BuildRequires: %{_includedir}/gnu/stubs-32.h BuildRequires: compat-gcc-34 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - %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+. -Run 'memtest-setup' to add to your GRUB or lilo boot menu. +This version avoids the following errors when booting from grub: +"Error 7: Loading below 1MB is not supported" +"Error 13: Invalid or unsupported executable format" +"Error 28: Selected item cannot fit into memory" +Optionally, run 'memtest-setup' to add to your GRUB or lilo boot menu. %prep %setup -q +sed -i -e's,0x10000,0x100000,' memtest.lds %build # Regular build flags not wanted for this binary @@ -39,35 +44,78 @@ make CC=gcc34 # It makes no sense to use smp flags here. %install -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT/boot -mkdir -p $RPM_BUILD_ROOT/sbin -mkdir -p $RPM_BUILD_ROOT%{_sbindir} +rm -rf %{buildroot} +mkdir -p %{buildroot}/boot +mkdir -p %{buildroot}/sbin +mkdir -p %{buildroot}%{_sbindir} + +# install the ELF version, not the floppy (memtest.bin) one. +install -m644 memtest %{buildroot}/boot/%{name}-%{version} +install -m755 %{SOURCE1} %{buildroot}/sbin/new-memtest-pkg +install -m755 %{SOURCE2} %{buildroot}%{_sbindir}/memtest-setup +sed -i 's/\r//' $RPM_BUILD_DIR/%{name}-%{version}/README + +%post +%if %{with update-grub.conf} +if [ -x /sbin/grubby ] ; then + /sbin/grubby \ + --add-kernel="/boot/%{name}-%{version}" \ + --title "Memtest86+ (%{version})" + + sed -i -e's,kernel /%{name}-%{version},kernel --type=netbsd /%{name}-%{version},' /boot/grub/grub.conf +fi +%else +cat << EOF + +************************************************ +* REMINDER: Please update your /etc/grub.conf * +* file and add the memtest86+ boot entry, * +* by running /usr/sbin/memtest-setup as root. * +************************************************ + +EOF +%endif + +%postun +%if %{with update-grub.conf} +if [ -x /sbin/grubby ] ; then + sed -i -e's,kernel --type=netbsd /%{name}-%{version},kernel /%{name}-%{version},' /boot/grub/grub.conf + /sbin/grubby --remove-kernel="/boot/%{name}-%{version}" +fi +%else +cat << EOF + +************************************************ +* REMINDER: Please update your /etc/grub.conf * +* file and remove any memtest86+ boot entry. * +************************************************ + +EOF +%endif -install -m644 memtest.bin $RPM_BUILD_ROOT/boot/memtest86+-%{version} -install -m755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/new-memtest-pkg -install -m755 %{SOURCE2} $RPM_BUILD_ROOT%{_sbindir}/memtest-setup %clean -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc README -/boot/memtest86+-%{version} +/boot/%{name}-%{version} /sbin/new-memtest-pkg %{_sbindir}/memtest-setup -%preun -/sbin/new-memtest-pkg --remove %{version} - %changelog +* Mon Mar 11 2009 Paulo Roma - 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 - 2.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild -* Mon Dec 22 2008 Warren Togami - 2.11-1 -- 2.11 - * Mon Nov 12 2008 Warren Togami - 2.10-1 - 2.10 @@ -104,6 +152,9 @@ rm -rf $RPM_BUILD_ROOT - some spec cleanups (#226135) - remove old Obsoletes +* Wed Jul 12 2006 Jesse Keating - 1.65-4.1 +- rebuild + * Tue Jun 27 2006 Florian La Roche - 1.65-4 - make sure coreutils is installed for the preun script