From cb452983b52457bad7c9cc4300d1dd470a40ba58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sun, 10 Mar 2019 14:23:23 +0100 Subject: [PATCH] plymouth-ignore-serial-consoles: adjusting the method from marmarek suggestion https://github.com/fepitre/qubes-linux-kernel/commit/af674124d6da121e285baf2b5b5ee412c8254c7e (cherry picked from commit e69b02bec8e69b0dc21c8b2c2f73df7b5a840149) --- kernel.spec.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel.spec.in b/kernel.spec.in index f03f123..826a552 100644 --- a/kernel.spec.in +++ b/kernel.spec.in @@ -430,13 +430,15 @@ done # with kernel-4.14+ plymouth detects hvc0 serial console and forces text boot # we simply make plymouth ignore it to recover the splash screen -if ! grep -q '^GRUB_CMDLINE_LINUX.*plymouth.ignore-serial-consoles' /etc/default/grub; then - sed -i 's/^GRUB_CMDLINE_LINUX="[^"]*/& plymouth.ignore-serial-consoles/' /etc/default/grub +if [ -f /etc/default/grub ]; then + if ! grep -q plymouth.ignore-serial-consoles /etc/default/grub; then + echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX plymouth.ignore-serial-consoles"' >> /etc/default/grub + fi fi # grubby (used by new-kernel-pkg) do not understand xen entries in grub2 config if [ -x /sbin/new-kernel-pkg -a -e /boot/grub2/grub.cfg ]; then - grub2-mkconfig > /boot/grub2/grub.cfg + grub2-mkconfig > /boot/grub2/grub.cfg fi %preun