]>
Commit | Line | Data |
---|---|---|
435aa863 MT |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | # older versions of grub2 do not have this yet (LP: #459080) | |
5 | if [ ! -e /usr/lib/grub/grub-mkconfig_lib ]; then | |
6 | echo "no grub-mkconfig_lib, exiting" | |
7 | exit 0 | |
8 | fi | |
9 | ||
10 | . /usr/lib/grub/grub-mkconfig_lib | |
11 | ||
12 | # We can't cope with loop-mounted devices here. | |
13 | case ${GRUB_DEVICE_BOOT} in | |
14 | /dev/loop/*|/dev/loop[0-9]) | |
15 | exit 0 | |
16 | ;; | |
17 | esac | |
18 | ||
19 | if test -e /boot/memtest86+; then | |
20 | MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+" ) | |
21 | echo "Found memtest86+ image: $MEMTESTPATH" >&2 | |
22 | cat << EOF | |
23 | menuentry "Memory test (memtest86+)" { | |
24 | EOF | |
25 | prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" | |
26 | printf '%s\n' "${prepare_boot_cache}" | |
27 | cat << EOF | |
28 | linux16 $MEMTESTPATH | |
29 | } | |
30 | menuentry "Memory test (memtest86+, serial console 115200)" { | |
31 | EOF | |
32 | printf '%s\n' "${prepare_boot_cache}" | |
33 | cat << EOF | |
34 | linux16 $MEMTESTPATH console=ttyS0,115200n8 | |
35 | } | |
36 | EOF | |
37 | fi |