Blame SOURCES/0287-squish-don-t-dup-rhgb-quiet-check-mtimes.patch

d3c3ab
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d3c3ab
From: Robbie Harwood <rharwood@redhat.com>
d3c3ab
Date: Wed, 17 Aug 2022 10:26:07 -0400
d3c3ab
Subject: [PATCH] squish: don't dup rhgb quiet, check mtimes
d3c3ab
d3c3ab
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
d3c3ab
(cherry picked from commit 275a0487c74e309cfd0a8c670740f6c34e729c45)
d3c3ab
---
d3c3ab
 util/grub.d/10_linux.in | 14 ++++++++++----
d3c3ab
 1 file changed, 10 insertions(+), 4 deletions(-)
d3c3ab
d3c3ab
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
d3c3ab
index ec529eb814..becf5ba9c6 100644
d3c3ab
--- a/util/grub.d/10_linux.in
d3c3ab
+++ b/util/grub.d/10_linux.in
d3c3ab
@@ -166,10 +166,16 @@ update_bls_cmdline()
d3c3ab
     local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
d3c3ab
     local -a files=($(get_sorted_bls))
d3c3ab
 
d3c3ab
-    if [[ ! -f /etc/kernel/cmdline ]]; then
d3c3ab
-	# anaconda has the correct information to do this during install;
d3c3ab
-	# afterward, grubby will take care of syncing on updates.
d3c3ab
-	echo "$cmdline rhgb quiet" > /etc/kernel/cmdline
d3c3ab
+    if [[ ! -f /etc/kernel/cmdline ]] ||
d3c3ab
+	   [[ /etc/kernel/cmdline -ot /etc/default/grub ]]; then
d3c3ab
+	# anaconda has the correct information to create this during install;
d3c3ab
+	# afterward, grubby will take care of syncing on updates.  If the user
d3c3ab
+	# has modified /etc/default/grub, try to cope.
d3c3ab
+	if [[ ! "$cmdline" =~ "rhgb quiet" ]]; then
d3c3ab
+	    # ensure these only show up once
d3c3ab
+	    cmdline="$cmdline rhgb quiet"
d3c3ab
+	fi
d3c3ab
+	echo "$cmdline" > /etc/kernel/cmdline
d3c3ab
     fi
d3c3ab
 
d3c3ab
     for bls in "${files[@]}"; do