summaryrefslogtreecommitdiff
path: root/libre/grub-git/60_memtest86+
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-01-20 21:07:15 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-01-20 21:12:23 -0300
commit4908ab12e48bd3b9c9676689e9cc074d91e9243f (patch)
tree44b84f6c47e2a86c144b9e6cd9228ac51afaf83a /libre/grub-git/60_memtest86+
parent56e5a39f8f249f5600a230291c0338445371965e (diff)
downloadabslibre-4908ab12e48bd3b9c9676689e9cc074d91e9243f.tar.gz
abslibre-4908ab12e48bd3b9c9676689e9cc074d91e9243f.tar.bz2
abslibre-4908ab12e48bd3b9c9676689e9cc074d91e9243f.zip
add grub-git (uboot only) to [libre]
Diffstat (limited to 'libre/grub-git/60_memtest86+')
-rw-r--r--libre/grub-git/60_memtest86+32
1 files changed, 32 insertions, 0 deletions
diff --git a/libre/grub-git/60_memtest86+ b/libre/grub-git/60_memtest86+
new file mode 100644
index 000000000..086f0cc84
--- /dev/null
+++ b/libre/grub-git/60_memtest86+
@@ -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