Accepting request 667984 from home:rwill:branches:Base:System

- Build platform-packages 'noarch' and move to '/usr/share/efi'
  for SUSE Manager.  (FATE#326960)
  * grub2-efi-xen-chainload.patch (bsc#1122563)
  * grub2-efi-xen-removable.patch (refresh)

OBS-URL: https://build.opensuse.org/request/show/667984
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=321
This commit is contained in:
Michael Chang 2019-01-23 11:53:47 +00:00 committed by Git OBS Bridge
parent 0aca94611d
commit eac2d99699
6 changed files with 137 additions and 79 deletions

View File

@ -19,15 +19,15 @@ V2:
XEN hypervisor version with sections for different kernels, avoiding XEN hypervisor version with sections for different kernels, avoiding
useless duplicates for sym-linked hypervisors. and removing previously useless duplicates for sym-linked hypervisors. and removing previously
installed files from ESP. installed files from ESP.
V3:
- support move to '/usr/share/efi/$machine' for EFI-binaries. (bsc#1122563)
--- ---
util/grub.d/20_linux_xen.in | 88 +++++++++++++++++++++++++++++++++++++++++++- util/grub.d/20_linux_xen.in | 109 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 86 insertions(+), 2 deletions(-) 1 file changed, 97 insertions(+), 12 deletions(-)
Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in --- a/util/grub.d/20_linux_xen.in
=================================================================== +++ b/util/grub.d/20_linux_xen.in
--- grub-2.02~beta2.orig/util/grub.d/20_linux_xen.in
+++ grub-2.02~beta2/util/grub.d/20_linux_xen.in
@@ -21,6 +21,8 @@ prefix="@prefix@" @@ -21,6 +21,8 @@ prefix="@prefix@"
exec_prefix="@exec_prefix@" exec_prefix="@exec_prefix@"
datarootdir="@datarootdir@" datarootdir="@datarootdir@"
@ -37,7 +37,7 @@ Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
. "$pkgdatadir/grub-mkconfig_lib" . "$pkgdatadir/grub-mkconfig_lib"
export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAIN=@PACKAGE@
@@ -36,9 +38,11 @@ CLASS="--class gnu-linux --class gnu --c @@ -36,11 +38,23 @@ CLASS="--class gnu-linux --class gnu --c
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux OS=GNU/Linux
@ -49,8 +49,20 @@ Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
+ CLASS="--class ${os} ${CLASS}" + CLASS="--class ${os} ${CLASS}"
fi fi
+machine=`uname -m`
+
+case "$machine" in
+ i?86) GENKERNEL_ARCH="x86" ;;
+ mips|mips64) GENKERNEL_ARCH="mips" ;;
+ mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
+ arm*) GENKERNEL_ARCH="arm" ;;
+ *) GENKERNEL_ARCH="$machine" ;;
+esac
+
# loop-AES arranges things so that /dev/loop/X can be our root device, but # loop-AES arranges things so that /dev/loop/X can be our root device, but
@@ -85,6 +89,31 @@ esac # the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
@@ -87,6 +101,32 @@ esac
title_correction_code= title_correction_code=
@ -59,7 +71,8 @@ Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
+ err_msg="" + err_msg=""
+ efi_dir="/boot/efi/efi/${os}" + efi_dir="/boot/efi/efi/${os}"
+ grub_dir=/boot/@PACKAGE@ + grub_dir=/boot/@PACKAGE@
+ xen_dir=/usr/lib64/efi + xen_dir=/usr/share/efi/$machine
+ [ -d $xen_dir ] || xen_dir=/usr/lib64/efi
+ for d in $grub_dir $efi_dir $xen_dir; do + for d in $grub_dir $efi_dir $xen_dir; do
+ [ ! -d "$d" ] || continue + [ ! -d "$d" ] || continue
+ err_msg="${err_msg}$ME: Essential directory '$d' not found!\n" + err_msg="${err_msg}$ME: Essential directory '$d' not found!\n"
@ -82,7 +95,7 @@ Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
linux_entry () linux_entry ()
{ {
os="$1" os="$1"
@@ -122,6 +151,40 @@ linux_entry () @@ -124,6 +164,40 @@ linux_entry ()
save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/" save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
fi fi
@ -123,7 +136,24 @@ Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
if [ -z "${prepare_boot_cache}" ]; then if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
fi fi
@@ -219,6 +282,24 @@ while [ "x${xen_list}" != "x" ] ; do @@ -200,16 +274,6 @@ boot_device_id=
title_correction_code=
-machine=`uname -m`
-
-case "$machine" in
- i?86) GENKERNEL_ARCH="x86" ;;
- mips|mips64) GENKERNEL_ARCH="mips" ;;
- mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
- arm*) GENKERNEL_ARCH="arm" ;;
- *) GENKERNEL_ARCH="$machine" ;;
-esac
-
# Extra indentation to add to menu entries in a submenu. We're not in a submenu
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""
@@ -223,6 +287,24 @@ while [ "x${xen_list}" != "x" ] ; do
xen_dirname=`dirname ${current_xen}` xen_dirname=`dirname ${current_xen}`
rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname` rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"` xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
@ -148,7 +178,7 @@ Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
if [ -z "$boot_device_id" ]; then if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi fi
@@ -283,7 +364,6 @@ while [ "x${xen_list}" != "x" ] ; do @@ -287,7 +369,6 @@ while [ "x${xen_list}" != "x" ] ; do
if [ x"$is_top_level" != xtrue ]; then if [ x"$is_top_level" != xtrue ]; then
echo ' }' echo ' }'
fi fi
@ -156,7 +186,7 @@ Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
done done
# If at least one kernel was found, then we need to # If at least one kernel was found, then we need to
@@ -293,3 +373,7 @@ if [ x"$is_top_level" != xtrue ]; then @@ -297,3 +378,7 @@ if [ x"$is_top_level" != xtrue ]; then
fi fi
echo "$title_correction_code" echo "$title_correction_code"

View File

@ -16,11 +16,13 @@ This patch fixes the problem by ensuring the directory available to Xen
installation if any Xen hypervisor found and independent to grub boot path installation if any Xen hypervisor found and independent to grub boot path
$cmdpath to work. $cmdpath to work.
Index: grub-2.02/util/grub.d/20_linux_xen.in ---
=================================================================== util/grub.d/20_linux_xen.in | 62 ++++++++++++++++++++++++--------------------
--- grub-2.02.orig/util/grub.d/20_linux_xen.in 1 file changed, 35 insertions(+), 27 deletions(-)
+++ grub-2.02/util/grub.d/20_linux_xen.in
@@ -91,31 +91,6 @@ esac --- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -101,32 +101,6 @@ esac
title_correction_code= title_correction_code=
@ -29,7 +31,8 @@ Index: grub-2.02/util/grub.d/20_linux_xen.in
- err_msg="" - err_msg=""
- efi_dir="/boot/efi/efi/${os}" - efi_dir="/boot/efi/efi/${os}"
- grub_dir=/boot/@PACKAGE@ - grub_dir=/boot/@PACKAGE@
- xen_dir=/usr/lib64/efi - xen_dir=/usr/share/efi/$machine
- [ -d $xen_dir ] || xen_dir=/usr/lib64/efi
- for d in $grub_dir $efi_dir $xen_dir; do - for d in $grub_dir $efi_dir $xen_dir; do
- [ ! -d "$d" ] || continue - [ ! -d "$d" ] || continue
- err_msg="${err_msg}$ME: Essential directory '$d' not found!\n" - err_msg="${err_msg}$ME: Essential directory '$d' not found!\n"
@ -52,7 +55,7 @@ Index: grub-2.02/util/grub.d/20_linux_xen.in
grub2_unquote () grub2_unquote ()
{ {
awk ' awk '
@@ -223,10 +198,15 @@ linux_entry () @@ -234,10 +208,15 @@ linux_entry ()
kernel=${basename} root=${linux_root_device_thisversion} ${args_unq} kernel=${basename} root=${linux_root_device_thisversion} ${args_unq}
ramdisk=${initrd} ramdisk=${initrd}
EOF EOF
@ -69,7 +72,7 @@ Index: grub-2.02/util/grub.d/20_linux_xen.in
} }
EOF EOF
for f in ${grub_dir}/$xen_cfg ${xen_dir}/${xen_basename} ${dirname}/${basename} ${dirname}/${initrd}; do for f in ${grub_dir}/$xen_cfg ${xen_dir}/${xen_basename} ${dirname}/${basename} ${dirname}/${initrd}; do
@@ -307,6 +287,7 @@ else @@ -318,6 +297,7 @@ else
done done
fi fi
prepare_boot_cache= prepare_boot_cache=
@ -77,7 +80,7 @@ Index: grub-2.02/util/grub.d/20_linux_xen.in
boot_device_id= boot_device_id=
title_correction_code= title_correction_code=
@@ -327,6 +308,33 @@ submenu_indentation="" @@ -328,6 +308,34 @@ submenu_indentation=""
is_top_level=true is_top_level=true
@ -86,7 +89,8 @@ Index: grub-2.02/util/grub.d/20_linux_xen.in
+ err_msg="" + err_msg=""
+ efi_dir="/boot/efi/efi/${os}" + efi_dir="/boot/efi/efi/${os}"
+ grub_dir=/boot/grub2 + grub_dir=/boot/grub2
+ xen_dir=/usr/lib64/efi + xen_dir=/usr/share/efi/$machine
+ [ -d $xen_dir ] || xen_dir=/usr/lib64/efi
+ for d in $grub_dir $xen_dir; do + for d in $grub_dir $xen_dir; do
+ [ ! -d "$d" ] || continue + [ ! -d "$d" ] || continue
+ err_msg="${err_msg}$ME: Essential directory '$d' not found!\n" + err_msg="${err_msg}$ME: Essential directory '$d' not found!\n"

View File

@ -1 +0,0 @@
addFilter('arch-independent-package-contains-binary-or-object')

View File

@ -1,7 +1,11 @@
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 9 11:54:00 UTC 2019 - rw@suse.com Wed Jan 23 10:44:09 UTC 2019 - rw@suse.com
- Build platform-packages 'noarch' and move to '/usr/share/efi'
for SUSE Manager. (FATE#326960)
* grub2-efi-xen-chainload.patch (bsc#1122563)
* grub2-efi-xen-removable.patch (refresh)
- Build platform-packages 'noarch' for SUSE Manager. (FATE#326960)
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Dec 20 09:21:27 UTC 2018 - mchang@suse.com Thu Dec 20 09:21:27 UTC 2018 - mchang@suse.com

View File

@ -9,3 +9,5 @@ addFilter("unstripped-binary-or-object .*/grub2/*/.*.mod")
addFilter("s390x: W: executable-stack") addFilter("s390x: W: executable-stack")
# #
addFilter("suse-filelist-forbidden-noarch") addFilter("suse-filelist-forbidden-noarch")
#
addFilter('arch-independent-package-contains-binary-or-object')

View File

@ -167,7 +167,6 @@ Source16: grub2-xen-pv-firmware.cfg
# required hook for systemd-sleep (bsc#941758) # required hook for systemd-sleep (bsc#941758)
Source17: grub2-systemd-sleep.sh Source17: grub2-systemd-sleep.sh
Source18: grub2-check-default.sh Source18: grub2-check-default.sh
Source999: grub2-rpmlintrc
Source1000: PATCH_POLICY Source1000: PATCH_POLICY
Patch1: rename-grub-info-file-to-grub2.patch Patch1: rename-grub-info-file-to-grub2.patch
Patch2: grub2-linux.patch Patch2: grub2-linux.patch
@ -383,7 +382,9 @@ Upstream branding for GRUB2's graphical console
Summary: Bootloader with support for Linux, Multiboot and more Summary: Bootloader with support for Linux, Multiboot and more
Group: System/Boot Group: System/Boot
%if %{platform} != emu
BuildArch: noarch BuildArch: noarch
%endif
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires(post): %{name} = %{version} Requires(post): %{name} = %{version}
%if 0%{?update_bootloader_requires:1} %if 0%{?update_bootloader_requires:1}
@ -612,6 +613,8 @@ swap partition while in resuming
%patch501 -p1 %patch501 -p1
%build %build
# collect evidence to debug spurious build failure on SLE15
ulimit -a
# patches above may update the timestamp of grub.texi # patches above may update the timestamp of grub.texi
# and via build-aux/mdate-sh they end up in grub2.info, breaking build-compare # and via build-aux/mdate-sh they end up in grub2.info, breaking build-compare
[ -z "$SOURCE_DATE_EPOCH" ] ||\ [ -z "$SOURCE_DATE_EPOCH" ] ||\
@ -660,12 +663,13 @@ export CFLAGS CXXFLAGS FFLAGS
%if %{emu} %if %{emu}
cd build-emu cd build-emu
%define arch_specific --enable-device-mapper --disable-grub-mount %define arch_specific --enable-device-mapper --disable-grub-mount
TFLAGS="-fPIC" TLFLAGS="-fPIC"
# -static is needed so that autoconf script is able to link # -static is needed so that autoconf script is able to link
# test that looks for _start symbol on 64 bit platforms # test that looks for _start symbol on 64 bit platforms
../configure TARGET_LDFLAGS=$TFLAGS \ ../configure TARGET_LDFLAGS=$TLFLAGS \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
--libdir=%{_datadir} \
--sysconfdir=%{_sysconfdir} \ --sysconfdir=%{_sysconfdir} \
--target=%{_target_platform} \ --target=%{_target_platform} \
--with-platform=emu \ --with-platform=emu \
@ -684,9 +688,9 @@ cd build-xen
../configure \ ../configure \
TARGET_LDFLAGS=-static \ TARGET_LDFLAGS=-static \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
--libdir=%{_datadir} \
--sysconfdir=%{_sysconfdir} \ --sysconfdir=%{_sysconfdir} \
--target=%{_target_platform} \ --target=%{_target_platform} \
--libdir=%{_libdir} \
--with-platform=xen \ --with-platform=xen \
--program-transform-name=s,grub,%{name}, --program-transform-name=s,grub,%{name},
make %{?_smp_mflags} make %{?_smp_mflags}
@ -701,9 +705,9 @@ cd build-efi
../configure \ ../configure \
TARGET_LDFLAGS=-static \ TARGET_LDFLAGS=-static \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
--libdir=%{_datadir} \
--sysconfdir=%{_sysconfdir} \ --sysconfdir=%{_sysconfdir} \
--target=%{_target_platform} \ --target=%{_target_platform} \
--libdir=%{_libdir} \
--with-platform=efi \ --with-platform=efi \
--program-transform-name=s,grub,%{name}, --program-transform-name=s,grub,%{name},
make %{?_smp_mflags} make %{?_smp_mflags}
@ -771,12 +775,13 @@ cd build
%if %{platform} != "emu" %if %{platform} != "emu"
%define arch_specific --enable-device-mapper %define arch_specific --enable-device-mapper
TFLAGS="-static" TLFLAGS="-static"
# -static is needed so that autoconf script is able to link # -static is needed so that autoconf script is able to link
# test that looks for _start symbol on 64 bit platforms # test that looks for _start symbol on 64 bit platforms
../configure TARGET_LDFLAGS=$TFLAGS \ ../configure TARGET_LDFLAGS="$TLFLAGS" \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
--libdir=%{_datadir} \
--sysconfdir=%{_sysconfdir} \ --sysconfdir=%{_sysconfdir} \
--target=%{_target_platform} \ --target=%{_target_platform} \
--with-platform=%{platform} \ --with-platform=%{platform} \
@ -792,7 +797,7 @@ cd ..
%ifarch %{ix86} x86_64 %ifarch %{ix86} x86_64
cd build-xen cd build-xen
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
install -m 644 grub.xen $RPM_BUILD_ROOT%{_libdir}/%{name}/%{grubxenarch}/. install -m 644 grub.xen $RPM_BUILD_ROOT%{_datadir}/%{name}/%{grubxenarch}/.
cd .. cd ..
%endif %endif
@ -800,26 +805,28 @@ cd ..
cd build-efi cd build-efi
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
install -m 644 grub.efi grub-tpm.efi $RPM_BUILD_ROOT%{_libdir}/%{name}/%{grubefiarch}/. install -m 644 grub.efi grub-tpm.efi $RPM_BUILD_ROOT%{_datadir}/%{name}/%{grubefiarch}/.
# Create grub.efi link to system efi directory # Create grub.efi link to system efi directory
# This is for tools like kiwi not fiddling with the path # This is for tools like kiwi not fiddling with the path
%if "%{grubefiarch}" == "x86_64-efi" %define sysefibasedir %{_datadir}/efi
%define sysefibasedir %{_exec_prefix}/lib64/efi
%else
%define sysefibasedir %{_libdir}/efi
%endif
%define sysefidir %{sysefibasedir}/%{_target_cpu} %define sysefidir %{sysefibasedir}/%{_target_cpu}
install -d $RPM_BUILD_ROOT%{sysefidir} install -d $RPM_BUILD_ROOT%{sysefidir}
ln -sf ../../../../%{_libdir}/%{name}/%{grubefiarch}/grub.efi $RPM_BUILD_ROOT%{sysefidir}/grub.efi ln -sr $RPM_BUILD_ROOT%{_datadir}/%{name}/%{grubefiarch}/grub.efi $RPM_BUILD_ROOT%{sysefidir}/grub.efi
%ifarch x86_64 %ifarch x86_64
# provide compatibility sym-link for previous shim-install # provide compatibility sym-link for previous shim-install and the like
ln -sf %{_target_cpu}/grub.efi $RPM_BUILD_ROOT%{sysefibasedir}/grub.efi install -d $RPM_BUILD_ROOT/usr/lib64/efi
ln -srf $RPM_BUILD_ROOT%{_datadir}/%{name}/%{grubefiarch}/grub.efi $RPM_BUILD_ROOT/usr/lib64/efi/grub.efi
cat <<-EoM > $RPM_BUILD_ROOT/usr/lib64/efi/DEPRECATED
This directory and it's contents was moved to %{_datadir}/efi/x86_64.
Individual symbolic links are provided for a smooth transition and
may vanish at any point in time. Please use the new location!
EoM
%endif %endif
%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
%if 0%{?suse_version} >= 1230 || 0%{?suse_version} == 1110 %if 0%{?suse_version} >= 1230 || 0%{?suse_version} == 1110
export BRP_PESIGN_FILES="%{_libdir}/%{name}/%{grubefiarch}/grub.efi %{_libdir}/%{name}/%{grubefiarch}/grub-tpm.efi" export BRP_PESIGN_FILES="%{_datadir}/%{name}/%{grubefiarch}/grub.efi %{_datadir}/%{name}/%{grubefiarch}/grub-tpm.efi"
install -m 444 grub.der $RPM_BUILD_ROOT%{sysefidir}/ install -m 444 grub.der $RPM_BUILD_ROOT%{sysefidir}/
%endif %endif
%endif %endif
@ -833,17 +840,25 @@ make DESTDIR=$RPM_BUILD_ROOT install
cd .. cd ..
%endif %endif
if [ -d build-emu/grub-core ]; then if [ "%{platform}" = "emu" ]; then
# emu-lite is currently broken (and not needed), don't install!
rm -f $RPM_BUILD_ROOT%{_bindir}/%{name}-emu-lite
elif [ -d build-emu/grub-core ]; then
cd build-emu/grub-core cd build-emu/grub-core
install -m 755 grub-emu $RPM_BUILD_ROOT%{_bindir}/%{name}-emu install -m 755 grub-emu $RPM_BUILD_ROOT%{_bindir}/%{name}-emu
install -m 755 grub-emu-lite $RPM_BUILD_ROOT%{_bindir}/%{name}-emu-lite if false; then
# this needs to go to '-emu'-package; until that is ready, don't install!
install -m 755 grub-emu-lite $RPM_BUILD_ROOT%{_bindir}/%{name}-emu-lite
else
rm -f $RPM_BUILD_ROOT%{_bindir}/%{name}-emu-lite
fi
install -m 644 grub-emu.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}-emu.1 install -m 644 grub-emu.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}-emu.1
cd ../.. cd ../..
fi fi
# *.module files are installed with executable bits due to the way grub2 build # *.module files are installed with executable bits due to the way grub2 build
# system works. Clear executable bits to not confuse find-debuginfo.sh # system works. Clear executable bits to not confuse find-debuginfo.sh
find $RPM_BUILD_ROOT%{_libdir}/%{name} \ find $RPM_BUILD_ROOT%{_datadir}/%{name} \
\( -name '*.module' -o -name '*.image' -o -name '*.exec' \) -print0 | \ \( -name '*.module' -o -name '*.image' -o -name '*.exec' \) -print0 | \
xargs --no-run-if-empty -0 chmod a-x xargs --no-run-if-empty -0 chmod a-x
@ -858,7 +873,7 @@ install -d $RPM_BUILD_ROOT/boot/%{name}
touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg
# Remove devel files # Remove devel files
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*/*.h rm $RPM_BUILD_ROOT/%{_datadir}/%{name}/*/*.h
%if 0%{?suse_version} >= 1140 %if 0%{?suse_version} >= 1140
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.h rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.h
%endif %endif
@ -893,7 +908,7 @@ chmod 600 $R%{_sysconfdir}/default/zipl2grub.conf.in
%define dracutgrubmoddir %{dracutlibdir}/modules.d/99grub2 %define dracutgrubmoddir %{dracutlibdir}/modules.d/99grub2
install -m 755 -d $R%{dracutgrubmoddir} install -m 755 -d $R%{dracutgrubmoddir}
for f in module-setup.sh grub2.sh; do for f in module-setup.sh grub2.sh; do
mv $R%{_libdir}/%{name}/%{grubarch}/dracut-$f $R%{dracutgrubmoddir}/$f mv $R%{_datadir}/%{name}/%{grubarch}/dracut-$f $R%{dracutgrubmoddir}/$f
done done
rm -f $R%{_sysconfdir}/grub.d/30_os-prober rm -f $R%{_sysconfdir}/grub.d/30_os-prober
@ -919,6 +934,7 @@ perl -ni -e '
%find_lang %{name} %find_lang %{name}
%fdupes %buildroot%{_bindir} %fdupes %buildroot%{_bindir}
%fdupes %buildroot%{_libdir} %fdupes %buildroot%{_libdir}
%fdupes %buildroot%{_datadir}
%pre %pre
%service_add_pre grub2-once.service %service_add_pre grub2-once.service
@ -1125,7 +1141,6 @@ fi
%if 0%{?has_systemd:1} %if 0%{?has_systemd:1}
%{_unitdir}/grub2-once.service %{_unitdir}/grub2-once.service
%endif %endif
%dir %{_libdir}/%{name}
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/themes %dir %{_datadir}/%{name}/themes
%if 0%{?suse_version} >= 1140 %if 0%{?suse_version} >= 1140
@ -1156,7 +1171,7 @@ fi
%{_mandir}/man8/%{name}-reboot.8.* %{_mandir}/man8/%{name}-reboot.8.*
%{_mandir}/man8/%{name}-set-default.8.* %{_mandir}/man8/%{name}-set-default.8.*
%if %{emu} %if %{emu}
%{_bindir}/%{name}-emu* %{_bindir}/%{name}-emu
%{_mandir}/man1/%{name}-emu.1.* %{_mandir}/man1/%{name}-emu.1.*
%endif %endif
%ifnarch s390x %ifnarch s390x
@ -1183,49 +1198,53 @@ fi
%files %{grubarch} %files %{grubarch}
%defattr(-,root,root,-) %defattr(-,root,root,-)
%dir %{_libdir}/%{name}/%{grubarch} %dir %{_datadir}/%{name}/%{grubarch}
%ifarch ppc ppc64 ppc64le %ifarch ppc ppc64 ppc64le
# This is intentionally "grub.chrp" and not "%%{name}.chrp" # This is intentionally "grub.chrp" and not "%%{name}.chrp"
%{_libdir}/%{name}/%{grubarch}/grub.chrp %{_datadir}/%{name}/%{grubarch}/grub.chrp
%{_libdir}/%{name}/%{grubarch}/bootinfo.txt %{_datadir}/%{name}/%{grubarch}/bootinfo.txt
%endif %endif
%ifnarch ppc ppc64 ppc64le s390x %{arm} %ifnarch ppc ppc64 ppc64le s390x %{arm}
%{_libdir}/%{name}/%{grubarch}/*.image %{_datadir}/%{name}/%{grubarch}/*.image
%endif %endif
%{_libdir}/%{name}/%{grubarch}/*.img %{_datadir}/%{name}/%{grubarch}/*.img
%{_libdir}/%{name}/%{grubarch}/*.lst %{_datadir}/%{name}/%{grubarch}/*.lst
%{_libdir}/%{name}/%{grubarch}/*.mod %{_datadir}/%{name}/%{grubarch}/*.mod
%{_libdir}/%{name}/%{grubarch}/*.module %{_datadir}/%{name}/%{grubarch}/*.module
%ifarch x86_64 %ifarch x86_64
%{_libdir}/%{name}/%{grubarch}/efiemu*.o %{_datadir}/%{name}/%{grubarch}/efiemu*.o
%endif %endif
%{_libdir}/%{name}/%{grubarch}/gdb_grub %{_datadir}/%{name}/%{grubarch}/gdb_grub
%{_libdir}/%{name}/%{grubarch}/gmodule.pl %{_datadir}/%{name}/%{grubarch}/gmodule.pl
%{_libdir}/%{name}/%{grubarch}/kernel.exec %{_datadir}/%{name}/%{grubarch}/kernel.exec
%{_libdir}/%{name}/%{grubarch}/modinfo.sh %{_datadir}/%{name}/%{grubarch}/modinfo.sh
%endif %endif
%ifarch %{efi} %ifarch %{efi}
%files %{grubefiarch} %files %{grubefiarch}
%defattr(-,root,root,-) %defattr(-,root,root,-)
%dir %{_libdir}/%{name}/%{grubefiarch} %dir %{_datadir}/%{name}/%{grubefiarch}
%{_libdir}/%{name}/%{grubefiarch}/grub.efi %{_datadir}/%{name}/%{grubefiarch}/grub.efi
%{_libdir}/%{name}/%{grubefiarch}/grub-tpm.efi %{_datadir}/%{name}/%{grubefiarch}/grub-tpm.efi
%{_libdir}/%{name}/%{grubefiarch}/*.img %{_datadir}/%{name}/%{grubefiarch}/*.img
%{_libdir}/%{name}/%{grubefiarch}/*.lst %{_datadir}/%{name}/%{grubefiarch}/*.lst
%{_libdir}/%{name}/%{grubefiarch}/*.mod %{_datadir}/%{name}/%{grubefiarch}/*.mod
%{_libdir}/%{name}/%{grubefiarch}/*.module %{_datadir}/%{name}/%{grubefiarch}/*.module
%{_libdir}/%{name}/%{grubefiarch}/gdb_grub %{_datadir}/%{name}/%{grubefiarch}/gdb_grub
%{_libdir}/%{name}/%{grubefiarch}/gmodule.pl %{_datadir}/%{name}/%{grubefiarch}/gmodule.pl
%{_libdir}/%{name}/%{grubefiarch}/kernel.exec %{_datadir}/%{name}/%{grubefiarch}/kernel.exec
%{_libdir}/%{name}/%{grubefiarch}/modinfo.sh %{_datadir}/%{name}/%{grubefiarch}/modinfo.sh
%dir %{sysefibasedir} %dir %{sysefibasedir}
%dir %{sysefidir} %dir %{sysefidir}
%{sysefidir}/grub.efi %{sysefidir}/grub.efi
%if 0%{?suse_version} < 1600
%ifarch x86_64 %ifarch x86_64
# provide compatibility sym-link for previous shim-install # provide compatibility sym-link for previous shim-install and kiwi
%{sysefibasedir}/grub.efi %dir /usr/lib64/efi
/usr/lib64/efi/DEPRECATED
/usr/lib64/efi/grub.efi
%endif
%endif %endif
%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
@ -1244,8 +1263,8 @@ fi
%ifarch %{ix86} x86_64 %ifarch %{ix86} x86_64
%files %{grubxenarch} %files %{grubxenarch}
%dir %{_libdir}/%{name}/%{grubxenarch} %dir %{_datadir}/%{name}/%{grubxenarch}
%{_libdir}/%{name}/%{grubxenarch}/* %{_datadir}/%{name}/%{grubxenarch}/*
%endif %endif
%if 0%{?has_systemd:1} %if 0%{?has_systemd:1}