blob: 20422b74d65a8f481910c7d68fd5bb06758172cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#!/bin/sh
. /usr/share/grub/grub-mkconfig_lib
memtest=/boot/memtest86plus/memtest.bin
memtestelf=/boot/memtest86plus/memtest
if [ -f "${memtest}" ] && [ -f "${memtestelf}" ]; then
multiple_memtest=true
fi
submenu_indentation=""
if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
submenu_indentation="${grub_tab}"
cat <<EOF
submenu 'Memtest86+' {
EOF
fi
if [ -f "${memtest}" ]; then
gettext_printf "Found memtest image: %s\n" "${memtest}" >&2
device="$("${grub_probe}" --target=device "${memtest}")"
path="$(make_system_path_relative_to_its_root "${memtest}")"
cat <<EOF
${submenu_indentation}menuentry 'Memtest86+' {
EOF
if [ -n "{submenu_indentation}" ]; then
prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
else
prepare_grub_to_access_device "${device}" | grub_add_tab
fi
cat <<EOF
${submenu_indentation}linux16 "${path}"
${submenu_indentation}}
EOF
fi
if [ -f "${memtestelf}" ]; then
gettext_printf "Found memtest image: %s\n" "${memtestelf}" >&2
device="$("${grub_probe}" --target=device "${memtestelf}")"
path="$(make_system_path_relative_to_its_root "${memtestelf}")"
cat <<EOF
${submenu_indentation}menuentry 'Memtest86+ (ELF)' {
EOF
if [ -n "${submenu_indentation}" ]; then
prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
else
prepare_grub_to_access_device "${device}" | grub_add_tab
fi
# We use knetbsd as a lazy way of booting an ELF.
# It's not actually related to NetBSD at all.
cat <<EOF
${submenu_indentation}knetbsd "${path}"
${submenu_indentation}}
EOF
fi
if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
cat <<EOF
}
EOF
fi
|