Skip to contentSkip to conversation

30_os-prober.in: only warn if os-prober is available

PATCH New Sertonix 1 participant 1 message Apr 18, 2024

lore
Share & tools
lore

Sertonix

author
#0 lore raw

PATCH 1/1 30_os-prober.in: only warn if os-prober is available

From: Christoph Anton Mitterer <[email protected]>

It doesn’t make sense to warn that os-prober is not going to be executed when that isn’t available anyway.

---
The initial patch was attached in this bug report: https://savannah.gnu.org/bugs/index.php?61718
I simplified it slightly.

 util/grub.d/30_os-prober.in | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
util/grub.d/30_os-prober.in +4 -5
index 656301eaf..f3c682da8 100644
@@ -26,16 +26,15 @@ export TEXTDOMAINDIR="@localedir@"
 
 . "$pkgdatadir/grub-mkconfig_lib"
 
-if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
-  grub_warn "$(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.")"
-  exit 0
-fi
-
 if ! command -v os-prober > /dev/null || ! command -v linux-boot-prober > /dev/null ; then
   # missing os-prober and/or linux-boot-prober
   exit 0
 fi
 
+if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
+  grub_warn "$(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.")"
+  exit 0
+fi
 grub_warn "$(gettext_printf "os-prober will be executed to detect other bootable partitions.\nIts output will be used to detect bootable binaries on them and create new boot entries.")"
 
 OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
Signature · 7 lines
2.44.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel