archrelease: copy trunk to extra-x86_64
[arch-packages.git] / memtest86+ / trunk / 60_memtest86+-efi
blobe6d77ea5112ee043dc08ef0803f121689f65b5db
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.efi"
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+ EFI 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}" == "efi" ]; then
26 menuentry "Memory Tester (memtest86+)" ${CLASS} {
27 if loadfont unicode ; then
28 set gfxmode=1024x768,800x600,auto
29 set gfxpayload=800x600,1024x768
30 terminal_output gfxterm
32 search --fs-uuid --no-floppy --set=root ${_GRUB_MEMTEST_HINTS_STRING} ${_GRUB_MEMTEST_FS_UUID}
33 linux ${_GRUB_MEMTEST_REL_PATH} ${GRUB_CMDLINE_MEMTEST86}
36 EOF