Blame 0169-Check-rd.zfcp-format-in-dracut-hook-cmdline-process-.patch

Harald Hoyer bb31e7
From 7527b90c886e0c950f4a533fbb4eefb3714a5f9a Mon Sep 17 00:00:00 2001
Harald Hoyer bb31e7
From: Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
Harald Hoyer bb31e7
Date: Fri, 16 Oct 2015 04:04:34 +0200
Harald Hoyer bb31e7
Subject: [PATCH] Check rd.zfcp= format in dracut hook:cmdline process stage
Harald Hoyer bb31e7
Harald Hoyer bb31e7
When using rd.zfcp= parameter in generic.prm file, wrong format
Harald Hoyer bb31e7
parameters will prevent the zfcp driver to add the correct SCSI
Harald Hoyer bb31e7
disk. dracut should die when a wrong rd.zfcp= parameter supplied.
Harald Hoyer bb31e7
Harald Hoyer bb31e7
Signed-off-by: Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
Harald Hoyer bb31e7
---
Harald Hoyer bb31e7
 modules.d/95zfcp/parse-zfcp.sh | 2 ++
Harald Hoyer bb31e7
 1 file changed, 2 insertions(+)
Harald Hoyer bb31e7
Harald Hoyer bb31e7
diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh
Harald Hoyer bb31e7
index 223cd32..6e1514f 100755
Harald Hoyer bb31e7
--- a/modules.d/95zfcp/parse-zfcp.sh
Harald Hoyer bb31e7
+++ b/modules.d/95zfcp/parse-zfcp.sh
Harald Hoyer bb31e7
@@ -3,6 +3,8 @@
Harald Hoyer bb31e7
 getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
Harald Hoyer bb31e7
 
Harald Hoyer bb31e7
 for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do
Harald Hoyer bb31e7
+    echo $zfcp_arg | grep '0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\},0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}' >/dev/null
Harald Hoyer bb31e7
+    test $? -ne 0 && die "For argument 'rd.zfcp=$zfcp_arg'\nSorry, invalid format."
Harald Hoyer bb31e7
     (
Harald Hoyer bb31e7
         IFS=","
Harald Hoyer bb31e7
         set $zfcp_arg