Harald Hoyer b94732
From 3ae60e559f049ba41d5d198f27509721a245d6ea Mon Sep 17 00:00:00 2001
Harald Hoyer b94732
From: Hannes Reinecke <hare@suse.de>
Harald Hoyer b94732
Date: Thu, 11 Dec 2014 15:46:11 +0100
Harald Hoyer b94732
Subject: [PATCH] Handle module alias properly
Harald Hoyer b94732
Harald Hoyer b94732
Some modules (like ext4) provide aliases by which the modules
Harald Hoyer b94732
can be accessed, too. But when using aliases directly dracut
Harald Hoyer b94732
fails to include the correct module. So translate the alias
Harald Hoyer b94732
into the correct module name before checking the module.
Harald Hoyer b94732
Harald Hoyer b94732
References: bnc#886839
Harald Hoyer b94732
Harald Hoyer b94732
Signed-off-by: Hannes Reinecke <hare@suse.de>
Harald Hoyer b94732
Signed-off-by: Thomas Renninger <trenn@suse.de>
Harald Hoyer b94732
---
Harald Hoyer b94732
 dracut-functions.sh | 7 +++++++
Harald Hoyer b94732
 1 file changed, 7 insertions(+)
Harald Hoyer b94732
Harald Hoyer b94732
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer b94732
index edd8ea9..7a12a76 100755
Harald Hoyer b94732
--- a/dracut-functions.sh
Harald Hoyer b94732
+++ b/dracut-functions.sh
Harald Hoyer b94732
@@ -1689,6 +1689,13 @@ instmods() {
Harald Hoyer b94732
             --*) _mpargs+=" $_mod" ;;
Harald Hoyer b94732
             *)
Harald Hoyer b94732
                 _mod=${_mod##*/}
Harald Hoyer b94732
+                # Check for aliased modules
Harald Hoyer b94732
+                _modalias=$(modinfo -k $kernel -F filename $_mod 2> /dev/null)
Harald Hoyer b94732
+                _modalias=${_modalias%.ko}
Harald Hoyer b94732
+                if [ "${_modalias##*/}" != "$_mod" ] ; then
Harald Hoyer b94732
+                    _mod=${_modalias##*/}
Harald Hoyer b94732
+                fi
Harald Hoyer b94732
+
Harald Hoyer b94732
                 # if we are already installed, skip this module and go on
Harald Hoyer b94732
                 # to the next one.
Harald Hoyer b94732
                 if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \