OCaml 4.13.1 rebuild
[arch-packages.git] / memtest86+ / trunk / 60_memtest86+
blob086f0cc84068c3004a3ff05af40896c4d84ecc2f
1 #!/usr/bin/env bash
2 ########################################################
3 # This script generates a memtest86+ entry on grub.cfg #
4 # if memtest is installed on the system. #
5 ########################################################
7 prefix="/usr"
8 exec_prefix="${prefix}"
10 datarootdir="/usr/share"
11 datadir="${datarootdir}"
13 . "${datadir}/grub/grub-mkconfig_lib"
15 MEMTEST86_IMAGE="/boot/memtest86+/memtest.bin"
16 CLASS="--class memtest86 --class gnu --class tool"
18 if [ -e "${MEMTEST86_IMAGE}" ] && is_path_readable_by_grub "${MEMTEST86_IMAGE}" ; then
19 ## image exists, create menu entry
20 echo "Found memtest86+ image: ${MEMTEST86_IMAGE}" >&2
21 _GRUB_MEMTEST_HINTS_STRING="$(${grub_probe} --target=hints_string ${MEMTEST86_IMAGE})"
22 _GRUB_MEMTEST_FS_UUID="$(${grub_probe} --target=fs_uuid ${MEMTEST86_IMAGE})"
23 _GRUB_MEMTEST_REL_PATH="$(make_system_path_relative_to_its_root ${MEMTEST86_IMAGE})"
24 cat << EOF
25 if [ "\${grub_platform}" == "pc" ]; then
26 menuentry "Memory Tester (memtest86+)" ${CLASS} {
27 search --fs-uuid --no-floppy --set=root ${_GRUB_MEMTEST_HINTS_STRING} ${_GRUB_MEMTEST_FS_UUID}
28 linux16 ${_GRUB_MEMTEST_REL_PATH} ${GRUB_CMDLINE_MEMTEST86}
31 EOF