Blame SOURCES/0001-dracut.sh-harden-host_modalias-reading.patch

712866
From ffecc452321bbef2c0e1efca09c2077775448141 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Fri, 13 Sep 2013 16:33:01 +0200
712866
Subject: [PATCH] dracut.sh: harden host_modalias reading
712866
712866
Some weird PPC driver make their modulias unreadable
712866
712866
$ cat /sys/devices/vio/4000/modalias
712866
cat: /sys/devices/vio/4000/modalias: No such device
712866
---
712866
 dracut.sh | 2 +-
712866
 1 file changed, 1 insertion(+), 1 deletion(-)
712866
712866
diff --git a/dracut.sh b/dracut.sh
712866
index bd905e3..fd27846 100755
712866
--- a/dracut.sh
712866
+++ b/dracut.sh
712866
@@ -921,7 +921,7 @@ if [[ $hostonly ]]; then
712866
     declare -A host_modalias
712866
     find  /sys/devices/ -name modalias -print > "$initdir/.modalias"
712866
     while read m; do
712866
-        host_modalias["$(<"$m")"]=1
712866
+        modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1
712866
     done < "$initdir/.modalias"
712866
     rm -f -- "$initdir/.modalias"
712866