- 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)
This commit is contained in:
Dan Horák 2009-11-09 19:30:31 +00:00
parent 42fa73d556
commit 7568a722ac
4 changed files with 201 additions and 23 deletions

128
cpi.initd Normal file
View File

@ -0,0 +1,128 @@
#!/bin/sh
#
# Copyright 2009 Red Hat, Inc.
# License: GPLv2
# Author: Dan Horak <dhorak@redhat.com>
#
# cpi Set Control Program Identification on IBM zSeries
#
# chkconfig: 12345 80 20
# description: Set Control Program Identification on IBM zSeries \
# that's reported from Linux guest to a LPAR or z/VM
### BEGIN INIT INFO
# Provides: cpi
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 1 2 3 4 5
# Default-Stop: 0 6
# Short-Description: Set control program identification on IBM zSeries
# Description: Set Control Program Identification on IBM zSeries \
# that's reported from Linux guest to a LPAR or z/VM
### END INIT INFO
# Source function library.
. /etc/init.d/functions
prog="cpi"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
cpipath=/sys/firmware/cpi
start() {
echo -n $"Starting $prog: "
if [ -d $cpipath ]; then
retval=0
echo LINUX > $cpipath/system_type 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo "$SYSTEM_NAME" > $cpipath/system_name 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo "$SYSPLEX_NAME" > $cpipath/sysplex_name 2> /dev/null || retval=1
level_maj=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 1`
level_min=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 2`
level_mic=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 3`
level=`printf '%02x%02x%02x' $level_maj $level_min $level_mic`
[ $retval -eq 0 ] && echo $level > $cpipath/system_level 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo 1 > $cpipath/set 2> /dev/null || retval=1
else
retval=1
fi
[ $retval -eq 0 ] && success || failure
echo
return $retval
}
stop() {
echo -n $"Stopping $prog: "
# nothing to do
success
echo
return 0
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
if [ -d $cpipath ]; then
echo -n "System type: "; cat $cpipath/system_type
echo -n "System level: "; cat $cpipath/system_level
echo -n "System name: "; cat $cpipath/system_name
echo -n "Sysplex name: "; cat $cpipath/sysplex_name
retval=0
else
echo "Control Program Identification system interface doesn't exist."
retval=1
fi
return $retval
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
$1
;;
stop)
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

5
cpi.sysconfig Normal file
View File

@ -0,0 +1,5 @@
# Define a system name (8 chars maximum)
SYSTEM_NAME=
# Define a sysplex name (8 chars maximum)
SYSPLEX_NAME=

View File

@ -0,0 +1,25 @@
diff -up lib-zfcp-hbaapi-2.0/Makefile.am.orig lib-zfcp-hbaapi-2.0/Makefile.am
--- lib-zfcp-hbaapi-2.0/Makefile.am.orig 2009-11-05 17:22:58.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/Makefile.am 2009-11-09 14:07:17.000000000 +0100
@@ -66,6 +66,9 @@ libzfcphbaapi_la_LDFLAGS = \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
-export-symbols $(SYMFILE)
+if VENDORLIB
+libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
+endif
if DOCS
man_MANS = libzfcphbaapi.3 dox/man/man3/SupportedHBAAPIs.3 \
diff -up lib-zfcp-hbaapi-2.0/Makefile.in.orig lib-zfcp-hbaapi-2.0/Makefile.in
--- lib-zfcp-hbaapi-2.0/Makefile.in.orig 2009-11-09 14:06:58.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/Makefile.in 2009-11-09 14:08:40.000000000 +0100
@@ -254,6 +254,8 @@ libzfcphbaapi_la_LDFLAGS = \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
-export-symbols $(SYMFILE)
+@VENDORLIB_TRUE@libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
+
@DOCS_FALSE@man_MANS = libzfcphbaapi.3
@DOCS_TRUE@man_MANS = libzfcphbaapi.3 dox/man/man3/SupportedHBAAPIs.3 \
@DOCS_TRUE@ dox/man/man3/UnSupportedHBAAPIs.3 dox/man/man3/hbaapi.h.3

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: 2%{?dist}
Release: 3%{?dist}
Epoch: 2
License: GPLv2 and GPLv2+ and CPL
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -25,6 +25,9 @@ Source6: http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/h
Source7: zfcp.udev
# http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi-%{hbaapiver}.html
Source9: http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/lib-zfcp-hbaapi-%{hbaapiver}.tar.gz
# files for the Control Program Identification (Linux Call Home) feature (#463282)
Source10: cpi.initd
Source11: cpi.sysconfig
Patch1: 0001-s390-tools-1.5.3-zipl-zfcpdump-2.patch
Patch2: 0002-s390-tools-1.8.1-zipl-automenu.patch
@ -44,6 +47,7 @@ Patch101: cmsfs-1.1.8-kernel26.patch
Patch200: src_vipa-2.0.4-locations.patch
Patch300: lib-zfcp-hbaapi-2.0-sgutils.patch
Patch301: lib-zfcp-hbaapi-2.0-module.patch
Requires: s390utils-base = %{epoch}:%{version}-%{release}
Requires: s390utils-osasnmpd = %{epoch}:%{version}-%{release}
@ -123,6 +127,9 @@ popd
pushd lib-zfcp-hbaapi-%{hbaapiver}
# fix for newer sg3_utils and missing function declarations
%patch300 -p1 -b .sgutils
# build the library as a module
%patch301 -p1 -b .module
popd
# remove --strip from install
@ -158,7 +165,7 @@ make CC_FLAGS="$RPM_OPT_FLAGS -fPIC" LIBDIR=%{_libdir}
popd
pushd lib-zfcp-hbaapi-%{hbaapiver}
%configure --disable-static --enable-vendor-lib=no
%configure --disable-static
make EXTRA_CFLAGS="$RPM_OPT_FLAGS"
popd
@ -209,16 +216,23 @@ pushd src_vipa-%{vipaver}
make install LIBDIR=%{_libdir} SBINDIR=%{_bindir} INSTROOT=$RPM_BUILD_ROOT
popd
# lib-zfcp-hbaapi
pushd lib-zfcp-hbaapi-%{hbaapiver}
%makeinstall docdir=$RPM_BUILD_ROOT%{_docdir}/lib-zfcp-hbaapi-devel-%{hbaapiver}
# keep only html docs
rm -rf $RPM_BUILD_ROOT%{_docdir}/lib-zfcp-hbaapi-devel-%{hbaapiver}/latex
%makeinstall docdir=$RPM_BUILD_ROOT%{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}
popd
# keep only html docs
rm -rf $RPM_BUILD_ROOT%{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}/latex
# remove unwanted files
rm -f $RPM_BUILD_ROOT%{_libdir}/libzfcphbaapi.*
# install usefull headers for devel subpackage
mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name}
install -p -m 644 include/vtoc.h $RPM_BUILD_ROOT%{_includedir}/%{name}
# CPI
install -p -m 644 %{SOURCE11} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/cpi
install -p -m 755 %{SOURCE10} ${RPM_BUILD_ROOT}%{_initddir}/cpi
%clean
rm -rf ${RPM_BUILD_ROOT}
@ -362,18 +376,25 @@ s390 base tools. This collection provides the following utilities:
- chshut: Change actions which should be done in case of halt, poff,
reboot or panic.
* cpi:
Allows to set the system and sysplex names from the Linux guest to
the HMC/SE using the Control Program Identification feature.
For more information refer to the following publications:
* "Device Drivers, Features, and Commands" chapter "Useful Linux commands"
* "Using the dump tools"
%post base
/sbin/chkconfig --add dumpconf
/sbin/chkconfig --add cpi
%preun base
if [ $1 = 0 ]; then
# not for updates
/sbin/service dumpconf stop > /dev/null 2>&1
/sbin/chkconfig --del dumpconf
/sbin/service cpi stop > /dev/null 2>&1
/sbin/chkconfig --del cpi
fi
:
@ -420,6 +441,8 @@ fi
%{_bindir}/vmconvert
%{_initddir}/dumpconf
%config(noreplace) %{_sysconfdir}/sysconfig/dumpconf
%{_initddir}/cpi
%config(noreplace) %{_sysconfdir}/sysconfig/cpi
/lib/s390-tools
%{_mandir}/man1/zfcpdbf.1*
%{_mandir}/man4/prandom.4*
@ -469,7 +492,7 @@ fi
# src_vipa
%{_bindir}/src_vipa.sh
%{_libdir}/src_vipa.so
%{_mandir}/man8/src_vipa.8.gz
%{_mandir}/man8/src_vipa.8*
#
# *********************** s390-tools osasnmpd package ***********************
@ -669,16 +692,13 @@ URL: http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html
BuildRequires: automake autoconf
BuildRequires: doxygen libsysfs-devel
BuildRequires: sg3_utils-devel
Requires: libhbaapi
%description libzfcphbaapi
ZFCP HBA API Library is an implementation of FC-HBA (see www.t11.org ) for
the zfcp device driver.
%post libzfcphbaapi -p /sbin/ldconfig
%postun libzfcphbaapi -p /sbin/ldconfig
%files libzfcphbaapi
%defattr (-,root,root,-)
%doc lib-zfcp-hbaapi-%{hbaapiver}/README
@ -686,34 +706,30 @@ the zfcp device driver.
%doc lib-zfcp-hbaapi-%{hbaapiver}/ChangeLog
%doc lib-zfcp-hbaapi-%{hbaapiver}/AUTHORS
%doc lib-zfcp-hbaapi-%{hbaapiver}/LICENSE
%{_libdir}/libzfcphbaapi.so.0*
%{_libdir}/libzfcphbaapi-%{hbaapiver}.so
%{_mandir}/man3/libzfcphbaapi.3*
%{_mandir}/man3/SupportedHBAAPIs.3*
%{_mandir}/man3/UnSupportedHBAAPIs.3*
%{_mandir}/man3/hbaapi.h.3*
%exclude %{_mandir}/man3/hbaapi.h.3*
#
# *********************** libzfcphbaapi-devel package ***********************
#
%package libzfcphbaapi-devel
%package libzfcphbaapi-docs
License: CPL
Summary: ZFCP HBA API Library -- Development
Summary: ZFCP HBA API Library -- Documentation
Group: Development/Libraries
URL: http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html
Requires: %{name}-libzfcphbaapi = %{epoch}:%{version}-%{release}
%description libzfcphbaapi-devel
Headers, libraries and documentation for development to link against
ZFCP HBA API Library.
%description libzfcphbaapi-docs
Documentation for the ZFCP HBA API Library.
%files libzfcphbaapi-devel
%files libzfcphbaapi-docs
%defattr (-,root,root,-)
%docdir %{_docdir}/lib-zfcp-hbaapi-devel-%{hbaapiver}
%{_docdir}/lib-zfcp-hbaapi-devel-%{hbaapiver}/
%{_includedir}/hbaapi.h
%{_libdir}/libzfcphbaapi.so
%exclude %{_libdir}/libzfcphbaapi.la
%docdir %{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}
%{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}/
#
# *********************** cmsfs package ***********************
@ -758,6 +774,10 @@ User-space development files for the s390/s390x architecture.
%changelog
* 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)
* Fri Oct 30 2009 Dan Horák <dan[at]danny.cz> 2:1.8.2-2
- install dasd udev rules provided by the s390-tools
- added patch for setting readahead value