From c21131904e83a5de675b6feb6a023b5923dad174 Mon Sep 17 00:00:00 2001 From: Hans van Kranenburg Date: Wed, 3 Aug 2022 16:58:02 +0200 Subject: [PATCH] d/.../grub.d/xen.cfg: Redirect output when running grub-mkconfig 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) --- .../tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg b/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg index 900c12df5d..255663e124 100644 --- a/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg +++ b/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg @@ -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 -- 2.30.2