Accepting request 1072324 from home:frispete:Tumbleweed

- Meanwhile, memtest86+ gained EFI support, but using the grub
  command line to run it manually is quite tedious...
  Adapt 20_memtest86+ to provide a proper menu entry. Executing
  memtest requires to turn security off in BIOS: (Boot Mode: Other OS).

OBS-URL: https://build.opensuse.org/request/show/1072324
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=445
This commit is contained in:
Michael Chang 2023-03-20 02:50:55 +00:00 committed by Git OBS Bridge
parent 7c44841cbf
commit 3c4b4c1ff8
3 changed files with 30 additions and 11 deletions

View File

@ -4,6 +4,7 @@ set -e
# grub-mkconfig helper script.
# Copyright (C) 2011 Michal Ambroz <rebus@seznam.cz>
# Adapted for openSUSE by Andrey Borzenkov <arvidjaar@gmail.com>
# Adapted for EFI by Hans-Peter Jansen <hpj@urpla.net>
#
# you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -18,17 +19,11 @@ set -e
# You should have received a copy of the GNU General Public License
# along with the script. If not, see <http://www.gnu.org/licenses/>.
. /usr/share/grub2/grub-mkconfig_lib
. "$pkgdatadir/grub-mkconfig_lib"
export TEXTDOMAIN=grub2
export TEXTDOMAINDIR=/usr/share/locale
# memset86+ requires the x86 real mode
# which is not available with UEFI booting.
if [ -d /sys/firmware/efi ]; then
exit 0
fi
CLASS="--class memtest86 --class gnu --class tools"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
@ -38,7 +33,19 @@ else
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
fi
# memtest86+ comes in two flavours, one EFI and one suitable for x86 real mode.
# The EFI module requires security disabled in BIOS (Boot Mode: Other OS)
if [ -d /sys/firmware/efi -a -f /boot/efi/EFI/memtest86/memtest.efi ]; then
memtest=/boot/efi/EFI/memtest86/memtest.efi
loader='linux '
message="$(gettext_printf "Loading EFI memtest ...\n" | grub_quote)"
# locate the real EFI partition
GRUB_DEVICE_BOOT=$(grub2-probe -t device "$memtest")
else
memtest=/boot/memtest.bin
loader='linux16'
message="$(gettext_printf "Loading x86 memtest ...\n" | grub_quote)"
fi
if grub_file_is_not_garbage "$memtest" ; then
gettext_printf "Found memtest image: %s\n" "$memtest" >&2
@ -50,10 +57,10 @@ if grub_file_is_not_garbage "$memtest" ; then
printf "menuentry '%s' %s \$menuentry_id_option '%s' {\n" "${OS}" "${CLASS}" "memtest-$boot_device_id"
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
printf '%s\n' "${prepare_boot_cache}"
message="$(gettext_printf "Loading memtest ...\n" | grub_quote)"
cat << EOF
echo '$message'
linux16 ${rel_dirname}/${basename}
${loader} ${rel_dirname}/${basename}
}
EOF
fi

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 15 21:46:00 UTC 2023 - Hans-Peter Jansen <hpj@urpla.net>
- Meanwhile, memtest86+ gained EFI support, but using the grub
command line to run it manually is quite tedious...
Adapt 20_memtest86+ to provide a proper menu entry. Executing
memtest requires to turn security off in BIOS: (Boot Mode: Other OS).
-------------------------------------------------------------------
Mon Mar 13 15:43:01 UTC 2023 - rw@suse.com

View File

@ -528,6 +528,10 @@ Requires: s390-tools
%ifarch ppc64 ppc64le
Requires: powerpc-utils
%endif
%ifarch %{ix86}
# meanwhile, memtest is available as EFI executable
Recommends: memtest86+
%endif
%if 0%{?only_x86_64:1}
ExclusiveArch: x86_64