Hello, in grub2 scripting language you can test if grub is running in bios or uefi mode.
Now in /etc/grub.d/20_memtest86+ is:
===
cat << EOF
menuentry "Memory test (memtest86+)" {
EOF
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
$LX $MEMTESTPATH
}
menuentry "Memory test (memtest86+, serial console 115200)" {
EOF
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
$LX $MEMTESTPATH console=ttyS0,115200n8
}
EOF
===
You can change it to:
===
cat << EOF
if test "\$grub_cpu" = "i386" -a "\$grub_platform" = "pc"; then
menuentry "Memory test (memtest86+)" {
EOF
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
$LX $MEMTESTPATH
}
menuentry "Memory test (memtest86+, serial console 115200)" {
EOF
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
$LX $MEMTESTPATH console=ttyS0,115200n8
}
fi
EOF
===
and both memtest86+ menu entries will be visible only if grub is
running in bios mode. In uefi mode grub_platform is set to "efi".
I think that this change should fix this bug. Memtest86+ menu
entries will not be visible in uefi mode anymore...
--
Pali Rohár
[email protected]
signature.asc
Description: This is a digitally signed message part.

