- added udev rules and script for dasd initialization (#536966)

- added ghosted zfcp and dasd config files, fixes their ownership on the
    system
- fixed upgrade path for libzfcphbaapi-devel subpackage
This commit is contained in:
Dan Horák 2009-11-12 14:42:15 +00:00
parent 37829ac682
commit 0b9732be4a
3 changed files with 128 additions and 1 deletions

16
dasd.udev Normal file
View File

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

94
dasdconf.sh Normal file
View File

@ -0,0 +1,94 @@
#!/bin/sh
# config file syntax:
# deviceno sysfs_opts...
#
# Examples:
# 0.0.0203 readonly=1 failfast=1
# 0.0.0204
# 0.0.0205 erplog=1
[ -z "$DEVPATH" ] && exit 0
[ "$ACTION" != "add" ] && exit 0
CHANNEL=${DEVPATH##*/}
CONFIG=/etc/dasd.conf
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
#warn "No dasd-eckd or dasd-eckd loaded"
exit 0
fi
tr "A-Z" "a-z" < $CONFIG | while read line; do
case $line in
\#*) ;;
*)
[ -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
# 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 [ -n "$1" ]; do
(
attribute="$1"
IFS="="
set $attribute
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
# 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

View File

@ -8,7 +8,7 @@ Name: s390utils
Summary: Utilities and daemons for IBM System/z
Group: System Environment/Base
Version: 1.8.2
Release: 3%{?dist}
Release: 4%{?dist}
Epoch: 2
License: GPLv2 and GPLv2+ and CPL
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -28,6 +28,9 @@ Source9: http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/h
# files for the Control Program Identification (Linux Call Home) feature (#463282)
Source10: cpi.initd
Source11: cpi.sysconfig
# files for DASD initialization
Source12: dasd.udev
Source13: dasdconf.sh
Patch1: 0001-s390-tools-1.5.3-zipl-zfcpdump-2.patch
Patch2: 0002-s390-tools-1.8.1-zipl-automenu.patch
@ -186,7 +189,11 @@ install -p -m 644 zipl/boot/tape0.bin $RPM_BUILD_ROOT/boot/tape0
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
install -p -m 755 %{SOURCE5} $RPM_BUILD_ROOT/sbin
install -p -m 755 %{SOURCE13} $RPM_BUILD_ROOT/sbin
install -p -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/56-zfcp.rules
install -p -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/56-dasd.rules
touch $RPM_BUILD_ROOT%{_sysconfdir}/{zfcp.conf,dasd.conf}
install -p -m 644 etc/sysconfig/dumpconf ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
install -p -m 755 etc/init.d/dumpconf ${RPM_BUILD_ROOT}%{_initddir}/dumpconf
@ -485,8 +492,12 @@ fi
%{_sysconfdir}/profile.d/s390.csh
%{_sysconfdir}/profile.d/s390.sh
%config(noreplace) %{_sysconfdir}/udev/rules.d/56-zfcp.rules
%config(noreplace) %{_sysconfdir}/udev/rules.d/56-dasd.rules
%config(noreplace) %{_sysconfdir}/udev/rules.d/59-dasd.rules
%config(noreplace) %{_sysconfdir}/udev/rules.d/60-readahead.rules
%ghost %config(noreplace) %{_sysconfdir}/dasd.conf
%ghost %config(noreplace) %{_sysconfdir}/zfcp.conf
/sbin/dasdconf.sh
/sbin/zfcpconf.sh
# src_vipa
@ -693,6 +704,7 @@ BuildRequires: automake autoconf
BuildRequires: doxygen libsysfs-devel
BuildRequires: sg3_utils-devel
Requires: libhbaapi
Obsoletes: %{name}-libzfcphbaapi-devel < 2:1.8.2-4
%description libzfcphbaapi
@ -774,6 +786,11 @@ User-space development files for the s390/s390x architecture.
%changelog
* Thu Nov 12 2009 Dan Horák <dan[at]danny.cz> 2:1.8.2-4
- added udev rules and script for dasd initialization (#536966)
- added ghosted zfcp and dasd config files, fixes their ownership on the system
- fixed upgrade path for libzfcphbaapi-devel subpackage
* Mon Nov 9 2009 Dan Horák <dan[at]danny.cz> 2:1.8.2-3
- added files for the CPI feature (#463282)
- built lib-zfcp-hbaabi library as vendor lib, switched from -devel (no devel content now) to -docs subpackage (#532707)