summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Kohler <bkohler@gentoo.org>2022-06-07 12:02:49 -0500
committerBen Kohler <bkohler@gentoo.org>2022-06-07 12:42:47 -0500
commitb28d427224c238f876169474ba9c8c865c989f73 (patch)
treec45a94d2c52aefc0eeebb786068df3a2391ca99f /sys-apps/memtest86+
parentapp-admin/rsyslog: take up maintainership; update metadata (diff)
downloadgentoo-b28d427224c238f876169474ba9c8c865c989f73.tar.gz
gentoo-b28d427224c238f876169474ba9c8c865c989f73.tar.bz2
gentoo-b28d427224c238f876169474ba9c8c865c989f73.zip
sys-apps/memtest86+: add 6.00_beta2
Signed-off-by: Ben Kohler <bkohler@gentoo.org>
Diffstat (limited to 'sys-apps/memtest86+')
-rw-r--r--sys-apps/memtest86+/Manifest1
-rw-r--r--sys-apps/memtest86+/files/39_memtest86+-r2126
-rw-r--r--sys-apps/memtest86+/memtest86+-6.00_beta2.ebuild71
-rw-r--r--sys-apps/memtest86+/metadata.xml6
4 files changed, 204 insertions, 0 deletions
diff --git a/sys-apps/memtest86+/Manifest b/sys-apps/memtest86+/Manifest
index a3c17016ab5d..30e66ca497f9 100644
--- a/sys-apps/memtest86+/Manifest
+++ b/sys-apps/memtest86+/Manifest
@@ -1 +1,2 @@
DIST memtest86+-5.31b.tar.gz 227779 BLAKE2B 14aced912bb84115278a3aff7650a3571918b823335aaf7d09880ef10374c320f64878765d93d2ee5a75e2b33ef6c9c4886a9a168955bd77c668f06f5c86a6ca SHA512 ad5891fd0c430ce7a5d0cde2d10dee20b66ad8060d47c3e70e038461d9cde3a78dfc13442b5b09da7c662741945a670353c72dbc08fd5ee8bae82256001a9541
+DIST memtest86+-6.00_beta2.tar.gz 214840 BLAKE2B 223c3023ba38d584c9ff1923e859ee37f1d943be657c80d4151d0b9ded79b4b363f3e2f7e51d58c7b2b637133ecada0f9a952fcdbbf03d8c34cb00a64762022c SHA512 78b13cc05f470e40e347f6eddb4441c2b377c47ea9aa0252096ef37c884f452bdfce1292452a36aa3ce0cf59c3eb0e53c0e069863b3f165dcd648d9eae9c76ea
diff --git a/sys-apps/memtest86+/files/39_memtest86+-r2 b/sys-apps/memtest86+/files/39_memtest86+-r2
new file mode 100644
index 000000000000..a213e0325609
--- /dev/null
+++ b/sys-apps/memtest86+/files/39_memtest86+-r2
@@ -0,0 +1,126 @@
+#!/bin/sh
+
+. /usr/share/grub/grub-mkconfig_lib
+
+mtbios32=/boot/memtest86plus/memtest32.bios
+mtbios64=/boot/memtest86plus/memtest64.bios
+mtefi32=/boot/memtest86plus/memtest.efi32
+mtefi64=/boot/memtest86plus/memtest.efi64
+
+if [ $(ls /boot/memtest86plus | wc -l) -gt 1 ]; then
+ multiple_memtest=true
+fi
+
+submenu_indentation=""
+if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
+ submenu_indentation="${grub_tab}"
+ cat <<EOF
+submenu 'Memtest86+' {
+EOF
+fi
+
+# Start bios32
+if [ -f "${mtbios32}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${mtbios32}" >&2
+
+ device="$("${grub_probe}" --target=device "${mtbios32}")"
+ path="$(make_system_path_relative_to_its_root "${mtbios32}")"
+ cat <<EOF
+${submenu_indentation}if [ "x\$grub_platform" = xpc ]; then
+${submenu_indentation}menuentry 'Memtest86+ 32bit' {
+EOF
+
+ if [ -n "{submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ cat <<EOF
+ ${submenu_indentation}linux "${path}"
+${submenu_indentation}}
+${submenu_indentation}fi
+EOF
+fi
+# End bios32
+
+# Start bios64
+if [ -f "${mtbios64}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${mtbios64}" >&2
+
+ device="$("${grub_probe}" --target=device "${mtbios64}")"
+ path="$(make_system_path_relative_to_its_root "${mtbios64}")"
+ cat <<EOF
+${submenu_indentation}if [ "x\$grub_platform" = xpc ]; then
+${submenu_indentation}menuentry 'Memtest86+ 64bit' {
+EOF
+
+ if [ -n "{submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ cat <<EOF
+ ${submenu_indentation}linux "${path}"
+${submenu_indentation}}
+${submenu_indentation}fi
+EOF
+fi
+# End bios64
+
+# Start efi32
+if [ -f "${mtefi32}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${mtefi32}" >&2
+
+ device="$("${grub_probe}" --target=device "${mtefi32}")"
+ path="$(make_system_path_relative_to_its_root "${mtefi32}")"
+ cat <<EOF
+${submenu_indentation}if [ "x\$grub_platform" = xefi ]; then
+${submenu_indentation}menuentry 'Memtest86+ 32bit UEFI' {
+EOF
+
+ if [ -n "{submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ cat <<EOF
+ ${submenu_indentation}chainloader "${path}"
+${submenu_indentation}}
+${submenu_indentation}fi
+EOF
+fi
+# End efi32
+
+# Start efi64
+if [ -f "${mtefi64}" ]; then
+ gettext_printf "Found memtest image: %s\n" "${mtefi64}" >&2
+
+ device="$("${grub_probe}" --target=device "${mtefi64}")"
+ path="$(make_system_path_relative_to_its_root "${mtefi64}")"
+ cat <<EOF
+${submenu_indentation}if [ "x\$grub_platform" = xefi ]; then
+${submenu_indentation}menuentry 'Memtest86+ 64bit UEFI' {
+EOF
+
+ if [ -n "{submenu_indentation}" ]; then
+ prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+ else
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ fi
+
+ cat <<EOF
+ ${submenu_indentation}chainloader "${path}"
+${submenu_indentation}}
+${submenu_indentation}fi
+EOF
+fi
+#End efi64
+
+if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
+ cat <<EOF
+}
+EOF
+fi
diff --git a/sys-apps/memtest86+/memtest86+-6.00_beta2.ebuild b/sys-apps/memtest86+/memtest86+-6.00_beta2.ebuild
new file mode 100644
index 000000000000..0463eb856f04
--- /dev/null
+++ b/sys-apps/memtest86+/memtest86+-6.00_beta2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit mount-boot
+
+MY_PV=${PV/_/-}
+
+DESCRIPTION="Memory tester based on PCMemTest"
+HOMEPAGE="https://www.memtest.org/"
+SRC_URI="https://github.com/memtest86plus/memtest86plus/archive/refs/tags/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="bios32 bios64 +boot efi32 efi64 iso32 iso64"
+
+ISODEPS="
+ dev-libs/libisoburn
+ sys-fs/dosfstools
+ sys-fs/mtools
+"
+BDEPEND="
+ iso32? ( ${ISODEPS} )
+ iso64? ( ${ISODEPS} )
+"
+
+S=${WORKDIR}/memtest86plus-${MY_PV}
+
+src_prepare() {
+ sed -i -e "s#/sbin/mkdosfs#mkfs.vfat#" build{32,64}/Makefile || die
+ sed -i -e "s/^AS = as/AS +=/" -e "/^CC/d" build{32,64}/Makefile || die
+ default
+}
+
+src_compile() {
+ pushd build32
+ use bios32 && emake memtest.bin
+ use efi32 && emake memtest.efi
+ use iso32 && emake iso
+ popd
+
+ pushd build64
+ use bios64 && emake memtest.bin
+ use efi64 && emake memtest.efi
+ use iso32 && emake iso
+ popd
+}
+
+install_memtest_images() {
+ use bios32 && newins build32/memtest.bin memtest32.bios
+ use bios64 && newins build64/memtest.bin memtest64.bios
+ use efi32 && newins build32/memtest.efi memtest.efi32
+ use efi64 && newins build64/memtest.efi memtest.efi64
+}
+
+src_install() {
+ default
+ if use boot; then
+ exeinto /etc/grub.d/
+ newexe "${FILESDIR}"/39_memtest86+-r2 39_memtest86+
+ insinto /boot/memtest86plus
+ install_memtest_images
+ fi
+
+ insinto /usr/share/${PN}
+ install_memtest_images
+ use iso32 && newins build32/memtest.iso memtest32.iso
+ use iso64 && newins build64/memtest.iso memtest64.iso
+}
diff --git a/sys-apps/memtest86+/metadata.xml b/sys-apps/memtest86+/metadata.xml
index 359afa21d566..dd0c79050ba4 100644
--- a/sys-apps/memtest86+/metadata.xml
+++ b/sys-apps/memtest86+/metadata.xml
@@ -6,9 +6,15 @@
<name>Ben Kohler</name>
</maintainer>
<use>
+ <flag name="bios32">Compile a BIOS-bootable 32bit memtest image</flag>
+ <flag name="bios64">Compile a BIOS-bootable 64bit memtest image</flag>
<flag name="boot">Also install to /boot instead of just /usr/share/memtest86+/</flag>
+ <flag name="efi32">Compile a EFI32-bootable 32bit memtest image</flag>
+ <flag name="efi64">Compile a UEFI-bootable 64bit memtest image</flag>
<flag name="floppy">Install a script to create floppy disks containing memtest86+ binaries.</flag>
<flag name="iso">Compile an ISO image</flag>
+ <flag name="iso32">Compile a 32bit ISO image</flag>
+ <flag name="iso64">Compile a 64bit ISO image</flag>
<flag name="serial">Compile with serial console support</flag>
</use>
</pkgmetadata>