Accepting request 1155093 from home:gcomes.obs
- add source 20_memtest86 * replace similar file from package grub2 - don't install files in /boot. The OS needs to stay in /usr OBS-URL: https://build.opensuse.org/request/show/1155093 OBS-URL: https://build.opensuse.org/package/show/Base:System/memtest86+?expand=0&rev=53
This commit is contained in:
parent
09d8a18b50
commit
d40a9fa2bd
75
20_memtest86
Normal file
75
20_memtest86
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
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
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with the script. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
. "$pkgdatadir/grub-mkconfig_lib"
|
||||||
|
|
||||||
|
export TEXTDOMAIN=grub2
|
||||||
|
export TEXTDOMAINDIR=/usr/share/locale
|
||||||
|
|
||||||
|
CLASS="--class memtest86 --class gnu --class tools"
|
||||||
|
|
||||||
|
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
|
||||||
|
OS=Memtest
|
||||||
|
else
|
||||||
|
OS="${GRUB_DISTRIBUTOR} Memtest"
|
||||||
|
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.
|
||||||
|
if [ -d /sys/firmware/efi ]; then
|
||||||
|
if [ -f /usr/lib/memtest86/memtest.efi ]; then
|
||||||
|
memtest=/usr/lib/memtest86/memtest.efi
|
||||||
|
else
|
||||||
|
#memtest.efi not found
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
loader='linux '
|
||||||
|
message="$(gettext_printf "Loading EFI memtest ...\n" | grub_quote)"
|
||||||
|
else
|
||||||
|
if [ -f /usr/lib/memtest86/memtest.bin ]; then
|
||||||
|
memtest=/usr/lib/memtest86/memtest.bin
|
||||||
|
else
|
||||||
|
#memtest.bin not found
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
loader='linux16'
|
||||||
|
message="$(gettext_printf "Loading x86 memtest ...\n" | grub_quote)"
|
||||||
|
fi
|
||||||
|
# locate the real partition
|
||||||
|
GRUB_DEVICE_BOOT=$(grub2-probe -t device "$memtest")
|
||||||
|
|
||||||
|
if grub_file_is_not_garbage "$memtest" ; then
|
||||||
|
gettext_printf "Found memtest image: %s\n" "$memtest" >&2
|
||||||
|
basename=`basename $memtest`
|
||||||
|
dirname=`dirname $memtest`
|
||||||
|
rel_dirname=`make_system_path_relative_to_its_root $dirname`
|
||||||
|
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE_BOOT}")"
|
||||||
|
|
||||||
|
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}"
|
||||||
|
cat << EOF
|
||||||
|
echo '$message'
|
||||||
|
${loader} ${rel_dirname}/${basename}
|
||||||
|
}
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 4 14:56:40 UTC 2024 - Giacomo Comes <gcomes.obs@gmail.com>
|
||||||
|
|
||||||
|
- add source 20_memtest86
|
||||||
|
* replace similar file from package grub2
|
||||||
|
- don't install files in /boot. The OS needs to stay in /usr
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 15 10:58:15 UTC 2024 - Lubos Kocman <lubos.kocman@suse.com>
|
Mon Jan 15 10:58:15 UTC 2024 - Lubos Kocman <lubos.kocman@suse.com>
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ License: GPL-2.0-only
|
|||||||
Group: System/Boot
|
Group: System/Boot
|
||||||
URL: https://www.memtest.org
|
URL: https://www.memtest.org
|
||||||
Source: https://github.com/memtest86plus/memtest86plus/archive/v%{version}/%{name}-%{version}.tar.gz
|
Source: https://github.com/memtest86plus/memtest86plus/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Source1: 20_memtest86
|
||||||
#!BuildIgnore: gcc-PIE
|
#!BuildIgnore: gcc-PIE
|
||||||
Provides: lilo:/boot/memtest.bin
|
Provides: lilo:/boot/memtest.bin
|
||||||
Obsoletes: memtest86 <= 3.2
|
Obsoletes: memtest86 <= 3.2
|
||||||
@ -55,15 +56,18 @@ cd build32
|
|||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
# Script to generate memtest86+ menu entry
|
||||||
|
mkdir -p %{buildroot}/%{_sysconfdir}/grub.d
|
||||||
|
install -m 755 %{SOURCE1} %{buildroot}/%{_sysconfdir}/grub.d/
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
cd build64
|
cd build64
|
||||||
%else
|
%else
|
||||||
cd build32
|
cd build32
|
||||||
%endif
|
%endif
|
||||||
install -Dpm 0644 memtest.bin \
|
install -Dpm 0644 memtest.bin \
|
||||||
%{buildroot}/boot/memtest.bin
|
%{buildroot}%{_prefix}/lib/memtest86/memtest.bin
|
||||||
install -Dpm 0644 memtest.efi \
|
install -Dpm 0644 memtest.efi \
|
||||||
%{buildroot}/boot/efi/EFI/memtest86/memtest.efi
|
%{buildroot}%{_prefix}/lib/memtest86/memtest.efi
|
||||||
export BRP_PESIGN_FILES="*.efi"
|
export BRP_PESIGN_FILES="*.efi"
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -76,10 +80,9 @@ export BRP_PESIGN_FILES="*.efi"
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%doc doc
|
%doc doc
|
||||||
/boot/memtest.bin
|
%dir %{_prefix}/lib/memtest86
|
||||||
%dir /boot/efi
|
%{_prefix}/lib/memtest86/memtest.*
|
||||||
%dir /boot/efi/EFI
|
%dir %{_sysconfdir}/grub.d
|
||||||
%dir /boot/efi/EFI/memtest86
|
%config(noreplace) %{_sysconfdir}/grub.d/20_memtest86
|
||||||
/boot/efi/EFI/memtest86/memtest.efi
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user