diff options
author | Harald Hoyer <harald@redhat.com> | 2009-11-04 11:48:12 +0100 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2009-11-06 08:44:01 +0100 |
commit | 8686bd554ba66d861e7b1198f98215e8543eecbc (patch) | |
tree | 22596b962628f9368e3ba97077f976f3c9f6191b /modules.d | |
parent | 62cfb5c161482d4448c0563405885638dc46c9b8 (diff) | |
download | dracut-8686bd554ba66d861e7b1198f98215e8543eecbc.tar.gz dracut-8686bd554ba66d861e7b1198f98215e8543eecbc.tar.bz2 dracut-8686bd554ba66d861e7b1198f98215e8543eecbc.zip |
95dasd: fixed rd_DASD argument handling
Diffstat (limited to 'modules.d')
-rw-r--r-- | modules.d/95dasd/56-dasd.rules | 16 | ||||
-rwxr-xr-x | modules.d/95dasd/dasdconf.sh | 64 | ||||
-rwxr-xr-x | modules.d/95dasd/install | 1 | ||||
-rwxr-xr-x | modules.d/95dasd_mod/install | 2 | ||||
-rwxr-xr-x | modules.d/95dasd_mod/parse-dasd-mod.sh (renamed from modules.d/95dasd_mod/parse-dasd.sh) | 2 |
5 files changed, 71 insertions, 14 deletions
diff --git a/modules.d/95dasd/56-dasd.rules b/modules.d/95dasd/56-dasd.rules new file mode 100644 index 00000000..5364935a --- /dev/null +++ b/modules.d/95dasd/56-dasd.rules @@ -0,0 +1,16 @@ +ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="dasd-eckd", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="dasd-fba", RUN+="/sbin/dasdconf.sh" + +# This list should be autogenerated with "modinfo dasd_{eckd,fba}_mod" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t1750m*dt3380dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t1750m*dt3390dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2107m*dt3380dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2107m*dt3390dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t9343m*dt9345dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2105m*dt3380dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3990m*dt3380dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3880m*dt3390dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2105m*dt3390dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3990m*dt3390dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3880m*dt3370dm*", RUN+="/sbin/dasdconf.sh" +ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t6310m*dt9336dm*", RUN+="/sbin/dasdconf.sh" diff --git a/modules.d/95dasd/dasdconf.sh b/modules.d/95dasd/dasdconf.sh index 40a8ff9b..fb3ac90e 100755 --- a/modules.d/95dasd/dasdconf.sh +++ b/modules.d/95dasd/dasdconf.sh @@ -8,12 +8,24 @@ # 0.0.0204 # 0.0.0205 erplog=1 +[ -z "$DEVPATH" ] && exit 0 +[ "$ACTION" != "add" ] && exit 0 + +CHANNEL=${DEVPATH##*/} + CONFIG=/etc/dasd.conf -PATH=/bin:/usr/bin:/sbin:/usr/sbin +PATH=/sbin:/bin:/usr/sbin:/usr/bin +export PATH + +warn() { + [ -e /dev/kmsg ] && echo "<4>dasdconf.sh Warning: $@" > /dev/kmsg + echo "dasdconf.sh Warning: $@" >&2 +} if [ -f "$CONFIG" ]; then if [ ! -d /sys/bus/ccw/drivers/dasd-eckd ] && [ ! -d /sys/bus/ccw/drivers/dasd-fba ]; then - return + #warn "No dasd-eckd or dasd-eckd loaded" + exit 0 fi tr "A-Z" "a-z" < $CONFIG | while read line; do case $line in @@ -21,34 +33,62 @@ if [ -f "$CONFIG" ]; then *) [ -z "$line" ] && continue set $line + + # if we are in single add mode, only add the new CHANNEL + [ "$SUBSYSTEM" = "ccw" ] && [ "$1" != "$CHANNEL" ] && continue + 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 + # if we are in single add mode, this is a failure! + [ "$SUBSYSTEM" = "ccw" ] && warn "Could not find $DEVICE in sysfs" continue fi - echo 1 > $SYSFSPATH/online + + # skip already onlined devices + if [ "$(cat $SYSFSPATH/online)" = "1" ]; then + if [ "$SUBSYSTEM" = "ccw" ]; then + # if we are in single add mode, we should not touch the device + warn "$DEVICE is already online, not configuring" + exit 0 + fi + continue + fi + shift - while [ ! -z "$1" ]; do + while [ -n "$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 + + if [ "$1" = "use_diag" ]; then + # this module better only returns after + # all sysfs entries have the "use_diag" file + modprobe dasd_diag_mod + fi + + if [ -r "$SYSFSPATH/$1" ]; then + echo $2 > $SYSFSPATH/$1 || warn "Could not set $1=$2 for $DEVICE" + else + warn "$1 does not exist for $DEVICE" + fi ) shift done - echo + + # Now, put the device online + echo 1 > $SYSFSPATH/online || echo "Could not activate $DEVICE" + + # if we are in single add mode, we are done + [ "$SUBSYSTEM" = "ccw" ] && exit 0 ;; esac done fi +exit 0 diff --git a/modules.d/95dasd/install b/modules.d/95dasd/install index d918dae6..9d0b98c9 100755 --- a/modules.d/95dasd/install +++ b/modules.d/95dasd/install @@ -2,4 +2,5 @@ inst_hook cmdline 30 "$moddir/parse-dasd.sh" dracut_install tr inst "$moddir/dasdconf.sh" /sbin/dasdconf.sh +inst_rules "$moddir/56-dasd.rules" inst /etc/dasd.conf diff --git a/modules.d/95dasd_mod/install b/modules.d/95dasd_mod/install index 8545a253..0704c5cb 100755 --- a/modules.d/95dasd_mod/install +++ b/modules.d/95dasd_mod/install @@ -1,3 +1,3 @@ #!/bin/bash -inst_hook cmdline 30 "$moddir/parse-dasd.sh" +inst_hook cmdline 30 "$moddir/parse-dasd-mod.sh" diff --git a/modules.d/95dasd_mod/parse-dasd.sh b/modules.d/95dasd_mod/parse-dasd-mod.sh index 6902eebc..023c9ad7 100755 --- a/modules.d/95dasd_mod/parse-dasd.sh +++ b/modules.d/95dasd_mod/parse-dasd-mod.sh @@ -2,6 +2,6 @@ dasd_arg=$(getarg rd_DASD_MOD=) if [ -n "$dasd_arg" ]; then - echo "options dasd_mod dasd=$dasd_arg" >> /etc/modprobe.d/dasd.conf + echo "options dasd_mod dasd=$dasd_arg" >> /etc/modprobe.d/dasd_mod.conf fi unset dasd_arg |