summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/memtest86-bin')
-rw-r--r--sys-apps/memtest86-bin/Manifest1
-rw-r--r--sys-apps/memtest86-bin/files/memtest86-bin-grub.d21
-rw-r--r--sys-apps/memtest86-bin/memtest86-bin-10.7.ebuild46
-rw-r--r--sys-apps/memtest86-bin/metadata.xml8
4 files changed, 76 insertions, 0 deletions
diff --git a/sys-apps/memtest86-bin/Manifest b/sys-apps/memtest86-bin/Manifest
new file mode 100644
index 000000000000..11fe0c3a54c0
--- /dev/null
+++ b/sys-apps/memtest86-bin/Manifest
@@ -0,0 +1 @@
+DIST memtest86-bin-10.7.zip 11924203 BLAKE2B 1729934abdb968d324677439136c6a9c7b9266c3bf0e95feb0e46b8143708bddc366465731f6e5b702faedad44e724fee30e30a289797e5d1c99a2b587e4b24b SHA512 ccd6c10471ddc66bfad057f0d9f391255c88d910a4607566b9523aeaae47c04975cc7b65bc33ff6809a8660c69ae42faf5cc8d527972c03847e93b1ca7c0300b
diff --git a/sys-apps/memtest86-bin/files/memtest86-bin-grub.d b/sys-apps/memtest86-bin/files/memtest86-bin-grub.d
new file mode 100644
index 000000000000..db1ddf855d0e
--- /dev/null
+++ b/sys-apps/memtest86-bin/files/memtest86-bin-grub.d
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+. /usr/share/grub/grub-mkconfig_lib
+
+memtest_efi=/boot/memtest86-bin.efi
+
+if [ -f "${memtest_efi}" ]; then
+ echo "Found MemTest86-EFI" >&2
+ device="$("${grub_probe}" --target=device "${memtest_efi}")"
+ path="$(make_system_path_relative_to_its_root "${memtest_efi}")"
+ cat <<EOF
+if [ "x\$grub_platform" = xefi ]; then
+ menuentry "MemTest86-EFI" {
+EOF
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ cat <<EOF
+ chainloader "${path}"
+ }
+fi
+EOF
+fi
diff --git a/sys-apps/memtest86-bin/memtest86-bin-10.7.ebuild b/sys-apps/memtest86-bin/memtest86-bin-10.7.ebuild
new file mode 100644
index 000000000000..02c964500e1e
--- /dev/null
+++ b/sys-apps/memtest86-bin/memtest86-bin-10.7.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit mount-boot secureboot
+
+DESCRIPTION="Stand alone memory testing software for x86 EFI hardware"
+HOMEPAGE="http://www.memtest86.com/"
+SRC_URI="https://www.memtest86.com/downloads/memtest86-usb.zip -> ${P}.zip"
+S="${WORKDIR}"
+
+LICENSE="PassMark-EULA"
+RESTRICT="mirror bindist"
+SLOT="0"
+KEYWORDS="-* ~amd64"
+
+BDEPEND="
+ app-arch/unzip
+ sys-fs/fatcat
+"
+
+src_unpack() {
+ default
+ fatcat -O 1048576 -r /EFI/BOOT/BOOTX64.efi memtest86-usb.img > ${PN}.efi || die
+}
+
+src_install() {
+ insinto /boot
+ doins ${PN}.efi
+
+ exeinto /etc/grub.d/
+ newexe "${FILESDIR}"/${PN}-grub.d 39_memtest86-bin
+
+ dodoc MemTest86_User_Guide_UEFI.pdf
+
+ secureboot_auto_sign --in-place
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+
+ if [ ! -e /sys/firmware/efi ]; then
+ ewarn "WARNING: You appear to be booted in BIOS mode but ${PN} is an EFI-only tool."
+ fi
+}
diff --git a/sys-apps/memtest86-bin/metadata.xml b/sys-apps/memtest86-bin/metadata.xml
new file mode 100644
index 000000000000..aa20bff17b1d
--- /dev/null
+++ b/sys-apps/memtest86-bin/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>bkohler@gentoo.org</email>
+ <name>Ben Kohler</name>
+ </maintainer>
+</pkgmetadata>