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

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