Blob Blame History Raw
From 911c72bbf7ae362111593e82c4dfe730a44a1e8f Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:24:05 +0200
Subject: [PATCH 1/4] s390-tools-1.5.3-zipl-zfcpdump-2

---
 common.mak |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common.mak b/common.mak
index 5321ccb..541a232 100644
--- a/common.mak
+++ b/common.mak
@@ -62,8 +62,8 @@ GROUP		= $(shell id -gn)
 export INSTROOT BINDIR LIBDIR MANDIR OWNER GROUP
 
 # Special defines for zfcpdump
-ZFCPDUMP_DIR    = /usr/local/share/zfcpdump
-ZFCPDUMP_IMAGE  = zfcpdump.image
+ZFCPDUMP_DIR    = /boot
+ZFCPDUMP_IMAGE  = zfcpdump
 ZFCPDUMP_RD     = zfcpdump.rd
 export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
 
-- 
1.7.7.6


From d8a4a2d505564e597cefab16871c35cfb6f06854 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:46:01 +0200
Subject: [PATCH 2/4] s390-tools-1.8.1-fdasd-su

---
 fdasd/fdasd.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index 842e72a..3ab81c0 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -2104,10 +2104,12 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
 	if (anc->verbose) printf("disk type check     : ok\n");
 
         if (dasd_info.FBA_layout != 0) {
-                snprintf(err_str, ERROR_STRING_SIZE, 
-			"%s is not formatted with z/OS compatible "
-			"disk layout!", options.device);
-                fdasd_error(anc, wrong_disk_format, err_str);
+                if(!anc->silent) {
+                    snprintf(err_str, ERROR_STRING_SIZE,
+			    "%s is not formatted with z/OS compatible "
+			    "disk layout!", options.device);
+                    fdasd_error(anc, wrong_disk_format, err_str);
+                }
         }      
 
 	if (anc->verbose) printf("disk layout check   : ok\n");
-- 
1.7.7.6


From 39ac18ef1622f4ae1254983530e120a7d036aff7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 19 Jun 2009 10:01:30 +0200
Subject: [PATCH 3/4] s390-tools-1.8.1-zipl-kdump-man

Description: Add kdump kernel installation instruction to zipl man page.
Symptom:     User wants to prepare SCSI disk for dump, but has not installed
             the kdump kernel rpm.
Problem:     The installation of the kdump kernel rpm is prereq for preparing
             a SCSI dump disk for dump.
Solution:    Document that in the zipl man page.
---
 zipl/man/zipl.8 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8
index 01d18c5..e699b59 100644
--- a/zipl/man/zipl.8
+++ b/zipl/man/zipl.8
@@ -271,6 +271,8 @@ will be incomplete.
 It is not possible to specify both this parameter and the name of a menu
 or configuration section on the command line at the same time.
 
+.B Note that before using this option the "kernel-kdump" rpm has to be
+.B installed.
 .TP
 .BR "\-M <DUMPLIST[,SIZE]>" " or " "--mvdump=<DUMPLIST[,SIZE]>"
 Install a multi-volume dump record on each device associated with one of the
-- 
1.7.7.6


From 0dc93d3f17430677e1e218124bef32730d4f35ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 21 Aug 2012 09:58:21 +0200
Subject: [PATCH 4/4] Support for new storage device on System z (rhbz#847086)

Allow Linux to access a new storage device as a block device using a new interface.
That includes the adaption of common IO functions to allow to attach, configure
and operate the new subchannels.
---
 zconf/Makefile |    4 +-
 zconf/lscss    |   45 +++++++++++++++++++++++++++++---
 zconf/lscss.8  |    4 +++
 zconf/lsscm    |   77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 zconf/lsscm.8  |   67 ++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 191 insertions(+), 6 deletions(-)
 create mode 100644 zconf/lsscm
 create mode 100644 zconf/lsscm.8

diff --git a/zconf/Makefile b/zconf/Makefile
index ebd1713..ee8fc0e 100644
--- a/zconf/Makefile
+++ b/zconf/Makefile
@@ -4,11 +4,11 @@
 include ../common.mak
 
 SCRIPTS	= lsdasd lstape lscss chccwdev lsqeth lszfcp lschp chchp lszcrypt \
-	  chzcrypt cio_ignore znetconf dasdstat
+	  chzcrypt cio_ignore znetconf dasdstat lsscm
 USRSBIN_SCRIPTS = lsmem chmem lsluns
 MANPAGES= lsdasd.8 lstape.8 lscss.8 chccwdev.8 lsqeth.8 lszfcp.8 lschp.8 \
 	  chchp.8 lszcrypt.8 chzcrypt.8 lsluns.8 cio_ignore.8 znetconf.8 \
-	  chmem.8 lsmem.8 dasdstat.8
+	  chmem.8 lsmem.8 dasdstat.8 lsscm.8
 
 all:
 
diff --git a/zconf/lscss b/zconf/lscss
index d506c57..eaa5e52 100755
--- a/zconf/lscss
+++ b/zconf/lscss
@@ -62,6 +62,8 @@ function print_usage() {
 		 		Show IO subchannels. (default)
 		 	--chsc
 		 		Show CHSC subchannels.
+		 	--eadm
+		 		Show EADM subchannels.
 		 	-a|--all
 		 		Show subchannels of all types.
 	EOD
@@ -76,10 +78,11 @@ function print_version()
 
 SUBCHANNEL_TYPE_IO=0
 SUBCHANNEL_TYPE_CHSC=1
+SUBCHANNEL_TYPE_EADM=3
 
 IDFORMAT=[[:xdigit:]]*.[0-3].[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]
 
-unset SCH_IO SCH_CHSC SHOW_AVAIL UPPERCASE SHORTID DEVTYPES DEVRANGE RANGE
+unset SCH_IO SCH_CHSC SCH_EADM SHOW_AVAIL UPPERCASE SHORTID DEVTYPES DEVRANGE RANGE
 shopt -s nocasematch
 shopt -s nullglob
 
@@ -179,9 +182,13 @@ while [ $# -gt 0 ]; do
 	--chsc)
 	    SCH_CHSC=true
 	    ;;
+	--eadm)
+	    SCH_EADM=true
+	    ;;
 	-a|--all)
 	    SCH_IO=true
 	    SCH_CHSC=true
+	    SCH_EADM=true
 	    ;;
 	--avail)
 	    SHOW_AVAIL=true
@@ -209,7 +216,7 @@ if [ $RANGE ] ;then
     parse_ranges $RANGE
 fi
 
-if [ ! \( "$SCH_IO" -o "$SCH_CHSC" \) ] ;then
+if [ ! \( "$SCH_IO" -o "$SCH_CHSC" -o "$SCH_EADM" \) ] ;then
     SCH_IO=true
 fi
 
@@ -343,8 +350,24 @@ function print_chsc()
     done
 }
 
+function print_eadm()
+{
+    list_sch_of_type $SUBCHANNEL_TYPE_EADM |
+    while read DEV ;do
+	SCH=${DEV%/*}
+	SCH=${SCH##*/}
+	if [ $SHORTID ] ;then
+	    if [ ${SCH:0:4} != "0.0." ] ;then
+		continue
+	    fi
+	    SCH=${SCH#0.0.}
+	fi
+	printf "%-8.8s %-8.8s\n" "n/a" $SCH
+    done
+}
+
 if [ $SCH_IO ] ;then
-    if [ "$SCH_CHSC" ] ;then
+    if [ \( "$SCH_CHSC" -o "$SCH_EADM" \) ] ;then
 	echo "IO Subchannels and Devices:"
     fi
     if [ $SHOW_AVAIL ] ;then
@@ -362,7 +385,7 @@ if [ $SCH_IO ] ;then
 fi
 
 if [ $SCH_CHSC ] ;then
-    if [ "$SCH_IO" ] ;then
+    if [ \( "$SCH_IO" -o "$SCH_EADM" \) ] ;then
 	echo
 	echo "CHSC Subchannels:"
     fi
@@ -374,3 +397,17 @@ if [ $SCH_CHSC ] ;then
 	cat -
     fi
 fi
+
+if [ $SCH_EADM ] ;then
+    if [ \( "$SCH_IO" -o "$SCH_CHSC" \) ] ;then
+	echo
+	echo "EADM Subchannels:"
+    fi
+    echo "Device   Subchan."
+    echo "-----------------"
+    print_eadm | if [ $UPPERCASE ] ;then
+	tr "[:lower:]" "[:upper:]"
+    else
+	cat -
+    fi
+fi
diff --git a/zconf/lscss.8 b/zconf/lscss.8
index 2bef171..46adfe0 100644
--- a/zconf/lscss.8
+++ b/zconf/lscss.8
@@ -61,6 +61,10 @@ Show IO subchannels. (default)
 Show CHSC subchannels.
 
 .TP 8
+.BR --eadm
+Show EADM subchannels.
+
+.TP 8
 .BR -a | --all
 Show subchannels of all types.
 
diff --git a/zconf/lsscm b/zconf/lsscm
new file mode 100644
index 0000000..b436e62
--- /dev/null
+++ b/zconf/lsscm
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+CMD=${0##*/}
+VERSION="%S390_TOOLS_VERSION%"
+
+function print_help()
+{
+	cat <<-EOD
+Usage: $CMD <options>
+
+List information about available Storage Class Memory Increments.
+
+<options>
+ 	-h|--help
+ 		Print this help, then exit.
+ 	-v|--version
+ 		Print version information, then exit.
+EOD
+}
+
+function print_version()
+{
+    echo -ne "$CMD: version $VERSION\nCopyright IBM Corp. 2012\n"
+}
+
+
+# Parse command line parameters
+while [ $# -gt 0 ]; do
+	case $1 in
+	-h|--help)
+		print_help
+		exit 0
+		;;
+	-v|--version)
+		print_version
+		exit 0
+		;;
+	-*|--*)
+		echo "$CMD: Invalid option $1" >&2
+		echo "Try '$CMD --help' for more information." >&2
+		exit 1
+		;;
+	*)
+		echo "$CMD: Invalid argument $1" >&2
+		echo "Try '$CMD --help' for more information." >&2
+		exit 1
+		;;
+	esac
+	shift
+done
+
+
+echo "SCM Increment    Size    Name  Rank D_state O_state Pers ResID"
+echo "--------------------------------------------------------------"
+find /sys/bus/scm/devices/ -type l 2> /dev/null | sort -t/ -k6 |
+while read SCM ;do
+    ADDR=${SCM##*/}
+    BLKDIR=$SCM/block/scm*
+    if [ -d $BLKDIR ] ;then
+	set - $BLKDIR
+	NAME=${1##*/}
+    else
+	NAME="N/A"
+    fi
+
+    read SIZE 2> /dev/null < $BLKDIR/size || SIZE=0
+    SIZE=$((SIZE/2048)) # (SIZE * 512) / 1024^2
+
+    read RANK 2> /dev/null < $SCM/rank || continue
+    read DSTATE 2> /dev/null < $SCM/data_state || continue
+    read OSTATE 2> /dev/null < $SCM/oper_state || continue
+    read PERS 2> /dev/null < $SCM/persistence || continue
+    read RES 2> /dev/null < $SCM/res_id || continue
+
+    printf "%s %5sMB %-5.5s %4d %7d %7d %4d %5d\n" \
+	"$ADDR" "$SIZE" "$NAME" "$RANK" "$DSTATE" "$OSTATE" "$PERS" "$RES"
+done
diff --git a/zconf/lsscm.8 b/zconf/lsscm.8
new file mode 100644
index 0000000..25a8a2a
--- /dev/null
+++ b/zconf/lsscm.8
@@ -0,0 +1,67 @@
+.TH LSCHP 8 "Jul 2012" s390\-tools
+
+.SH NAME
+lsscm \- list information about available Storage Class Memory Increments.
+
+.SH SYNOPSIS
+.B lsscm
+.RB [ \-h|\-\-help ]
+.RB [ \-v|\-\-version ]
+
+.SH DESCRIPTION
+The lsscm command lists status and information about available
+Storage Class Memory Increments.
+
+.B Column description:
+
+SCM Increment
+.RS
+Starting address of the SCM increment.
+.RE
+
+Size
+.RS
+Size of the block device representing the SCM increment.
+.RE
+
+Name
+.RS
+Name of the block device representing the SCM increment.
+.RE
+
+Rank
+.RS
+Rank (conceptual quality) of the SCM increment.
+.RE
+
+D_state
+.RS
+Data state of the SCM increment.
+.RE
+
+O_state
+.RS
+Operation state of the SCM increment.
+.RE
+
+Pers
+.RS
+Persistence attribute.
+.RE
+
+ResID
+.RS
+Resource identifier.
+.RE
+
+
+.SH OPTIONS
+.B \-h | \-\-help
+.RS
+Print a short help text, then exit.
+.RE
+
+.B \-v | \-\-version
+.RS
+Print version number, then exit.
+.RE
-- 
1.7.7.6