nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0003-Revert-templates-Disable-the-os-prober-by-default.patch

8e15ce
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8e15ce
From: Javier Martinez Canillas <javierm@redhat.com>
8e15ce
Date: Fri, 11 Jun 2021 12:10:58 +0200
8e15ce
Subject: [PATCH] Revert "templates: Disable the os-prober by default"
8e15ce
8e15ce
This reverts commit e346414725a70e5c74ee87ca14e580c66f517666.
8e15ce
---
8e15ce
 docs/grub.texi              | 18 ++++++++----------
8e15ce
 util/grub.d/30_os-prober.in |  5 +----
8e15ce
 2 files changed, 9 insertions(+), 14 deletions(-)
8e15ce
8e15ce
diff --git a/docs/grub.texi b/docs/grub.texi
8e15ce
index f8b4b3b21a7..69f08d289f9 100644
8e15ce
--- a/docs/grub.texi
8e15ce
+++ b/docs/grub.texi
8e15ce
@@ -1519,13 +1519,10 @@ boot sequence.  If you have problems, set this option to @samp{text} and
8e15ce
 GRUB will tell Linux to boot in normal text mode.
8e15ce
 
8e15ce
 @item GRUB_DISABLE_OS_PROBER
8e15ce
-The @command{grub-mkconfig} has a feature to use the external
8e15ce
-@command{os-prober} program to discover other operating systems installed on
8e15ce
-the same machine and generate appropriate menu entries for them. It is disabled
8e15ce
-by default since automatic and silent execution of @command{os-prober}, and
8e15ce
-creating boot entries based on that data, is a potential attack vector. Set
8e15ce
-this option to @samp{false} to enable this feature in the
8e15ce
-@command{grub-mkconfig} command.
8e15ce
+Normally, @command{grub-mkconfig} will try to use the external
8e15ce
+@command{os-prober} program, if installed, to discover other operating
8e15ce
+systems installed on the same system and generate appropriate menu entries
8e15ce
+for them.  Set this option to @samp{true} to disable this.
8e15ce
 
8e15ce
 @item GRUB_OS_PROBER_SKIP_LIST
8e15ce
 List of space-separated FS UUIDs of filesystems to be ignored from os-prober
8e15ce
@@ -1853,9 +1850,10 @@ than zero; otherwise 0.
8e15ce
 @section Multi-boot manual config
8e15ce
 
8e15ce
 Currently autogenerating config files for multi-boot environments depends on
8e15ce
-os-prober and has several shortcomings. Due to that it is disabled by default.
8e15ce
-It is advised to use the power of GRUB syntax and do it yourself. A possible
8e15ce
-configuration is detailed here, feel free to adjust to your needs.
8e15ce
+os-prober and has several shortcomings. While fixing it is scheduled for the
8e15ce
+next release, meanwhile you can make use of the power of GRUB syntax and do it
8e15ce
+yourself. A possible configuration is detailed here, feel free to adjust to your
8e15ce
+needs.
8e15ce
 
8e15ce
 First create a separate GRUB partition, big enough to hold GRUB. Some of the
8e15ce
 following entries show how to load OS installer images from this same partition,
8e15ce
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
8e15ce
index 80685b15f4d..1b91c102f35 100644
8e15ce
--- a/util/grub.d/30_os-prober.in
8e15ce
+++ b/util/grub.d/30_os-prober.in
8e15ce
@@ -26,8 +26,7 @@ export TEXTDOMAINDIR="@localedir@"
8e15ce
 
8e15ce
 . "$pkgdatadir/grub-mkconfig_lib"
8e15ce
 
8e15ce
-if [ "x${GRUB_DISABLE_OS_PROBER}" = "xfalse" ]; then
8e15ce
-  gettext_printf "os-prober will not be executed to detect other bootable partitions.\nSystems on them will not be added to the GRUB boot configuration.\nCheck GRUB_DISABLE_OS_PROBER documentation entry.\n"
8e15ce
+if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
8e15ce
   exit 0
8e15ce
 fi
8e15ce
 
8e15ce
@@ -40,8 +39,6 @@ OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
8e15ce
 if [ -z "${OSPROBED}" ] ; then
8e15ce
   # empty os-prober output, nothing doing
8e15ce
   exit 0
8e15ce
-else
8e15ce
-  grub_warn "$(gettext_printf "os-prober was executed to detect other bootable partitions.\nIt's output will be used to detect bootable binaries on them and create new boot entries.")"
8e15ce
 fi
8e15ce
 
8e15ce
 osx_entry() {