Skip to contentSkip to conversation

30_os-prober: Provide GRUB_OS_PROBER_DISABLE_DEBUG

PATCH In review Michael Chang 2 participants 5 messages Jul 15, 2019 – Jul 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 30_os-prober: Provide GRUB_OS_PROBER_DISABLE_DEBUG

This patch adds support to disable os-prober debug output while running grub-mkconfig through GRUB_OS_PROBER_DISABLE_DEBUG=true in simple configuration interface. The os-prober needs to support the OS_PROBER_DISABLE_DEBUG environment variable, which was introduced by 1.72 release.

---
 docs/grub.texi              | 4 ++++
 util/grub-mkconfig.in       | 3 ++-
 util/grub.d/30_os-prober.in | 4 ++++
 3 files changed, 10 insertions(+), 1 deletion(-)
docs/grub.texi +4 -0
index 3d50b16ba..0295d1e67 100644
@@ -1490,6 +1490,10 @@ for them.  Set this option to @samp{true} to disable this.
 List of space-separated FS UUIDs of filesystems to be ignored from os-prober
 output. For efi chainloaders it's <UUID>@@<EFI FILE>
 
+@item GRUB_OS_PROBER_DISABLE_DEBUG
+Set to @samp{true} to disable @command{os-prober} program's debug output while
+running the @command{grub-mkconfig}.
+
 @item GRUB_DISABLE_SUBMENU
 Normally, @command{grub-mkconfig} will generate top level menu entry for
 the kernel with highest version number and put all other found kernels
util/grub-mkconfig.in +2 -1
index 9f477ff05..80e8a9d62 100644
@@ -238,7 +238,8 @@ export GRUB_DEFAULT \
   GRUB_ENABLE_CRYPTODISK \
   GRUB_BADRAM \
   GRUB_OS_PROBER_SKIP_LIST \
-  GRUB_DISABLE_SUBMENU
+  GRUB_DISABLE_SUBMENU \
+  GRUB_OS_PROBER_DISABLE_DEBUG
 
 if test "x${grub_cfg}" != "x"; then
   rm -f "${grub_cfg}.new"
util/grub.d/30_os-prober.in +4 -0
index 515a68c7a..b182b5842 100644
@@ -30,6 +30,10 @@ if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
   exit 0
 fi
 
+if [ "x${GRUB_OS_PROBER_DISABLE_DEBUG}" = "xtrue" ]; then
+  export OS_PROBER_DISABLE_DEBUG=y
+fi
+
 if [ -z "`which os-prober 2> /dev/null`" ] || [ -z "`which linux-boot-prober 2> /dev/null`" ] ; then
   # missing os-prober and/or linux-boot-prober
   exit 0
Signature · 1 line
2.16.4
#1 lore raw
Quoted 5 lines · Michael Chang

This patch adds support to disable os-prober debug output while running grub-mkconfig through GRUB_OS_PROBER_DISABLE_DEBUG=true in simple configuration interface. The os-prober needs to support the OS_PROBER_DISABLE_DEBUG environment variable, which was introduced by 1.72 release.

Rather than extending the /etc/default/grub configuration interface for this, I wonder if it would be better to just do something like this in 30_os-prober:

  export OS_PROBER_DISABLE_DEBUG="${OS_PROBER_DISABLE_DEBUG-y}"

That way, people who want details can set OS_PROBER_DISABLE_DEBUG= (i.e. empty) when running grub-mkconfig, or we could add a --debug option or something; but otherwise debug output will be suppressed, which seems like a better default for grub-mkconfig.

Signature · 1 line
Colin Watson                                       [[email protected]]
#2 lore raw
Quoted 11 lines · Colin Watson
Quoted 5 lines · Michael Chang

This patch adds support to disable os-prober debug output while running grub-mkconfig through GRUB_OS_PROBER_DISABLE_DEBUG=true in simple configuration interface. The os-prober needs to support the OS_PROBER_DISABLE_DEBUG environment variable, which was introduced by 1.72 release.

Rather than extending the /etc/default/grub configuration interface for this, I wonder if it would be better to just do something like this in 30_os-prober:

Quoted 6 lines
  export OS_PROBER_DISABLE_DEBUG="${OS_PROBER_DISABLE_DEBUG-y}"

That way, people who want details can set OS_PROBER_DISABLE_DEBUG= (i.e. empty) when running grub-mkconfig, or we could add a --debug option or something; but otherwise debug output will be suppressed, which seems like a better default for grub-mkconfig.

What about changing the os-prober default to disable the debug output ? In that way we don't need to patch grub, just do this to enable it.

export OS_PROBER_ENABLE_DEBUG=y; grub-mkconfig

Btw, the intention of using /etc/default/grub is to make the change persistent to os-prober as it has no settings for that, and is in a documented way. I'm fine doing it either way, because the thing here is to suppress os-prober debug output as default, and re-enable it by settings or command line interface are all viable imho.

Thanks,
Michael

Quoted 8 lines
Signature · 7 lines
-- 
Colin Watson                                       [[email protected]]

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#3 lore raw
Quoted 1 line · Michael Chang

What about changing the os-prober default to disable the debug output ?

I haven't thought about it in detail, but that seems reasonable enough. Could you file a bug report against os-prober in Debian?

Signature · 1 line
Colin Watson                                       [[email protected]]
#4 lore raw
Quoted 5 lines · Colin Watson
Quoted 1 line · Michael Chang

What about changing the os-prober default to disable the debug output ?

I haven't thought about it in detail, but that seems reasonable enough. Could you file a bug report against os-prober in Debian?

I just filed it to Debian. Please let me know if you don't get the copy of it.

Thanks,
Michael

Quoted 8 lines
Signature · 7 lines
-- 
Colin Watson                                       [[email protected]]

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