]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/commitdiff
memtest86+: Update to 6.00
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Dec 2022 22:06:16 +0000 (22:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Dec 2022 22:06:16 +0000 (22:06 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
memtest86+/60_memtest86+ [new file with mode: 0644]
memtest86+/60_memtest86+-efi [new file with mode: 0644]
memtest86+/memtest86+.grub [deleted file]
memtest86+/memtest86+.nm

diff --git a/memtest86+/60_memtest86+ b/memtest86+/60_memtest86+
new file mode 100644 (file)
index 0000000..086f0cc
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+########################################################
+# This script generates a memtest86+ entry on grub.cfg #
+# if memtest is installed on the system.               #
+########################################################
+
+prefix="/usr"
+exec_prefix="${prefix}"
+
+datarootdir="/usr/share"
+datadir="${datarootdir}"
+
+. "${datadir}/grub/grub-mkconfig_lib"
+
+MEMTEST86_IMAGE="/boot/memtest86+/memtest.bin"
+CLASS="--class memtest86 --class gnu --class tool"
+
+if [ -e "${MEMTEST86_IMAGE}" ] && is_path_readable_by_grub "${MEMTEST86_IMAGE}" ; then
+    ## image exists, create menu entry
+    echo "Found memtest86+ image: ${MEMTEST86_IMAGE}" >&2
+    _GRUB_MEMTEST_HINTS_STRING="$(${grub_probe} --target=hints_string ${MEMTEST86_IMAGE})"
+    _GRUB_MEMTEST_FS_UUID="$(${grub_probe} --target=fs_uuid ${MEMTEST86_IMAGE})"
+    _GRUB_MEMTEST_REL_PATH="$(make_system_path_relative_to_its_root ${MEMTEST86_IMAGE})"
+    cat << EOF
+if [ "\${grub_platform}" == "pc" ]; then
+    menuentry "Memory Tester (memtest86+)" ${CLASS} {
+        search --fs-uuid --no-floppy --set=root ${_GRUB_MEMTEST_HINTS_STRING} ${_GRUB_MEMTEST_FS_UUID}
+        linux16 ${_GRUB_MEMTEST_REL_PATH} ${GRUB_CMDLINE_MEMTEST86}
+    }
+fi
+EOF
+fi
diff --git a/memtest86+/60_memtest86+-efi b/memtest86+/60_memtest86+-efi
new file mode 100644 (file)
index 0000000..e6d77ea
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+########################################################
+# This script generates a memtest86+ entry on grub.cfg #
+# if memtest is installed on the system.               #
+########################################################
+
+prefix="/usr"
+exec_prefix="${prefix}"
+
+datarootdir="/usr/share"
+datadir="${datarootdir}"
+
+. "${datadir}/grub/grub-mkconfig_lib"
+
+MEMTEST86_IMAGE="/boot/memtest86+/memtest.efi"
+CLASS="--class memtest86 --class gnu --class tool"
+
+if [ -e "${MEMTEST86_IMAGE}" ] && is_path_readable_by_grub "${MEMTEST86_IMAGE}" ; then
+    ## image exists, create menu entry
+    echo "Found memtest86+ EFI image: ${MEMTEST86_IMAGE}" >&2
+    _GRUB_MEMTEST_HINTS_STRING="$(${grub_probe} --target=hints_string ${MEMTEST86_IMAGE})"
+    _GRUB_MEMTEST_FS_UUID="$(${grub_probe} --target=fs_uuid ${MEMTEST86_IMAGE})"
+    _GRUB_MEMTEST_REL_PATH="$(make_system_path_relative_to_its_root ${MEMTEST86_IMAGE})"
+    cat << EOF
+if [ "\${grub_platform}" == "efi" ]; then
+    menuentry "Memory Tester (memtest86+)" ${CLASS} {
+        if loadfont unicode ; then
+            set gfxmode=1024x768,800x600,auto
+            set gfxpayload=800x600,1024x768
+            terminal_output gfxterm
+        fi
+        search --fs-uuid --no-floppy --set=root ${_GRUB_MEMTEST_HINTS_STRING} ${_GRUB_MEMTEST_FS_UUID}
+        linux ${_GRUB_MEMTEST_REL_PATH} ${GRUB_CMDLINE_MEMTEST86}
+    }
+fi
+EOF
+fi
diff --git a/memtest86+/memtest86+.grub b/memtest86+/memtest86+.grub
deleted file mode 100755 (executable)
index 3301b85..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-set -e
-
-# older versions of grub2 do not have this yet (LP: #459080)
-if [ ! -e /usr/lib/grub/grub-mkconfig_lib ]; then
-    echo "no grub-mkconfig_lib, exiting"
-    exit 0
-fi
-
-. /usr/lib/grub/grub-mkconfig_lib
-
-# We can't cope with loop-mounted devices here.
-case ${GRUB_DEVICE_BOOT} in
-  /dev/loop/*|/dev/loop[0-9])
-    exit 0
-  ;;
-esac
-
-if test -e /boot/memtest86+; then
-  MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+" )
-  echo "Found memtest86+ image: $MEMTESTPATH" >&2
-  cat << EOF
-menuentry "Memory test (memtest86+)" {
-EOF
-  prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
-  printf '%s\n' "${prepare_boot_cache}"
-  cat << EOF
-       linux16 $MEMTESTPATH
-}
-menuentry "Memory test (memtest86+, serial console 115200)" {
-EOF
-  printf '%s\n' "${prepare_boot_cache}"
-  cat << EOF
-       linux16 $MEMTESTPATH console=ttyS0,115200n8
-}
-EOF
-fi
index 0e5e44445a66a03d10504d03000aad2775cbac96..74f45c426194f27b09165f698b1f636e03a7418f 100644 (file)
@@ -4,14 +4,15 @@
 ###############################################################################
 
 name       = memtest86+
-version    = 4.20
-release    = 4
-sup_arches = i686 x86_64
+version    = 6.00
+release    = 1
+thisapp    = memtest86plus-%{version}
+sup_arches = x86_64
 
 groups     = System/Base
 url        = http://www.memtest.org/
 license    = GPLv2
-summary    = Stand-alone memory tester for x86 and x86-64 computers.
+summary    = Stand-alone memory tester for x86 and x86-64 computers
 
 description
        Memtest86+ is a thorough stand-alone memory test for x86 and x86-64
@@ -20,25 +21,45 @@ description
        Memtest86+.
 end
 
-source_dl  =
+source_dl  = https://github.com/memtest86plus/memtest86plus/archive/refs/tags/%{version}.tar.gz#/
+sources    = %{thisapp}.tar.gz
 
 build
-       CFLAGS += -fno-builtin -ffreestanding
+       requires
+               dosfstools
+       end
 
        build
-               make CC="gcc -fno-stack-protector -fno-PIE" \
-                       CFLAGS="%{CFLAGS}" memtest.bin %{PARALLELISMFLAGS}
+               make -C build64 memtest.bin memtest.efi %{PARALLELISMFLAGS}
        end
 
        install
-               mkdir -pv %{BUILDROOT}/boot
-               cp -vf memtest.bin %{BUILDROOT}/boot/memtest86+
+               mkdir -pv %{BUILDROOT}/boot/memtest86+
+               install -v -m 644 build64/memtest.{bin,efi} %{BUILDROOT}/boot/memtest86+/
 
-               mkdir -pv %{BUILDROOT}/etc/grub.d
-               cp -vf %{DIR_SOURCE}/%{name}.grub %{BUILDROOT}/etc/grub.d/20_%{name}
+               mkdir -pv %{BUILDROOT}%{sysconfdir}/grub.d
+               install -v -m 644 %{DIR_SOURCE}/60_memtest86+{,-efi} %{BUILDROOT}%{sysconfdir}/grub.d/
        end
 end
 
 packages
        package %{name}
+               recommends
+                       %{name}-efi = %{thisver}
+               end
+
+               files
+                       /boot/memtest86+/memtest.bin
+                       %{sysconfdir}/grub.d/60_memtest86+
+               end
+       end
+
+       package %{name}-efi
+               summary = Memory Test for EFI systems
+
+               files
+                       /boot/memtest86+/memtest.efi
+                       %{sysconfdir}/grub.d/60_memtest86+-efi
+               end
+       end
 end