]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Support new rd_DASD parameter for s390 systems.
authorDavid Cantrell <dcantrell@redhat.com>
Mon, 2 Nov 2009 19:59:58 +0000 (09:59 -1000)
committerHarald Hoyer <harald@redhat.com>
Tue, 3 Nov 2009 09:43:15 +0000 (10:43 +0100)
The new rd_DASD parameter allows dracut to handle multiple rd_DASD
options.  One parameter per DASD.  The syntax is:

    rd_DASD=<device path>[,readonly=X][,erplog=X][,use_diag=X][,failfast=X]

The device path is a CCW device path, such as 0.0.0200.  The optional
parameters are sysfs attributes for the DASD.  The X value can be 0 or
1.  Dracut will write out each of the rd_DASD settings to
/etc/dasd.conf and on bootup, the dasdconf.sh script will parse this
file and bring each DASD online with the specified attribute settings.

modules.d/95dasd/check
modules.d/95dasd/dasdconf.sh [new file with mode: 0755]
modules.d/95dasd/install
modules.d/95dasd/installkernel
modules.d/95dasd/parse-dasd.sh

index a26196cf36bb611875c6ec5b821b690c73e2fc83..72ad84668cc2af8620a8266201851c7209f4185e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
 arch=$(uname -m)
-[ "$arch" = "s390" -o "$arch" = "s390x" ] || exit 1 
+[ "$arch" = "s390" -o "$arch" = "s390x" ] || exit 1
 
 exit 0
diff --git a/modules.d/95dasd/dasdconf.sh b/modules.d/95dasd/dasdconf.sh
new file mode 100755 (executable)
index 0000000..40a8ff9
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# config file syntax:
+# deviceno   sysfs_opts...
+#
+# Examples:
+# 0.0.0203 readonly=1 failfast=1
+# 0.0.0204
+# 0.0.0205 erplog=1
+
+CONFIG=/etc/dasd.conf
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+if [ -f "$CONFIG" ]; then
+    if [ ! -d /sys/bus/ccw/drivers/dasd-eckd ] && [ ! -d /sys/bus/ccw/drivers/dasd-fba ]; then
+        return
+    fi
+    tr "A-Z" "a-z" < $CONFIG | while read line; do
+        case $line in
+            \#*) ;;
+            *)
+                [ -z "$line" ] && continue
+                set $line
+                DEVICE=$1
+                SYSFSPATH=
+                if [ -r "/sys/bus/ccw/drivers/dasd-eckd/$DEVICE" ]; then
+                    SYSFSPATH="/sys/bus/ccw/drivers/dasd-eckd/$DEVICE"
+                elif [ -r "/sys/bus/ccw/drivers/dasd-fba/$DEVICE" ]; then
+                    SYSFSPATH="/sys/bus/ccw/drivers/dasd-fba/$DEVICE"
+                else
+                    continue
+                fi
+                echo 1 > $SYSFSPATH/online
+                shift
+                while [ ! -z "$1" ]; do
+                    (
+                        attribute="$1"
+                        IFS="="
+                        set $attribute
+                        case "$1" in
+                            readonly|use_diag|erplog|failfast)
+                                if [ -r "$SYSFSPATH/$1" ]; then
+                                    echo $2 > $SYSFSPATH/$1
+                                fi
+                                ;;
+                        esac
+                    )
+                    shift
+                done
+                echo
+                ;;
+        esac
+    done
+fi
index 8545a25346c47dae8dcda78fa757b31cef59942b..d918dae6c92d57cf915f5f3d7577d32e3604c754 100755 (executable)
@@ -1,3 +1,5 @@
 #!/bin/bash
 inst_hook cmdline 30 "$moddir/parse-dasd.sh"
-
+dracut_install tr
+inst "$moddir/dasdconf.sh" /sbin/dasdconf.sh
+inst /etc/dasd.conf
index c83c1943ccc1c97a4cfbb0bcdd9dd9e14a91116e..1f8b372135eabdf6fe35e5223f1ca0d4d9eacd1f 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/bash
 
 instmods dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod
-       
 
index 6caa64ff2ff85e6cce3fcbf6b1075ddc04128dda..af58b3193123fbb1793d48091bde376cea0695f7 100755 (executable)
@@ -1,7 +1,7 @@
-[ -d /etc/modprobe.d ] || mkdir /etc/modprobe.d
-
-dasd_arg=$(getarg rd_DASD=)
-if [ -n "$dasd_arg" ]; then
-       echo "options dasd_mod dasd=$dasd_arg" >> /etc/modprobe.d/dasd.conf
-fi
-unset dasd_arg
+for dasd_arg in $(getargs 'rd_DASD='); do
+    (
+        IFS=","
+        set $dasd_arg
+        echo "$@" >> /etc/dasd.conf
+    )
+done