* [PATCH] 30_os-prober: Provide GRUB_OS_PROBER_DISABLE_DEBUG
@ 2019-07-15 9:28 Michael Chang
2019-07-15 16:26 ` Colin Watson
0 siblings, 1 reply; 5+ messages in thread
From: Michael Chang @ 2019-07-15 9:28 UTC (permalink / raw)
To: grub-devel@gnu.org
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.
Signed-off-by: Michael Chang <mchang@suse.com>
---
docs/grub.texi | 4 ++++
util/grub-mkconfig.in | 3 ++-
util/grub.d/30_os-prober.in | 4 ++++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/docs/grub.texi b/docs/grub.texi
index 3d50b16ba..0295d1e67 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -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
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 9f477ff05..80e8a9d62 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -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"
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
index 515a68c7a..b182b5842 100644
--- a/util/grub.d/30_os-prober.in
+++ b/util/grub.d/30_os-prober.in
@@ -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
--
2.16.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] 30_os-prober: Provide GRUB_OS_PROBER_DISABLE_DEBUG
2019-07-15 9:28 [PATCH] 30_os-prober: Provide GRUB_OS_PROBER_DISABLE_DEBUG Michael Chang
@ 2019-07-15 16:26 ` Colin Watson
2019-07-16 7:28 ` Michael Chang
0 siblings, 1 reply; 5+ messages in thread
From: Colin Watson @ 2019-07-15 16:26 UTC (permalink / raw)
To: grub-devel
On Mon, Jul 15, 2019 at 09:28:31AM +0000, Michael Chang wrote:
> 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.
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] 30_os-prober: Provide GRUB_OS_PROBER_DISABLE_DEBUG
2019-07-15 16:26 ` Colin Watson
@ 2019-07-16 7:28 ` Michael Chang
2019-07-23 18:41 ` Colin Watson
0 siblings, 1 reply; 5+ messages in thread
From: Michael Chang @ 2019-07-16 7:28 UTC (permalink / raw)
To: The development of GNU GRUB
On Mon, Jul 15, 2019 at 05:26:55PM +0100, Colin Watson wrote:
> On Mon, Jul 15, 2019 at 09:28:31AM +0000, Michael Chang wrote:
> > 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.
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
>
> --
> Colin Watson [cjwatson@ubuntu.com]
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-07-25 10:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-15 9:28 [PATCH] 30_os-prober: Provide GRUB_OS_PROBER_DISABLE_DEBUG Michael Chang
2019-07-15 16:26 ` Colin Watson
2019-07-16 7:28 ` Michael Chang
2019-07-23 18:41 ` Colin Watson
2019-07-25 10:27 ` Michael Chang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.