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
parent
fe32b77f87
commit
a790547896
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2,4 +2,3 @@
|
|||
|
||||
instmods dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue