d/.../grub.d/xen.cfg: Redirect output when running grub-mkconfig
authorHans van Kranenburg <hans@knorrie.org>
Wed, 3 Aug 2022 14:58:02 +0000 (16:58 +0200)
committerHans van Kranenburg <hans@knorrie.org>
Tue, 23 Aug 2022 11:40:41 +0000 (13:40 +0200)
John E. Krokes noticed that the grub configuration fragment that we ship
outputs text to stdout, which means it will end up being part of the
generated grub configuration. This is wrong, and leads to error messages
during boot like "error: can't find command `Including'."...

Instead, output informational messages about progress to stderr (exactly
like what happens with other messages such as "Generating grub
configuration file ..." or "Found linux image: /boot/vmlinuz-[...]").

For the more prominent message about changing GRUB_DEFAULT as a side
effect, use the grub_warn helper instead.

(Closes: #1016547)

debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg

index 900c12df5db2f70b6da3f5e20a210039b66d6dce..255663e124a61cf4d11d94a5ee08d90882f3fb9e 100644 (file)
@@ -5,7 +5,7 @@
 # The configuration in here makes it possible to have different options set
 # for the linux kernel when booting with or without Xen.
 
-echo "Including Xen overrides from /etc/default/grub.d/xen.cfg"
+echo "Including Xen overrides from /etc/default/grub.d/xen.cfg" >&2
 
 #######################################################################
 # Xen Hypervisor Command Line Options
@@ -83,8 +83,8 @@ echo "Including Xen overrides from /etc/default/grub.d/xen.cfg"
 #XEN_OVERRIDE_GRUB_DEFAULT=
 #
 if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "" ]; then
-       echo "WARNING: GRUB_DEFAULT changed to boot into Xen by default!"
-       echo "         Edit /etc/default/grub.d/xen.cfg to avoid this warning."
+       grub_warn "GRUB_DEFAULT changed to boot into Xen by default!" \
+                 "Edit /etc/default/grub.d/xen.cfg to avoid this warning."
        XEN_OVERRIDE_GRUB_DEFAULT=1
 fi
 if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "1" ]; then