rpms/s390utils/devel 0001-s390-tools-1.8.1-common-mak.patch, NONE, 1.1 0004-s390-tools-1.8.1-zipl-automenu.patch, NONE, 1.1 0005-s390-tools-1.8.1-fdasd-su.patch, NONE, 1.1 0006-s390-tools-1.8.1-fdasd-raid-lvm.patch, NONE, 1.1 0008-s390-tools-1.8.1-ziorep-fixes.patch, NONE, 1.1 0009-s390-tools-1.8.1-cflags.patch, NONE, 1.1 0010-s390-tools-1.8.1-defaultmenu.patch, NONE, 1.1 0011-s390-tools-1.8.1-execstack.patch, NONE, 1.1 0012-s390-tools-1.8.1-ziomon-fixes.patch, NONE, 1.1 0013-s390-tools-1.8.1-zipl-fix-unsupported-device.patch, NONE, 1.1 0014-s390-tools-1.8.1-zipl-kdump-man.patch, NONE, 1.1 0015-s390-tools-1.8.1-iucvterm-getlogin-to-getpwuid.patch, NONE, 1.1 0016-s390-tools-1.8.1-dumpconf-improve-error-checking.patch, NONE, 1.1 0017-s390-tools-1.8.1-cpuplugd-memplug.patch, NONE, 1.1 0018-s390-tools-1.8.1-ziomon-new-blkiomon.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 s390.csh, 1.1, 1.2 s390.sh, 1.1, 1.2 s390utils.spec, 1.1, 1.2 sources, 1.2, 1.3 src_vipa-2.0.4-locations.patch, 1.1, 1.2 0001-s390-tools-1.5.0-su.patch, 1.1, NONE 0002-s390-tools-1.5.0-fdasd-raid.patch, 1.1, NONE 0003-s390-tools-1.5.0-fmtpercentage.patch, 1.1, NONE 0004-s390-tools-1.8.0-automenu.patch, 1.1, NONE 0005-s390-tools-1.5.3-lvm.patch, 1.1, NONE 0006-s390-tools-1.5.3-dumpconf-vmlinuz.patch, 1.1, NONE 0007-s390-tools-1.5.3-zipl-zfcpdump-2.patch, 1.1, NONE 0008-s390-tools-1.8.0-zipl-timeout.patch, 1.1, NONE 0009-s390-tools-1.8.0-zipl-target.patch, 1.1, NONE 0010-s390-tools-1.5.3-zipl-zfcpdump-man.patch, 1.1, NONE 0011-s390-tools-1.5.3-fdasd-raid.patch, 1.1, NONE 0012-s390-tools-1.8.0-initscript-fix.patch, 1.1, NONE 0013-s390-tools-1.8.0-cflags.patch, 1.1, NONE

Dan Horák sharkcz at fedoraproject.org
Fri Jul 3 09:23:00 UTC 2009


Author: sharkcz

Update of /cvs/pkgs/rpms/s390utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8588

Modified Files:
	.cvsignore s390.csh s390.sh s390utils.spec sources 
	src_vipa-2.0.4-locations.patch 
Added Files:
	0001-s390-tools-1.8.1-common-mak.patch 
	0004-s390-tools-1.8.1-zipl-automenu.patch 
	0005-s390-tools-1.8.1-fdasd-su.patch 
	0006-s390-tools-1.8.1-fdasd-raid-lvm.patch 
	0008-s390-tools-1.8.1-ziorep-fixes.patch 
	0009-s390-tools-1.8.1-cflags.patch 
	0010-s390-tools-1.8.1-defaultmenu.patch 
	0011-s390-tools-1.8.1-execstack.patch 
	0012-s390-tools-1.8.1-ziomon-fixes.patch 
	0013-s390-tools-1.8.1-zipl-fix-unsupported-device.patch 
	0014-s390-tools-1.8.1-zipl-kdump-man.patch 
	0015-s390-tools-1.8.1-iucvterm-getlogin-to-getpwuid.patch 
	0016-s390-tools-1.8.1-dumpconf-improve-error-checking.patch 
	0017-s390-tools-1.8.1-cpuplugd-memplug.patch 
	0018-s390-tools-1.8.1-ziomon-new-blkiomon.patch 
Removed Files:
	0001-s390-tools-1.5.0-su.patch 
	0002-s390-tools-1.5.0-fdasd-raid.patch 
	0003-s390-tools-1.5.0-fmtpercentage.patch 
	0004-s390-tools-1.8.0-automenu.patch 
	0005-s390-tools-1.5.3-lvm.patch 
	0006-s390-tools-1.5.3-dumpconf-vmlinuz.patch 
	0007-s390-tools-1.5.3-zipl-zfcpdump-2.patch 
	0008-s390-tools-1.8.0-zipl-timeout.patch 
	0009-s390-tools-1.8.0-zipl-target.patch 
	0010-s390-tools-1.5.3-zipl-zfcpdump-man.patch 
	0011-s390-tools-1.5.3-fdasd-raid.patch 
	0012-s390-tools-1.8.0-initscript-fix.patch 
	0013-s390-tools-1.8.0-cflags.patch 
Log Message:
* Mon Jun 29 2009 Dan Horák <dan[at]danny.cz> 2:1.8.1-1
- update to 1.8.1
- drop upstreamed patches
- create iucvterm subpackage
- update src_vipa locations patch
- install cmsfs tools into /sbin
- add post 1.8.1 fixes from IBM


0001-s390-tools-1.8.1-common-mak.patch:

--- NEW FILE 0001-s390-tools-1.8.1-common-mak.patch ---
>From 1536e0140cbce3c8837478cfc25ea45dc3681cce Mon Sep 17 00:00:00 2001
From: Dan Horak <dan at danny.cz>
Date: Sun, 20 Jul 2008 09:24:05 +0200
Subject: [PATCH] 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
--- a/common.mak
+++ b/common.mak
@@ -38,8 +38,8 @@ GROUP		= $(shell id -gn)
 export INSTROOT BINDIR LIBDIR MANDIR OWNER GROUP
 
 # Special defines for zfcpdump
-ZFCPDUMP_DIR    = /usr/local/share/zfcpdump
-ZFCPDUMP_IMAGE  = zfcpdump.image
+ZFCPDUMP_DIR    = /boot
+ZFCPDUMP_IMAGE  = zfcpdump
 ZFCPDUMP_RD     = zfcpdump.rd
 export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
 endif
-- 
1.6.0.6


0004-s390-tools-1.8.1-zipl-automenu.patch:

--- NEW FILE 0004-s390-tools-1.8.1-zipl-automenu.patch ---
>From 1648e0dab246190c170e82244c790ef8e9144e40 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
Date: Thu, 23 Apr 2009 11:45:36 +0200
Subject: [PATCH] s390-tools-1.8.1-zipl-automenu

---
 zipl/man/zipl.8 |    7 ++
 zipl/src/job.c  |  194 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 zipl/src/scan.c |    4 +-
 zipl/src/zipl.c |    1 +
 4 files changed, 197 insertions(+), 9 deletions(-)

diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8
index 8a83c01..6ebf240 100644
--- a/zipl/man/zipl.8
+++ b/zipl/man/zipl.8
@@ -249,6 +249,13 @@ whether they contain a dump signature or not.
 This option can only be used together with
 .BR \-\-mvdump .
 
+.TP
+.BR "\-x" " or " "\-\-no-automenu"
+Disables the automatic creation of a multiboot menu. Specifying a menu with the
+"-m <MENU>" option or a section disables this feature, too. This option was
+added for compatibility with previous versions of the multiboot version of
+zipl.
+
 .SH EXAMPLE
 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
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -43,6 +43,7 @@ static struct option options[] = {
 	{ "version",		no_argument,		NULL, 'v'},
 	{ "verbose",		no_argument,		NULL, 'V'},
 	{ "add-files",		no_argument,		NULL, 'a'},
+	{ "no-automenu",        no_argument,            NULL, 'x'},
 	{ "tape",		required_argument,	NULL, 'T'},
 	{ "dry-run",		no_argument,		NULL, '0'},
 	{ "force",		no_argument,		NULL, 'f'},
@@ -50,7 +51,7 @@ static struct option options[] = {
 };
 
 /* Command line option abbreviations */
-static const char option_string[] = "-c:t:i:r:p:P:d:D:M:s:m:hHnVvaT:f";
+static const char option_string[] = "-c:t:i:r:p:P:d:D:M:s:m:hHnVvaxT:f";
 
 struct command_line {
 	char* data[SCAN_KEYWORD_NUM];
@@ -62,11 +63,14 @@ struct command_line {
 	int version;
 	int verbose;
 	int add_files;
+	int automenu;
 	int dry_run;
 	int force;
 	enum scan_section_type type;
 };
 
+/* Global variable for default boot target. Ugly but necessary... */
+static char *default_target;
 
 static int
 store_option(struct command_line* cmdline, enum scan_keyword_id keyword,
@@ -92,6 +96,7 @@ get_command_line(int argc, char* argv[], struct command_line* line)
 	int i;
 
 	memset((void *) &cmdline, 0, sizeof(struct command_line));
+	cmdline.automenu = 1;
 	cmdline.type = section_invalid;
 	is_keyword = 0;
 	/* Process options */
@@ -101,16 +106,22 @@ get_command_line(int argc, char* argv[], struct command_line* line)
 		switch (opt) {
 		case 'd':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_dumpto,
 					  optarg);
 			break;
 		case 'D':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_dumptofs,
 					  optarg);
 			break;
 		case 'M':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_mvdump,
 					  optarg);
 #ifndef __s390x__
@@ -121,35 +132,49 @@ get_command_line(int argc, char* argv[], struct command_line* line)
 			break;
 		case 'i':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_image,
 					  optarg);
 			break;
 		case 'P':
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_parameters,
 					  optarg);
 			break;
 		case 'p':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_parmfile,
 					  optarg);
 			break;
 		case 'r':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_ramdisk,
 					  optarg);
 			break;
 		case 's':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_segment,
 					  optarg);
 			break;
 		case 't':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_target,
 					  optarg);
 			break;
 		case 'T':
 			is_keyword = 1;
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
 			rc = store_option(&cmdline, scan_keyword_tape,
 					  optarg);
 			break;
@@ -190,6 +215,10 @@ get_command_line(int argc, char* argv[], struct command_line* line)
 		case 'f':
 			cmdline.force = 1;
 			break;
+		case 'x':
+			cmdline.automenu = 0;
+			scan_key_table[1][8] = req;
+			break;
 		case 1:
 			/* Non-option is interpreted as section name */
 			if (cmdline.section != NULL) {
@@ -214,6 +243,9 @@ get_command_line(int argc, char* argv[], struct command_line* line)
 	if (cmdline.help || cmdline.version) {
 		/* Always accept --help and --version */
 	} else if ((cmdline.menu != NULL) || (cmdline.section != NULL)) {
+		/* If either menu or section has been selected disable
+		   automenu generation */
+		cmdline.automenu = 0;
 		/* Config file mode */
 		if ((cmdline.menu != NULL) && (cmdline.section != NULL)) {
 			error_reason("Option 'menu' cannot be used when "
@@ -832,7 +864,14 @@ get_job_from_section_data(char* data[], struct job_data* job, char* section)
 		/* IPL job */
 		job->id = job_ipl;
 		/* Fill in name of bootmap directory */
-		job->bootmap_dir = misc_strdup(data[(int) scan_keyword_target]);
+		if (data[(int) scan_keyword_target] == NULL) {
+			if (default_target == NULL) {
+				error_text("Unable to find default section in your config file.");
+				break;
+			}
+			job->bootmap_dir = misc_strdup(default_target);
+		} else
+			job->bootmap_dir = misc_strdup(data[(int) scan_keyword_target]);
 		if (job->bootmap_dir == NULL)
 			return -1;
 		/* Fill in name and address of image file */
@@ -1102,6 +1141,8 @@ get_menu_job(struct scan_token* scan, char* menu, struct job_data* job)
 		if (temp_job == NULL)
 			return -1;
 		memset((void *) temp_job, 0, sizeof(struct job_data));
+		if (data[(int) scan_keyword_target] == NULL)
+			data[(int) scan_keyword_target] = misc_strdup(job->bootmap_dir);
 		rc = get_job_from_section_data(data, temp_job,
 					job->data.menu.entry[current].name);
 		if (rc) {
@@ -1150,6 +1191,7 @@ get_default_section(struct scan_token* scan, char** section, int* is_menu)
 	i = scan_find_section(scan, DEFAULTBOOT_SECTION,
 			      scan_id_section_heading, 0);
 	if (i<0) {
+		*section = NULL;
 		error_reason("No '" DEFAULTBOOT_SECTION "' section found and "
 			     "no section specified on command line");
 		return -1;
@@ -1169,6 +1211,7 @@ get_default_section(struct scan_token* scan, char** section, int* is_menu)
 		}
 	}
 	/* Should not happen */
+	*section = NULL;
 	error_reason("No default section specified");
 	return -1;
 }
@@ -1184,19 +1227,35 @@ get_section_job(struct scan_token* scan, char* section, struct job_data* job,
 {
 	char* data[SCAN_KEYWORD_NUM];
 	char* buffer;
+	char* default_section;
 	int rc;
 	int i;
 
+	rc = get_default_section(scan, &default_section, &i);
+	if (rc)
+		return rc;
 	if (section == NULL) {
-		rc = get_default_section(scan, &section, &i);
-		if (rc)
-			return rc;
+		section = default_section;
 		if (i) {
 			/* 'defaultmenu' was specified */
 			rc = get_menu_job(scan, section, job);
 			return rc;
 		}
 	}
+	else
+	{
+		char* name = NULL;
+
+		for (i = 0; (int) scan[i].id != 0; i++) {
+			if (scan[i].id == scan_id_section_heading) {
+				name = scan[i].content.section.name;
+			}
+			if (scan[i].id == scan_id_keyword_assignment &&
+			    scan[i].content.keyword.keyword == scan_keyword_target &&
+			    !strcmp(DEFAULTBOOT_SECTION, name))
+				default_target = misc_strdup(scan[i].content.keyword.value);
+		}
+	}
 	if (strcmp(section, DEFAULTBOOT_SECTION) == 0) {
 		error_reason("Special section '" DEFAULTBOOT_SECTION "' cannot "
 			     "be used as target section");
@@ -1268,10 +1327,118 @@ get_section_job(struct scan_token* scan, char* section, struct job_data* job,
 }
 
 
+/* Create a fake menu to simulate the old s390utils-1.1.7 multiboot
+ * behaviour. */
+static struct scan_token *
+create_fake_menu(struct scan_token *scan)
+{
+	int i, j, pos, numsec, size, defaultpos;
+	char *name;
+	char *target;
+	char *timeout;
+	char *seclist[1024];
+	char *defaultsection;
+	char buf[1024];
+	struct scan_token *tmp;
+
+	/* Count # of sections */
+	numsec = 0;
+	name = NULL;
+	target = NULL;
+	timeout = NULL;
+	for (i = 0; (int) scan[i].id != 0; i++) {
+		if (scan[i].id == scan_id_section_heading) {
+			name = scan[i].content.section.name;
+			if (strcmp(DEFAULTBOOT_SECTION, name))
+				seclist[numsec++] = name;
+		}
+		if (scan[i].id == scan_id_keyword_assignment &&
+		    (scan[i].content.keyword.keyword == scan_keyword_dumpto ||
+		     scan[i].content.keyword.keyword == scan_keyword_dumptofs)) {
+			numsec--;
+			continue;
+		}
+		if (scan[i].id == scan_id_keyword_assignment &&
+		    scan[i].content.keyword.keyword == scan_keyword_target &&
+		    !strcmp(DEFAULTBOOT_SECTION, name))
+			target = scan[i].content.keyword.value;
+
+		if (scan[i].id == scan_id_keyword_assignment &&
+		    scan[i].content.keyword.keyword == scan_keyword_timeout)
+			timeout = scan[i].content.keyword.value;
+	}
+	get_default_section(scan, &defaultsection, &j);
+
+	if (defaultsection == NULL) {
+		error_text("Unable to find default section in your config file.");
+		return NULL;
+	}
+
+	if (target == NULL) {
+		error_text("Keyword target is missing in default section.");
+		return NULL;
+	}
+
+	default_target = misc_strdup(target);
+
+	size = i+6+numsec;
+	tmp = (struct scan_token *) misc_malloc(size * sizeof(struct scan_token));
+	if (tmp == NULL) {
+		error_text("Couldn't allocate memory for menu entries");
+		return NULL;
+	}
+
+	memset(tmp, 0, size * sizeof(struct scan_token));
+	memcpy(tmp, scan, i * sizeof(struct scan_token));
+	free(scan);
+	scan = tmp;
+
+	defaultpos = 0;
+	for (j = 0; j < numsec; j++) {
+		if (!strcmp(defaultsection, seclist[j]))
+			defaultpos = j+1;
+	}
+
+	snprintf(buf, 1024, "%d", defaultpos);
+
+	scan[i].id = scan_id_menu_heading;
+	scan[i].line = i;
+	scan[i++].content.menu.name = misc_strdup("rh-automatic-menu");
+	scan[i].id = scan_id_keyword_assignment;
+	scan[i].line = i;
+	scan[i].content.keyword.keyword = scan_keyword_target;
+	scan[i++].content.keyword.value = misc_strdup(target);
+	scan[i].id = scan_id_keyword_assignment;
+	scan[i].line = i;
+	scan[i].content.keyword.keyword = scan_keyword_default;
+	scan[i++].content.keyword.value = misc_strdup(buf);
+	scan[i].id = scan_id_keyword_assignment;
+	scan[i].line = i;
+	scan[i].content.keyword.keyword = scan_keyword_prompt;
+	scan[i++].content.keyword.value = misc_strdup("1");
+	scan[i].id = scan_id_keyword_assignment;
+	scan[i].line = i;
+	scan[i].content.keyword.keyword = scan_keyword_timeout;
+	if (timeout)
+		scan[i++].content.keyword.value = misc_strdup(timeout);
+	else
+		scan[i++].content.keyword.value = misc_strdup("15");
+
+	pos = i;
+	for (i = 0; i<numsec; i++) {
+		scan[pos].id = scan_id_number_assignment;
+		scan[pos].line = pos;
+		scan[pos].content.number.number = i+1;
+		scan[pos++].content.number.value = misc_strdup(seclist[i]);
+	}
+
+	return scan;
+}
+
 static int
 get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
 {
-	struct scan_token* scan;
+	struct scan_token* scan, *nscan;
 	char* filename;
 	char* source;
 	int rc;
@@ -1303,9 +1470,22 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
 		scan_free(scan);
 		return rc;
 	}
+
+	if (cmdline->automenu) {
+		nscan = create_fake_menu(scan);
+		if (nscan == NULL) {
+			scan_free(scan);
+			return -1;
+		}
+		scan = nscan;
+	}
+
 	/* Get job from config file data */
-	if (cmdline->menu != NULL)
+	if (cmdline->menu != NULL || cmdline->automenu) {
+		if (cmdline->automenu)
+			cmdline->menu = misc_strdup("rh-automatic-menu");
 		rc = get_menu_job(scan, cmdline->menu, job);
+	}
 	else {
 		rc = get_section_job(scan, cmdline->section, job,
 				cmdline->data[(int) scan_keyword_parameters]);
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
index 9948092..caca3cf 100644
--- a/zipl/src/scan.c
+++ b/zipl/src/scan.c
@@ -33,9 +33,9 @@ enum scan_key_state scan_key_table[SCAN_SECTION_NUM][SCAN_KEYWORD_NUM] = {
  *			     rs                                 enu
  */
 /* defaultboot	*/
-	{opt, inv, inv, inv, inv, inv, inv, inv, inv, inv, inv, opt, inv, inv},
+	{opt, inv, inv, inv, inv, inv, inv, inv, req, inv, opt, opt, inv, inv},
 /* ipl		*/
-	{inv, inv, inv, req, opt, opt, opt, inv, req, inv, inv, inv, inv, inv},
+	{inv, inv, inv, req, opt, opt, opt, inv, opt, inv, inv, inv, inv, inv},
 /* segment load */
 	{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
--- a/zipl/src/zipl.c
+++ b/zipl/src/zipl.c
@@ -71,6 +71,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",
+"-x, --no-automenu               Don't autogenerate multiboot menu",
 "    --dry-run                   Simulate run but don't modify IPL records"
 };
 
-- 
1.6.0.6


0005-s390-tools-1.8.1-fdasd-su.patch:

--- NEW FILE 0005-s390-tools-1.8.1-fdasd-su.patch ---
>From 0ac6c456898d8c09908a35add45d018eb8f76613 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
Date: Thu, 23 Apr 2009 11:46:01 +0200
Subject: [PATCH] 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
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -2005,10 +2005,12 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
 	if (anc->verbose) printf("disk type check     : ok\n");
 
         if (dasd_info.FBA_layout != 0) {
-                snprintf(err_str, ERROR_STRING_SIZE, 
-			"%s is not formatted with z/OS compatible "
-			"disk layout!", options.device);
-                fdasd_error(anc, wrong_disk_format, err_str);
+                if(!anc->silent) {
+                    snprintf(err_str, ERROR_STRING_SIZE,
+			    "%s is not formatted with z/OS compatible "
+			    "disk layout!", options.device);
+                    fdasd_error(anc, wrong_disk_format, err_str);
+                }
         }      
 
 	if (anc->verbose) printf("disk layout check   : ok\n");
-- 
1.6.0.6


0006-s390-tools-1.8.1-fdasd-raid-lvm.patch:

--- NEW FILE 0006-s390-tools-1.8.1-fdasd-raid-lvm.patch ---
>From 9c34968b40aa5fee679abf0056255510333ae9c3 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
Date: Thu, 23 Apr 2009 11:46:16 +0200
Subject: [PATCH] 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
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -258,10 +258,10 @@ fdasd_error(fdasd_anchor_t *anc, enum fdasd_failure why, char *str)
 static int
 read_line(void) 
 {
-	bzero(line_buffer, LINE_LENGTH);
 	line_ptr = line_buffer;
         if (!fgets(line_buffer, LINE_LENGTH, stdin))
 		return 0;
+	line_buffer[LINE_LENGTH-1] = 0;
 	while (*line_ptr && !isgraph(*line_ptr))
 		line_ptr++;
 	return *line_ptr;
@@ -310,6 +310,10 @@ fdasd_partition_type (char *str)
 		strcpy(str, "Linux native");
 	else if (strncmp("SWAP  ", str, 6) == 0)
 		strcpy(str, "Linux swap");
+	else if (strncmp("RAID  ", str, 6) == 0)
+		strcpy(str, "Linux Raid");
+	else if (strncmp("LVM   ", str, 6) == 0)
+		strcpy(str, "Linux LVM");
 	else
 		strcpy(str, "unknown");
 
@@ -1117,14 +1121,24 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
 			strncpy(c1, s2, 31);
 		}
 		else {
+			char str[20];
 			char *tmp = strstr(ch, "SWAP");
+			char *tmp1 = strstr(ch, "RAID");
 
 			/* create a new data set name */
 			while (getpos(anc, k) > -1)
 				k++;
 
 			setpos(anc, k, i-1);
-			
+
+			strncpy(s2, ch, 44);
+			s2[44]=0;
+			vtoc_ebcdic_dec(s2, s2, 44);
+			c2 = strstr(s2, "PART");
+			if (c2 != NULL) strncpy(str, c2+=9, 6);
+			str[6] = '\0';
+			fdasd_partition_type(str);
+
 			strncpy(ch, "LINUX.V               "
 				"                      ", 44);
 
@@ -1140,10 +1154,21 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
 			strncpy(c1, dsno, 4);
 
 			c1 += 4;
-			if (tmp)
-				strncpy(c1, ".SWAP", 5);
-			else
-				strncpy(c1, ".NATIVE", 7);
+			if (tmp || tmp1) {
+				if (tmp)
+					strncpy(c1, ".SWAP", 5);
+				if (tmp1)
+					strncpy(c1, ".RAID", 5);
+			} else {
+				if (strcmp("unknown", str) == 0) {
+					strncpy(c1, ".NATIVE", 7);
+				}
+				else {
+					strncpy(c1, ".", 1);
+					strncpy(c1+1, c2, 6);
+				}
+			}
+
 		}
 		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)
 
 	printf("current partition type is: %s\n\n", fdasd_partition_type(str));
 	printf("   1  Linux native\n" \
-	       "   2  Linux swap\n\n");
+	       "   2  Linux swap\n" \
+	       "   3  Linux raid\n\n");
 	part_type = 0;
-	while ((part_type < 1) || (part_type > 2)) {
+	while ((part_type < 1) || (part_type > 3)) {
         	while (!isdigit(part_type = 
 				read_char("new partition type: ")));
         	part_type -= 48;
@@ -1444,6 +1470,9 @@ fdasd_change_part_type (fdasd_anchor_t *anc)
         case 2:
 		strncpy(str, "SWAP  ", 6);
                 break;
+        case 3:
+		strncpy(str, "RAID  ", 6);
+                break;
         default:
                 printf("'%d' is not supported!\n", part_type);
         }
@@ -1621,7 +1650,7 @@ fdasd_process_invalid_vtoc(fdasd_anchor_t *anc)
 static void
 fdasd_process_valid_vtoc(fdasd_anchor_t *anc, unsigned long blk)
 {
-	int f1_counter = 0, f7_counter = 0, f5_counter = 0;
+	int f1_counter = 0, f7_counter = 0, f5_counter = 0, oldfmt = 0;
 	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)
 			vtoc_ebcdic_enc(part_info->f1->DS1DSNAM,
 					part_info->f1->DS1DSNAM, 44);
 
-			if ((part_no < 0) || (part_no >= USABLE_PARTITIONS))
+			/* this dasd has data set names 0000-0002
+                           but we use now 0001-0003 */
+                        if (part_no == -1)
+                                oldfmt++;
+
+			if (((oldfmt == 0) && (part_no < 0))
+			    || (part_no >= USABLE_PARTITIONS))
 				printf("WARNING: partition number (%i) found "
 				       "in data set name of an existing "
 				       "partition\ndoes not match range of "
 				       "possible partition numbers (1-%d)\n\n",
 				       part_no + 1, USABLE_PARTITIONS);
-			else
-				setpos(anc, part_no, f1_counter);
+			else {
+				if (oldfmt) /* correct +1 */ {
+					setpos(anc, part_no+1, f1_counter);
+					printf("Correcting f1 header number!\n");
+				}
+				else
+					setpos(anc, part_no, f1_counter);
+			}
 
 			part_info = part_info->next;
 			f1_counter++;
-- 
1.6.0.6


0008-s390-tools-1.8.1-ziorep-fixes.patch:

--- NEW FILE 0008-s390-tools-1.8.1-ziorep-fixes.patch ---
>From afe16490113999868ff408ff303ac7df4b733ff5 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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


0009-s390-tools-1.8.1-cflags.patch:

--- NEW FILE 0009-s390-tools-1.8.1-cflags.patch ---
>From d2f00bb021508f8104a1d8164432e8f4d239d872 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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


0010-s390-tools-1.8.1-defaultmenu.patch:

--- NEW FILE 0010-s390-tools-1.8.1-defaultmenu.patch ---
>From 486526858271c8ea890e8728a1cf1cceeceb9b1a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
Date: Thu, 23 Apr 2009 15:28:06 +0200
Subject: [PATCH] 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
--- 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)
 	struct scan_token* scan, *nscan;
 	char* filename;
 	char* source;
+	char* default_section;
+	int is_menu;
 	int rc;
 
 	/* Read configuration file */
@@ -1470,20 +1472,23 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
 		scan_free(scan);
 		return rc;
 	}
-
-	if (cmdline->automenu) {
-		nscan = create_fake_menu(scan);
-		if (nscan == NULL) {
-			scan_free(scan);
-			return -1;
-		}
-		scan = nscan;
-	}
+	
+	/* disable automenu iff default menu exists */
+	rc = get_default_section(scan, &default_section, &is_menu);
+	if (!rc && is_menu)
+		cmdline->automenu = 0;
 
 	/* Get job from config file data */
 	if (cmdline->menu != NULL || cmdline->automenu) {
-		if (cmdline->automenu)
+		if (cmdline->automenu) {
+			nscan = create_fake_menu(scan);
+			if (nscan == NULL) {
+				scan_free(scan);
+				return -1;
+			}
+			scan = nscan;
 			cmdline->menu = misc_strdup("rh-automatic-menu");
+		}
 		rc = get_menu_job(scan, cmdline->menu, job);
 	}
 	else {
-- 
1.6.0.6


0011-s390-tools-1.8.1-execstack.patch:

--- NEW FILE 0011-s390-tools-1.8.1-execstack.patch ---
>From 77f053260b9d2b4d683edfbed50a528d74620d4b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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


0012-s390-tools-1.8.1-ziomon-fixes.patch:

--- NEW FILE 0012-s390-tools-1.8.1-ziomon-fixes.patch ---
>From 1833f9dae371a48e3f52891262ad2d5fd75fc205 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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


0013-s390-tools-1.8.1-zipl-fix-unsupported-device.patch:

--- NEW FILE 0013-s390-tools-1.8.1-zipl-fix-unsupported-device.patch ---
>From 38dfbc2642350aba44df80b41c91ab78891ba818 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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


0014-s390-tools-1.8.1-zipl-kdump-man.patch:

--- NEW FILE 0014-s390-tools-1.8.1-zipl-kdump-man.patch ---
>From 815064b5e73bdeb11e85e04fb691745b15d00e99 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
Date: Fri, 19 Jun 2009 10:01:30 +0200
Subject: [PATCH] s390-tools-1.8.1-zipl-kdump-man

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

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


0015-s390-tools-1.8.1-iucvterm-getlogin-to-getpwuid.patch:

--- NEW FILE 0015-s390-tools-1.8.1-iucvterm-getlogin-to-getpwuid.patch ---
>From b76deacff693b951c2e5a01ed17e058379b9e00a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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 at 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


0016-s390-tools-1.8.1-dumpconf-improve-error-checking.patch:

--- NEW FILE 0016-s390-tools-1.8.1-dumpconf-improve-error-checking.patch ---
>From 263c0e5646ea3c81e570ec7e53c214cac8cb4412 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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


0017-s390-tools-1.8.1-cpuplugd-memplug.patch:

--- NEW FILE 0017-s390-tools-1.8.1-cpuplugd-memplug.patch ---
>From 277fbeaa8cdd27e586d1d3d0f58242a0a40b3a48 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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


0018-s390-tools-1.8.1-ziomon-new-blkiomon.patch:

--- NEW FILE 0018-s390-tools-1.8.1-ziomon-new-blkiomon.patch ---
>From 65f317c463de53abf7a8bba3285a077dbaf42486 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at 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



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- .cvsignore	7 Apr 2009 08:03:08 -0000	1.2
+++ .cvsignore	3 Jul 2009 09:22:59 -0000	1.3
@@ -1,4 +1,4 @@
-s390-tools-1.8.0.tar.bz2
+s390-tools-1.8.1.tar.bz2
 cmsfs-1.1.8c.tar.gz
 lib-zfcp-hbaapi-2.0.tar.gz
 src_vipa-2.0.4.tar.gz


Index: s390.csh
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/devel/s390.csh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- s390.csh	7 Apr 2009 08:03:09 -0000	1.1
+++ s390.csh	3 Jul 2009 09:23:00 -0000	1.2
@@ -1,5 +1,5 @@
 # /etc/profile.d/s390.csh - set TERM variable
 
-if ( `/sbin/consoletype` == "serial" ) then
+if ( `/sbin/consoletype stdout` == "serial" ) then
     setenv TERM dumb
 endif


Index: s390.sh
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/devel/s390.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- s390.sh	7 Apr 2009 08:03:09 -0000	1.1
+++ s390.sh	3 Jul 2009 09:23:00 -0000	1.2
@@ -1,6 +1,6 @@
 # /etc/profile.d/s390.sh - set TERM variable
 
-contype=`/sbin/consoletype`
+contype=`/sbin/consoletype stdout`
 if [ "$contype" == "serial" ]; then
     export TERM=dumb
 fi


Index: s390utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/devel/s390utils.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- s390utils.spec	7 Apr 2009 08:03:09 -0000	1.1
+++ s390utils.spec	3 Jul 2009 09:23:00 -0000	1.2
@@ -7,8 +7,8 @@
 Name:           s390utils
 Summary:        Utilities and daemons for IBM System/z
 Group:          System Environment/Base
-Version:        1.8.0
-Release:        5%{?dist}
+Version:        1.8.1
+Release:        1%{?dist}
 Epoch:          2
 License:        GPLv2 and GPLv2+ and CPL
 Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -26,22 +26,28 @@ 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
-Patch1:         0001-s390-tools-1.5.0-su.patch
-Patch2:         0002-s390-tools-1.5.0-fdasd-raid.patch
-Patch3:         0003-s390-tools-1.5.0-fmtpercentage.patch
-Patch4:         0004-s390-tools-1.8.0-automenu.patch
-Patch5:         0005-s390-tools-1.5.3-lvm.patch
-Patch6:         0006-s390-tools-1.5.3-dumpconf-vmlinuz.patch
-Patch7:         0007-s390-tools-1.5.3-zipl-zfcpdump-2.patch
-Patch8:         0008-s390-tools-1.8.0-zipl-timeout.patch
-Patch9:         0009-s390-tools-1.8.0-zipl-target.patch
-Patch10:        0010-s390-tools-1.5.3-zipl-zfcpdump-man.patch
-Patch11:        0011-s390-tools-1.5.3-fdasd-raid.patch
-Patch12:        0012-s390-tools-1.8.0-initscript-fix.patch
-Patch13:        0013-s390-tools-1.8.0-cflags.patch
+
+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
+
 Patch100:       cmsfs-1.1.8-warnings.patch
 Patch101:       cmsfs-1.1.8-kernel26.patch
+
 Patch200:       src_vipa-2.0.4-locations.patch
+
 Requires:       s390utils-base = %{epoch}:%{version}-%{release}
 Requires:       s390utils-osasnmpd = %{epoch}:%{version}-%{release}
 Requires:       s390utils-cpuplugd = %{epoch}:%{version}-%{release}
@@ -63,44 +69,46 @@ be used together with the zSeries (s390)
 %prep
 %setup -q -n s390-tools-%{version} -a 4 -a 6 -a 9
 
-# Fix to honor the silent flag for wrongly formated disks
-%patch1 -p1 -b .su
+# Use rpm PATH variables for installation and set correct zfcpdump path
+%patch1 -p1 -b .common-mak
 
-# Enhancement to add raid partiton support to dasds
-%patch2 -p1 -b .fdasd-raid
+# Patch to maintain backwards compatibility with older zipl multiboot feature
+%patch4 -p1 -b .zipl-automenu
 
-# Enhancement to add a percentage output bar to dasdfmt, needed for anaconda
-%patch3 -p1 -b .fmtpercentage
+# Fix to honor the silent flag for wrongly formated disks
+%patch5 -p1 -b .fdasd-su
 
-# Patch to maintain backwards compatibility with older zipl multiboot feature
-%patch4 -p1 -b .automenu
+# Enhancement to add raid partiton support to dasds
+%patch6 -p1 -b .fdasd-raid-lvm
 
-# Patch to fix installer LVM partitions that show up as "unknown" in fdasd (#250176)
-%patch5 -p1 -b .lvm
+# Post 1.8.1 fixes for ziorep
+%patch8 -p1 -b .ziorep
 
-# Added zfcpdump kernel symlink to dumpconf init script (#430550)
-%patch6 -p1 -b .dumpconf-vmlinuz
+# Allow override of optimization level in CFLAGS
+%patch9 -p1 -b .cflags
 
-# Updates for cleanup SCSI dumper code for upstream integration - tool (#253118)
-%patch7 -p1 -b .zipl-zfcpdump-2
+# Don't build automenu iff default menu exists (#486444)
+%patch10 -p1 -b .defaultmenu
 
-# Add support for timeout parameter in /etc/zipl.conf (#323651)
-%patch8 -p1 -b .zipl-timeout
+# Remove the execuatble stack flag from zipl
+%patch11 -p1 -b .execstack
 
-# Fix for zipl fail when section is specified and target is not repeated for all sections (#381201)
-%patch9 -p1 -b .zipl-target
+# Post 1.8.1 fixes for ziomon
+%patch12 -p1 -b .ziomon
 
-# Update documentation for zfcpdump (#437477)
-%patch10 -p1 -b .zipl-zfcpdump-man
+# Post 1.8.1 fix for zipl
+%patch13 -p1 -b .zipl-device
 
-# fix the Linux Raid partition type is not retained when changed through fdasd (#445271)
-%patch11 -p1 -b .fdasd-raid
+# Update zipl man page
+%patch14 -p1 -b .zipl-kdump-man
 
-# fix init scripts of cpuplugd, dumpconf and mon_statd
-%patch12 -p1 -b .initscripts-fix
+# Last-minute fixes from IBM
+%patch15 -p1 -b iucvterm-getlogin-to-getpwuid
+%patch16 -p1 -b dumpconf-improve-error-checking
+%patch17 -p1 -b cpuplugd-memplug
 
-# allow override of optimization level in CFLAGS
-%patch13 -p1 -b .cflags
+# Adapt ziomon to the new layout of the blkiomon_stat structure (#506966)
+%patch18 -p1 -b ziomon-new-blkiomon
 
 #
 # cmsfs
@@ -146,7 +154,7 @@ popd
 
 
 %build
-make OPT_FLAGS="$RPM_OPT_FLAGS"
+make OPT_FLAGS="$RPM_OPT_FLAGS" DISTRELEASE=%{release}
 
 pushd cmsfs-%{cmsfsver}
 ./configure
@@ -170,7 +178,8 @@ mkdir -p $RPM_BUILD_ROOT{%{_lib},%{_libd
 make install \
         INSTROOT=$RPM_BUILD_ROOT \
         MANDIR=$RPM_BUILD_ROOT%{_mandir} \
-        LIBDIR=${RPM_BUILD_ROOT}/%{_lib}
+        LIBDIR=${RPM_BUILD_ROOT}/%{_lib} \
+        DISTRELEASE=%{release}
 
 %{__mkdir} -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
 %{__mkdir} -p ${RPM_BUILD_ROOT}%{_initddir}
@@ -195,11 +204,12 @@ install -m 755 etc/init.d/cpuplugd ${RPM
 
 install -D -m 644 etc/udev/rules.d/57-osasnmpd.rules ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d
 
-install -p -m 755 cmsfs-%{cmsfsver}/cmsfscat $RPM_BUILD_ROOT%{_sbindir}
-install -p -m 755 cmsfs-%{cmsfsver}/cmsfslst $RPM_BUILD_ROOT%{_sbindir}
-install -p -m 755 cmsfs-%{cmsfsver}/cmsfsvol $RPM_BUILD_ROOT%{_sbindir}
-install -p -m 755 cmsfs-%{cmsfsver}/cmsfscp  $RPM_BUILD_ROOT%{_sbindir}
-install -p -m 755 cmsfs-%{cmsfsver}/cmsfsck  $RPM_BUILD_ROOT%{_sbindir}
+# cmsfs tools must be available in /sbin
+install -p -m 755 cmsfs-%{cmsfsver}/cmsfscat $RPM_BUILD_ROOT/sbin
+install -p -m 755 cmsfs-%{cmsfsver}/cmsfslst $RPM_BUILD_ROOT/sbin
+install -p -m 755 cmsfs-%{cmsfsver}/cmsfsvol $RPM_BUILD_ROOT/sbin
+install -p -m 755 cmsfs-%{cmsfsver}/cmsfscp  $RPM_BUILD_ROOT/sbin
+install -p -m 755 cmsfs-%{cmsfsver}/cmsfsck  $RPM_BUILD_ROOT/sbin
 install -p -m 644 cmsfs-%{cmsfsver}/cmsfscat.8 $RPM_BUILD_ROOT%{_mandir}/man8
 install -p -m 644 cmsfs-%{cmsfsver}/cmsfslst.8 $RPM_BUILD_ROOT%{_mandir}/man8
 install -p -m 644 cmsfs-%{cmsfsver}/cmsfsvol.8 $RPM_BUILD_ROOT%{_mandir}/man8
@@ -208,7 +218,7 @@ install -p -m 644 cmsfs-%{cmsfsver}/cmsf
 
 # src_vipa
 pushd src_vipa-%{vipaver}
-make install LIBDIR=%{_libdir} INSTROOT=$RPM_BUILD_ROOT
+make install LIBDIR=%{_libdir} SBINDIR=%{_bindir} INSTROOT=$RPM_BUILD_ROOT
 popd
 
 pushd lib-zfcp-hbaapi-%{hbaapiver}
@@ -221,6 +231,7 @@ popd
 %clean
 rm -rf ${RPM_BUILD_ROOT}
 
+
 %files
 %defattr(-,root,root,-)
 %doc README
@@ -394,8 +405,6 @@ fi
 /sbin/scsi_logging_level
 /sbin/zfcpdbf
 /sbin/qetharp
-/sbin/qetharp-2.4
-/sbin/qetharp-2.6
 /sbin/qethconf
 /sbin/tape390_display
 /sbin/tape390_crypt
@@ -456,7 +465,7 @@ fi
 /sbin/zfcpconf.sh
 
 # src_vipa
-%{_sbindir}/src_vipa.sh
+%{_bindir}/src_vipa.sh
 %{_libdir}/src_vipa.so
 %{_mandir}/man8/src_vipa.8.gz
 
@@ -477,8 +486,6 @@ ATM Ethernet LAN Emulation in QDIO mode.
 
 %files osasnmpd
 %defattr(-,root,root,-)
-%{_sbindir}/osasnmpd-2.4
-%{_sbindir}/osasnmpd-2.6
 %{_sbindir}/osasnmpd
 %config(noreplace) %{_sysconfdir}/udev/rules.d/57-osasnmpd.rules
 %{_mandir}/man8/osasnmpd.8*
@@ -567,7 +574,7 @@ fi
 License:        GPLv2
 Summary:        S390 ziomon tools
 Group:          Applications/System
-Requires:       perl lsscsi coreutils blktrace >= 1.0
+Requires:       perl lsscsi coreutils blktrace >= 1.0.1
 
 %description ziomon
 Tool set to collect data for zfcp performance analysis.
@@ -579,11 +586,68 @@ Tool set to collect data for zfcp perfor
 /sbin/ziomon_mgr
 /sbin/ziomon_util
 /sbin/ziomon_zfcpdd
+/sbin/ziorep_config
+/sbin/ziorep_traffic
+/sbin/ziorep_utilization
 %{_mandir}/man8/ziomon.8*
 %{_mandir}/man8/ziomon_fcpconf.8*
 %{_mandir}/man8/ziomon_mgr.8*
 %{_mandir}/man8/ziomon_util.8*
 %{_mandir}/man8/ziomon_zfcpdd.8*
+%{_mandir}/man8/ziorep_config.8*
+%{_mandir}/man8/ziorep_traffic.8*
+%{_mandir}/man8/ziorep_utilization.8*
+
+#
+# *********************** s390-tools iucvterm package  *************************
+#
+%package iucvterm
+License:        GPLv2
+Summary:        z/VM IUCV terminal applications
+Group:          Applications/System
+BuildRequires:  gettext
+
+%description iucvterm
+z/VM IUCV terminal applications.
+
+%pre iucvterm
+# check for ts-shell group and create it
+getent group ts-shell > /dev/null || groupadd -r ts-shell
+
+%post iucvterm
+# /etc/shells is provided by "setup"
+grep -q '^/usr/bin/ts-shell$' /etc/shells \
+    || echo "/usr/bin/ts-shell" >> /etc/shells
+
+%postun iucvterm
+if [ $1 = 0 ]
+then
+    # remove ts-shell from /etc/shells on uninstall
+    grep -v '^/usr/bin/ts-shell$' /etc/shells > /etc/shells.ts-new
+    mv /etc/shells.ts-new /etc/shells
+    chmod 0644 /etc/shells
+fi
+
+%files iucvterm
+%defattr(-,root,root,-)
+%dir %{_sysconfdir}/iucvterm
+%config(noreplace) %attr(0640,root,ts-shell) %{_sysconfdir}/iucvterm/ts-audit-systems.conf
+%config(noreplace) %attr(0640,root,ts-shell) %{_sysconfdir}/iucvterm/ts-authorization.conf
+%config(noreplace) %attr(0640,root,ts-shell) %{_sysconfdir}/iucvterm/ts-shell.conf
+%config(noreplace) %attr(0640,root,ts-shell) %{_sysconfdir}/iucvterm/unrestricted.conf
+%{_bindir}/iucvconn
+%{_bindir}/iucvtty
+%{_bindir}/ts-shell
+%{_sbindir}/chiucvallow
+%{_sbindir}/lsiucvallow
+%dir %attr(2770,root,ts-shell) /var/log/ts-shell
+%doc iucvterm/doc/ts-shell
+%{_mandir}/man1/iucvconn.1*
+%{_mandir}/man1/iucvtty.1*
+%{_mandir}/man1/ts-shell.1*
+%{_mandir}/man7/af_iucv.7*
+%{_mandir}/man8/chiucvallow.8*
+%{_mandir}/man9/hvc_iucv.9*
 
 #
 # *********************** libzfcphbaapi package  ***********************
@@ -657,11 +721,11 @@ This package contains the CMS file syste
 
 %files cmsfs
 %defattr(-,root,root,-)
-%{_sbindir}/cmsfscat
-%{_sbindir}/cmsfsck
-%{_sbindir}/cmsfscp
-%{_sbindir}/cmsfslst
-%{_sbindir}/cmsfsvol
+/sbin/cmsfscat
+/sbin/cmsfsck
+/sbin/cmsfscp
+/sbin/cmsfslst
+/sbin/cmsfsvol
 %{_mandir}/man8/cmsfscat.8*
 %{_mandir}/man8/cmsfsck.8*
 %{_mandir}/man8/cmsfscp.8*
@@ -670,6 +734,17 @@ This package contains the CMS file syste
 
 
 %changelog
+* Mon Jun 29 2009 Dan Horák <dan[at]danny.cz> 2:1.8.1-1
+- update to 1.8.1
+- drop upstreamed patches
+- create iucvterm subpackage
+- update src_vipa locations patch
+- install cmsfs tools into /sbin
+- add post 1.8.1 fixes from IBM
+
+* Fri Apr 17 2009 Dan Horák <dan[at]danny.cz> 2:1.8.0-6
+- fix build with newer kernels
+
 * Wed Mar 25 2009 Dan Horák <dan[at]danny.cz> 2:1.8.0-5
 - reword the summaries a bit
 - add downloadable URLs for Sources


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- sources	7 Apr 2009 08:03:09 -0000	1.2
+++ sources	3 Jul 2009 09:23:00 -0000	1.3
@@ -1,4 +1,4 @@
-5033eee356663d160784e37b193f93fa  s390-tools-1.8.0.tar.bz2
+6a94c4655204a4ec7a2c64f42c9afed3  s390-tools-1.8.1.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

src_vipa-2.0.4-locations.patch:

Index: src_vipa-2.0.4-locations.patch
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/devel/src_vipa-2.0.4-locations.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- src_vipa-2.0.4-locations.patch	7 Apr 2009 08:03:09 -0000	1.1
+++ src_vipa-2.0.4-locations.patch	3 Jul 2009 09:23:00 -0000	1.2
@@ -42,3 +42,33 @@ index 669b6c6..d395fa8 100644
 -- 
 1.6.0.6
 
+From 5c21f29f4d9e82942a997775c111280b85d01bb8 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
+Date: Wed, 22 Apr 2009 12:53:55 +0200
+Subject: [PATCH] make the man page path and script path configurable
+
+---
+ Makefile |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d395fa8..365472b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,9 +23,11 @@ VERSION=2.0.4
+ LIBDIR=/usr/lib
+ SRC_VIPA_PATH=$(INSTROOT)$(LIBDIR)
+ # the path to the starter script
+-SRC_VIPA_STARTER_PATH=$(INSTROOT)/usr/sbin
++SBINDIR=/usr/sbin
++SRC_VIPA_STARTER_PATH=$(INSTROOT)$(SBINDIR)
+ # path to man page
+-SRC_VIPA_MANPAGE_PATH=$(INSTROOT)/usr/share/man
++MANDIR=/usr/share/man
++SRC_VIPA_MANPAGE_PATH=$(INSTROOT)$(MANDIR)
+ 
+ all: src_vipa.so src_vipa.sh
+ 
+-- 
+1.6.0.6
+


--- 0001-s390-tools-1.5.0-su.patch DELETED ---


--- 0002-s390-tools-1.5.0-fdasd-raid.patch DELETED ---


--- 0003-s390-tools-1.5.0-fmtpercentage.patch DELETED ---


--- 0004-s390-tools-1.8.0-automenu.patch DELETED ---


--- 0005-s390-tools-1.5.3-lvm.patch DELETED ---


--- 0006-s390-tools-1.5.3-dumpconf-vmlinuz.patch DELETED ---


--- 0007-s390-tools-1.5.3-zipl-zfcpdump-2.patch DELETED ---


--- 0008-s390-tools-1.8.0-zipl-timeout.patch DELETED ---


--- 0009-s390-tools-1.8.0-zipl-target.patch DELETED ---


--- 0010-s390-tools-1.5.3-zipl-zfcpdump-man.patch DELETED ---


--- 0011-s390-tools-1.5.3-fdasd-raid.patch DELETED ---


--- 0012-s390-tools-1.8.0-initscript-fix.patch DELETED ---


--- 0013-s390-tools-1.8.0-cflags.patch DELETED ---




More information about the fedora-extras-commits mailing list