File 0402-driver-fail-summary.patch of Package dracut.9139
From 2e176c1a99db334756c91c6c0e10e029993e56c7 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.com>
Date: Tue, 3 Nov 2015 17:25:44 +0100
Subject: [PATCH] Accumulate kernel module installation failures
- Port 0169-Enabled-Warning-for-failed-kernel-modules-per-defaul.patch:
Subject: Enable warning for failed kernel moduiles
Enabled Warning for failed kernel modules per default
and added summary of those to the end of dracut output
References: bnc#886839
- Disable inline warnings in favour of summary
Signed-off-by: Fabian Vogt <fvogt@suse.com>
---
dracut-init.sh | 8 +++++---
dracut.sh | 15 +++++++++++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index 9689c0b..0fda778 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -1084,14 +1084,16 @@ instmods() {
[[ $no_kernel = yes ]] && return
# called [sub]functions inherit _fderr
local _fderr=9
- local _check=no
+ local _check=yes
local _silent=no
+
if [[ $1 = '-c' ]]; then
_check=yes
shift
fi
if [[ $1 = '-s' ]]; then
+ _check=no
_silent=yes
shift
fi
@@ -1173,7 +1175,7 @@ instmods() {
while read _mod || [ -n "$_mod" ]; do
inst1mod "${_mod%.ko*}" || {
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
- dfatal "Failed to install module $_mod"
+ echo $_mod >> $tmp_dracut_failed_drivers
fi
}
done
@@ -1181,7 +1183,7 @@ instmods() {
while (($# > 0)); do # filenames as arguments
inst1mod ${1%.ko*} || {
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
- dfatal "Failed to install module $1"
+ echo $1 >> $tmp_dracut_failed_drivers
fi
}
shift
diff --git a/dracut.sh b/dracut.sh
index 12b253d..d7dc9ff 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -390,6 +390,12 @@ verbosity_mod_l=0
unset kernel
unset outfile
+if ! tmp_dracut_failed_drivers=$(mktemp /tmp/dracut.XXXXXXXXXX); then
+ echo "Could not create temporary file"
+ exit 1
+fi
+export tmp_dracut_failed_drivers
+
rearrange_params "$@"
eval set -- "$TEMP"
@@ -1761,6 +1767,15 @@ if ! (
exit 1
fi
+if [[ -s $tmp_dracut_failed_drivers ]]; then
+ dwarn "Some kernel modules could not be included"
+ dwarn "This is not necessarily an error:"
+ while read line; do
+ dwarn "$line"
+ done < $tmp_dracut_failed_drivers
+fi
+rm $tmp_dracut_failed_drivers
+
if (( maxloglvl >= 5 )); then
if [[ $allowlocal ]]; then
"$dracutbasedir/lsinitrd.sh" "${DRACUT_TMPDIR}/initramfs.img"| ddebug
--
2.6.6