]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Check rd.zfcp= format in dracut hook:cmdline process stage
authorZhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
Fri, 16 Oct 2015 02:04:34 +0000 (04:04 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 13 Nov 2015 13:02:19 +0000 (14:02 +0100)
When using rd.zfcp= parameter in generic.prm file, wrong format
parameters will prevent the zfcp driver to add the correct SCSI
disk. dracut should die when a wrong rd.zfcp= parameter supplied.

Signed-off-by: Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
modules.d/95zfcp/parse-zfcp.sh

index 223cd32daa4dcb32ab64e62900401f35b7c423a1..6e1514fd79619f88e2f74840fcf5a0d5bc869d74 100755 (executable)
@@ -3,6 +3,8 @@
 getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
 
 for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do
+    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
+    test $? -ne 0 && die "For argument 'rd.zfcp=$zfcp_arg'\nSorry, invalid format."
     (
         IFS=","
         set $zfcp_arg