summaryrefslogtreecommitdiff
path: root/sys-apps/memtest86-bin/files/memtest86-bin-grub.d
blob: db1ddf855d0eb6d7333d7d6b7fcb321111c8dd42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

. /usr/share/grub/grub-mkconfig_lib

memtest_efi=/boot/memtest86-bin.efi

if [ -f "${memtest_efi}" ]; then
	echo "Found MemTest86-EFI" >&2
	device="$("${grub_probe}" --target=device "${memtest_efi}")"
	path="$(make_system_path_relative_to_its_root "${memtest_efi}")"
	cat <<EOF
if [ "x\$grub_platform" = xefi ]; then
	menuentry "MemTest86-EFI" {
EOF
	prepare_grub_to_access_device "${device}" | grub_add_tab
	cat <<EOF
		chainloader "${path}"
	}
fi
EOF
fi