Add btrfs snapshot submenu and move grub2-probe to tools-minimal

The btrfs snapshot submenu was removed because it broke the old grubby tool
since it searched for "menuentry". But now that a BLS config is supported,
this can be added again as long as grubby isn't used.

This patch also moves the grub2-probe tool to the tools-minimal package to
prevent a circular dependency since the grub2-tools package depends on the
os-prober package, but os-prober package needs grub2-probe as a dependency.

So instead of making os-prober to depend on grub2-tools, it can be made to
depend on the grub2-tools-minimal subpackage.

Resolves: rhbz#1715994

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2019-07-17 14:15:22 +02:00
parent 7e98da058f
commit a1dedc8a10
No known key found for this signature in database
GPG Key ID: C751E590D63F3D69
2 changed files with 27 additions and 7 deletions

View File

@ -4,15 +4,13 @@ Date: Thu, 21 Aug 2014 03:39:11 +0000
Subject: [PATCH] grub2-btrfs-05-grub2-mkconfig
Signed-off-by: Michael Chang <mchang@suse.com>
[dusty: No more "Bootable Snapshot" submenu in grub.cfg.]
Signed-off-by: Dusty Mabe <dusty@dustymabe.com>
---
util/grub-mkconfig.in | 3 ++-
util/grub-mkconfig_lib.in | 4 ++++
util/grub.d/00_header.in | 12 +++++++++++-
util/grub.d/00_header.in | 25 ++++++++++++++++++++++++-
util/grub.d/10_linux.in | 4 ++++
util/grub.d/20_linux_xen.in | 4 ++++
5 files changed, 25 insertions(+), 2 deletions(-)
5 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 8218f3d477f..4248b9341ab 100644
@ -45,7 +43,7 @@ index 113a41f9409..b3aae534ddc 100644
is_path_readable_by_grub ()
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 858b526c925..8a16fea347e 100644
index 858b526c925..de727e6ee6b 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -27,6 +27,14 @@ export TEXTDOMAINDIR="@localedir@"
@ -74,6 +72,23 @@ index 858b526c925..8a16fea347e 100644
load_env
fi
EOF
@@ -356,3 +366,16 @@ fi
if [ "x${GRUB_BADRAM}" != "x" ] ; then
echo "badram ${GRUB_BADRAM}"
fi
+
+if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] &&
+ [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ] &&
+ [ "x${GRUB_FS}" = "xbtrfs" ] ; then
+ # Note: No $snapshot_num on *read-only* rollback! (bsc#901487)
+ cat <<EOF
+if [ -n "\$extra_cmdline" ]; then
+ submenu "Bootable snapshot #\$snapshot_num" {
+ menuentry "If OK, run 'snapper rollback' and reboot." { true; }
+ }
+fi
+EOF
+fi
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 4e49ccdf742..d9a05937e46 100644
--- a/util/grub.d/10_linux.in

View File

@ -7,7 +7,7 @@
Name: grub2
Epoch: 1
Version: 2.02
Release: 92%{?dist}
Release: 93%{?dist}
Summary: Bootloader with support for Linux, Multiboot and more
License: GPLv3+
URL: http://www.gnu.org/software/grub/
@ -371,6 +371,7 @@ rm -r /boot/grub2.tmp/ || :
%files tools-minimal
%{_sysconfdir}/prelink.conf.d/grub2.conf
%{_sbindir}/%{name}-get-kernel-settings
%{_sbindir}/%{name}-probe
%attr(4755, root, root) %{_sbindir}/%{name}-set-bootflag
%{_sbindir}/%{name}-set-default
%{_sbindir}/%{name}-set*password
@ -414,7 +415,6 @@ rm -r /boot/grub2.tmp/ || :
%{_datarootdir}/bash-completion/completions/grub
%{_sbindir}/%{name}-mkconfig
%{_sbindir}/%{name}-switch-to-blscfg
%{_sbindir}/%{name}-probe
%{_sbindir}/%{name}-rpm-sort
%{_sbindir}/%{name}-reboot
%{_bindir}/%{name}-file
@ -518,6 +518,11 @@ rm -r /boot/grub2.tmp/ || :
%endif
%changelog
* Wed Jul 17 2019 Javier Martinez Canillas <javierm@redhat.com> - 2.02-93
- Add btrfs snapshot submenu when BLS configuration is used
- Move grub2-probe to the grub2-tools-minimal subpackage
Resolves: rhbz#1715994
* Tue Jul 16 2019 Javier Martinez Canillas <javierm@redhat.com> - 2.02-92
- Cleanup our patchset to reduce the number of patches