Only show os-prober disable warning if installed
authorGRUB Maintainers <pkg-grub-devel@alioth-lists.debian.net>
Mon, 19 Jun 2023 15:23:25 +0000 (17:23 +0200)
committerJulian Andres Klode <jak@debian.org>
Sun, 2 Nov 2025 11:08:11 +0000 (12:08 +0100)
It isn't very useful to see this message when os-prober is not
even available.

Gbp-Pq: Name Only-show-os-prober-disable-warning-if-installed.patch

util/grub.d/30_os-prober.in

index b4885f80b5833479b821ff8a821cb01e2c896925..ea9004bcff3cbe8b9af7d1c8acdf292a8a478166 100644 (file)
@@ -40,13 +40,13 @@ EOF
   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.")"
+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 ! command -v os-prober > /dev/null || ! command -v linux-boot-prober > /dev/null ; then
-  # missing os-prober and/or linux-boot-prober
+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