summaryrefslogtreecommitdiff
path: root/libre/grub-parabola/60_memtest86+
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2014-08-25 04:39:34 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2014-08-25 04:39:34 -0300
commit2d8fa2297c79aa9e49134989bcb752357424fd4b (patch)
tree257dfa11b0e26c286b503814ea3c777a0cfee088 /libre/grub-parabola/60_memtest86+
parent8a97f5a1b7ee574476b2c54ce3b1e6d26a81f8b2 (diff)
parent209738a781a5dc4b683a3204ee75b379489c2e3b (diff)
downloadabslibre-2d8fa2297c79aa9e49134989bcb752357424fd4b.tar.gz
abslibre-2d8fa2297c79aa9e49134989bcb752357424fd4b.tar.bz2
abslibre-2d8fa2297c79aa9e49134989bcb752357424fd4b.zip
Merge branch 'master' of ssh://lukeshu.com:1863/srv/git/mirror/parabola/abslibre
Diffstat (limited to 'libre/grub-parabola/60_memtest86+')
-rw-r--r--libre/grub-parabola/60_memtest86+32
1 files changed, 32 insertions, 0 deletions
diff --git a/libre/grub-parabola/60_memtest86+ b/libre/grub-parabola/60_memtest86+
new file mode 100644
index 000000000..086f0cc84
--- /dev/null
+++ b/libre/grub-parabola/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