summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Januszewski <spock@gentoo.org>2009-03-26 08:42:04 +0000
committerMichael Januszewski <spock@gentoo.org>2009-03-26 08:42:04 +0000
commit1340e5a94b68e698e267824170f361d149d790fa (patch)
treed3f3bc637dfaf6f4f3f470ba45b248e1d3dd39a7 /sys-apps/memtest86+
parentFix GCC 4.4 build errors (bug 254256). (diff)
downloadgentoo-2-1340e5a94b68e698e267824170f361d149d790fa.tar.gz
gentoo-2-1340e5a94b68e698e267824170f361d149d790fa.tar.bz2
gentoo-2-1340e5a94b68e698e267824170f361d149d790fa.zip
Add a script to install memtest86+ on floppy disks (bug #252996).
(Portage version: 2.1.6.10/cvs/Linux x86_64, RepoMan options: --force)
Diffstat (limited to 'sys-apps/memtest86+')
-rw-r--r--sys-apps/memtest86+/ChangeLog7
-rw-r--r--sys-apps/memtest86+/files/make-memtest86+-boot-floppy111
-rw-r--r--sys-apps/memtest86+/files/make-memtest86+-boot-floppy.139
-rw-r--r--sys-apps/memtest86+/memtest86+-2.11.ebuild13
-rw-r--r--sys-apps/memtest86+/metadata.xml3
5 files changed, 167 insertions, 6 deletions
diff --git a/sys-apps/memtest86+/ChangeLog b/sys-apps/memtest86+/ChangeLog
index 61b54e3f03e4..c3912fe99fc0 100644
--- a/sys-apps/memtest86+/ChangeLog
+++ b/sys-apps/memtest86+/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-apps/memtest86+
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/memtest86+/ChangeLog,v 1.48 2009/03/22 08:40:40 spock Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/memtest86+/ChangeLog,v 1.49 2009/03/26 08:42:03 spock Exp $
+
+ 26 Mar 2009; Michał Januszewski <spock@gentoo.org>
+ +files/make-memtest86+-boot-floppy, +files/make-memtest86+-boot-floppy.1,
+ metadata.xml, memtest86+-2.11.ebuild:
+ Add a script to install memtest86+ on floppy disks (bug #252996).
22 Mar 2009; Michał Januszewski <spock@gentoo.org>
memtest86+-2.01.ebuild, memtest86+-2.10.ebuild, memtest86+-2.11.ebuild:
diff --git a/sys-apps/memtest86+/files/make-memtest86+-boot-floppy b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy
new file mode 100644
index 000000000000..9c225c740bf4
--- /dev/null
+++ b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy
@@ -0,0 +1,111 @@
+#!/bin/sh
+#
+# Script for making a memtest86 boot floppy using GRUB as bootloader
+#
+
+# (c) 2003 Peter Loje Hansen <pl@2m.dk>
+# - original version
+# (c) 2004 Yann Dirson <dirson@debian.org>
+# - added parameters
+# - ability to work on a floppy image instead of a real floppy
+# - adapted patches from Martin Koeppe <martin@koeppe-net.de>, to use
+# mtools and install full grub
+
+# TODO:
+# - add a flag to generate a default boot entry for (hd0)
+
+set -e
+
+MEMTEST=/boot/memtest86plus/memtest.bin
+FLOPPYIMAGE=/dev/fd0
+GRUBBIN=/sbin/grub
+GRUBLIB=/lib/grub
+MFORMAT=/usr/bin/mformat
+
+arch=$(uname -m)
+
+case "$arch" in
+ i386|i486|i686) GRUBARCH=i386-pc;;
+ x86_64) GRUBARCH=x86_64-pc;;
+ *) error "Unsupported architecture: $arch";;
+esac
+
+error()
+{
+ echo >&2 "$0: $*"
+ exit 1
+}
+
+needsarg()
+{
+ [ $1 -ge 2 ] || error "syntax error"
+}
+
+[ -d $GRUBLIB ] || error "Can't find $GRUBLIB - did you install a recent grub package (0.95+cvs20040624 or later) ?"
+[ -x $MFORMAT ] || error "Can't find mformat - did you install the mtools package ?"
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ --help) echo "$0 [--memtest $MEMTEST] [--floppyimage $FLOPPYIMAGE]"; exit 0 ;;
+ --memtest) needsarg $#; MEMTEST="$2"; shift ;;
+ --floppyimage) needsarg $#; FLOPPYIMAGE="$2"; shift ;;
+ *) error "syntax error" ;;
+ esac
+ shift
+done
+
+MOUNTPOINT=$(mktemp -d)
+
+if [ -b "$FLOPPYIMAGE" ]
+then
+ FINALDEV="$FLOPPYIMAGE"
+ FLOPPYIMAGE="$(mktemp)"
+else
+ FINALDEV=""
+fi
+
+echo "* Creating msdos file system"
+echo
+if [ ! -s "$FLOPPYIMAGE" ]; then
+ # unless a non-empty image exists, create a blank one first
+ dd bs=1024 count=1440 if=/dev/zero of="$FLOPPYIMAGE"
+fi
+# FIXME: "-f 1440" should probably be dropped
+mformat -i $FLOPPYIMAGE -f 1440 ::
+
+mmd -i $FLOPPYIMAGE ::/boot
+mmd -i $FLOPPYIMAGE ::/boot/grub
+
+echo
+echo "* Installing GRUB files"
+mcopy -v -i "$FLOPPYIMAGE" - ::/boot/grub/menu.lst <<EOF
+color green/black light-green/black
+default 0
+timeout 10
+title memtest
+kernel (fd0)/boot/memtest.bin
+EOF
+mcopy -v -i "$FLOPPYIMAGE" $GRUBLIB/$GRUBARCH/* ::/boot/grub
+
+echo
+echo "* Installing $MEMTEST"
+mcopy -v -i "$FLOPPYIMAGE" "$MEMTEST" ::/boot/memtest.bin
+
+echo
+echo -n "* Installing GRUB"
+$GRUBBIN --batch --device-map=/dev/null <<EOF
+device (fd0) $FLOPPYIMAGE
+root (fd0)
+setup (fd0)
+quit
+EOF
+
+if [ -n "$FINALDEV" ]; then
+ echo
+ echo "Insert a writable floppy for $FINALDEV and press enter"
+ read FOO
+
+ dd bs=1024 if="$FLOPPYIMAGE" of="$FINALDEV"
+ rm "$FLOPPYIMAGE"
+fi
diff --git a/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1 b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1
new file mode 100644
index 000000000000..e1283e5efc8f
--- /dev/null
+++ b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1
@@ -0,0 +1,39 @@
+.\" Man page for make-memtest86+-boot-floppy
+
+.TH make-memtest86+-boot-floppy 1
+
+.SH NAME
+make-memtest86+-boot-floppy \- create a memtest86+ boot-floppy using GRUB.
+
+.SH SYNOPSIS
+
+.B make-memtest86+-boot-floppy [ \-\-memtest
+.I <path to memtest86+-image>
+.B ] [ \-\-floppyimage
+.I <path to floppyimage/device>
+.B ]
+
+.SH DESCRIPTION
+.B make-memtest86+-boot-floppy
+can create a memtest86+ boot floppy using GRUB as the bootloader.
+
+.SH OPTIONS
+
+.IP "\-\-memtest <path to the memtest-image>"
+Path to the memtest86+-image, default is /boot/memtest86+.bin.
+
+.IP "\-\-floppyimage <path to the floppyimage or device>"
+File or device where the boot-image should be written to, default is /dev/fd0.
+
+.IP "\-\-help"
+Display a short message about the options of the tool.
+
+.SH AUTHOR
+This man-page has been written by Thomas Schmidt <thomas@thsnet.de>
+.PP
+Permission is granted to copy, distribute and/or modify this document under
+the terms of the GNU General Public License, Version 2 any
+later version published by the Free Software Foundation.
+.PP
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common\-licenses/GPL.
diff --git a/sys-apps/memtest86+/memtest86+-2.11.ebuild b/sys-apps/memtest86+/memtest86+-2.11.ebuild
index 4c80150c8c48..76eed82aca8a 100644
--- a/sys-apps/memtest86+/memtest86+-2.11.ebuild
+++ b/sys-apps/memtest86+/memtest86+-2.11.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/memtest86+/memtest86+-2.11.ebuild,v 1.3 2009/03/22 08:40:40 spock Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/memtest86+/memtest86+-2.11.ebuild,v 1.4 2009/03/26 08:42:03 spock Exp $
inherit mount-boot eutils
@@ -11,11 +11,11 @@ SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
-IUSE="serial"
+IUSE="floppy serial"
RESTRICT="test"
-DEPEND=""
-RDEPEND=""
+RDEPEND="floppy? ( >=sys-boot/grub-0.95 sys-fs/mtools )"
+DEPEND="${RDEPEND}"
src_unpack() {
unpack ${A}
@@ -37,6 +37,11 @@ src_install() {
insinto /boot/memtest86plus
doins memtest.bin || die
dodoc README README.build-process
+
+ if use floppy ; then
+ dobin "${FILESDIR}"/make-memtest86+-boot-floppy
+ doman "${FILESDIR}"/make-memtest86+-boot-floppy.1
+ fi
}
pkg_postinst() {
diff --git a/sys-apps/memtest86+/metadata.xml b/sys-apps/memtest86+/metadata.xml
index 6a2eeff7d216..7af41c5371aa 100644
--- a/sys-apps/memtest86+/metadata.xml
+++ b/sys-apps/memtest86+/metadata.xml
@@ -4,9 +4,10 @@
<herd>base-system</herd>
<maintainer>
<email>spock@gentoo.org</email>
- <name>Michal Januszewski</name>
+ <name>Michał Januszewski</name>
</maintainer>
<use>
<flag name='serial'>Compile with serial console support</flag>
+ <flag name='floppy'>Install a script to create floppy disks containing memtest86+ binaries.</flag>
</use>
</pkgmetadata>