From 05c2e3dc9b3a1051dfb903b774bba6afad2fb2be Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Fri, 31 Mar 2023 10:20:27 +0200 Subject: [PATCH] Fix wrong dracut timeout message We added Anaconda error reporting when Dracut timeout during boot. If the reason is known issue we will print that to a user. However, in case it is not known the code failed with message: ... /run/anaconda/initrd_errors.txt: No such file or directory To fix this just print "Reason unknown" and not execute rest of the code. (cherry picked from commit 87780c8ba530f10cc4e489c387fc34084f98afee) Resolves: RHEL-5638 --- dracut/anaconda-error-reporting.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dracut/anaconda-error-reporting.sh b/dracut/anaconda-error-reporting.sh index c9cca5cea2e..b410cd667e5 100755 --- a/dracut/anaconda-error-reporting.sh +++ b/dracut/anaconda-error-reporting.sh @@ -14,9 +14,13 @@ warn "Please also note that the 'inst.' prefix is now mandatory." warn "# #" warn "#### Installer errors encountered during boot: ####" warn "# #" -while read -r line; do - warn "$line" -done < /run/anaconda/initrd_errors.txt +if ! [ -e /run/anaconda/initrd_errors.txt ]; then + warn "Reason unknown" +else + while read -r line; do + warn "$line" + done < /run/anaconda/initrd_errors.txt +fi warn "# #" warn "############# Anaconda installer errors end ###############"