summaryrefslogtreecommitdiffstats
path: root/0001-dracut.sh-harden-host_modalias-reading.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-dracut.sh-harden-host_modalias-reading.patch')
-rw-r--r--0001-dracut.sh-harden-host_modalias-reading.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/0001-dracut.sh-harden-host_modalias-reading.patch b/0001-dracut.sh-harden-host_modalias-reading.patch
new file mode 100644
index 0000000..a695138
--- /dev/null
+++ b/0001-dracut.sh-harden-host_modalias-reading.patch
@@ -0,0 +1,26 @@
+From 57f90974f9d7c11e06c2b3f2b7e4b47801f380cc Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald@redhat.com>
+Date: Fri, 13 Sep 2013 16:33:01 +0200
+Subject: [PATCH] dracut.sh: harden host_modalias reading
+
+Some weird PPC driver make their modulias unreadable
+
+$ cat /sys/devices/vio/4000/modalias
+cat: /sys/devices/vio/4000/modalias: No such device
+---
+ dracut.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index bd905e3..fd27846 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -921,7 +921,7 @@ if [[ $hostonly ]]; then
+ declare -A host_modalias
+ find /sys/devices/ -name modalias -print > "$initdir/.modalias"
+ while read m; do
+- host_modalias["$(<"$m")"]=1
++ modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1
+ done < "$initdir/.modalias"
+ rm -f -- "$initdir/.modalias"
+