Support new rd_DASD parameter for s390 systems.

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.
master
David Cantrell 2009-11-02 09:59:58 -10:00 committed by Harald Hoyer
parent fe32b77f87
commit a790547896
5 changed files with 65 additions and 10 deletions

View File

@ -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

54
modules.d/95dasd/dasdconf.sh Executable file
View File

@ -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

View File

@ -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

View File

@ -1,5 +1,4 @@
#!/bin/bash

instmods dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod


View File

@ -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