Compare commits

...

18 Commits
rawhide ... f12

Author SHA1 Message Date
Fedora Release Engineering 27aeaaaec6 dist-git conversion 2010-07-29 11:59:13 +00:00
Dan Horák ef2efb08c2 - fixed return codes in ziorep (#556849)
- fixed return code in lstape (#556910)
- fixed reading the size of /proc/sys/vm/cmm_pages in cpuplugd (#556911)
- support new attributes in lsqeth (#556915)
2010-01-20 08:21:58 +00:00
Dan Horák c4730d6b5e fix a typo in patch filename 2010-01-13 08:22:51 +00:00
Dan Horák 26b962c73e - updated device_cio_free script (#533494)
- fixed uppercase conversion in lscss (#554768)
2010-01-13 08:17:17 +00:00
Dan Horák c708e0fb32 - updated device_cio_free script (#533494) 2010-01-08 11:14:15 +00:00
Dan Horák cb89e7333f - updated device_cio_free script (#533494) 2010-01-08 07:43:49 +00:00
Dan Horák 5991560055 - fixed return value in cpi initscript (#541389)
- updated zfcpconf.sh script from dracut
- added device-mapper support into zipl (#546280)
- added missing check and print NSS name in case an NSS has been IPLed
    (#546297)
- added device_cio_free script and its symlinks
- added qualified return codes and further error handling in znetconf
    (#548487)
2009-12-22 10:56:32 +00:00
Dan Horák 1729ef40b7 - added device-mapper support into zipl (#546280)
- added missing check and print NSS name in case an NSS has been IPLed
    (#546297)
2009-12-10 17:48:03 +00:00
Dan Horák 5d6a4c5806 - fixed return value in cpi initscript (#541389)
- updated zfcpconf.sh script from dracut
2009-12-01 09:59:31 +00:00
Bill Nottingham 8bd4f662fe Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:34:43 +00:00
Dan Horák ed213f7b2d - added multiple fixes from IBM (#533955, #537142, #537144) 2009-11-13 10:21:17 +00:00
Dan Horák 0b9732be4a - 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
2009-11-12 14:42:15 +00:00
Dan Horák 37829ac682 - 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)
2009-11-09 19:28:42 +00:00
Dan Horák ce944c0206 - install dasd udev rules provided by the s390-tools
- added patch for setting readahead value
2009-10-30 11:38:33 +00:00
Dan Horák 16b972163b - added patch for improving mon_statd behaviour
- rebased to 1.8.2
2009-10-08 13:54:28 +00:00
Dan Horák 833ea3bb97 - really changed ramdisk load address (#526339)
- change the required and optional subpackages for the meta package
2009-10-04 15:58:07 +00:00
Dan Horák 5d885ca46a - changed ramdisk load address (#526339)
- updated zfcpconf.sh script to new sysfs interface (#526324)
- added 1.8.1 fixes from IBM (#525495)
2009-09-30 20:10:50 +00:00
Toshio くらとみ 498de1bc9d Initialize branch F-12 for s390utils 2009-09-30 20:04:42 +00:00
44 changed files with 6035 additions and 1381 deletions

View File

@ -1,4 +1,4 @@
s390-tools-1.8.1.tar.bz2
s390-tools-1.8.2.tar.bz2
cmsfs-1.1.8c.tar.gz
lib-zfcp-hbaapi-2.0.tar.gz
src_vipa-2.0.4.tar.gz

View File

@ -1,17 +1,17 @@
From 1536e0140cbce3c8837478cfc25ea45dc3681cce Mon Sep 17 00:00:00 2001
From 2b8336a93376953ba0ed84223264be55243ac7f8 Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:24:05 +0200
Subject: [PATCH] s390-tools-1.5.3-zipl-zfcpdump-2
Subject: [PATCH 1/9] 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 62c17e2..3acb534 100644
index 8b248f1..0a7916e 100644
--- a/common.mak
+++ b/common.mak
@@ -38,8 +38,8 @@ GROUP = $(shell id -gn)
@@ -63,8 +63,8 @@ GROUP = $(shell id -gn)
export INSTROOT BINDIR LIBDIR MANDIR OWNER GROUP
# Special defines for zfcpdump
@ -21,7 +21,7 @@ index 62c17e2..3acb534 100644
+ZFCPDUMP_IMAGE = zfcpdump
ZFCPDUMP_RD = zfcpdump.rd
export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
endif
--
1.6.0.6
1.6.3.3

View File

@ -1,7 +1,7 @@
From 1648e0dab246190c170e82244c790ef8e9144e40 Mon Sep 17 00:00:00 2001
From 2513c0f8096c681f962d77420dac731f7bb33e44 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:45:36 +0200
Subject: [PATCH] s390-tools-1.8.1-zipl-automenu
Subject: [PATCH 2/9] s390-tools-1.8.1-zipl-automenu
---
zipl/man/zipl.8 | 7 ++
@ -29,7 +29,7 @@ index 8a83c01..6ebf240 100644
1. Scenario: prepare disk for booting a Linux kernel image using the
following parameters:
diff --git a/zipl/src/job.c b/zipl/src/job.c
index 2f69104..1b7bcb2 100644
index c5c85d8..6a526e4 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -43,6 +43,7 @@ static struct option options[] = {
@ -407,10 +407,10 @@ index 9948092..caca3cf 100644
{inv, inv, inv, inv, inv, inv, inv, req, req, inv, inv, inv, inv, inv},
/* part dump */
diff --git a/zipl/src/zipl.c b/zipl/src/zipl.c
index f99177d..2a11404 100644
index 9cb764c..4d9fd36 100644
--- a/zipl/src/zipl.c
+++ b/zipl/src/zipl.c
@@ -71,6 +71,7 @@ static const char* usage_text[] = {
@@ -73,6 +73,7 @@ static const char* usage_text[] = {
"-n, --noninteractive Answer all confirmation questions with 'yes'",
"-V, --verbose Provide more verbose output",
"-a, --add-files Add all referenced files to bootmap file",
@ -419,5 +419,5 @@ index f99177d..2a11404 100644
};
--
1.6.0.6
1.6.3.3

View File

@ -1,17 +1,17 @@
From 0ac6c456898d8c09908a35add45d018eb8f76613 Mon Sep 17 00:00:00 2001
From f8acd63e169cdec39c47ac0d8c1b98e115cf24a1 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] s390-tools-1.8.1-fdasd-su
Subject: [PATCH 3/9] 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 ef01c9b..b6802f9 100644
index aa16659..3a54968 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -2005,10 +2005,12 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
@@ -2009,10 +2009,12 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
if (anc->verbose) printf("disk type check : ok\n");
if (dasd_info.FBA_layout != 0) {
@ -29,5 +29,5 @@ index ef01c9b..b6802f9 100644
if (anc->verbose) printf("disk layout check : ok\n");
--
1.6.0.6
1.6.3.3

View File

@ -1,14 +1,14 @@
From 9c34968b40aa5fee679abf0056255510333ae9c3 Mon Sep 17 00:00:00 2001
From 35298f5f9512835071b8c08e843731bbfbb15b7e 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:16 +0200
Subject: [PATCH] s390-tools-1.8.1-fdasd-raid-lvm
Subject: [PATCH 4/9] s390-tools-1.8.1-fdasd-raid-lvm
---
fdasd/fdasd.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 53 insertions(+), 12 deletions(-)
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index b6802f9..286b0bb 100644
index 3a54968..a526d7f 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -258,10 +258,10 @@ fdasd_error(fdasd_anchor_t *anc, enum fdasd_failure why, char *str)
@ -23,7 +23,7 @@ index b6802f9..286b0bb 100644
while (*line_ptr && !isgraph(*line_ptr))
line_ptr++;
return *line_ptr;
@@ -310,6 +310,10 @@ fdasd_partition_type (char *str)
@@ -312,6 +312,10 @@ fdasd_partition_type (char *str)
strcpy(str, "Linux native");
else if (strncmp("SWAP ", str, 6) == 0)
strcpy(str, "Linux swap");
@ -34,7 +34,7 @@ index b6802f9..286b0bb 100644
else
strcpy(str, "unknown");
@@ -1117,14 +1121,24 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
@@ -1122,14 +1126,24 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
strncpy(c1, s2, 31);
}
else {
@ -60,7 +60,7 @@ index b6802f9..286b0bb 100644
strncpy(ch, "LINUX.V "
" ", 44);
@@ -1140,10 +1154,21 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
@@ -1145,10 +1159,21 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
strncpy(c1, dsno, 4);
c1 += 4;
@ -86,7 +86,7 @@ index b6802f9..286b0bb 100644
}
vtoc_ebcdic_enc(ch, ch, 44);
if (anc->verbose) printf("%2x ", part_info->f1->DS1FMTID);
@@ -1429,9 +1454,10 @@ fdasd_change_part_type (fdasd_anchor_t *anc)
@@ -1433,9 +1458,10 @@ fdasd_change_part_type (fdasd_anchor_t *anc)
printf("current partition type is: %s\n\n", fdasd_partition_type(str));
printf(" 1 Linux native\n" \
@ -99,7 +99,7 @@ index b6802f9..286b0bb 100644
while (!isdigit(part_type =
read_char("new partition type: ")));
part_type -= 48;
@@ -1444,6 +1470,9 @@ fdasd_change_part_type (fdasd_anchor_t *anc)
@@ -1448,6 +1474,9 @@ fdasd_change_part_type (fdasd_anchor_t *anc)
case 2:
strncpy(str, "SWAP ", 6);
break;
@ -109,7 +109,7 @@ index b6802f9..286b0bb 100644
default:
printf("'%d' is not supported!\n", part_type);
}
@@ -1621,7 +1650,7 @@ fdasd_process_invalid_vtoc(fdasd_anchor_t *anc)
@@ -1625,7 +1654,7 @@ fdasd_process_invalid_vtoc(fdasd_anchor_t *anc)
static void
fdasd_process_valid_vtoc(fdasd_anchor_t *anc, unsigned long blk)
{
@ -118,7 +118,7 @@ index b6802f9..286b0bb 100644
int i, part_no, f1_size = sizeof(format1_label_t);
partition_info_t *part_info = anc->first;
format1_label_t f1_label;
@@ -1673,14 +1702,26 @@ fdasd_process_valid_vtoc(fdasd_anchor_t *anc, unsigned long blk)
@@ -1677,14 +1706,26 @@ fdasd_process_valid_vtoc(fdasd_anchor_t *anc, unsigned long blk)
vtoc_ebcdic_enc(part_info->f1->DS1DSNAM,
part_info->f1->DS1DSNAM, 44);
@ -149,5 +149,5 @@ index b6802f9..286b0bb 100644
part_info = part_info->next;
f1_counter++;
--
1.6.0.6
1.6.3.3

View File

@ -1,14 +1,14 @@
From 486526858271c8ea890e8728a1cf1cceeceb9b1a Mon Sep 17 00:00:00 2001
From 1efcfe8d7ad20f7a3f584628375da60682b4579c Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 15:28:06 +0200
Subject: [PATCH] don't create automenu when default menu exists
Subject: [PATCH 5/9] don't create automenu when default menu exists
---
zipl/src/job.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/zipl/src/job.c b/zipl/src/job.c
index 1b7bcb2..9fc6c2d 100644
index 6a526e4..89c8c23 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -1441,6 +1441,8 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
@ -55,5 +55,5 @@ index 1b7bcb2..9fc6c2d 100644
}
else {
--
1.6.0.6
1.6.3.3

View File

@ -1,7 +1,7 @@
From 815064b5e73bdeb11e85e04fb691745b15d00e99 Mon Sep 17 00:00:00 2001
From 894de5382653e4389dc8490f2ee4a2a9c59eb86d 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] s390-tools-1.8.1-zipl-kdump-man
Subject: [PATCH 6/9] 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
@ -14,7 +14,7 @@ Solution: Document that in the zipl man page.
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8
index 8d2b42c..66b23eb 100644
index 6ebf240..6df6026 100644
--- a/zipl/man/zipl.8
+++ b/zipl/man/zipl.8
@@ -176,6 +176,8 @@ will be incomplete.
@ -27,5 +27,5 @@ index 8d2b42c..66b23eb 100644
.BR "\-M <DUMPLIST[,SIZE]>" " or " "--mvdump=<DUMPLIST[,SIZE]>"
Install a multi-volume dump record on each device associated with one of the
--
1.6.0.6
1.6.3.3

View File

@ -1,17 +1,17 @@
From ce6dabd2c97ae9ff589232f7ff95c699a9755267 Mon Sep 17 00:00:00 2001
From 80e1e88e108b774c7aa7c201326f1a92cf1b7e35 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 26 Aug 2009 14:21:14 +0200
Subject: [PATCH 21/21] s390-tools-1.8.1-lszfcp-perf
Subject: [PATCH 7/9] s390-tools-1.8.1-lszfcp-perf
---
zconf/lszfcp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zconf/lszfcp b/zconf/lszfcp
index e6fc94f..8ac66ea 100755
index d0bf84f..a872d05 100755
--- a/zconf/lszfcp
+++ b/zconf/lszfcp
@@ -231,7 +231,7 @@ show_devices()
@@ -233,7 +233,7 @@ show_devices()
# Differentiate old and new sysfs layout
if $FC_CLASS; then
SCSI_DEVICE_LIST=`ls -d \

View File

@ -1,7 +1,7 @@
From 664ab55f566e46c31806b25a976dea444a7976a3 Mon Sep 17 00:00:00 2001
From d0c06736586d8f85f2e7c64291f3f289c12a0caa Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 24 Sep 2009 09:12:39 +0200
Subject: [PATCH] fix string overflow in vtoc_volume_label_init
Subject: [PATCH 8/9] fix string overflow in vtoc_volume_label_init
Originaly it tries to copy a 84B string into 4B field and reset also
the other fields thru the overflow. This doesn't work with recent GCC

View File

@ -1,389 +0,0 @@
From afe16490113999868ff408ff303ac7df4b733ff5 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:47:13 +0200
Subject: [PATCH] s390-tools-1.8.1-ziorep-fixes
---
ziomon/stats.h | 9 ++++---
ziomon/ziomon | 13 +++++++----
ziomon/ziorep_config | 23 +++++++++++----------
ziomon/ziorep_traffic.cpp | 31 +++++++++++++++++------------
ziomon/ziorep_utilization.cpp | 4 +-
ziomon/ziorep_utils.cpp | 43 +++++++++++++++++++++++++++++++++++-----
6 files changed, 82 insertions(+), 41 deletions(-)
diff --git a/ziomon/stats.h b/ziomon/stats.h
index 1003f91..a28d436 100644
--- a/ziomon/stats.h
+++ b/ziomon/stats.h
@@ -108,7 +108,7 @@ static inline int histlog2_index(__u64 val, struct histlog2 *h)
{
int i;
- for (i = 0; i < (h->num - 1) && val > histlog2_upper_limit(i, h); i++);
+ for (i = 0; i < h->num && val > histlog2_upper_limit(i, h); i++);
return i;
}
@@ -123,15 +123,16 @@ static inline void histlog2_merge(struct histlog2 *h, __u32 *dst, const __u32 *s
{
int i;
- for (i = 0; i < h->num - 1; i++)
+ for (i = 0; i < h->num; i++) {
dst[i] += src[i];
+ }
}
static inline void histlog2_swap(__u32 a[], struct histlog2 *h)
{
int i;
- for (i = 0; i < h->num - 1; i++)
+ for (i = 0; i < h->num; i++)
swap_32(a[i]);
}
@@ -141,7 +142,7 @@ static inline void histlog2_print(const char *s, const __u32 a[],
int i;
printf("%s:\n", s);
- for (i = 0; i < h->num - 1; i++) {
+ for (i = 0; i < h->num; i++) {
printf(" %10ld:%6d",
(unsigned long)(histlog2_upper_limit(i, h)), a[i]);
if (!((i + 1) % 4))
diff --git a/ziomon/ziomon b/ziomon/ziomon
index 30c8adf..aa1cf78 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -411,14 +411,14 @@ function check_for_multipath_devices() {
devices_basenames[$j]="";
clean_devices;
(( i+=3 ));
- while [ "${mp_arr[$i]:0:1}" == "_" ]; do
+ while [[ ! "${mp_arr[$i]:0:1}" =~ "[0-9a-zA-Z]" ]] && [ $i -lt ${#mp_arr[@]} ]; do
checked_devs[${#checked_devs[@]}]=`echo ${mp_arr[$i]} | awk '{print "/dev/"$3}'`;
ddebug " add ${checked_devs[${#checked_devs[@]}-1]}";
- line=${mp_arr[$i]#_*};
+ line=${mp_arr[$i]#* };
line=${line%%:*};
line=`echo $line | sed 's/ //g'`;
WRP_HOST_ADAPTERS[${#WRP_HOST_ADAPTERS[@]}]="host$line";
- WRP_LUNS[${#WRP_LUNS[@]}]=`echo ${mp_arr[$i]#_*} | awk '{print $1}'`;
+ WRP_LUNS[${#WRP_LUNS[@]}]=`echo ${mp_arr[$i]#* } | awk '{print $1}'`;
(( i++ ));
done;
(( --i ));
@@ -599,6 +599,7 @@ function check_size_requirements() {
local estimated_size;
local free_space;
local logpath=`dirname $WRP_LOGFILE`;
+ local num_uniq_devs;
set `ziomon_mgr -e`;
util_base_sz=$1;
@@ -610,10 +611,12 @@ function check_size_requirements() {
# NOTE: Since blktrace and ziomon_zfcpdd write messages only when there is
# traffic, the estimate is an upper boundary only
+ num_uniq_devs=`echo ${WRP_LUNS[@]} | sed 's/ /\n/g' | cut -d : -f 4 | sort | uniq | wc -l`;
+ debug "number of unique devices: $num_uniq_devs";
debug "disk space requirements:";
(( size_per_record = $util_base_sz + ${#WRP_HOST_ADAPTERS[@]} * $util_variable_sz + $ioerr_base_sz
- + ${#WRP_DEVICES[@]} * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
- + ( 2 + ${#WRP_DEVICES[@]}) * 8 ));
+ + $num_uniq_devs * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
+ + ( 2 + $num_uniq_devs) * 8 ));
debug " size per interval: $size_per_record Bytes";
(( total_num_records = $WRP_DURATION / $WRP_INTERVAL ));
debug " total number of intervals: $total_num_records";
diff --git a/ziomon/ziorep_config b/ziomon/ziorep_config
index 21094bf..de60379 100755
--- a/ziomon/ziorep_config
+++ b/ziomon/ziorep_config
@@ -84,9 +84,10 @@ sub get_sub_ch_data
$c_src = catdir($base_dir, S_DIR2, $sub_ch, $adapter);
$sub_ch{$adapter}{lic} = get_line("lic_version");
$sub_ch{$adapter}{gen} = get_line("card_version");
+ $sub_ch{$adapter}{state} = get_line("online") == 1 ? "Online" :
+ "Offline";
$c_src = catdir($base_dir, S_DIR2, $sub_ch);
$sub_ch{$adapter}{chpid} = substr(get_line("chpids"), 0, 2);
- $sub_ch{$adapter}{state} = get_line("port_state");
}
}
@@ -220,7 +221,7 @@ sub adapter_report
my @adapters = @_;
foreach my $a (sort keys %sub_ch) {
- next if (@adapters && "@adapters" !~ /$a/);
+ next if (@adapters && "@adapters" !~ /\b$a\b/);
my @out_str;
push @out_str, "Host: $sub_ch{$a}{host}\n";
push @out_str, "CHPID: $sub_ch{$a}{chpid}\n";
@@ -252,11 +253,11 @@ sub device_report
"===============================================\n";
}
foreach my $hctl (sort keys %devices) {
- next if (@$adapters && "@$adapters" !~ /$devices{$hctl}{hba_id}/);
- next if (@$ports && "@$ports" !~ /$devices{$hctl}{wwpn}/);
- next if (@$luns && "@$luns" !~ /$devices{$hctl}{lun}/);
- next if (@$s_devs && "@$s_devs" !~ /$devices{$hctl}{dev}/);
- next if (@$hosts && "@$hosts" !~ /$sub_ch{$devices{$hctl}{hba_id}}{host}/);
+ next if (@$adapters && "@$adapters" !~ /\b$devices{$hctl}{hba_id}\b/);
+ next if (@$ports && "@$ports" !~ /\b$devices{$hctl}{wwpn}\b/);
+ next if (@$luns && "@$luns" !~ /\b$devices{$hctl}{lun}\b/);
+ next if (@$s_devs && "@$s_devs" !~ /\b$devices{$hctl}{dev}\b/);
+ next if (@$hosts && "@$hosts" !~ /\b$sub_ch{$devices{$hctl}{hba_id}}{host}\b/);
my @out_str;
push @out_str, $devices{$hctl}{hba_id};
push @out_str, $devices{$hctl}{wwpn};
@@ -293,10 +294,10 @@ sub mapper_report
}
foreach my $hctl (sort keys %devices) {
next if (! $devices{$hctl}{mp_dev_mm});
- next if (@$adapters && "@$adapters" !~ /$devices{$hctl}{hba_id}/);
- next if (@$ports && "@$ports" !~ /$devices{$hctl}{wwpn}/);
- next if (@$s_devs && "@$s_devs" !~ /$devices{$hctl}{dev}/);
- next if (@$m_devs && "@$m_devs" !~ /$mapper_dev{$devices{$hctl}{mp_dev_mm}}/);
+ next if (@$adapters && "@$adapters" !~ /\b$devices{$hctl}{hba_id}\b/);
+ next if (@$ports && "@$ports" !~ /\b$devices{$hctl}{wwpn}\b/);
+ next if (@$s_devs && "@$s_devs" !~ /\b$devices{$hctl}{dev}\b/);
+ next if (@$m_devs && "@$m_devs" !~ /\b$mapper_dev{$devices{$hctl}{mp_dev_mm}}\b/);
my @line_str;
push @line_str, $devices{$hctl}{hba_id};
push @line_str, $devices{$hctl}{wwpn};
diff --git a/ziomon/ziorep_traffic.cpp b/ziomon/ziorep_traffic.cpp
index 40cbf47..1461e55 100644
--- a/ziomon/ziorep_traffic.cpp
+++ b/ziomon/ziorep_traffic.cpp
@@ -121,6 +121,7 @@ static int parse_params(int argc, char **argv, struct options *opts)
__u32 tmp32;
long long unsigned int tmp64;
long tmpl;
+ char mychar;
static struct option long_options[] = {
{ "version", no_argument, NULL, 'v'},
{ "help", no_argument, NULL, 'h'},
@@ -188,18 +189,22 @@ static int parse_params(int argc, char **argv, struct options *opts)
opts->print_summary = true;
break;
case 'c':
- rc = sscanf(optarg, "%x", &tmp32);
- if (rc != 1) {
- fprintf(stdout, "%s: Could"
+ rc = sscanf(optarg, "%x%c", &tmp32, &mychar);
+ if (rc < 1) {
+ fprintf(stderr, "%s: Could"
" not read chpid %s\n", toolname, optarg);
return -1;
}
+ if (rc > 1) {
+ fprintf(stderr, "%s: %s is not a valid chpid\n", toolname, optarg);
+ return -1;
+ }
opts->chpids.push_back(tmp32);
break;
case 'p':
rc = sscanf(optarg, "0x%Lx", &tmp64);
if (rc != 1) {
- fprintf(stdout, "%s: Could"
+ fprintf(stderr, "%s: Could"
" not read port number %s\n", toolname, optarg);
return -1;
}
@@ -208,7 +213,7 @@ static int parse_params(int argc, char **argv, struct options *opts)
case 'l':
rc = sscanf(optarg, "0x%Lx", &tmp64);
if (rc != 1) {
- fprintf(stdout, "%s: Could"
+ fprintf(stderr, "%s: Could"
" not read lun %s\n", toolname, optarg);
return -1;
}
@@ -217,11 +222,11 @@ static int parse_params(int argc, char **argv, struct options *opts)
case 'u':
rc = sscanf(optarg, "0.0.%x", &tmp32);
if (rc != 1) {
- fprintf(stdout, "%s: Could not read bus-ID"
+ fprintf(stderr, "%s: Could not read bus-ID"
" %s\n", toolname, optarg);
return -1;
}
- opts->wwpns.push_back(tmp32);
+ opts->devnos.push_back(tmp32);
break;
case 'd':
opts->devices.push_back(optarg);
@@ -313,7 +318,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u32>::const_iterator i = opts->chpids.begin();
i != opts->chpids.end(); ++i) {
if (!(*cfg)->verify_chpid(*i)) {
- fprintf(stdout, "Error: Could not find chpid 0.0.%04x in"
+ fprintf(stderr, "Error: Could not find chpid %x in"
" configuration.\n", *i);
rc = -2;
}
@@ -321,7 +326,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u32>::const_iterator i = opts->devnos.begin();
i != opts->devnos.end(); ++i) {
if (!(*cfg)->verify_devno(*i)) {
- fprintf(stdout, "Error: Could not find bus-ID 0.0.%04x in"
+ fprintf(stderr, "Error: Could not find bus-ID 0.0.%04x in"
" configuration.\n", *i);
rc = -3;
}
@@ -329,7 +334,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u64>::const_iterator i = opts->wwpns.begin();
i != opts->wwpns.end(); ++i) {
if (!(*cfg)->verify_wwpn(*i)) {
- fprintf(stdout, "Error: Could not find WWPN %016Lx in"
+ fprintf(stderr, "Error: Could not find WWPN %016Lx in"
" configuration.\n", (long long unsigned int)*i);
rc = -4;
}
@@ -337,7 +342,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u64>::const_iterator i = opts->luns.begin();
i != opts->luns.end(); ++i) {
if (!(*cfg)->verify_lun(*i)) {
- fprintf(stdout, "Error: Could not find LUN %016Lx in"
+ fprintf(stderr, "Error: Could not find LUN %016Lx in"
" configuration.\n", (long long unsigned int)*i);
rc = -5;
}
@@ -345,7 +350,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<const char*>::iterator i = opts->devices.begin();
i != opts->devices.end(); ++i) {
if (!(*cfg)->verify_device(*i)) {
- fprintf(stdout, "Error: Could not find device %s in"
+ fprintf(stderr, "Error: Could not find device %s in"
" configuration.\n", *i);
rc = -6;
}
@@ -353,7 +358,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<const char*>::iterator i = opts->mp_devices.begin();
i != opts->mp_devices.end(); ++i) {
if (!(*cfg)->verify_mp_device(*i)) {
- fprintf(stdout, "Error: Could not find multipath"
+ fprintf(stderr, "Error: Could not find multipath"
" device %s in configuration.\n", *i);
rc = -7;
}
diff --git a/ziomon/ziorep_utilization.cpp b/ziomon/ziorep_utilization.cpp
index a036a03..3f57a47 100644
--- a/ziomon/ziorep_utilization.cpp
+++ b/ziomon/ziorep_utilization.cpp
@@ -167,7 +167,7 @@ static int parse_params(int argc, char **argv, struct options *opts)
case 'c':
rc = sscanf(optarg, "%x", &tmp);
if (rc != 1) {
- fprintf(stdout, "Error: Could not read chpid"
+ fprintf(stderr, "Error: Could not read chpid"
" %s\n", optarg);
return -1;
}
@@ -237,7 +237,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u32>::const_iterator i = opts->chpids.begin();
i != opts->chpids.end(); ++i) {
if (!(*cfg)->verify_chpid(*i)) {
- fprintf(stdout, "Error: Could not find chpid %x in"
+ fprintf(stderr, "Error: Could not find chpid %x in"
" configuration.\n", *i);
rc = -2;
}
diff --git a/ziomon/ziorep_utils.cpp b/ziomon/ziorep_utils.cpp
index 75a9578..715115e 100644
--- a/ziomon/ziorep_utils.cpp
+++ b/ziomon/ziorep_utils.cpp
@@ -303,8 +303,17 @@ int adjust_timeframe(const char *filename, __u64 *begin, __u64 *end,
verbose_msg("using original interval length: %lus\n",
(long unsigned int)*interval);
}
- // now check if the interval is correct
- if (*interval != UINT32_MAX && *interval % f_hdr.interval_length) {
+ /* the exact frame boundaries don't include the length of the very
+ first interval, so we have to add one more to our calculations */
+ if (*interval && (*end - *begin + f_hdr.interval_length) % *interval != 0) {
+ // cut off rest in case of user-set interval
+ *end -= (*end - *begin) % *interval + f_hdr.interval_length;
+ t = *end;
+ verbose_msg(" cut off at : %s", ctime(&t));
+ }
+
+ // check if the interval is correct
+ if (*interval % f_hdr.interval_length) {
fprintf(stderr, "%s: Data aggregation interval %lu"
" is incompatible with source data. Please use"
" a multiple of %lu and try again.\n", toolname,
@@ -392,7 +401,7 @@ int print_summary_report(FILE *fp, char *filename, ConfigReader &cfg)
rc += fprintf(fp, "Aggregated range: ");
if (a_hdr) {
rc += fprintf(fp, "%s to ",
- print_time_formatted(a_hdr->begin_time));
+ print_time_formatted(a_hdr->begin_time - f_hdr.interval_length));
rc += fprintf(fp, "%s\n",
print_time_formatted(a_hdr->end_time));
}
@@ -404,7 +413,7 @@ int print_summary_report(FILE *fp, char *filename, ConfigReader &cfg)
a_hdr = NULL;
rc += fprintf(fp, "Detailed range: %s to ",
- print_time_formatted(f_hdr.begin_time));
+ print_time_formatted(f_hdr.begin_time - f_hdr.interval_length));
rc += fprintf(fp, "%s\n", print_time_formatted(f_hdr.end_time));
rc += fprintf(fp, "Interval length: %d seconds\n",
f_hdr.interval_length);
@@ -446,16 +455,32 @@ int print_summary_report(FILE *fp, char *filename, ConfigReader &cfg)
return rc;
}
+/* Calculates seconds since 1970 _without_ caring for daylight
+ savings time (comtrary to mktime() et al).
+ It does not care for leap years and the like, which is OK,
+ since we use it in a very narrow scenario: To calculate any
+ daylight savings time related shifts.
+ Hence: Dont't use if you're not sure what you are doing... */
+static __u64 secs_since_1970(const struct tm *t) {
+ __u64 res = 0;
+ res += t->tm_sec;
+ res += 60 * t->tm_min;
+ res += 3600 * t->tm_hour;
+ res += 86400 * t->tm_yday;
+ res += 86400 * 365 * t->tm_year;
+
+ return res;
+}
+
int get_datetime_val(const char *str, __u64 *tgt)
{
- struct tm t;
+ struct tm t, t_old;
char *ret;
// strptime only sets
memset(&t, 0, sizeof(struct tm));
ret = strptime(str, "%Y-%m-%d %H:%M", &t);
-
if (ret == NULL || *ret != '\0') {
ret = strptime(str, "%Y-%m-%d %H:%M:%S", &t);
if (ret == NULL || *ret != '\0') {
@@ -465,7 +490,13 @@ int get_datetime_val(const char *str, __u64 *tgt)
return -1;
}
}
+ t_old = t;
*tgt = mktime(&t);
+ // if daylight savings time applies, 't' has been adjusted,
+ // so we have to correct
+ if (t_old.tm_hour != t.tm_hour)
+ *tgt -= secs_since_1970(&t) - secs_since_1970(&t_old);
+ verbose_msg("datetime value from user after translation: %s", ctime((const time_t *)tgt));
return 0;
}
--
1.6.0.6

View File

@ -0,0 +1,27 @@
From 1697d4f40be133c78cd09fb0af14af22e8c6219e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Sun, 4 Oct 2009 17:46:16 +0200
Subject: [PATCH 9/9] change default load address for ramdisk
The default load address for the initial ramdisk is changed from
0x800000 to 0x2000000 to allow larger kernels to be loaded.
---
zipl/include/zipl.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zipl/include/zipl.h b/zipl/include/zipl.h
index 1f70e48..d2d26dd 100644
--- a/zipl/include/zipl.h
+++ b/zipl/include/zipl.h
@@ -22,7 +22,7 @@
#define DEFAULT_PARMFILE_ADDRESS 0x1000LL
#define DEFAULT_STAGE3_ADDRESS 0xa000LL
#define DEFAULT_IMAGE_ADDRESS 0x10000LL
-#define DEFAULT_RAMDISK_ADDRESS 0x800000LL
+#define DEFAULT_RAMDISK_ADDRESS 0x2000000LL
#define PSW_ADDRESS_MASK 0x000000007fffffffLL
#define PSW_LOAD 0x0008000080000000LL
--
1.6.3.3

View File

@ -1,27 +0,0 @@
From d2f00bb021508f8104a1d8164432e8f4d239d872 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:47:29 +0200
Subject: [PATCH] s390-tools-1.8.1-cflags
---
common.mak | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/common.mak b/common.mak
index d57b854..f0252da 100644
--- a/common.mak
+++ b/common.mak
@@ -25,8 +25,8 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
INSTALL = install # FIXME: We need s390-install (strip)
-CFLAGS = $(OPT_FLAGS) -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE)
-CXXFLAGS = $(OPT_FLAGS) -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE)
+CFLAGS = -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) $(OPT_FLAGS)
+CXXFLAGS = -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) $(OPT_FLAGS)
export AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP INSTALL CFLAGS
# Support alternate install root
--
1.6.0.6

View File

@ -0,0 +1,189 @@
From 7cd1f2254e27cae8e061d1b42fa6c78bc10a5f39 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 8 Oct 2009 10:29:23 +0200
Subject: [PATCH] improve mon_statd init script
- stop: do not print error messages if a daemon is not configured
- start: do not load module if no daemon is configured
- remove useless newlines
---
etc/init.d/mon_statd | 113 ++++++++++++++++++++++++++++----------------------
1 files changed, 64 insertions(+), 49 deletions(-)
diff --git a/etc/init.d/mon_statd b/etc/init.d/mon_statd
index 4d84b5b..60bcf00 100755
--- a/etc/init.d/mon_statd
+++ b/etc/init.d/mon_statd
@@ -22,7 +22,6 @@ PROCD_PATH=/usr/sbin/$PROCD
CONFIG_FILE=/etc/sysconfig/$DAEMON
FSSTATD_PID_FILE=/var/run/$FSSTATD.pid
PROCD_PID_FILE=/var/run/$PROCD.pid
-RETVAL=0
# source function library
. /lib/lsb/init-functions
@@ -32,68 +31,81 @@ if [ -f $CONFIG_FILE ]; then
. $CONFIG_FILE
fi
-start()
+load_kernel_module()
{
if [ ! -e /dev/monwriter ]; then
echo "Loading monwriter module..."
modprobe monwriter 2>&1
- if [ "$?" -ne 0 ]; then
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ udevsettle
+ if [ $? -ne 0 ]; then
exit 1
fi
- while [ ! -e /dev/monwriter ]; do
- sleep 0
- done
fi
+}
- if [ ! -f $FSSTATD_PID_FILE -a "$FSSTAT" = "yes" ]; then
- echo -n $"Starting $FSSTATD:"
- $FSSTATD_PATH -i $FSSTAT_INTERVAL
- if [ $? == 0 ]; then
+start_daemon()
+{
+ local daemon_name=$1
+ local daemon_interval=$2
+ local daemon_pid_file=$3
+ local daemon_path=$4
+
+ if [ ! -f $daemon_pid_file ]; then
+ load_kernel_module
+ echo -n "Starting $daemon_name:"
+ $daemon_path -i $daemon_interval
+ if [ $? -eq 0 ]; then
touch /var/lock/subsys/mon_statd
log_success_msg
else
log_failure_msg
fi
- elif [ "$FSSTAT" = "yes" ]; then
- echo "$FSSTATD (pid $(cat $FSSTATD_PID_FILE)) is already running..."
+ else
+ echo "$daemon_name (pid $(cat $daemon_pid_file)) is already running..."
+ fi
+}
+
+start()
+{
+ if [ "$FSSTAT" = "yes" ]; then
+ start_daemon $FSSTATD $FSSTAT_INTERVAL $FSSTATD_PID_FILE \
+ $FSSTATD_PATH
fi
- if [ ! -f $PROCD_PID_FILE -a "$PROC" = "yes" ]; then
- echo -n $"Starting $PROCD:"
- $PROCD_PATH -i $PROC_INTERVAL
- if [ $? == 0 ]; then
- touch /var/lock/subsys/mon_statd
- log_success_msg
- else
- log_failure_msg
- fi
- elif [ "$PROC" = "yes" ]; then
- echo "$PROCD (pid $(cat $PROCD_PID_FILE)) is already running..."
+ if [ "$PROC" = "yes" ]; then
+ start_daemon $PROCD $PROC_INTERVAL $PROCD_PID_FILE \
+ $PROCD_PATH
fi
- echo
}
-stop()
+stop_daemon()
{
- echo -n $"Stopping $FSSTATD:"
- if [ -f $FSSTATD_PID_FILE ]; then
- killproc $FSSTATD_PATH -TERM
+ local daemon_name=$1
+ local daemon_pid_file=$2
+ local daemon_path=$3
+
+ echo -n "Stopping $daemon_name:"
+ if [ -f $daemon_pid_file ]; then
+ killproc $daemon_path -TERM
log_success_msg
- rm -f $FSSTATD_PID_FILE
+ rm -f $daemon_pid_file
else
log_failure_msg
fi
+}
- echo -n $"Stopping $PROCD:"
- if [ -f $PROCD_PID_FILE ]; then
- killproc $PROCD_PATH -TERM
- log_success_msg
- rm -f $PROCD_PID_FILE
- else
- log_failure_msg
+stop()
+{
+ if [ "$FSSTAT" = "yes" ]; then
+ stop_daemon $FSSTATD $FSSTATD_PID_FILE $FSSTATD_PATH
+ fi
+ if [ "$PROC" = "yes" ]; then
+ stop_daemon $PROCD $PROCD_PID_FILE $PROCD_PATH
fi
rm -f /var/lock/subsys/mon_statd
- echo
}
restart() {
@@ -101,20 +113,23 @@ restart() {
start
}
-status()
+status_daemon()
{
- if [ ! -f $FSSTATD_PID_FILE ]; then
- echo "$FSSTATD is not running."
- else
- echo "$FSSTATD (pid $(cat $FSSTATD_PID_FILE), interval: $FSSTAT_INTERVAL) is running."
- fi
+ local daemon_name=$1
+ local daemon_pid_file=$2
+ local daemon_interval=$3
- if [ ! -f $PROCD_PID_FILE ]; then
- echo "$PROCD is not running."
+ if [ ! -f $daemon_pid_file ]; then
+ echo "$daemon_name is not running."
else
- echo "$PROCD (pid $(cat $PROCD_PID_FILE), interval: $PROC_INTERVAL) is running."
+ echo "$daemon_name (pid $(cat $daemon_pid_file), interval: $daemon_interval) is running."
fi
- echo
+}
+
+status()
+{
+ status_daemon $FSSTATD $FSSTATD_PID_FILE $FSSTAT_INTERVAL
+ status_daemon $PROCD $PROCD_PID_FILE $PROC_INTERVAL
}
# How are we called?
@@ -133,7 +148,7 @@ case "$1" in
;;
*)
echo "Usage: $DAEMON {start|stop|status|restart|reload}"
- RETVAL=1
+ exit 1
esac
-exit $RETVAL
+exit 0
--
1.6.3.3

View File

@ -1,25 +0,0 @@
From 77f053260b9d2b4d683edfbed50a528d74620d4b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 24 Apr 2009 14:05:29 +0200
Subject: [PATCH] remove the executable stack flag
---
zipl/src/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
index 16d5276..07b3b74 100644
--- a/zipl/src/Makefile
+++ b/zipl/src/Makefile
@@ -12,7 +12,7 @@ includes = $(wildcard ../include/*.h)
all: zipl
zipl: $(objects)
- $(CC) $(objects) ../boot/data.o -o zipl
+ $(CC) -Wl,-z,noexecstack $(objects) ../boot/data.o -o zipl
%.o: %.c $(includes) Makefile
$(CC) $(CFLAGS) -c -o $@ $<
--
1.6.0.6

View File

@ -0,0 +1,38 @@
From 5707bfdf0aac985e8e82c9a5004eb458d1d79801 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 30 Oct 2009 11:23:08 +0100
Subject: [PATCH] update readahead value for better performance
Description: dasd,zfcp: Add udev rule to set increased "default max readahead"
Symptom: Sequential read performance on disks is not as good as it could be.
Problem: The current "default max readahead" defined by the kernel is too
small for s390 (128 kb).
Solution: Add udev rule to set a better default value (512 kb). This will
increase sequential read performance up to 40%.
---
etc/udev/rules.d/60-readahead.rules | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
create mode 100644 etc/udev/rules.d/60-readahead.rules
diff --git a/etc/udev/rules.d/60-readahead.rules b/etc/udev/rules.d/60-readahead.rules
new file mode 100644
index 0000000..3133c66
--- /dev/null
+++ b/etc/udev/rules.d/60-readahead.rules
@@ -0,0 +1,13 @@
+#
+# Rules to set an increased default max readahead size for s390 disk devices
+# This file should be installed in /etc/udev/rules.d
+#
+
+SUBSYSTEM!="block", GOTO="ra_end"
+
+ACTION!="add", GOTO="ra_end"
+# on device add set initial readahead to 512 (instead of in kernel 128)
+KERNEL=="sd*[!0-9]", ATTR{queue/read_ahead_kb}="512"
+KERNEL=="dasd*[!0-9]", ATTR{queue/read_ahead_kb}="512"
+
+LABEL="ra_end"
--
1.6.3.3

View File

@ -0,0 +1,33 @@
From e9c5f5e15122b143f5f202e9782773321f8cf6b9 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Nov 2009 10:46:57 +0100
Subject: [PATCH 12/14] fix multipath device detection in ziomon
Description: ziomon: Fix multipath device detection
Symptom: Running ziomon with a valid multipath device like
/dev/mapper/36005076303ffc56200000000000010cc
fails with "ziomon: The following devices do not seem
to exist:".
Problem: The output from multipath -l is not appended correctly to
the mp_arr array.
Solution: Properly initializing mp_arr to an empty array fixes this.
---
ziomon/ziomon | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ziomon/ziomon b/ziomon/ziomon
index 7449843..924c1dd 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -471,7 +471,7 @@ function clean_devices() {
function check_for_multipath_devices() {
local i;
local j;
- local mp_arr;
+ local mp_arr=();
local line;
local devices_basenames;
local tmp;
--
1.6.3.3

View File

@ -1,197 +0,0 @@
From 1833f9dae371a48e3f52891262ad2d5fd75fc205 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 5 Jun 2009 14:12:52 +0200
Subject: [PATCH] s390-tools-1.8.1-ziomon-fixes
---
ziomon/stats.h | 2 +-
ziomon/ziomon | 84 ++++++++++++++++++++++++++++++++++++++++++++-----
ziomon/ziomon_util.c | 2 +-
3 files changed, 77 insertions(+), 11 deletions(-)
diff --git a/ziomon/stats.h b/ziomon/stats.h
index a28d436..0920b27 100644
--- a/ziomon/stats.h
+++ b/ziomon/stats.h
@@ -142,7 +142,7 @@ static inline void histlog2_print(const char *s, const __u32 a[],
int i;
printf("%s:\n", s);
- for (i = 0; i < h->num; i++) {
+ for (i = 0; i < h->num - 1; i++) {
printf(" %10ld:%6d",
(unsigned long)(histlog2_upper_limit(i, h)), a[i]);
if (!((i + 1) % 4))
diff --git a/ziomon/ziomon b/ziomon/ziomon
index aa1cf78..fe4d8ec 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -32,7 +32,7 @@ WRP_DEVICES=();
WRP_LUNS=();
WRP_LOGFILE="";
# limit of actual data in percent that need space on disk
-WRP_SIZE_THRESHOLD="25";
+WRP_SIZE_THRESHOLD="10";
WRP_FORCE=0;
function debug() {
@@ -234,6 +234,7 @@ function start_trace() {
local hosts_param;
local luns_param;
local i;
+ local len;
if [ $WRP_DEBUG -ne 0 ]; then
verbose="-V";
@@ -276,7 +277,7 @@ function start_trace() {
blkiomon_command="blkiomon --interval=$WRP_INTERVAL -Q $WRP_MSG_Q_PATH -q $WRP_MSG_Q_ID -m $WRP_MSG_Q_BLKIOMON_ID $verbose_blk -d -";
zfcpdd_command="ziomon_zfcpdd -Q $WRP_MSG_Q_PATH -q $WRP_MSG_Q_ID -m $WRP_MSG_Q_ZIOMON_ZFCPDD_ID -i $WRP_INTERVAL";
debug "starting blktrace: $blktrace_command | $blkiomon_command | $zfcpdd_command";
- $blktrace_command | $blkiomon_command | $zfcpdd_command > $WRP_MSG_Q_PATH/blktrace.log &
+ $blktrace_command 2>$WRP_MSG_Q_PATH/blktrace.err | $blkiomon_command | $zfcpdd_command > $WRP_MSG_Q_PATH/blktrace.log &
i=0;
# might take a moment to start all processes in the pipe if system under load
while [ $i -lt 60 ]; do
@@ -303,7 +304,17 @@ function start_trace() {
echo "done";
echo -n "Collecting data...";
- sleep $WRP_DURATION;
+ # pay extra attention to blktrace
+ for (( i=0; i<$WRP_DURATION; ++i )); do
+ len=`cat $WRP_MSG_Q_PATH/blktrace.err | wc -l`;
+ if [ $len -ne 0 ]; then
+ cat $WRP_MSG_Q_PATH/blktrace.err;
+ echo "Error: blktrace has errors, aborting";
+ return;
+ fi
+ sleep 1;
+ done
+
echo "done";
}
@@ -358,6 +369,58 @@ function emergency_shutdown() {
}
+function check_cpuplugd {
+ # check if cpuplugd is running
+ # If so, the whole per-cpu mechanism of blktrace gets corrupted, which
+ # results in the infamous 'bad trace magic' message
+ if [ -e /var/run/cpuplugd.pid ]; then
+ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ echo "ziomon: Warning: cpuplugd is running which can corrupt the traces.";
+ echo " It is recommended to stop cpuplugd for the duration of the";
+ echo " trace using 'service cpuplugd stop'.";
+ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ fi
+}
+
+
+# we need 2MB per device and CPU
+function check_vmalloc_space() {
+ local total;
+ local used;
+ local free;
+ local num_cpus;
+ local required;
+ local result;
+
+ num_cpus=`cat /proc/cpuinfo | grep processors | awk '{print $4}'`;
+ total=`cat /proc/meminfo | grep VmallocTotal | awk '{print $2}'`;
+ used=`cat /proc/meminfo | grep VmallocUsed | awk '{print $2}'`;
+
+ (( free=$total-$used ));
+ (( required=$num_cpus*${#WRP_DEVICES[@]}*2048 ));
+ (( result=$free-$required ));
+ debug "Required Vmalloc space: $required KBytes";
+ if [ $result -lt 0 ]; then
+ echo "$WRP_TOOLNAME: Not enough free Vmalloc space:";
+ echo " Required: $required KBytes";
+ echo " Free: $free KBytes";
+ exit 1;
+ fi
+
+ return 0;
+}
+
+
+function check_blkiomon() {
+ # check blkiomon version
+ ver=`blkiomon -V | awk '{print $3}'`;
+ if [ "$ver" != "0.2" ]; then
+ echo "$WRP_TOOLNAME: Unsupported blkiomon version $ver detected, aborting";
+ exit 1;
+ fi
+}
+
+
function setup() {
while [ -e $WRP_MSG_Q_PATH ]; do
WRP_MSG_Q_PATH="$WRP_MSG_Q_PATH$RANDOM";
@@ -476,7 +539,7 @@ function determine_host_adapters() {
local num_s_devs;
local s_dev_ratio;
- echo -n "check devices...";
+ echo -n "Check devices...";
# Estimate fraction of /dev/s* devices - if >50%, start with check for regular devices
num_s_devs=`echo ${WRP_DEVICES[@]} | sed "s/ /\n/g" | grep /dev/s | wc -l`;
@@ -599,7 +662,6 @@ function check_size_requirements() {
local estimated_size;
local free_space;
local logpath=`dirname $WRP_LOGFILE`;
- local num_uniq_devs;
set `ziomon_mgr -e`;
util_base_sz=$1;
@@ -611,12 +673,10 @@ function check_size_requirements() {
# NOTE: Since blktrace and ziomon_zfcpdd write messages only when there is
# traffic, the estimate is an upper boundary only
- num_uniq_devs=`echo ${WRP_LUNS[@]} | sed 's/ /\n/g' | cut -d : -f 4 | sort | uniq | wc -l`;
- debug "number of unique devices: $num_uniq_devs";
debug "disk space requirements:";
(( size_per_record = $util_base_sz + ${#WRP_HOST_ADAPTERS[@]} * $util_variable_sz + $ioerr_base_sz
- + $num_uniq_devs * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
- + ( 2 + $num_uniq_devs) * 8 ));
+ + ${#WRP_DEVICES[@]} * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
+ + ( 2 + ${#WRP_DEVICES[@]}) * 8 ));
debug " size per interval: $size_per_record Bytes";
(( total_num_records = $WRP_DURATION / $WRP_INTERVAL ));
debug " total number of intervals: $total_num_records";
@@ -653,10 +713,16 @@ setup;
parse_params $@;
+check_cpuplugd;
+
+check_blkiomon;
+
check_for_existing_output;
determine_host_adapters;
+check_vmalloc_space;
+
check_size_requirements;
[ $? -eq 0 ] && start_trace;
diff --git a/ziomon/ziomon_util.c b/ziomon/ziomon_util.c
index e3e0762..043d3d1 100644
--- a/ziomon/ziomon_util.c
+++ b/ziomon/ziomon_util.c
@@ -597,7 +597,7 @@ static int poll_ioerr_cnt(int init, struct ioerr_data *data,
for (i=0; i<opts->num_luns; ++i) {
/* read ioerr_cnt attribute */
if (read_attribute(opts->luns[i], line, NULL)) {
- fprintf(stderr, "%s: Warning: Could read %s\n",
+ fprintf(stderr, "%s: Warning: Could not read %s\n",
toolname, opts->luns[i]);
grc++;
continue;
--
1.6.0.6

View File

@ -1,54 +0,0 @@
From 38dfbc2642350aba44df80b41c91ab78891ba818 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 16 Jun 2009 11:10:47 +0200
Subject: [PATCH] s390-tools-1.8.1-zipl-fix-unsupported-device
Description: zipl: zipl does not exit for an unsupported device driver.
Symptom: zipl does not exit with an error when it is run against a
target device which is provided by an unsupported device driver
(e.g. device-mapper). The resulting IPL records might be
incorrect and filesystem corruption may occur.
Problem: The device driver name check does not cause an error when the
device driver name is unknown and the device is not a
partition.
Solution: Change the device driver name check to write an error message
and to exit when it finds an unknown device driver name.
Problem-ID: 53660
---
zipl/src/disk.c | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/zipl/src/disk.c b/zipl/src/disk.c
index 3a48e44..f1b98a7 100644
--- a/zipl/src/disk.c
+++ b/zipl/src/disk.c
@@ -190,24 +190,8 @@ disk_get_info(const char* device, struct disk_info** info)
data->device = stats.st_rdev & ~SCSI_PARTN_MASK;
} else {
/* Driver name is unknown */
- if (data->devno == -1) {
- if (data->geo.start) {
- /* Writing to the parent device of this
- * partition may not be safe so stop here. */
- error_reason("Unsupported device driver '%s'",
- data->drv_name);
- goto out_close;
- }
- /* Assume that the first block can be overwritten
- * even if we don't now the exact device type. */
- data->type = disk_type_scsi;
- data->partnum = 0;
- data->device = stats.st_rdev;
- } else {
- error_reason("Unsupported device driver '%s' "
- "for disk type DASD", data->drv_name);
- goto out_close;
- }
+ error_reason("Unsupported device driver '%s'", data->drv_name);
+ goto out_close;
}
/* Convert device size to size in physical blocks */
--
1.6.0.6

View File

@ -0,0 +1,119 @@
From 4770ba2827a5c582c6376139f1ec2d10519779e2 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Nov 2009 10:48:17 +0100
Subject: [PATCH 13/14] zipl - handle status during ipl
Description: zipl: handle status during ipl
Symptom: You encounter an error during IPL with "disabled wait" message.
Problem: During the IPL sequence the subchannel of the IPL device has
to be enabled. If there is a status pending or busy condition
on the subchannel the IPL code abborts the IPL and goes into
disabled wait.
Solution: To resolve the problem the IPL code accepts the status pending
or busy condition on the subchannel and does up to 256 retries.
---
zipl/boot/common.S | 65 ++++++++++++++++++++++++++++++++++-----------------
1 files changed, 43 insertions(+), 22 deletions(-)
diff --git a/zipl/boot/common.S b/zipl/boot/common.S
index 620fed9..fa45e5a 100644
--- a/zipl/boot/common.S
+++ b/zipl/boot/common.S
@@ -6,6 +6,7 @@
#
# some definitions from kernel land
+__LC_IRB = 0x0300
__LC_IPLDEV = 0xC6C
__LC_PANIC_MAGIC= 0xE00
@@ -186,23 +187,33 @@ _load_blocklist:
_enable_device:
stm %r6,%r15,24(%r15)
basr %r13,0 # base register
-0: s %r15,1f-0b(%r13)
+0: s %r15,4f-0b(%r13)
lr %r1,%r2
- l %r2,4f-0b(%r13) # set panik code early
- stsch 2f-0b(%r13)
- oi 2f-0b+5(%r13),0x84 # enable ssch and multipath mode
- msch 2f-0b(%r13)
- bnz _panik-0b(%r13) # subchannel busy or in error ?
- lctl %c6,%c6,3f-0b(%r13) # enable all interrupt classes
+ l %r2,7f-0b(%r13) # set panik code early
+ stsch 5f-0b(%r13)
+ brc 1,3f # panic if not operational
+ oi 5f-0b+5(%r13),0x80 # enable subchannel
+ lhi %r6,256 # r6 retry counter
+1: # modify subchannel
+ msch 5f-0b(%r13)
+ brc 6,2f # status pending or busy
+ brc 1,3f # panic if not operational
+ lctl %c6,%c6,6f-0b(%r13) # enable all interrupt classes
sr %r2,%r2
- ic %r2,10+2f-0b(%r13) # return lpum in r2
+ ic %r2,10+5f-0b(%r13) # return lpum in r2
lm %r6,%r15,120(%r15)
br %r14
-1: .long 96
+2: # clear status and retry
+ tsch __LC_IRB
+ brc 1,3f # panic if not operational
+ brct %r6,1b # retry
+3: # panic
+ b _panik-0b(%r13) # panic
+4: .long 96
.align 8
-2: .fill 64,1,0
-3: .long 0xff000000 # CR6 initial value
-4: .long EENABLE_DEV
+5: .fill 64,1,0
+6: .long 0xff000000 # CR6 initial value
+7: .long EENABLE_DEV
#
# Disable I/O on the ipl device.
@@ -211,20 +222,30 @@ _enable_device:
_disable_device:
stm %r6,%r15,24(%r15)
basr %r13,0 # base register
-0: s %r15,1f-0b(%r13)
+0: s %r15,4f-0b(%r13)
lr %r1,%r2
- l %r2,3f-0b(%r13) # set panik code early
- lctl %c6,%c6,2f-0b(%r13) # disable all interrupt classes
- stsch 2f-0b(%r13)
- ni 2f-0b+5(%r13),0x7B # disable ssch and multipath mode
- msch 2f-0b(%r13)
- bnz _panik-0b(%r13) # subchannel busy or in error ?
+ l %r2,6f-0b(%r13) # set panik code early
+ lctl %c6,%c6,5f-0b(%r13) # disable all interrupt classes
+ stsch 5f-0b(%r13)
+ brc 1,3f # panic if not operational
+ ni 5f-0b+5(%r13),0x7F # disable subchannel
+ lhi %r6,256 # r6 retry counter
+1: # modify subchannel
+ msch 5f-0b(%r13)
+ brc 6,2f # status pending or busy
+ brc 1,3f # panic if not operational
lm %r6,%r15,120(%r15)
br %r14
-1: .long 96
+2: # clear status and retry
+ tsch __LC_IRB
+ brc 1,3f # panic if not operational
+ brct %r6,1b
+3: # panic
+ b _panik-0b(%r13) # panic
+4: .long 96
.align 8
-2: .long 0x00000000 # CR6 (all interrupts classes disabled)
-3: .long EDISABLE_DEV
+5: .long 0x00000000 # CR6 (all interrupts classes disabled)
+6: .long EDISABLE_DEV
.endm
.macro io_subroutines
--
1.6.3.3

View File

@ -0,0 +1,285 @@
From 72168f2269dac94d25112e0ad548bd3fcdf907d9 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Nov 2009 10:49:37 +0100
Subject: [PATCH 14/14] dasdview, fdasd: fix floating point error for unformatted devices
When executed on an unformatted device the tools dasdview and fdasd
will end with an floating point exception error.
The reason for the error lies in the fact that we cannot rely on the
HDIO_GETGEO ioctl to report a correct number of cylinders and so we
compute the number of cylinders from the device size. However,
for unformatted devices the device size is zero and thus our
computation ends with a floating point exception.
To solve this issue read the correct number of cylinders from
the DASD device characteristics, which can be found in the data
returned by the BIODASDINFO ioctl.
---
dasdview/dasdview.c | 22 +++++++-------
dasdview/dasdview.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
fdasd/fdasd.c | 18 ++++++------
fdasd/fdasd.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 168 insertions(+), 20 deletions(-)
diff --git a/dasdview/dasdview.c b/dasdview/dasdview.c
index a74ae33..2909b16 100644
--- a/dasdview/dasdview.c
+++ b/dasdview/dasdview.c
@@ -169,7 +169,7 @@ static void
dasdview_get_info(dasdview_info_t *info)
{
int fd;
- u_int64_t device_size;
+ struct dasd_eckd_characteristics *characteristics;
fd = open(info->device, O_RDONLY);
if (fd == -1)
@@ -201,16 +201,6 @@ dasdview_get_info(dasdview_info_t *info)
exit(-1);
}
- if (ioctl(fd, BLKGETSIZE64, &device_size) != 0) {
- close(fd);
- zt_error_print("dasdview: ioctl error\n" \
- "Could not retrieve device size information.\n");
- exit(-1);
- }
-
- info->hw_cylinders = ((device_size / info->blksize)
- / info->geo.sectors) / info->geo.heads;
-
/* get disk information */
if (ioctl(fd, BIODASDINFO2, &info->dasd_info) == 0) {
info->dasd_info_version = 2;
@@ -223,6 +213,16 @@ dasdview_get_info(dasdview_info_t *info)
exit(-1);
}
}
+
+ characteristics = (struct dasd_eckd_characteristics *)
+ &info->dasd_info.characteristics;
+ if (characteristics->no_cyl == LV_COMPAT_CYL &&
+ characteristics->long_no_cyl)
+ info->hw_cylinders = characteristics->long_no_cyl;
+ else
+ info->hw_cylinders = characteristics->no_cyl;
+
+
close(fd);
}
diff --git a/dasdview/dasdview.h b/dasdview/dasdview.h
index 39e1228..5388592 100644
--- a/dasdview/dasdview.h
+++ b/dasdview/dasdview.h
@@ -72,6 +72,80 @@ typedef struct dasd_information2_t {
unsigned int reserved7; /* reserved for further use ,... */
} dasd_information2_t;
+struct dasd_eckd_characteristics {
+ unsigned short cu_type;
+ struct {
+ unsigned char support:2;
+ unsigned char async:1;
+ unsigned char reserved:1;
+ unsigned char cache_info:1;
+ unsigned char model:3;
+ } __attribute__ ((packed)) cu_model;
+ unsigned short dev_type;
+ unsigned char dev_model;
+ struct {
+ unsigned char mult_burst:1;
+ unsigned char RT_in_LR:1;
+ unsigned char reserved1:1;
+ unsigned char RD_IN_LR:1;
+ unsigned char reserved2:4;
+ unsigned char reserved3:8;
+ unsigned char defect_wr:1;
+ unsigned char XRC_supported:1;
+ unsigned char reserved4:1;
+ unsigned char striping:1;
+ unsigned char reserved5:4;
+ unsigned char cfw:1;
+ unsigned char reserved6:2;
+ unsigned char cache:1;
+ unsigned char dual_copy:1;
+ unsigned char dfw:1;
+ unsigned char reset_alleg:1;
+ unsigned char sense_down:1;
+ } __attribute__ ((packed)) facilities;
+ unsigned char dev_class;
+ unsigned char unit_type;
+ unsigned short no_cyl;
+ unsigned short trk_per_cyl;
+ unsigned char sec_per_trk;
+ unsigned char byte_per_track[3];
+ unsigned short home_bytes;
+ unsigned char formula;
+ union {
+ struct {
+ unsigned char f1;
+ unsigned short f2;
+ unsigned short f3;
+ } __attribute__ ((packed)) f_0x01;
+ struct {
+ unsigned char f1;
+ unsigned char f2;
+ unsigned char f3;
+ unsigned char f4;
+ unsigned char f5;
+ } __attribute__ ((packed)) f_0x02;
+ } __attribute__ ((packed)) factors;
+ unsigned short first_alt_trk;
+ unsigned short no_alt_trk;
+ unsigned short first_dia_trk;
+ unsigned short no_dia_trk;
+ unsigned short first_sup_trk;
+ unsigned short no_sup_trk;
+ unsigned char MDR_ID;
+ unsigned char OBR_ID;
+ unsigned char director;
+ unsigned char rd_trk_set;
+ unsigned short max_rec_zero;
+ unsigned char reserved1;
+ unsigned char RWANY_in_LR;
+ unsigned char factor6;
+ unsigned char factor7;
+ unsigned char factor8;
+ unsigned char reserved2[3];
+ unsigned char reserved3[6];
+ unsigned int long_no_cyl;
+} __attribute__ ((packed));
+
/*
* values to be used for dasd_information2_t.format
* 0x00: NOT formatted
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index a526d7f..8f7f5aa 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -2002,7 +2002,7 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
int fd, blksize = 0;
dasd_information_t dasd_info;
char err_str[ERROR_STRING_SIZE];
- u_int64_t device_size;
+ struct dasd_eckd_characteristics *characteristics;
if ((fd = open(options.device,O_RDONLY)) < 0) {
snprintf(err_str, ERROR_STRING_SIZE,
@@ -2023,14 +2023,6 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
"Could not retrieve blocksize information.");
}
- if (ioctl(fd, BLKGETSIZE64, &device_size) != 0) {
- close(fd);
- fdasd_error(anc, unable_to_ioctl,
- "Could not retrieve device size information.");
- }
-
- anc->hw_cylinders = ((device_size / blksize) / geo.sectors) / geo.heads;
-
/* get disk type */
if (ioctl(fd, BIODASDINFO, &dasd_info) != 0) {
close(fd);
@@ -2038,6 +2030,14 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
"Could not retrieve disk information.");
}
+ characteristics =
+ (struct dasd_eckd_characteristics *) &dasd_info.characteristics;
+ if (characteristics->no_cyl == LV_COMPAT_CYL &&
+ characteristics->long_no_cyl)
+ anc->hw_cylinders = characteristics->long_no_cyl;
+ else
+ anc->hw_cylinders = characteristics->no_cyl;
+
close(fd);
if (strncmp(dasd_info.type, "ECKD", 4) != 0) {
diff --git a/fdasd/fdasd.h b/fdasd/fdasd.h
index 107e486..8a1bfd0 100644
--- a/fdasd/fdasd.h
+++ b/fdasd/fdasd.h
@@ -43,6 +43,80 @@ typedef struct dasd_information_t {
char configuration_data[256]; /* from read_configuration_data */
} dasd_information_t;
+struct dasd_eckd_characteristics {
+ unsigned short cu_type;
+ struct {
+ unsigned char support:2;
+ unsigned char async:1;
+ unsigned char reserved:1;
+ unsigned char cache_info:1;
+ unsigned char model:3;
+ } __attribute__ ((packed)) cu_model;
+ unsigned short dev_type;
+ unsigned char dev_model;
+ struct {
+ unsigned char mult_burst:1;
+ unsigned char RT_in_LR:1;
+ unsigned char reserved1:1;
+ unsigned char RD_IN_LR:1;
+ unsigned char reserved2:4;
+ unsigned char reserved3:8;
+ unsigned char defect_wr:1;
+ unsigned char XRC_supported:1;
+ unsigned char reserved4:1;
+ unsigned char striping:1;
+ unsigned char reserved5:4;
+ unsigned char cfw:1;
+ unsigned char reserved6:2;
+ unsigned char cache:1;
+ unsigned char dual_copy:1;
+ unsigned char dfw:1;
+ unsigned char reset_alleg:1;
+ unsigned char sense_down:1;
+ } __attribute__ ((packed)) facilities;
+ unsigned char dev_class;
+ unsigned char unit_type;
+ unsigned short no_cyl;
+ unsigned short trk_per_cyl;
+ unsigned char sec_per_trk;
+ unsigned char byte_per_track[3];
+ unsigned short home_bytes;
+ unsigned char formula;
+ union {
+ struct {
+ unsigned char f1;
+ unsigned short f2;
+ unsigned short f3;
+ } __attribute__ ((packed)) f_0x01;
+ struct {
+ unsigned char f1;
+ unsigned char f2;
+ unsigned char f3;
+ unsigned char f4;
+ unsigned char f5;
+ } __attribute__ ((packed)) f_0x02;
+ } __attribute__ ((packed)) factors;
+ unsigned short first_alt_trk;
+ unsigned short no_alt_trk;
+ unsigned short first_dia_trk;
+ unsigned short no_dia_trk;
+ unsigned short first_sup_trk;
+ unsigned short no_sup_trk;
+ unsigned char MDR_ID;
+ unsigned char OBR_ID;
+ unsigned char director;
+ unsigned char rd_trk_set;
+ unsigned short max_rec_zero;
+ unsigned char reserved1;
+ unsigned char RWANY_in_LR;
+ unsigned char factor6;
+ unsigned char factor7;
+ unsigned char factor8;
+ unsigned char reserved2[3];
+ unsigned char reserved3[6];
+ unsigned int long_no_cyl;
+} __attribute__ ((packed));
+
/* Get information on a dasd device (enhanced) */
#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)
--
1.6.3.3

View File

@ -1,70 +0,0 @@
From b76deacff693b951c2e5a01ed17e058379b9e00a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:47:02 +0200
Subject: [PATCH] s390-tools-1.8.1-iucvterm-getlogin-to-getpwuid
Description: iucvconn: Replace getlogin() with getpwuid(geteuid())
Symptom: The user name is not always logged to syslog.
Problem: The getlogin() function returns the name of the user that
is logged in. This user name is used to write syslog records.
getlogin() retrieves the user information from the utmp
database. However, the user information might not always be
available, for example, the screen program can remove utmp
records (logoff function).
Solution: The getpwuid() function is used to get the user name from the
passwd file (or any other NSS source, i.e. LDAP etc.).
Problem-ID: 54225
---
iucvterm/src/iucvconn.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/iucvterm/src/iucvconn.c b/iucvterm/src/iucvconn.c
index 61f536e..da7d08a 100644
--- a/iucvterm/src/iucvconn.c
+++ b/iucvterm/src/iucvconn.c
@@ -7,6 +7,7 @@
* Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
*/
#include <errno.h>
+#include <pwd.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
@@ -237,6 +238,7 @@ int main(int argc, char *argv[])
struct sockaddr_iucv addr;
struct termios ios;
struct sigaction sigact;
+ struct passwd *passwd;
struct iucvtty_cfg conf;
@@ -266,6 +268,9 @@ int main(int argc, char *argv[])
/* syslog */
openlog(SYSLOG_IDENT, LOG_PID, LOG_AUTHPRIV);
+ /* get user information for syslog */
+ passwd = getpwuid(geteuid());
+
if (connect(server, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
switch (errno) {
case EAGAIN:
@@ -286,12 +291,14 @@ int main(int argc, char *argv[])
break;
}
AUDIT("Connection to %s/%s failed for user %s (uid=%i)",
- conf.host, conf.service, getlogin(), geteuid());
+ conf.host, conf.service,
+ (passwd != NULL) ? passwd->pw_name : "n/a", geteuid());
rc = 2;
goto return_on_error;
}
AUDIT("Established connection to %s/%s for user %s (uid=%i)",
- conf.host, conf.service, getlogin(), geteuid());
+ conf.host, conf.service,
+ (passwd != NULL) ? passwd->pw_name : "n/a", geteuid());
/* send client params */
iucvtty_tx_termenv(server, DEFAULT_TERM);
--
1.6.0.6

File diff suppressed because it is too large Load Diff

View File

@ -1,184 +0,0 @@
From 263c0e5646ea3c81e570ec7e53c214cac8cb4412 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:50:08 +0200
Subject: [PATCH] s390-tools-1.8.1-dumpconf-improve-error-checking
Description: dumpconf: Improve parameter checking and error messages.
Symptom: Ugly and confusing error messages on systems which do not support
the dump_reipl shutdown action.
Problem: Error handling is incomplete.
Solution: The dumpconf init script now validates the syntax of the device
specified in the config file.
---
etc/init.d/dumpconf | 98 +++++++++++++++++++++++++++++++++++----------------
1 files changed, 67 insertions(+), 31 deletions(-)
diff --git a/etc/init.d/dumpconf b/etc/init.d/dumpconf
index e97f76c..42a2242 100755
--- a/etc/init.d/dumpconf
+++ b/etc/init.d/dumpconf
@@ -119,18 +119,60 @@ verify_ccw_dump_device()
fi
}
-setup_ccw_device()
-{
- echo $DEVICE > $1/ccw/device || RETVAL=1
+#------------------------------------------------------------------------------
+# Helper function to check a device string.
+#------------------------------------------------------------------------------
+function CheckDeviceString() {
+ local X
+
+ X=$(
+ echo "$1" |
+ awk --posix -F. '
+ function PrintBusID(css, grp, devno) {
+ while(length(devno) < 4)
+ devno = "0" devno
+ print css "." grp "." devno
+ }
+ NF == 1 && $1 ~ /^[0-9a-fA-F]{1,4}$/ {
+ PrintBusID("0","0", $1)
+ next
+ }
+ NF != 3 || $1 !~ /^[0-9a-fA-F]{1,2}$/ {
+ next
+ }
+ $2 !~ /^[0-9a-fA-F]{1,2}$/ {
+ next
+ }
+ $3 !~ /^[0-9a-fA-F]{1,4}$/ {
+ next
+ }
+ {
+ PrintBusID($1, $2, $3)
+ }
+ '
+ )
+
+ if [ "$X" != "" ]; then
+ echo $X
+ return 0
+ fi
}
-setup_fcp_device()
+setup_device()
{
- echo $DEVICE > $1/fcp/device || RETVAL=1
- echo $WWPN > $1/fcp/wwpn || RETVAL=1
- echo $LUN > $1/fcp/lun || RETVAL=1
- echo $BOOTPROG > $1/fcp/bootprog || RETVAL=1
- echo $BR_LBA > $1/fcp/br_lba || RETVAL=1
+ DEV="$(CheckDeviceString $DEVICE)"
+ if [ "$DEV" != "" ]; then
+ echo $DEV > $1/$DUMP_TYPE/device || RETVAL=1
+ else
+ RETVAL=1
+ echo "ERROR: Invalid device '$DEVICE'" >&2
+ fi
+ if [ $DUMP_TYPE == "fcp" ] && [ $RETVAL -eq 0 ]; then
+ echo $WWPN > $1/fcp/wwpn || RETVAL=1
+ echo $LUN > $1/fcp/lun || RETVAL=1
+ echo $BOOTPROG > $1/fcp/bootprog || RETVAL=1
+ echo $BR_LBA > $1/fcp/br_lba || RETVAL=1
+ fi
}
setup_nss_device()
@@ -145,10 +187,8 @@ setup_reipl()
return
fi
- if [ "$REIPL_TYPE" == "ccw" ]; then
- setup_ccw_device $REIPL_CONFIG_DIR
- elif [ "$REIPL_TYPE" == "fcp" ]; then
- setup_fcp_device $REIPL_CONFIG_DIR
+ if [ "$REIPL_TYPE" == "ccw" ] || [ "$REIPL_TYPE" == "fcp" ]; then
+ setup_device $REIPL_CONFIG_DIR
elif [ "$REIPL_TYPE" == "nss" ]; then
setup_nss_device $REIPL_CONFIG_DIR
else
@@ -169,28 +209,23 @@ setup_reipl()
setup_dump()
{
- if [ "$DUMP_TYPE" == "ccw" ]; then
- setup_ccw_device $DUMP_CONFIG_DIR
- elif [ "$DUMP_TYPE" == "fcp" ]; then
- setup_fcp_device $DUMP_CONFIG_DIR
+ if [ "$DUMP_TYPE" == "ccw" ] || [ "$DUMP_TYPE" == "fcp" ]; then
+ setup_device $DUMP_CONFIG_DIR
elif [ "$DUMP_TYPE" != "none" ]; then
echo "ERROR: Unknown dump type '$DUMP_TYPE'" >&2
RETVAL=1
fi
- echo $DUMP_TYPE > $DUMP_CONFIG_DIR/dump_type || RETVAL=1
+ if [ $RETVAL -eq 0 ]; then
+ echo $DUMP_TYPE > $DUMP_CONFIG_DIR/dump_type || RETVAL=1
+ fi
if [ $RETVAL -eq 1 ]; then
- echo "ERROR: Setup of $DUMP_TYPE dump device failed." >&2
echo none > $DUMP_CONFIG_DIR/dump_type
return $RETVAL
fi
- if [ "$CONF_DUMP_TYPE" == "none" ]; then
- echo "No dump device configured. "
- else
- echo "$ON_PANIC on panic configured: Using $DUMP_TYPE dump device."
- fi
+ echo "Configuring $ON_PANIC on panic: Using $DUMP_TYPE dump device."
}
setup_on_panic_vmcmd()
@@ -260,7 +295,7 @@ status_dump()
echo "type....: fcp"
print_fcp_device $DUMP_CONFIG_DIR
else
- echo "ERROR: Unknown dump device type '$TYPE'!" >&2
+ echo "ERROR: Unknown dump device type '$CONF_DUMP_TYPE'!" >&2
echo " Please check if you have the latest dumpconf package!" >&2
fi
}
@@ -316,27 +351,28 @@ start()
if [ "$ON_PANIC" == "reipl" ]; then
setup_reipl
- elif [ "$ON_PANIC" == "dump" ]; then
+ elif [ "$ON_PANIC" == "dump" ] || [ "$ON_PANIC" == "dump_reipl" ]; then
setup_dump
elif [ "$ON_PANIC" == "vmcmd" ]; then
setup_on_panic_vmcmd
- elif [ "$ON_PANIC" == "dump_reipl" ]; then
- setup_dump
elif [ "$ON_PANIC" == "stop" ]; then
echo "stop on panic configured."
else
echo "ERROR: Unknown 'on panic' type '$ON_PANIC'" >&2
RETVAL=1
fi
+ if [ $RETVAL -eq 1 ]; then
+ echo "ERROR: Setup of $DUMP_TYPE dump device failed." >&2
+ return $RETVAL
+ fi
- echo $ON_PANIC > $ON_PANIC_CONFIG_FILE || RETVAL=1
+ echo $ON_PANIC > $ON_PANIC_CONFIG_FILE 2> /dev/null || RETVAL=1
# check for errors
if [ $RETVAL -eq 1 ]; then
- ERRMSG="\"on panic action\" configuration failed!"
echo stop > $ON_PANIC_CONFIG_FILE
- echo "ERROR: $ERRMSG Check $DUMP_CONFIG_FILE!" >&2
+ echo "ERROR: $ON_PANIC not supported by hardware!" >&2
return $RETVAL
fi
--
1.6.0.6

View File

@ -0,0 +1,376 @@
From 62fb535a68f1df693869e4361150259b42c6f211 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 10 Dec 2009 18:30:52 +0100
Subject: [PATCH 16/16] s390tools-1.8.2-lsreipl-nss
---
ipl_tools/ccw.c | 42 ++++++++++++++++---------------------
ipl_tools/chreipl.h | 9 +++++--
ipl_tools/fcp.c | 13 ++++++-----
ipl_tools/ipl.c | 57 +++++++++++++++++++++++++++++++-------------------
ipl_tools/main.c | 25 +++++++++++++++++-----
ipl_tools/system.c | 3 +-
6 files changed, 87 insertions(+), 62 deletions(-)
diff --git a/ipl_tools/ccw.c b/ipl_tools/ccw.c
index 7959831..eef4550 100644
--- a/ipl_tools/ccw.c
+++ b/ipl_tools/ccw.c
@@ -52,22 +52,19 @@ int isccwdev(const char *devno)
}
-int get_ccw_devno_old_sysfs(char *device, char *devno)
+int get_ccw_devno_old_sysfs(char *device)
{
FILE *filp;
- int len, errorpath, rc;
+ int errorpath;
char path1[4096];
char buf[4096];
- char *match, *s1, *s2;
+ char *match = NULL, *s1, *s2;
errorpath = 1;
- rc = 0;
sprintf(path1, "/sys/block/%s/uevent", device);
filp = fopen(path1, "r");
- if (!filp) {
- rc = -1;
- return rc;
- }
+ if (!filp)
+ return -1;
/*
* the uevent file contains an entry like this:
* PHYSDEVPATH=/devices/css0/0.0.206a/0.0.7e78
@@ -77,16 +74,16 @@ int get_ccw_devno_old_sysfs(char *device, char *devno)
if (match != NULL)
break;
}
+ fclose(filp);
+ if (!match)
+ return -1;
s1 = strchr(buf, '/');
s2 = strrchr(buf, '/');
- len = s2-s1;
- strncpy(devno, s2 + 1, sizeof(devno));
- devno[len] = '\0';
- fclose(filp);
+ strncpy(devno, s2 + 1, sizeof(devno) - 1);
return 0;
}
-int get_ccw_devno_new_sysfs(char *device, char *devno)
+int get_ccw_devno_new_sysfs(char *device)
{
int len, errorpath, rc;
char path2[4096];
@@ -119,8 +116,7 @@ int get_ccw_devno_new_sysfs(char *device, char *devno)
return rc;
}
}
- strncpy(devno, s2 + 1, sizeof(devno));
- devno[len] = '\0';
+ strncpy(devno, s2 + 1, sizeof(devno) - 1);
return 0;
}
@@ -134,16 +130,14 @@ int get_ccw_devno_new_sysfs(char *device, char *devno)
*
* This does not work when booting from tape
*/
-int get_ccw_devno(char *device, char *devno)
+int get_ccw_devno(char *device)
{
- if (get_ccw_devno_old_sysfs(device, devno) != 0) {
- if (get_ccw_devno_new_sysfs(device, devno) != 0) {
- fprintf(stderr, "%s: Failed to lookup the device number\n",
- name);
- return -1;
- }
- }
- return 0;
+ if (get_ccw_devno_old_sysfs(device) == 0)
+ return 0;
+ if (get_ccw_devno_new_sysfs(device) == 0)
+ return 0;
+ fprintf(stderr, "%s: Failed to lookup the device number\n", name);
+ return -1;
}
int get_ccw_dev(char *partition, char *device)
diff --git a/ipl_tools/chreipl.h b/ipl_tools/chreipl.h
index 19a83eb..37807a7 100644
--- a/ipl_tools/chreipl.h
+++ b/ipl_tools/chreipl.h
@@ -34,6 +34,9 @@ extern char saction[8];
extern char name[256];
extern int action;
+#define IPL_TYPE_LEN_MAX 100
+#define NSS_NAME_LEN_MAX 8
+
#define ACT_CCW 1
#define ACT_FCP 2
#define ACT_NODE 3
@@ -63,10 +66,10 @@ int is_valid_case(char *c);
int is_valid_action(char *action);
void parse_shutdown_options(int argc, char **argv);
void strlow(char *s);
-int get_ccw_devno(char *device, char *devno);
-int get_reipl_type(void);
+int get_ccw_devno(char *device);
+int get_reipl_type(char *reipltype);
void parse_lsreipl_options(int argc, char **argv);
-int get_ipl_type();
+int get_ipl_type(char *reipltype);
int get_ipl_loadparam(void);
void print_ipl_settings(void);
int get_sa(char *action, char *file);
diff --git a/ipl_tools/fcp.c b/ipl_tools/fcp.c
index 86fa95b..7a8b4c5 100644
--- a/ipl_tools/fcp.c
+++ b/ipl_tools/fcp.c
@@ -33,12 +33,11 @@
/*
* return the current reipl type from /sys/firmware/reipl/reipl_type
- * 0 = fcp, 1 = ccw, -1, error
+ * 0 = fcp, 1 = ccw, 2 = nss, -1 = unknown
*/
-int get_reipl_type(void)
+int get_reipl_type(char *reipltype)
{
FILE *filp;
- char reipltype[4];
char path[4096];
int rc;
@@ -49,7 +48,7 @@ int get_reipl_type(void)
fprintf(stderr, "%s: Can not open /sys/firmware/"
"reipl/reipl_type: ", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
rc = fscanf(filp, "%s", reipltype);
fclose(filp);
@@ -57,17 +56,19 @@ int get_reipl_type(void)
fprintf(stderr, "%s: Failed to read "
"/sys/firmware/reipl/reipl_type:", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
if (strncmp(reipltype, "fcp", strlen("fcp")) == 0)
return T_FCP;
else if (strncmp(reipltype, "ccw", strlen("ccw")) == 0)
return T_CCW;
- /* TODO: add NSS support */
+ else if (strncmp(reipltype, "nss", strlen("nss")) == 0)
+ return T_NSS;
} else {
fprintf(stderr, "%s: Can not open /sys/firmware/reipl/"
"reipl_type:", name);
fprintf(stderr, " %s\n", strerror(errno));
+ exit(1);
}
return -1;
}
diff --git a/ipl_tools/ipl.c b/ipl_tools/ipl.c
index 2bf817a..8cca700 100644
--- a/ipl_tools/ipl.c
+++ b/ipl_tools/ipl.c
@@ -33,12 +33,11 @@
/*
* return the ipl type based on /sys/firmware/ipl/ipl_type
- * returns 0 in case of fcp and 1 in case of ccw, -1 otherwise
+ * returns 0 in case of fcp and 1 in case of ccw, 2 for nss and -1 otherwise
*/
-int get_ipl_type()
+int get_ipl_type(char *reipltype)
{
FILE *filp;
- char reipltype[4];
char path[4096];
int rc;
@@ -49,7 +48,7 @@ int get_ipl_type()
fprintf(stderr, "%s: Can not open /sys/firmware/ipl/"
"ipl_type: ", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
rc = fscanf(filp, "%s", reipltype);
fclose(filp);
@@ -57,12 +56,14 @@ int get_ipl_type()
fprintf(stderr, "%s: Failed to read "
"/sys/firmware/ipl/ipl_type: ", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
if (strncmp(reipltype, "fcp", strlen("fcp")) == 0)
return T_FCP;
else if (strncmp(reipltype, "ccw", strlen("ccw")) == 0)
return T_CCW;
+ else if (strncmp(reipltype, "nss", strlen("nss")) == 0)
+ return T_NSS;
} else {
fprintf(stderr, "%s: Can not open /sys/firmware/ipl/"
"ipl_type:", name);
@@ -111,30 +112,38 @@ int get_ipl_loadparam(void)
void print_ipl_settings(void)
{
int rc, type;
- char bootprog[1024], lba[1024];
+ char bootprog[1024], lba[1024], nss_name[NSS_NAME_LEN_MAX + 1];
+ char reipltype[IPL_TYPE_LEN_MAX + 1];
- type = get_ipl_type();
- /*
- * TODO: add nss support
- */
- if (type == 1)
+ type = get_ipl_type(reipltype);
+ switch (type) {
+ case T_NSS:
+ printf("IPL type: nss\n");
+ rc = strrd(nss_name, "/sys/firmware/ipl/name");
+ if (rc != 0)
+ exit(1);
+ printf("Name: %s\n", nss_name);
+ break;
+ case T_CCW:
printf("IPL type: ccw\n");
- if (type == 0)
- printf("IPL type: fcp\n");
- rc = strrd(devno, "/sys/firmware/ipl/device");
- if (rc != 0)
- exit(1) /* the error msg comes from get_ipl_device */;
- if (strlen(devno) > 0)
- printf("Device: %s\n", devno);
- if (type == 1) {
+ rc = strrd(devno, "/sys/firmware/ipl/device");
+ if (rc != 0)
+ exit(1);
+ if (strlen(devno) > 0)
+ printf("Device: %s\n", devno);
rc = get_ipl_loadparam();
if (rc != -1)
printf("Loadparm: %d\n", rc);
else
printf("Loadparm: \n");
- }
- if (type == 0) {
- /* these settings are only available for fcp */
+ break;
+ case T_FCP:
+ printf("IPL type: fcp\n");
+ rc = strrd(devno, "/sys/firmware/ipl/device");
+ if (rc != 0)
+ exit(1);
+ if (strlen(devno) > 0)
+ printf("Device: %s\n", devno);
rc = strrd(wwpn, "/sys/firmware/reipl/fcp/wwpn");
if (rc != -1 && strlen(wwpn) > 0)
printf("WWPN: %s\n", wwpn);
@@ -147,6 +156,10 @@ void print_ipl_settings(void)
rc = strrd(lba, "/sys/firmware/ipl/br_lba");
if (rc != -1 && strlen(lba) > 0)
printf("br_lba: %s\n", lba);
+ break;
+ default:
+ printf("IPL type: %s (unknown)\n", reipltype);
+ break;
}
exit(0);
}
diff --git a/ipl_tools/main.c b/ipl_tools/main.c
index 2eaa043..bcebabe 100644
--- a/ipl_tools/main.c
+++ b/ipl_tools/main.c
@@ -57,13 +57,22 @@ int action; /* either CCW, FCP or NODE */
int lsreipl(int argc, char *argv[])
{
int rc;
- char bootprog[1024], lba[1024], val[9];
+ char bootprog[1024], lba[1024], val[9], reipltype[IPL_TYPE_LEN_MAX + 1];
+ char nss_name[NSS_NAME_LEN_MAX + 1];
/* parse the command line options in getop.c */
parse_lsreipl_options(argc, argv);
- rc = get_reipl_type();
- if (rc == 0) {
+ rc = get_reipl_type(reipltype);
+ switch (rc) {
+ case T_NSS:
+ printf("Re-IPL type: nss\n");
+ rc = strrd(nss_name, "/sys/firmware/reipl/nss/name");
+ if (rc != 0)
+ exit(1);
+ printf("Name: %s\n", nss_name);
+ break;
+ case T_FCP:
printf("Re-IPL type: fcp\n");
rc = strrd(wwpn, "/sys/firmware/reipl/fcp/wwpn");
if (rc != 0)
@@ -90,8 +99,8 @@ int lsreipl(int argc, char *argv[])
printf("bootprog: %s\n", bootprog);
if (strlen(lba) > 0)
printf("br_lba: %s\n", lba);
- }
- if (rc == 1) {
+ break;
+ case T_CCW:
printf("Re-IPL type: ccw\n");
rc = strrd(devno, "/sys/firmware/reipl/ccw/device");
if (rc != 0)
@@ -106,6 +115,10 @@ int lsreipl(int argc, char *argv[])
printf("Loadparm: %s\n", val);
else
printf("Loadparm: \n");
+ break;
+ default:
+ printf("Re-IPL type: %s (unknown)\n", reipltype);
+ break;
}
return 0;
}
@@ -134,7 +147,7 @@ int reipl(int argc, char *argv[])
"partition: %s\n", name, partition);
exit(1);
}
- rc = get_ccw_devno(device, devno);
+ rc = get_ccw_devno(device);
if (rc != 0) {
fprintf(stderr, "%s: Unable to lookup device"
" number for device %s\n", name,
diff --git a/ipl_tools/system.c b/ipl_tools/system.c
index fd5b76b..ca6c5af 100644
--- a/ipl_tools/system.c
+++ b/ipl_tools/system.c
@@ -174,7 +174,7 @@ int strrd(char *string, char *file)
fprintf(stderr, "%s\n", strerror(errno));
exit(1);
}
- rc = fread(string, 4096, 1, filp);
+ rc = fread(string, 1, 4096, filp);
fclose(filp);
/*
* special handling is required for
@@ -193,6 +193,7 @@ int strrd(char *string, char *file)
fprintf(stderr, "%s\n", strerror(errno));
return -1;
} else {
+ string[rc] = 0;
if (string[strlen(string) - 1] == '\n')
string[strlen(string) - 1] = 0;
return 0;
--
1.6.3.3

File diff suppressed because it is too large Load Diff

View File

@ -1,57 +0,0 @@
From 277fbeaa8cdd27e586d1d3d0f58242a0a40b3a48 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:51:44 +0200
Subject: [PATCH] s390-tools-1.8.1-cpuplugd-memplug
Description: cpuplugd: Daemon does not work in an memplug only environment.
Symptom: When the cpuplugd daemon is executed with only the memory
configuration in cpuplugd.conf it does not start properly.
Problem: A bug in the configuration file parser prevents this valid
user specified setup.
Solution: Adjust the configuration file parser, to accept this type of
system configuration.
---
cpuplugd/config.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cpuplugd/config.c b/cpuplugd/config.c
index 7f02c6c..93b31e5 100644
--- a/cpuplugd/config.c
+++ b/cpuplugd/config.c
@@ -66,6 +66,7 @@ void parse_configline(struct config *cfg, char *line)
rc = -1;
cmm_min = -1;
+ rvalue = NULL;
/* parse line by line */
for (token = strtok_r(line, "\n", &save);
token != NULL;
@@ -318,8 +319,7 @@ void check_config(struct config *cfg)
int lpar_status, error_counter;
lpar_status = check_lpar();
-
- if (cfg->cpu_max <= cfg->cpu_min && cfg->cpu_max != 0) {
+ if (cfg->cpu_max <= cfg->cpu_min && cfg->cpu_max != 0 && cpu != 0) {
if (foreground == 1)
fprintf(stderr, "cpu_max below or equal cpu_min,"
" aborting.\n");
@@ -328,7 +328,6 @@ void check_config(struct config *cfg)
"aborting\n");
clean_up();
}
-
if (cfg->cpu_max < 0 || cfg->cpu_min < 0 || cfg->update < 0
|| cfg->hotplug == NULL || cfg->hotunplug == NULL) {
if (foreground == 1)
@@ -337,6 +336,7 @@ void check_config(struct config *cfg)
if (foreground == 0)
syslog(LOG_INFO, "No valid CPU hotplug "
"configuration detected\n");
+ cpu = 0;
} else {
cpu = 1;
if (debug) {
--
1.6.0.6

View File

@ -0,0 +1,38 @@
From a8bcc744ec941c3b34c22c7a7729b52a390c7a08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 13 Jan 2010 08:39:09 +0100
Subject: [PATCH] fix uppercase conversion in lscss
Description: lscss: fix uppercase conversion
Symptom: when invoking the -u option, lscss will fail with the message "tr: missing operand"
Problem: the bash option "nullglob" interferes with the tr operands
Solution: avoid expanding of those operands by placing quotes around them
---
zconf/lscss | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/zconf/lscss b/zconf/lscss
index efdb9ca..fc40fe6 100755
--- a/zconf/lscss
+++ b/zconf/lscss
@@ -354,7 +354,7 @@ if [ $SCH_IO ] ;then
echo "----------------------------------------------------------------------"
fi
print_io | if [ $UPPERCASE ] ;then
- tr [:lower:] [:upper:]
+ tr "[:lower:]" "[:upper:]"
else
cat -
fi
@@ -368,7 +368,7 @@ if [ $SCH_CHSC ] ;then
echo "Device Subchan."
echo "-----------------"
print_chsc | if [ $UPPERCASE ] ;then
- tr [:lower:] [:upper:]
+ tr "[:lower:]" "[:upper:]"
else
cat -
fi
--
1.6.5.2

View File

@ -1,118 +0,0 @@
From 65f317c463de53abf7a8bba3285a077dbaf42486 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:53:22 +0200
Subject: [PATCH] s390-tools-1.8.1-ziomon-new-blkiomon
ziomon: Adjust to use blkiomon V0.3
Update the blkiomon header to the version packaged in RHEL 5.4, update
the version check appropriately and use the version number for .log files
to match what the proper, forthcoming version will use.
---
ziomon/blkiomon.h | 4 ++--
ziomon/ziomon | 2 +-
ziomon/ziomon_dacc.c | 12 ++++++------
ziomon/ziomon_dacc.h | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/ziomon/blkiomon.h b/ziomon/blkiomon.h
index da27d00..42b6b46 100644
--- a/ziomon/blkiomon.h
+++ b/ziomon/blkiomon.h
@@ -25,6 +25,7 @@ struct blkiomon_stat {
/* Histogram of dispatch to completion request times in u-secs.
Step-size is 8, starting at 0. */
__u32 d2c_hist[BLKIOMON_D2C_BUCKETS];
+ __u32 device; /* device identifier */
struct minmax size_r; /* stats of read request sizes in Bytes */
struct minmax size_w; /* stats of write request sizes in Bytes */
struct minmax d2c_r; /* stats of read request durations in u-secs */
@@ -33,8 +34,7 @@ struct blkiomon_stat {
struct minmax thrput_w; /* stats of write throughput in Kbytes per micro-sec */
__u64 bidir; /* number of bi-directional requests, is set exclusive
(ie. not implicitly adding 1 to rd and wrt as well) */
- __u32 device; /* device identifier */
-} __attribute__ ((packed));
+};
static struct histlog2 size_hist = {0, 1024, BLKIOMON_SIZE_BUCKETS};
diff --git a/ziomon/ziomon b/ziomon/ziomon
index fe4d8ec..297651c 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -414,7 +414,7 @@ function check_vmalloc_space() {
function check_blkiomon() {
# check blkiomon version
ver=`blkiomon -V | awk '{print $3}'`;
- if [ "$ver" != "0.2" ]; then
+ if [ "$ver" != "0.3" ]; then
echo "$WRP_TOOLNAME: Unsupported blkiomon version $ver detected, aborting";
exit 1;
fi
diff --git a/ziomon/ziomon_dacc.c b/ziomon/ziomon_dacc.c
index f2c34ac..0a17d9e 100644
--- a/ziomon/ziomon_dacc.c
+++ b/ziomon/ziomon_dacc.c
@@ -426,7 +426,7 @@ int add_msg(FILE *fp, struct message *msg, struct file_header *f_hdr,
int init_file(FILE *fp, struct file_header *f_hdr)
{
f_hdr->magic = DATA_MGR_MAGIC;
- f_hdr->version = DATA_MGR_V2;
+ f_hdr->version = DATA_MGR_V3;
f_hdr->first_msg_offset = 0;
f_hdr->end_time = 0;
f_hdr->begin_time = 0;
@@ -452,11 +452,11 @@ static int get_header(FILE *fp, struct file_header *hdr)
toolname);
return -2;
}
- if (hdr->version != DATA_MGR_V2) {
+ if (hdr->version != DATA_MGR_V3) {
fprintf(stderr, "%s: Wrong version: .log data is in version %u"
" format, while this tool only supports version %u."
" Get the matching tool version and try again.\n",
- toolname, hdr->version, DATA_MGR_V2);
+ toolname, hdr->version, DATA_MGR_V3);
return -2;
}
hdr->begin_time = 0;
@@ -557,11 +557,11 @@ static int read_aggr_file(FILE *fp, struct aggr_data *data)
toolname);
return -1;
}
- if (data->version != DATA_MGR_V2) {
+ if (data->version != DATA_MGR_V3) {
fprintf(stderr, "%s: Wrong version: .agg data is in version %u"
" format, while this tool only supports version %u."
" Get the matching tool version and try again.\n",
- toolname, data->version, DATA_MGR_V2);
+ toolname, data->version, DATA_MGR_V3);
return -1;
}
@@ -805,7 +805,7 @@ int write_aggr_file(FILE *fp, struct aggr_data *data)
void init_aggr_data_struct(struct aggr_data *data)
{
data->magic = DATA_MGR_MAGIC_AGGR;
- data->version = DATA_MGR_V2;
+ data->version = DATA_MGR_V3;
data->num_zfcpdd = 0;
data->num_blkiomon = 0;
data->end_time = 0;
diff --git a/ziomon/ziomon_dacc.h b/ziomon/ziomon_dacc.h
index f280c9b..8f301f4 100644
--- a/ziomon/ziomon_dacc.h
+++ b/ziomon/ziomon_dacc.h
@@ -17,7 +17,7 @@
#define DATA_MGR_MAGIC 0x64616d67
#define DATA_MGR_MAGIC_AGGR 0x61676772
-#define DATA_MGR_V2 2u
+#define DATA_MGR_V3 3u
/**
--
1.6.0.6

View File

@ -1,32 +0,0 @@
From 8384b80dac573a65de6610ff8dae753a0e2d6deb Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 13 Jul 2009 10:29:52 +0200
Subject: [PATCH] s390-tools-1.8.1-lsluns-disk-enc
Description: lsluns: fix byte check for disk encryption check.
Symptom: Encrypted disks are never displayed as encrypted.
Problem: The check was performed on the wrong bit.
Solution: Perform the check on the correct bit.
Problem-ID: 54517
---
zconf/lsluns | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/zconf/lsluns b/zconf/lsluns
index 08a11ba..164282e 100755
--- a/zconf/lsluns
+++ b/zconf/lsluns
@@ -216,8 +216,8 @@ sub show_attached_lun_info
(my $mod = substr($inq, 0x10, 0x10)) =~ s/\s*//g;
my $type = ord(substr($inq, 0x0, 0x1));
my $enc = ($mod =~ /2107/) ?
- ord(substr($inq, 0xa2, 0x80)) : 0;
- $l .= "(X)" if ($enc & 0x8);
+ ord(substr($inq, 0xa2, 0x1)) : 0;
+ $l .= "(X)" if ($enc & 0x80);
$txt[$type] = $type if (!defined($txt[$type]));
print("\t\tlun = $l\t$sg_dev\t$txt[$type]",
"\t$vend:$mod\n");
--
1.6.0.6

View File

@ -0,0 +1,53 @@
From a8ffd7242da2adcc4ab5b0f23193cfe764dc376d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:42:52 +0100
Subject: [PATCH 19/22] ziorep: fix return codes
Description: ziomon: ziorep tools return 1 when using options -h and -v
Symptom: Using ziorep_traffic/utilization with these options give an
error.
Problem: 1 as been introduced as rc for parse_parms besides error codes,
but is not distinguished from them when parse_params is called.
Solution: After calling parse_parms check for rc 1 and substitute through 0.
---
ziomon/ziorep_traffic.cpp | 5 ++++-
ziomon/ziorep_utilization.cpp | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ziomon/ziorep_traffic.cpp b/ziomon/ziorep_traffic.cpp
index 1461e55..20ee32f 100644
--- a/ziomon/ziorep_traffic.cpp
+++ b/ziomon/ziorep_traffic.cpp
@@ -529,8 +529,11 @@ int main(int argc, char **argv)
verbose = 0;
init_opts(&opts);
- if ( (rc = parse_params(argc, argv, &opts)) )
+ if ( (rc = parse_params(argc, argv, &opts)) ) {
+ if (rc == 1)
+ rc = 0;
goto out;
+ }
if ( (rc = check_opts(&opts, &cfg)) )
goto out;
diff --git a/ziomon/ziorep_utilization.cpp b/ziomon/ziorep_utilization.cpp
index 3f57a47..ac4576f 100644
--- a/ziomon/ziorep_utilization.cpp
+++ b/ziomon/ziorep_utilization.cpp
@@ -352,8 +352,11 @@ int main(int argc, char **argv)
verbose = 0;
init_opts(&opts);
- if ( (rc = parse_params(argc, argv, &opts)) )
+ if ( (rc = parse_params(argc, argv, &opts)) ) {
+ if (rc == 1)
+ rc = 0;
goto out;
+ }
if ( (rc = check_opts(&opts, &cfg)) )
goto out;
--
1.6.5.2

View File

@ -0,0 +1,31 @@
From 72ec5b5bd9a7fd23e2d1aaed455df8f2bda952ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:44:43 +0100
Subject: [PATCH 20/22] lstape: fix return code
Description: lstape: help function returns 1, although it was successful
Symptom: Issuing "lstape -h" or "lstape --help" and then looking for the
error code on the console through e.g. "echo $?" shows 1. Which
looks like an error.
Problem: exit 1, where we chould have exit 0.
Solution: Return 0 after calling the help function with exit 0.
---
zconf/lstape | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zconf/lstape b/zconf/lstape
index efacfc9..5671315 100755
--- a/zconf/lstape
+++ b/zconf/lstape
@@ -90,7 +90,7 @@ while [ $# -ne 0 ]; do
case $1 in
-h|--help)
PrintUsage
- exit 1
+ exit 0
;;
-t|--type)
if [ $# -lt 2 ]; then
--
1.6.5.2

View File

@ -1,25 +0,0 @@
From af1d22ef04368fd201480959ad6647853d82a25e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 26 Aug 2009 14:20:50 +0200
Subject: [PATCH 20/21] s390-tools-1.8.1-cpuplugd-cmminit
---
cpuplugd/config.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cpuplugd/config.c b/cpuplugd/config.c
index 93b31e5..c013a65 100644
--- a/cpuplugd/config.c
+++ b/cpuplugd/config.c
@@ -348,7 +348,7 @@ void check_config(struct config *cfg)
"configuration detected\n");
}
}
- if (cfg->cmm_max < 0 || cfg->cmm_min < -1
+ if (cfg->cmm_max < 0 || cfg->cmm_min < 0
|| cfg->cmm_inc < 0 || cfg->memplug == NULL || cfg->update < 0
|| cfg->memunplug == NULL) {
if (foreground == 1)
--
1.6.3.3

View File

@ -0,0 +1,32 @@
From d3c4eb2ced3a8e3c8f7a528f88721324028534e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:46:14 +0100
Subject: [PATCH 21/22] cpuplugd: fix reading the size of /proc/sys/vm/cmm_pages
Description: cpuplugd: fix fscanf file handling in get_cmmpages_size
Symptom: cpuplugd was not able to correctly read the size of the
/proc/sys/vm/cmm_pages file. This prevented cpuplugd from using
the cmm feature correctly.
Problem: The code checked for the wrong return code (!= 0 instead of ==0)
Solution: Check for the right return code in the get_cmmpages_size error
handling function.
---
cpuplugd/mem.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cpuplugd/mem.c b/cpuplugd/mem.c
index a8f2a8e..8d5f05f 100644
--- a/cpuplugd/mem.c
+++ b/cpuplugd/mem.c
@@ -230,7 +230,7 @@ int get_cmmpages_size()
return -1;
}
rc = fscanf(filp, "%d", &size);
- if (rc != 0) {
+ if (rc == 0) {
fprintf(stderr, "Can not read /proc/sys/vm/cmm_pages: %s\n",
strerror(errno));
if (foreground == 0)
--
1.6.5.2

View File

@ -0,0 +1,74 @@
From c986172e782ae2afa41209e7c238315175d589e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:48:52 +0100
Subject: [PATCH 22/22] lsqeth: support new attributes
Description: lsqeth: add recent qeth attributes
Symptom: no information about "isolation" and "sniffer" values
Problem: new sysfs attributes "isolation" and "sniffer" not mentioned in
lsqeth output.
Solution: add attributes "isolation" and "sniffer" to lsqeth.
---
README | 2 ++
zconf/lsqeth | 11 +++++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/README b/README
index 30ba06f..7c75563 100644
--- a/README
+++ b/README
@@ -192,6 +192,8 @@ Release History:
- lscss: Also show devices on the defunct subchannel.
+ - lsqeth: add attributes "isolation" and "sniffer"
+
- all: Reworked s390-tools build process.
Bug Fixes:
diff --git a/zconf/lsqeth b/zconf/lsqeth
index 9b155e9..b1c2809 100755
--- a/zconf/lsqeth
+++ b/zconf/lsqeth
@@ -3,7 +3,7 @@
# File...........: lsqeth
# Author(s)......: Steffen Thoss <thoss@de.ibm.com>
# Peter Tiedemann <ptiedem@de.ibm.com>
-# Copyright IBM Corp. 2004, 2009
+# Copyright IBM Corp. 2004, 2010
#
# History of changes:
#
@@ -63,7 +63,9 @@ output_array=( if_name
buffer_count
add_hhlen
layer2
- large_send )
+ large_send
+ isolation
+ sniffer )
# Array for sysfs values
sysfs_entries=( "sw checksumming" "hw checksumming" "no checksumming"
"always queue 0" "always queue 1"
@@ -87,7 +89,7 @@ parp_array=0
function PrintVersion
{
echo "$script_name: version %S390_TOOLS_VERSION%"
- echo "Copyright IBM Corp. 2003, 2009"
+ echo "Copyright IBM Corp. 2003, 2010"
}
@@ -308,7 +310,8 @@ function __print_normal_format
function __layer2_print
{
del_layer2=( route4 route6
- fake_ll fake_broadcast )
+ fake_ll fake_broadcast
+ sniffer )
for l in ${del_layer2[@]}
do
--
1.6.5.2

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: s390utils
# $Id$
NAME := s390utils
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

130
cpi.initd Normal file
View File

@ -0,0 +1,130 @@
#!/bin/sh
#
# Copyright 2009 Red Hat, Inc.
# License: GPLv2
# Author: Dan Horák <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() {
[ `id -u` -eq 0 ] || return 4
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

@ -1,2 +1,16 @@
KERNEL=="dasd*[a-z]", SUBSYSTEM=="block", PROGRAM=="/bin/sh -c 'cd /sys/block/$kernel/device;a=$$(pwd -P);echo $${a##*/}'", SYMLINK+="dasd/%c/disc"
KERNEL=="dasd*[0-9]", SUBSYSTEM=="block", PROGRAM=="/bin/sh -c 'cd /sys/block/$parent/device;a=$$(pwd -P);echo $${a##*/}'", SYMLINK+="dasd/%c/part%n"
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

227
device_cio_free Normal file
View File

@ -0,0 +1,227 @@
#!/bin/sh
#
# Copyright 2009 Red Hat, Inc.
# License: GPLv2
# Author: Dan Horák <dhorak@redhat.com>
#
# unblock devices listed in various config files and wait until they are ready
#
# it uses dasd and zfcp config file
# config file syntax:
# deviceno options
# or
# deviceno WWPN FCPLUN
#
# also processes the system ccw config file and network interface configurations
#
DASDCONFIG=/etc/dasd.conf
ZFCPCONFIG=/etc/zfcp.conf
ZNETCONFIG=/etc/ccw.conf
BLACKLIST=/proc/cio_ignore
VERBOSE=
PATH=/bin:/usr/bin:/sbin:/usr/sbin
ALL_DEVICES=
WAITING_TIMEOUT=60 # maximum time to wait for all devices to appear
WAITING_TOTAL=0 # actual time spent waiting for devices
usage()
{
echo "Usage: $CMD [-h|--help] [-V|--verbose]"
exit 1
}
# accepts single device, comma-separated lists and dash separated ranges and their combinations
free_device()
{
local DEV
[ -z "$1" ] && return
DEV=$(echo $1 | tr "A-Z" "a-z")
[ $VERBOSE ] && echo "Freeing device(s) $DEV"
if ! echo "free $DEV" > $BLACKLIST 2> /dev/null ; then
echo "Error: can't free device(s) $DEV"
else
if [ -z $ALL_DEVICES ]; then
ALL_DEVICES=$DEV
else
ALL_DEVICES="$ALL_DEVICES,$DEV"
fi
fi
}
# wait until a device appears on the ccw bus
wait_on_device()
{
local DEVICE_ONLINE DEV
[ -z "$1" ] && return
DEV=$1
DEVICE_ONLINE=/sys/bus/ccw/devices/$DEV/online
[ $VERBOSE ] && echo "Waiting on device $DEV"
[ -f "$DEVICE_ONLINE" ] && return
for t in 1 2 3 4 5
do
if [ $WAITING_TOTAL -ge $WAITING_TIMEOUT ]; then
[ $VERBOSE ] && echo "Waiting timeout of $WAITING_TIMEOUT seconds reached"
break
fi
WAITING_TOTAL=$(($WAITING_TOTAL + $t))
[ $VERBOSE ] && echo "Waiting additional $t second(s) and $WAITING_TOTAL second(s) in total"
sleep $t
[ -f "$DEVICE_ONLINE" ] && return
done
echo "Error: device $DEV still not ready"
}
# check how we were called
CMD=$(basename "$0")
case $CMD in
"dasd_cio_free")
CONFIG=$DASDCONFIG
MODE=dasd
;;
"zfcp_cio_free")
CONFIG=$ZFCPCONFIG
MODE=zfcp
;;
"znet_cio_free")
CONFIG=$ZNETCONFIG
MODE=znet
;;
*)
echo "Error: unknown alias '$CMD'."
echo "Supported aliases are dasd_cio_free, zfcp_cio_free and znet_cio_free."
exit 1
;;
esac
# process command line options
if [ $# -gt 0 ]; then
case $1 in
-V|--verbose)
VERBOSE=yes
shift
;;
-h|--help)
usage
;;
*)
echo "Error: unknown option $1"
usage
;;
esac
fi
if [ ! -f $BLACKLIST ]; then
echo "Error: $BLACKLIST kernel interface doesn't exist"
exit 2
fi
if [ $MODE = "dasd" -o $MODE = "zfcp" ]; then
# process the config file
if [ -f "$CONFIG" ]; then
while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
set $line
free_device $1
;;
esac
done < $CONFIG
fi
fi
if [ $MODE = "dasd" ]; then
# process the device list defined as option for the dasd module
DEVICES=$(modprobe --showconfig | grep "options[[:space:]]\+dasd_mod" | \
sed -e 's/.*[[:space:]]dasd=\([^[:space:]]*\).*/\1/' -e 's/([^)]*)//g' \
-e 's/nopav\|nofcx\|autodetect\|probeonly//g' -e 's/,,/,/g' -e 's/^,//' -e 's/,$//')
for DEVRANGE in $(echo $DEVICES | tr ',' ' '); do
free_device $DEVRANGE
done
fi
if [ $MODE = "znet" ]; then
# process the config file
if [ -f "$CONFIG" ]; then
while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
# grep 2 or 3 channels from beginning of each line
DEVICES=$(echo $line | grep -E -i -o "^([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)")
free_device $DEVICES
;;
esac
done < $CONFIG
fi
# process channels from network interface configurations
for line in $(grep -E -i -h "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null)
do
eval "$line"
free_device $SUBCHANNELS
done
fi
# wait until recently unblocked devices are ready
# at this point we know the content of ALL_DEVICES is syntacticly correct
OLD_IFS=$IFS
IFS=","
set $ALL_DEVICES
for DEV in $*
do
IFS="."
# get the lower bound for range or get the single device
LOWER=${DEV%%-*}
set $LOWER
if [ $# -eq 1 ]; then
L0=0
L1=0
L2=$(printf "%d" "0x$1")
else
L0=$(printf "%d" "0x$1")
L1=$(printf "%d" "0x$2")
L2=$(printf "%d" "0x$3")
fi
# get the upper bound for range or get the single device
UPPER=${DEV##*-}
set $UPPER
if [ $# -eq 1 ]; then
U0=0
U1=0
U2=$(printf "%d" "0x$1")
else
U0=$(printf "%d" "0x$1")
U1=$(printf "%d" "0x$2")
U2=$(printf "%d" "0x$3")
fi
IFS=$OLD_IFS
# iterate thru all devices
for i in $(seq $L0 $U0); do
[ $i -eq $L0 ] && LJ=$L1 || LJ=0
[ $i -eq $U0 ] && UJ=$U1 || UJ=3
for j in $(seq $LJ $UJ); do
[ $i -eq $L0 -a $j -eq $L1 ] && LK=$L2 || LK=0
[ $i -eq $U0 -a $j -eq $U1 ] && UK=$U2 || UK=65535
for k in $(seq $LK $UK); do
wait_on_device "$(printf %x.%x.%04x $i $j $k)"
done
done
done
done

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

@ -7,8 +7,8 @@
Name: s390utils
Summary: Utilities and daemons for IBM System/z
Group: System Environment/Base
Version: 1.8.1
Release: 6%{?dist}
Version: 1.8.2
Release: 10%{?dist}
Epoch: 2
License: GPLv2 and GPLv2+ and CPL
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -23,29 +23,38 @@ Source5: zfcpconf.sh
# http://www.ibm.com/developerworks/linux/linux390/src_vipa-%{vipaver}.html
Source6: http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/src_vipa-%{vipaver}.tar.gz
Source7: zfcp.udev
Source8: dasd.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
# files for DASD initialization
Source12: dasd.udev
Source13: dasdconf.sh
Source14: device_cio_free
Patch1: 0001-s390-tools-1.8.1-common-mak.patch
Patch4: 0004-s390-tools-1.8.1-zipl-automenu.patch
Patch5: 0005-s390-tools-1.8.1-fdasd-su.patch
Patch6: 0006-s390-tools-1.8.1-fdasd-raid-lvm.patch
Patch8: 0008-s390-tools-1.8.1-ziorep-fixes.patch
Patch9: 0009-s390-tools-1.8.1-cflags.patch
Patch10: 0010-s390-tools-1.8.1-defaultmenu.patch
Patch11: 0011-s390-tools-1.8.1-execstack.patch
Patch12: 0012-s390-tools-1.8.1-ziomon-fixes.patch
Patch13: 0013-s390-tools-1.8.1-zipl-fix-unsupported-device.patch
Patch14: 0014-s390-tools-1.8.1-zipl-kdump-man.patch
Patch15: 0015-s390-tools-1.8.1-iucvterm-getlogin-to-getpwuid.patch
Patch16: 0016-s390-tools-1.8.1-dumpconf-improve-error-checking.patch
Patch17: 0017-s390-tools-1.8.1-cpuplugd-memplug.patch
Patch18: 0018-s390-tools-1.8.1-ziomon-new-blkiomon.patch
Patch19: 0019-s390-tools-1.8.1-lsluns-disk-enc.patch
Patch20: 0020-s390-tools-1.8.1-cpuplugd-cmminit.patch
Patch21: 0021-s390-tools-1.8.1-lszfcp-perf.patch
Patch22: 0022-fix-string-overflow-in-vtoc_volume_label_init.patch
Patch1: 0001-s390-tools-1.5.3-zipl-zfcpdump-2.patch
Patch2: 0002-s390-tools-1.8.1-zipl-automenu.patch
Patch3: 0003-s390-tools-1.8.1-fdasd-su.patch
Patch4: 0004-s390-tools-1.8.1-fdasd-raid-lvm.patch
Patch5: 0005-don-t-create-automenu-when-default-menu-exists.patch
Patch6: 0006-s390-tools-1.8.1-zipl-kdump-man.patch
Patch7: 0007-s390-tools-1.8.1-lszfcp-perf.patch
Patch8: 0008-fix-string-overflow-in-vtoc_volume_label_init.patch
Patch9: 0009-change-default-load-address-for-ramdisk.patch
Patch10: 0010-improve-mon_statd-init-script.patch
Patch11: 0011-update-readahead-value-for-better-performance.patch
Patch12: 0012-fix-multipath-device-detection-in-ziomon.patch
Patch13: 0013-zipl-handle-status-during-ipl.patch
Patch14: 0014-dasdview-fdasd-fix-floating-point-error-for-unformat.patch
Patch15: 0015-s390tools-1.8.2-zipl-dm.patch
Patch16: 0016-s390tools-1.8.2-lsreipl-nss.patch
Patch17: 0017-qualified-return-codes-and-further-error-handling-in.patch
Patch18: 0018-fix-uppercase-conversion-in-lscss.patch
Patch19: 0019-ziorep-fix-return-codes.patch
Patch20: 0020-lstape-fix-return-code.patch
Patch21: 0021-cpuplugd-fix-reading-the-size-of-proc-sys-vm-cmm_pag.patch
Patch22: 0022-lsqeth-support-new-attributes.patch
Patch100: cmsfs-1.1.8-warnings.patch
Patch101: cmsfs-1.1.8-kernel26.patch
@ -53,20 +62,20 @@ 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}
Requires: s390utils-cpuplugd = %{epoch}:%{version}-%{release}
Requires: s390utils-mon_statd = %{epoch}:%{version}-%{release}
Requires: s390utils-iucvterm = %{epoch}:%{version}-%{release}
Requires: s390utils-ziomon = %{epoch}:%{version}-%{release}
Requires: s390utils-libzfcphbaapi = %{epoch}:%{version}-%{release}
Requires: s390utils-libzfcphbaapi-devel = %{epoch}:%{version}-%{release}
Requires: s390utils-cmsfs = %{epoch}:%{version}-%{release}
%description
This is a meta package for installing all s390-tools sub packages.
If you do not need all sub packages, it is recommended to install the
This is a meta package for installing the default s390-tools sub packages.
If you do not need all default sub packages, it is recommended to install the
required sub packages separately.
The s390utils packages contain a set of user space utilities that should to
@ -79,54 +88,67 @@ be used together with the zSeries (s390) Linux kernel and device drivers.
%patch1 -p1 -b .common-mak
# Patch to maintain backwards compatibility with older zipl multiboot feature
%patch4 -p1 -b .zipl-automenu
%patch2 -p1 -b .zipl-automenu
# Fix to honor the silent flag for wrongly formated disks
%patch5 -p1 -b .fdasd-su
%patch3 -p1 -b .fdasd-su
# Enhancement to add raid partiton support to dasds
%patch6 -p1 -b .fdasd-raid-lvm
# Post 1.8.1 fixes for ziorep
%patch8 -p1 -b .ziorep
# Allow override of optimization level in CFLAGS
%patch9 -p1 -b .cflags
%patch4 -p1 -b .fdasd-raid-lvm
# Don't build automenu iff default menu exists (#486444)
%patch10 -p1 -b .defaultmenu
# Remove the execuatble stack flag from zipl
%patch11 -p1 -b .execstack
# Post 1.8.1 fixes for ziomon
%patch12 -p1 -b .ziomon
# Post 1.8.1 fix for zipl
%patch13 -p1 -b .zipl-device
%patch5 -p1 -b .defaultmenu
# Update zipl man page
%patch14 -p1 -b .zipl-kdump-man
# Last-minute fixes from IBM
%patch15 -p1 -b .iucvterm-getlogin-to-getpwuid
%patch16 -p1 -b .dumpconf-improve-error-checking
%patch17 -p1 -b .cpuplugd-memplug
# Adapt ziomon to the new layout of the blkiomon_stat structure (#506966)
%patch18 -p1 -b .ziomon-new-blkiomon
# Fix byte check for disk encryption check in lsluns (#510032)
%patch19 -p1 -b .lsluns-disk-enc
# Fix cmm configuration file value initialization parser in cpuplugd (#511379)
%patch20 -p1 -b .cpuplugd-cmminit
%patch6 -p1 -b .zipl-kdump-man
# Check only ZFCP devices in lszfcp (#518669)
%patch21 -p1 -b .lszfcp-perf
%patch7 -p1 -b .lszfcp-perf
# Fix string overflow in vtoc_volume_label_init (#525318)
%patch22 -p1 -b .vtoc-label
%patch8 -p1 -b .vtoc-label
# Change default load address for ramdisk (#526339)
%patch9 -p1 -b .ramdisk-address
# Improve mon_statd init script
%patch10 -p1 -b .improve-mon_statd
# Update readahead value for better performance
%patch11 -p1 -b .readahead
# Fix multipath device detection in ziomon (#533955)
%patch12 -p1 -b .ziomon-multipath
# Handle status during ipl in zipl (#537142)
%patch13 -p1 -b .zipl-status
# Fix floating point error for unformatted devices in fdasd and dasdview (#537144)
%patch14 -p1 -b .dasd-zero-division
# Add device-mapper support into zipl (#546280)
%patch15 -p1 -b .zipl-dm
# Add missing check and print NSS name in case an NSS has been IPLed (#546297)
%patch16 -p1 -b .lsreipl-nss
# Add qualified return codes and further error handling in znetconf (#548487)
%patch17 -p1 -b .znetconf-returncodes
# Fixed uppercase conversion in lscss (#554768)
%patch18 -p1 -b .uppercase
# Fixed return codes in ziorep (#556849)
%patch19 -p1 -b .ziorep-returncodes
# Fixed return code in lstape (#556910)
%patch20 -p1 -b .lstape-returncode
# Fixed reading the size of /proc/sys/vm/cmm_pages in cpuplugd (#556911)
%patch21 -p1 -b .cpuplugd-fscanf
# Support new attributes in lsqeth (#556915)
%patch22 -p1 -b .lsqeth-new-attrs
#
# cmsfs
@ -153,6 +175,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
@ -176,7 +201,7 @@ popd
%build
make OPT_FLAGS="$RPM_OPT_FLAGS" DISTRELEASE=%{release}
make OPT_FLAGS="$RPM_OPT_FLAGS" DISTRELEASE=%{release} V=1
pushd cmsfs-%{cmsfsver}
./configure
@ -188,7 +213,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
@ -196,25 +221,27 @@ popd
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p $RPM_BUILD_ROOT{%{_lib},%{_libdir},/sbin,/bin,/boot,%{_mandir}/man1,%{_mandir}/man8,%{_sbindir},%{_bindir},%{_sysconfdir}/{profile.d,udev/rules.d,rc.d/init.d,sysconfig}}
mkdir -p $RPM_BUILD_ROOT{%{_lib},%{_libdir},/sbin,/bin,/boot,%{_mandir}/man1,%{_mandir}/man8,%{_sbindir},%{_bindir},%{_sysconfdir}/{profile.d,udev/rules.d,sysconfig},%{_initddir}}
# workaround an issue in the zipl-device-mapper patch
rm -f zipl/src/zipl_helper.device-mapper.*
make install \
INSTROOT=$RPM_BUILD_ROOT \
MANDIR=$RPM_BUILD_ROOT%{_mandir} \
LIBDIR=${RPM_BUILD_ROOT}/%{_lib} \
DISTRELEASE=%{release}
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
mkdir -p ${RPM_BUILD_ROOT}%{_initddir}
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d
mkdir -p ${RPM_BUILD_ROOT}/sbin
DISTRELEASE=%{release} \
V=1
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 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/56-dasd.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
@ -225,7 +252,7 @@ install -p -m 755 etc/init.d/mon_statd ${RPM_BUILD_ROOT}%{_initddir}/mon_statd
install -p -m 644 etc/sysconfig/cpuplugd ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
install -p -m 755 etc/init.d/cpuplugd ${RPM_BUILD_ROOT}%{_initddir}/cpuplugd
install -Dp -m 644 etc/udev/rules.d/57-osasnmpd.rules ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d
install -Dp -m 644 etc/udev/rules.d/*.rules ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d
# cmsfs tools must be available in /sbin
install -p -m 755 cmsfs-%{cmsfsver}/cmsfscat $RPM_BUILD_ROOT/sbin
@ -244,16 +271,31 @@ 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
# device_cio_free
install -p -m 755 %{SOURCE14} ${RPM_BUILD_ROOT}/sbin
pushd ${RPM_BUILD_ROOT}/sbin
for lnk in dasd zfcp znet; do
ln -sf device_cio_free ${lnk}_cio_free
done
popd
%clean
rm -rf ${RPM_BUILD_ROOT}
@ -364,19 +406,23 @@ s390 base tools. This collection provides the following utilities:
* zconf:
Set of scripts to configure and list status information of Linux for
zSeries IO devices.
- chccwdev: Modify generic attributes of channel attached devices.
- lscss: List channel subsystem devices.
- lsdasd: List channel attached direct access storage devices (DASD).
- lsqeth: List all qeth-based network devices with their corresponding
settings.
- lstape: List tape devices, both channel and FCP attached.
- lszfcp: Shows information contained in sysfs about zfcp adapters,
ports and units that are online.
- lschp: List information about available channel-paths.
- chchp: Modify channel-path state.
- lsluns: List available SCSI LUNs depending on adapter or port.
- lszcrypt: Show Information about zcrypt devices and configuration.
- chzcrypt: Modify zcrypt configuration.
- chccwdev: Modify generic attributes of channel attached devices.
- lscss: List channel subsystem devices.
- lsdasd: List channel attached direct access storage devices (DASD).
- lsqeth: List all qeth-based network devices with their corresponding
settings.
- lstape: List tape devices, both channel and FCP attached.
- lszfcp: Shows information contained in sysfs about zfcp adapters,
ports and units that are online.
- lschp: List information about available channel-paths.
- chchp: Modify channel-path state.
- lsluns: List available SCSI LUNs depending on adapter or port.
- lszcrypt: Show Information about zcrypt devices and configuration.
- chzcrypt: Modify zcrypt configuration.
- znetconf: List and configure network devices for System z network
adapters.
- cio_ignore: Query and modify the contents of the CIO device driver
blacklist.
* dumpconf:
Allows to configure the dump device used for system dump in case a kernel
@ -393,18 +439,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
:
@ -412,7 +465,6 @@ fi
%defattr(-,root,root,-)
%doc README
%doc LICENSE
/sbin/vmur
/sbin/zipl
/sbin/dasdfmt
/sbin/dasdinfo
@ -421,6 +473,7 @@ fi
/sbin/chccwdev
/sbin/chchp
/sbin/chzcrypt
/sbin/cio_ignore
/sbin/lschp
/sbin/lscss
/sbin/lsdasd
@ -438,6 +491,7 @@ fi
/sbin/tunedasd
/sbin/vmcp
/sbin/zgetdump
/sbin/znetconf
/sbin/dbginfo.sh
%{_sbindir}/lsreipl
%{_sbindir}/lsshut
@ -445,10 +499,12 @@ fi
%{_sbindir}/chshut
%{_sbindir}/ip_watcher.pl
%{_sbindir}/start_hsnc.sh
%{_sbindir}/vmur
%{_sbindir}/xcec-bridge
%{_bindir}/vmconvert
%{_initddir}/dumpconf
%config(noreplace) %{_sysconfdir}/sysconfig/dumpconf
/lib/s390-tools
%{_mandir}/man1/zfcpdbf.1*
%{_mandir}/man4/prandom.4*
%{_mandir}/man5/zipl.conf.5*
@ -457,6 +513,7 @@ fi
%{_mandir}/man8/chreipl.8*
%{_mandir}/man8/chshut.8*
%{_mandir}/man8/chzcrypt.8*
%{_mandir}/man8/cio_ignore.8*
%{_mandir}/man8/dasdfmt.8*
%{_mandir}/man8/dasdinfo.8*
%{_mandir}/man8/dasdview.8*
@ -481,20 +538,32 @@ fi
%{_mandir}/man8/vmcp.8*
%{_mandir}/man8/vmur.8*
%{_mandir}/man8/zgetdump.8*
%{_mandir}/man8/znetconf.8*
%{_mandir}/man8/zipl.8*
# Additional Redhat specific stuff
/boot/tape0
%{_sysconfdir}/profile.d/s390.csh
%{_sysconfdir}/profile.d/s390.sh
%config(noreplace) %{_sysconfdir}/udev/rules.d/56-dasd.rules
%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
%{_initddir}/cpi
%config(noreplace) %{_sysconfdir}/sysconfig/cpi
/sbin/dasdconf.sh
/sbin/zfcpconf.sh
/sbin/dasd_cio_free
/sbin/device_cio_free
/sbin/zfcp_cio_free
/sbin/znet_cio_free
# 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 ***********************
@ -604,18 +673,18 @@ Group: Applications/System
Requires: perl lsscsi coreutils blktrace >= 1.0.1
%description ziomon
Tool set to collect data for zfcp performance analysis.
Tool set to collect data for zfcp performance analysis and report.
%files ziomon
%defattr(-,root,root,-)
/sbin/ziomon
/sbin/ziomon_fcpconf
/sbin/ziomon_mgr
/sbin/ziomon_util
/sbin/ziomon_zfcpdd
/sbin/ziorep_config
/sbin/ziorep_traffic
/sbin/ziorep_utilization
%{_sbindir}/ziomon
%{_sbindir}/ziomon_fcpconf
%{_sbindir}/ziomon_mgr
%{_sbindir}/ziomon_util
%{_sbindir}/ziomon_zfcpdd
%{_sbindir}/ziorep_config
%{_sbindir}/ziorep_traffic
%{_sbindir}/ziorep_utilization
%{_mandir}/man8/ziomon.8*
%{_mandir}/man8/ziomon_fcpconf.8*
%{_mandir}/man8/ziomon_mgr.8*
@ -635,7 +704,14 @@ Group: Applications/System
BuildRequires: gettext
%description iucvterm
z/VM IUCV terminal applications.
A set of applications to provide terminal access via the z/VM Inter-User
Communication Vehicle (IUCV). The terminal access does not require an
active TCP/IP connection between two Linux guest operating systems.
- iucvconn: Application to establish a terminal connection via z/VM IUCV.
- iucvtty: Application to provide terminal access via z/VM IUCV.
- ts-shell: Terminal server shell to authorize and control IUCV terminal
connections for individual Linux users.
%pre iucvterm
# check for ts-shell group and create it
@ -687,16 +763,14 @@ URL: http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html
BuildRequires: automake autoconf
BuildRequires: doxygen libsysfs-devel
BuildRequires: sg3_utils-devel
Requires: libhbaapi
Obsoletes: %{name}-libzfcphbaapi-devel < 2:1.8.2-4
%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
@ -704,34 +778,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 ***********************
@ -776,6 +846,59 @@ User-space development files for the s390/s390x architecture.
%changelog
* Wed Jan 20 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-10
- fixed return codes in ziorep (#556849)
- fixed return code in lstape (#556910)
- fixed reading the size of /proc/sys/vm/cmm_pages in cpuplugd (#556911)
- support new attributes in lsqeth (#556915)
* Wed Jan 13 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-9
- updated device_cio_free script (#533494)
- fixed uppercase conversion in lscss (#554768)
* Fri Jan 8 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-8
- updated device_cio_free script (#533494)
* Fri Jan 8 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-7
- updated device_cio_free script (#533494)
* Tue Dec 22 2009 Dan Horák <dan[at]danny.cz> 2:1.8.2-6
- fixed return value in cpi initscript (#541389)
- updated zfcpconf.sh script from dracut
- added device-mapper support into zipl (#546280)
- added missing check and print NSS name in case an NSS has been IPLed (#546297)
- added device_cio_free script and its symlinks (#533494)
- added qualified return codes and further error handling in znetconf (#548487)
* Fri Nov 13 2009 Dan Horák <dan[at]danny.cz> 2:1.8.2-5
- added multiple fixes from IBM (#533955, #537142, #537144)
* 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)
* 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
* Thu Oct 8 2009 Dan Horák <dan[at]danny.cz> 2:1.8.2-1
- added patch for improving mon_statd behaviour
- rebased to 1.8.2
* Fri Oct 2 2009 Dan Horák <dan[at]danny.cz> 2:1.8.1-8
- really changed ramdisk load address (#526339)
- change the required and optional subpackages for the meta package
* Wed Sep 30 2009 Dan Horák <dan[at]danny.cz> 2:1.8.1-7
- changed ramdisk load address (#526339)
- updated zfcpconf.sh script to new sysfs interface (#526324)
- added 1.8.1 fixes from IBM (#525495)
* Fri Sep 25 2009 Dan Horák <dan[at]danny.cz> 2:1.8.1-6
- fix issues in lib-zfcp-hbaapi with a patch

View File

@ -1,4 +1,4 @@
6a94c4655204a4ec7a2c64f42c9afed3 s390-tools-1.8.1.tar.bz2
856ecdd42ad358433eb3fcc886b58a89 s390-tools-1.8.2.tar.bz2
71a8ee5918f2c44c385fcfe8350cdc98 cmsfs-1.1.8c.tar.gz
2cbfffca3f07c61420899f45d221d451 lib-zfcp-hbaapi-2.0.tar.gz
ba42772e5b305b5e147344442cd70826 src_vipa-2.0.4.tar.gz

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# config file syntax:
# deviceno WWPN FCPLUN
@ -10,37 +10,46 @@
#
# manual setup:
# modprobe zfcp
# echo WWPN > /sys/bus/ccw/drivers/zfcp/0.0.4000/port_add
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
#
# Example:
# modprobe zfcp
# echo 0x5005076300c213e9 > /sys/bus/ccw/drivers/zfcp/0.0.4000/port_add
# echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
# echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add
CONFIG=/etc/zfcp.conf
PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [ -f "$CONFIG" ]; then
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
modprobe zfcp
fi
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
return
fi
cat $CONFIG | grep -v "^#" | tr "A-Z" "a-z" | while read line; do
numparams=$(echo $line | wc -w)
if [ $numparams == 5 ]; then
read DEVICE SCSIID WWPN SCSILUN FCPLUN < <(echo $line)
echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN"
elif [ $numparams == 3 ]; then
read DEVICE WWPN FCPLUN < <(echo $line)
fi
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN ] && echo $WWPN > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/port_add
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/$FCPLUN ] && echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/unit_add
echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/online
tr "A-Z" "a-z" < $CONFIG| while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
set $line
if [ $# -eq 5 ]; then
DEVICE=$1
SCSIID=$2
WWPN=$3
SCSILUN=$4
FCPLUN=$5
echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN"
elif [ $# -eq 3 ]; then
DEVICE=${1##*0x}
WWPN=$2
FCPLUN=$3
fi
echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
;;
esac
done
fi