Added documentation regarding memtest-setup

This commit is contained in:
Jaroslav Škarvada 2014-08-26 14:19:26 +02:00
parent 3d22cc758c
commit 947ffdfa02
4 changed files with 85 additions and 11 deletions

11
README Normal file
View File

@ -0,0 +1,11 @@
Install Memtest86+ by running:
# 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.

View File

@ -6,35 +6,54 @@ PNAME="memtest86+"
# executable
ENAME="elf-memtest86+"
# grub2 template
# GRUB 2 template
G2TEMPL="20_memtest86+"
if [ "$1" = "--help" -o "$1" = "-h" ]; then
cat <<:EOF
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 \fI/boot/grub2/grub.cfg
This is not done automatically because it could overwrite any custom changes
in /boot/grub2/grub.cfg.
:EOF
exit 0
fi
if [ -d /sys/firmware/efi ]; then
echo "memtest86+ does not support EFI platforms."
exit 254
fi
if [ -f /boot/grub2/grub.cfg ]; then
echo "grub2 detected, installing template..."
echo "GRUB 2 detected, installing template..."
if [ ! -d /etc/grub.d ]; then
echo "ERROR: unable to find /etc/grub.d"
exit 253
fi
if [ -x /etc/grub.d/$G2TEMPL ]; then
echo "grub2 template is already installed. Exiting..."
echo "GRUB 2 template is already installed. Exiting..."
exit 252
fi
if [ -f /etc/grub.d/$G2TEMPL ]; then
echo "grub2 template is already in place, only enabling..."
echo "GRUB 2 template is already in place, only enabling..."
else
if [ ! -r /usr/share/memtest86+/$G2TEMPL ]; then
echo "ERROR: unable to find grub2 template."
echo "ERROR: unable to find GRUB 2 template."
exit 251
fi
cp /usr/share/memtest86+/$G2TEMPL /etc/grub.d
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
chmod a+x /etc/grub.d/$G2TEMPL
echo "grub 2 template installed."
echo "GRUB 2 template installed."
echo "Do not forget to regenerate your grub.cfg by:"
echo " # grub2-mkconfig -o /boot/grub2/grub.cfg"
else

32
memtest-setup.8 Normal file
View File

@ -0,0 +1,32 @@
.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
\fBmemtest\-setup\fR
.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 "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

@ -1,13 +1,15 @@
%bcond_with update_grub
# Prevent stripping
%define __spec_install_post /usr/lib/rpm/brp-compress
%global __spec_install_post /usr/lib/rpm/brp-compress
# Turn off debuginfo package
%define debug_package %{nil}
%global debug_package %{nil}
%global readme_suffix %{?rhel:redhat}%{!?rhel:fedora}
Name: memtest86+
Version: 5.01
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2
Summary: Stand-alone memory tester for x86 and x86-64 computers
Group: System Environment/Base
@ -15,6 +17,8 @@ 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: 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
@ -48,6 +52,7 @@ to add the %{name} entry to your GRUB boot menu.
%prep
%setup -q
cp -p %{SOURCE5} README.%{readme_suffix}
%patch0 -p1 -b .no-scp
%patch1 -p1 -b .no-optimization
%patch2 -p1 -b .compile-fix
@ -85,6 +90,9 @@ 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
%if %{with update_grub}
%post -p /usr/sbin/memtest-setup
%endif
@ -101,7 +109,7 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README
%doc README README.%{readme_suffix}
/boot/%{name}-%{version}
/boot/elf-%{name}-%{version}
%{_sbindir}/new-memtest-pkg
@ -109,8 +117,12 @@ rm -rf %{buildroot}
%{_datadir}/%{name}/20_memtest86+
%ghost %attr(0755,-,-) %{_sysconfdir}/grub.d/20_memtest86+
%{_sbindir}/memtest-setup
%{_mandir}/man8/*.8.gz
%changelog
* 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