From 30b139ceba13251a248441413bdbb9dd6964c70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 8 Mar 2019 18:22:23 +0100 Subject: [PATCH] Do not remove boot loader configuration for other boot loaders --- 20-grub.install | 4 ++-- grub2.spec | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/20-grub.install b/20-grub.install index 3238e43..f2de776 100755 --- a/20-grub.install +++ b/20-grub.install @@ -16,8 +16,8 @@ KERNEL_DIR="${KERNEL_IMAGE%/*}" MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID -# Remove it, since for grub2 the images are always installed in /boot -rm -rf "${BOOT_DIR_ABS%/*}" +# If ${BOOT_DIR_ABS} exists, some other boot loader is active. +[[ -d "${BOOT_DIR_ABS}" ]] && exit 0 BLS_DIR="/boot/loader/entries" diff --git a/grub2.spec b/grub2.spec index 1b83361..ce384ec 100644 --- a/grub2.spec +++ b/grub2.spec @@ -215,8 +215,6 @@ install -d -m 0755 %{buildroot}%{_prefix}/lib/kernel/install.d/ install -D -m 0755 -t %{buildroot}%{_prefix}/lib/kernel/install.d/ %{SOURCE9} install -D -m 0755 -t %{buildroot}%{_prefix}/lib/kernel/install.d/ %{SOURCE13} install -d -m 0755 %{buildroot}%{_sysconfdir}/kernel/install.d/ -install -m 0644 /dev/null %{buildroot}%{_sysconfdir}/kernel/install.d/20-grubby.install -install -m 0644 /dev/null %{buildroot}%{_sysconfdir}/kernel/install.d/90-loaderentry.install # Install systemd user service to set the boot_success flag install -D -m 0755 -t %{buildroot}%{_userunitdir} \ docs/grub-boot-success.{timer,service} @@ -317,8 +315,6 @@ rm -r /boot/grub2.tmp/ || : %exclude %{_datarootdir}/grub/themes/* %attr(0700,root,root) %dir %{_sysconfdir}/grub.d %{_prefix}/lib/kernel/install.d/20-grub.install -%{_sysconfdir}/kernel/install.d/20-grubby.install -%{_sysconfdir}/kernel/install.d/90-loaderentry.install %{_prefix}/lib/kernel/install.d/99-grub-mkconfig.install %dir %{_datarootdir}/grub %exclude %{_datarootdir}/grub/*