dracut/0158-Add-SUSE-kernel-module-dependencies-in-etc-modprobe..patch
2015-11-26 11:35:04 +00:00

57 lines
2.1 KiB
Diff

From 75faba5ea84fe53df7d3ca3e4f4b6cf390c824bb Mon Sep 17 00:00:00 2001
From: Jan Loseser <jloeser@suse.de>
Date: Thu, 11 Sep 2014 15:20:23 +0200
Subject: Add SUSE kernel module dependencies (in /etc/modprobe.d/*)
bnc#895331
CC: Jan Loeser <jloeser@suse.de>
---
dracut-init.sh | 6 +++++-
dracut.sh | 12 ++++++++++++
2 files changed, 17 insertions(+), 1 deletions(-)
Index: dracut-044/dracut-init.sh
===================================================================
--- dracut-044.orig/dracut-init.sh
+++ dracut-044/dracut-init.sh
@@ -1141,8 +1141,14 @@ instmods() {
--set-version $kernel ${_moddirname} $_mpargs
((_ret+=$?))
else
- [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
+ if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] \
+ && [ -n "${_mod%.ko*}" ]; then
echo ${_mod%.ko*} >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
+ for suse_mod_dep in ${suse_mod_deps["${_mod%.ko*}"]}; do
+ echo $suse_mod_dep >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
+ done
+ fi
+
fi
;;
esac
Index: dracut-044/dracut.sh
===================================================================
--- dracut-044.orig/dracut.sh
+++ dracut-044/dracut.sh
@@ -767,6 +767,18 @@ if [[ -n "$logfile" ]];then
fi
fi
+# parse SUSE kernel module dependencies
+# Kernel modules using "load_module" function may not show up in modprobe
+# depencies. While this is the case there is a workaround in SUSE which adds:
+# # SUSE_INITRD: module_name REQUIRES module1 module2 ...
+# to /etc/modprobe.d/*.conf
+declare -A suse_mod_deps
+while read -r line; do
+ _suse_mod="${line##*SUSE INITRD: }"
+ _suse_mod="${_suse_mod%% REQUIRES*}"
+ suse_mod_deps["$_suse_mod"]="${suse_mod_deps["$_suse_mod"]} ${line##*REQUIRES }"
+done <<< "$(grep -h "^# SUSE INITRD: " /etc/modprobe.d/[0-9][0-9]*.conf)"
+
# handle compression options.
if [[ $_no_compress_l = "cat" ]]; then
compress="cat"