Compare commits

..

2 Commits
rawhide ... f13

Author SHA1 Message Date
Fedora Release Engineering
af888fd1b4 dist-git conversion 2010-07-29 11:59:11 +00:00
Dennis Gilmore
c5988dd132 Initialize branch F-13 for s390utils 2010-03-10 14:15:55 +00:00
49 changed files with 6908 additions and 2565 deletions

5
.gitignore vendored
View File

@ -2,8 +2,3 @@ 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
/lib-zfcp-hbaapi-2.1.tar.gz
/src_vipa-2.1.0.tar.gz
/s390-tools-*.tar.bz2
/s390-tools-*.tar.gz
/s390-tools-*-rust-vendor.tar.xz

View File

@ -0,0 +1,27 @@
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 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 8b248f1..0a7916e 100644
--- a/common.mak
+++ b/common.mak
@@ -63,8 +63,8 @@ GROUP = $(shell id -gn)
export INSTROOT BINDIR LIBDIR MANDIR OWNER GROUP
# Special defines for zfcpdump
-ZFCPDUMP_DIR = /usr/local/share/zfcpdump
-ZFCPDUMP_IMAGE = zfcpdump.image
+ZFCPDUMP_DIR = /boot
+ZFCPDUMP_IMAGE = zfcpdump
ZFCPDUMP_RD = zfcpdump.rd
export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
--
1.6.3.3

View File

@ -0,0 +1,423 @@
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 2/9] 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 c5c85d8..6a526e4 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 9cb764c..4d9fd36 100644
--- a/zipl/src/zipl.c
+++ b/zipl/src/zipl.c
@@ -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",
+"-x, --no-automenu Don't autogenerate multiboot menu",
" --dry-run Simulate run but don't modify IPL records"
};
--
1.6.3.3

View File

@ -0,0 +1,33 @@
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 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 aa16659..3a54968 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -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) {
- 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.3.3

View File

@ -0,0 +1,153 @@
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 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 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)
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;
@@ -312,6 +312,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");
@@ -1122,14 +1126,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);
@@ -1145,10 +1159,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);
@@ -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" \
- " 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;
@@ -1448,6 +1474,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);
}
@@ -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)
{
- 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;
@@ -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);
- 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.3.3

View File

@ -0,0 +1,59 @@
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 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 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)
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.3.3

View File

@ -0,0 +1,31 @@
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 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
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 6ebf240..6df6026 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.3.3

View File

@ -0,0 +1,25 @@
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 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 d0bf84f..a872d05 100755
--- a/zconf/lszfcp
+++ b/zconf/lszfcp
@@ -233,7 +233,7 @@ show_devices()
# Differentiate old and new sysfs layout
if $FC_CLASS; then
SCSI_DEVICE_LIST=`ls -d \
- $SYSFS/devices/css0/*/*/host*/rport*/target*/*/ \
+ $SYSFS/bus/ccw/drivers/zfcp/*/host*/rport*/target*/*/ \
2>/dev/null |grep -P '\d+:\d+:\d+:\d+'`
else
SCSI_DEVICE_LIST=`ls -d $SYSFS/devices/css0/*/*/host*/*/`
--
1.6.3.3

View File

@ -0,0 +1,28 @@
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 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
and the security-related compile flags that are used in Fedora.
---
libvtoc/vtoc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libvtoc/vtoc.c b/libvtoc/vtoc.c
index 62a02a0..cebd5a4 100644
--- a/libvtoc/vtoc.c
+++ b/libvtoc/vtoc.c
@@ -326,7 +326,7 @@ void vtoc_volume_label_init (volume_label_t *vlabel)
{
sprintf(buffer, "%84s", " ");
vtoc_ebcdic_enc(buffer, buffer, 84);
- strncpy(vlabel->volkey, buffer, 84);
+ memcpy(vlabel, buffer, 84);
}
--
1.6.3.3

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

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

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

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

File diff suppressed because it is too large Load Diff

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

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

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

@ -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,183 +0,0 @@
#!/bin/bash
if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
exit 0
fi
[[ -f /etc/sysconfig/kernel ]] && . /etc/sysconfig/kernel
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
KERNEL_DIR="${KERNEL_IMAGE%/*}"
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
BLS_DIR="/boot/loader/entries"
ZIPLCFG="/etc/zipl.conf"
CMDLINE_LINUX_DEBUG=" systemd.log_level=debug systemd.log_target=kmsg"
LINUX_DEBUG_VERSION_POSTFIX="_with_debugging"
LINUX_DEBUG_TITLE_POSTFIX=" with debugging"
mkbls() {
local kernelver=$1 && shift
local datetime=$1 && shift
local kernelopts=$1 && shift
local debugname=""
local flavor=""
if [[ "$kernelver" == *\+* ]] ; then
local flavor=-"${kernelver##*+}"
if [[ "${flavor}" == "-debug" ]]; then
local debugname=" with debugging"
local debugid="-debug"
fi
fi
cat <<EOF
title ${NAME} (${kernelver}) ${VERSION}${debugname}
version ${kernelver}${debugid}
linux /boot/vmlinuz-${kernelver}
initrd /boot/initramfs-${kernelver}.img
options ${kernelopts}
id ${ID}-${datetime}-${kernelver}${debugid}
grub_users \$grub_users
grub_arg --unrestricted
grub_class kernel${flavor}
EOF
}
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
case "$COMMAND" in
add)
if [[ "${KERNEL_DIR}" != "/boot" ]]; then
# rename to match the name used in the pseudo-BLS snippet above
cp --remove-destination --preserve=timestamps -T "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}"
command -v restorecon &>/dev/null && \
restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}"
for i in \
"$KERNEL_DIR"/System.map \
"$KERNEL_DIR"/config \
"$KERNEL_DIR"/zImage.stub
do
[[ -e "$i" ]] || continue
cp --preserve=timestamps -T "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
command -v restorecon &>/dev/null && \
restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
done
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
if [[ -e "$i" ]]; then
cp --preserve=timestamps "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
command -v restorecon &>/dev/null && \
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
fi
fi
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
declare -a BOOT_OPTIONS
if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
fi
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" || "${i#BOOT_IMAGE=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
[[ -d "$BLS_DIR" ]] || mkdir -m 0700 -p "$BLS_DIR"
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
if [[ -f "${KERNEL_DIR}/bls.conf" ]]; then
cp --preserve=timestamps -T "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $?
sed -i -e "s,^linux.*,linux /boot/vmlinuz-${KERNEL_VERSION},g" "${BLS_TARGET}"
sed -i -e "s,^initrd.*,initrd /boot/initramfs-${KERNEL_VERSION}.img,g" "${BLS_TARGET}"
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_TARGET}"
else
mkbls "${KERNEL_VERSION}" \
"$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${KERNEL_DIR}")")" \
"${BOOT_OPTIONS[*]}" >"${BLS_TARGET}"
fi
if [[ "$KERNEL_VERSION" == *\+* ]] && [ "x$DEFAULTDEBUG" != "xyes" ]; then
UPDATEDEFAULT="no"
fi
if [[ "x$UPDATEDEFAULT" = "xyes" ]]; then
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
NEWDEFAULT="${TITLE}"
fi
if [ "x${MAKEDEBUG}" = "xyes" ]; then
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
cp --preserve=timestamps -T "${BLS_TARGET}" "${BLS_DEBUG}"
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
VERSION="$(grep '^version[ \t]' "${BLS_DEBUG}" | sed -e 's/^version[ \t]*//')"
BLSID="$(grep '^id[ \t]' "${BLS_DEBUG}" | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
sed -i -e "s/^title.*/title ${TITLE}${LINUX_DEBUG_TITLE_POSTFIX}/" "${BLS_DEBUG}"
sed -i -e "s/^version.*/version ${VERSION}${LINUX_DEBUG_VERSION_POSTFIX}/" "${BLS_DEBUG}"
sed -i -e "s/^id.*/${BLSID}/" "${BLS_DEBUG}"
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}${CMDLINE_LINUX_DEBUG}#" "${BLS_DEBUG}"
if [ -n "$NEWDEFAULT" -a "x$DEFAULTDEBUG" = "xyes" ]; then
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
NEWDEFAULT="${TITLE}"
fi
fi
if [ -n "$NEWDEFAULT" ] && [ -f "${ZIPLCFG}" ]; then
if grep -q "^default=" "${ZIPLCFG}"; then
sed -i -e "s,^default=.*,default=${NEWDEFAULT}," "${ZIPLCFG}"
else
echo "default=${NEWDEFAULT}" >> "${ZIPLCFG}"
fi
fi
exit 0
fi
/sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
/sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
/sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
# If grubby is used there's no need to run other installation plugins
exit 77
;;
remove)
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
ARCH="$(uname -m)"
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
if [ -f "${BLS_TARGET}" ] && [ -f "${ZIPLCFG}" ]; then
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
fi
if [[ -f "${BLS_DEBUG}" ]]; then
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
fi
rm -f "${BLS_TARGET}" "${BLS_DEBUG}"
for i in vmlinuz System.map config zImage.stub dtb; do
rm -rf "/boot/${i}-${KERNEL_VERSION}"
done
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
rm -f "/boot/.vmlinuz-${KERNEL_VERSION}.hmac"
exit 0
fi
/sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
# If grubby is used there's no need to run other installation plugins
exit 77
;;
*)
;;
esac

View File

@ -1,42 +0,0 @@
#!/bin/bash
[[ -f /etc/os-release ]] && . /etc/os-release
[[ -f /etc/sysconfig/kernel ]] && . /etc/sysconfig/kernel
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
BLS_DIR="/boot/loader/entries"
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
case "$COMMAND" in
add)
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
declare -a BOOT_OPTIONS
if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
fi
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
BLS_RESCUE="${BLS_DIR}/${MACHINE_ID}-0-rescue.conf"
if [[ -f "${BLS_RESCUE}" ]] && grep -q '^options.*$kernelopts' "${BLS_RESCUE}"; then
sed -i -e "s,^linux.*,linux /boot/vmlinuz-0-rescue-${MACHINE_ID},g" "${BLS_RESCUE}"
sed -i -e "s,^initrd.*,initrd /boot/initramfs-0-rescue-${MACHINE_ID}.img,g" "${BLS_RESCUE}"
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_RESCUE}"
fi
fi
;;
*)
;;
esac

View File

@ -1,15 +0,0 @@
#!/bin/bash
if [[ ! -f /etc/zipl.conf ]]; then
exit 0
fi
COMMAND="$1"
case "$COMMAND" in
add|remove)
zipl > /dev/null
;;
*)
;;
esac

View File

@ -1,4 +0,0 @@
ACTION!="add|bind|change", GOTO="ccw_end"
SUBSYSTEM!="ccw", GOTO="ccw_end"
DRIVER=="ctcm|lcs|qeth", RUN+="ccw_init"
LABEL="ccw_end"

200
ccw_init
View File

@ -1,200 +0,0 @@
#! /bin/sh
[ -z "$DEVPATH" ] && exit 0
[ "$SUBSYSTEM" != "ccw" ] && exit 0
[ -e /etc/ccw.conf ] && MODE="dracut" || MODE="normal"
OLD_IFS="$IFS"
get_config_line_by_subchannel()
{
local CHANNEL
CHANNEL="$1"
while read line; do
IFS=","
set $line
IFS="$OLD_IFS"
for i in $@; do
if [ "$CHANNEL" = "$i" ]; then
echo $line
return 0
fi
done
done < /etc/ccw.conf
return 1
}
# borrowed from network-scrips, initscripts along with the get_config_by_subchannel
[ -z "$__sed_discard_ignored_files" ] && __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
get_config_by_subchannel ()
{
LANG=C grep -E -i -l \
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \
/etc/sysconfig/network-scripts/ifcfg-* \
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
}
get_config_by_subchannel_nm ()
{
LANG=C grep -E -i -l \
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){0,2}${1};([0-9]\.[0-9]\.[a-f0-9]+;){0,2}$" \
/etc/NetworkManager/system-connections/*.nmconnection \
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
}
CHANNEL=${DEVPATH##*/}
if [ $MODE = "dracut" ]; then
CONFIG_LINE=$(get_config_line_by_subchannel $CHANNEL)
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && break
IFS=","
set $CONFIG_LINE
IFS="$OLD_IFS"
NETTYPE=$1
shift
SUBCHANNELS="$1"
OPTIONS=""
shift
while [ $# -gt 0 ]; do
case $1 in
*=*) OPTIONS="$OPTIONS $1";;
[0-9]*) SUBCHANNELS="$SUBCHANNELS,$1";;
esac
shift
done
elif [ $MODE = "normal" ]; then
NOLOCALE="yes"
CONFIG_FILE=$(get_config_by_subchannel $CHANNEL)
if [ -n "$CONFIG_FILE" ]; then
. $CONFIG_FILE
else
CONFIG_FILE=$(get_config_by_subchannel_nm $CHANNEL)
if [ -n "$CONFIG_FILE" ]; then
NETTYPE=$(sed -nr "/^\[ethernet\]/ { :l /^s390-nettype[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
SUBCHANNELS=$(sed -nr "/^\[ethernet\]/ { :l /^s390-subchannels[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE | sed -e "s/;/,/g" -e "s/,$//")
LAYER2=$(sed -nr "/^\[ethernet-s390-options\]/ { :l /^layer2[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
else
exit 1
fi
fi
else
echo "Unknown mode=$MODE"
exit 1
fi
# now we have extracted these variables from the config files:
# SUBCHANNELS
# OPTIONS
# put LAYER2 option into its own variable
set $OPTIONS
OPTIONS=""
while [ $# -gt 0 ]; do
case $1 in
layer2=*) LAYER2=${1##layer2=};;
*=*) OPTIONS="$OPTIONS $1";;
esac
shift
done
# translate variables from the interface config files to OPTIONS
if [ -n "$PORTNAME" ]; then
if [ "$NETTYPE" = "lcs" ]; then
OPTIONS="$OPTIONS portno=$PORTNAME"
else
OPTIONS="$OPTIONS portname=$PORTNAME"
fi
fi
if [ "$NETTYPE" = "ctc" -a -n "$CTCPROT" ]; then
OPTIONS="$OPTIONS protocol=$CTCPROT"
fi
# SUBCHANNELS is only set on mainframe ccwgroup devices
[ -z "$SUBCHANNELS" -o -z "$NETTYPE" ] && exit 0
if [ "$NETTYPE" = "ctc" ]; then
DIR="/sys/bus/ccwgroup/drivers/ctcm"
else
DIR="/sys/bus/ccwgroup/drivers/$NETTYPE"
fi
i=0
while [ $i -lt 20 ]; do
[ -e $DIR ] && break
sleep 0.1
i=$(($i+1))
done
# driver missing or not loaded
[ ! -e $DIR ] && exit 0
IFS=","
set $SUBCHANNELS
IFS="$OLD_IFS"
CHANNEL1=$1
CHANNEL2=$2
SYSDIR="$DIR/$CHANNEL1"
[ -e $SYSDIR ] && exit 0
# check if the interface is already online
if [ -e $SYSDIR/online ]; then
read on <$SYSDIR/online
[ "$on" = "1" ] && exit 0
fi
DRIVER=$(readlink $DEVPATH/driver)
DRIVER=${DRIVER##*/}
if [ "$DRIVER" = "lcs" -a "$NETTYPE" = "ctc" ]; then
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/unbind
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/bind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/unbind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/bind
fi
if [ "$DRIVER" = "ctcm" -a "$NETTYPE" = "lcs" ]; then
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/unbind
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/bind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/unbind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/bind
fi
if [ ! -e $SYSDIR ]; then
echo "$SUBCHANNELS" > $DIR/group
i=0
while [ $i -lt 20 ]; do
[ -e $SYSDIR ] && break
sleep 0.1
i=$(($i+1))
done
[ ! -e $SYSDIR ] && exit 1
fi
# check if the interface is already online
if [ -e $SYSDIR/online ]; then
read on <$SYSDIR/online
[ "$on" = "1" ] && exit 0
fi
# first set layer2, other options may depend on it
[ -n "$LAYER2" ] && echo $LAYER2 > $SYSDIR/layer2
if [ -n "$OPTIONS" ]; then
for i in $OPTIONS; do
OPT=${i%%=*}
VAL=${i##*=}
if [ -e "$SYSDIR/$OPT" ]; then
echo "$VAL" > "$SYSDIR/$OPT" || \
echo "Could not set value \"$VAL\" for OPTION \"$OPT\" with SUBCHANNELS \"$SUBCHANNELS\""
else
echo "OPTION \"$OPT\" does not exist for SUBCHANNELS \"$SUBCHANNELS\""
fi
done
fi
[ -e $SYSDIR/online ] && echo 1 > $SYSDIR/online

View File

@ -0,0 +1,12 @@
diff -urN cmsfs-1.1.8/cmsfssed.sh cmsfs-1.1.8_/cmsfssed.sh
--- cmsfs-1.1.8/cmsfssed.sh 2003-02-28 17:52:59.000000000 -0500
+++ cmsfs-1.1.8_/cmsfssed.sh 2004-05-28 16:36:22.000000000 -0400
@@ -85,7 +85,7 @@
DRIVER_SOURCE="cmsfs22x.c"
MODULES_DIRECTORY="/lib/modules/`uname -r`/fs"
;;
- 2.4*|2.5*)
+ 2.4*|2.5*|2.6*)
LINUX_RELEASE="2.4"
# ln -s cmsfs24x.c cmsfsvfs.c
INCLUDES="-I/lib/modules/`uname -r`/build/include"

View File

@ -0,0 +1,11 @@
--- cmsfs-1.1.8/cmsfsvol.c.warnings 2003-07-18 01:38:57.000000000 +0200
+++ cmsfs-1.1.8/cmsfsvol.c 2005-09-06 16:57:15.000000000 +0200
@@ -52,7 +52,7 @@
/* print a header; looks like CMS */
(void) printf("LABEL VDEV M STAT CYL TYPE \
-BLKSZ FILES BLKS USED-(%) BLKS LEFT BLK TOTAL\n");
+BLKSZ FILES BLKS USED-(%%) BLKS LEFT BLK TOTAL\n");
for ( ; i < argc ; i++)
{

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

@ -14,7 +14,7 @@
CHANNEL=${DEVPATH##*/}
CONFIG=/etc/dasd.conf
PATH=/sbin:/bin
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
warn() {
@ -27,7 +27,7 @@ if [ -f "$CONFIG" ]; then
#warn "No dasd-eckd or dasd-eckd loaded"
exit 0
fi
sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do
tr "A-Z" "a-z" < $CONFIG | while read line; do
case $line in
\#*) ;;
*)

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2009, 2010 Red Hat, Inc.
# Copyright 2009 Red Hat, Inc.
# License: GPLv2
# Author: Dan Horák <dhorak@redhat.com>
#
@ -14,68 +14,53 @@
#
# also processes the system ccw config file and network interface configurations
#
# requires: echo, sleep, modprobe, grep, printf, sed.
#
# it is used in
# anaconda
# dracut generated initramfs
# normal system startup driven by upstart
#
DASDCONFIG=/etc/dasd.conf
ZFCPCONFIG=/etc/zfcp.conf
ZNETCONFIG=/etc/ccw.conf
BLACKLIST=/proc/cio_ignore
CIO_SETTLE=/proc/cio_settle
VERBOSE=
PATH=/bin:/sbin
DEVICE= # list of devices given on command line
ALL_DEVICES= # list of all unblocked devices
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] [-d|--device <deviceid>]"
echo " -h|--help print this message"
echo " -V|--verbose be verbose"
echo " -d|--device <deviceid> unblock and wait for specified device"
echo "Usage: $CMD [-h|--help] [-V|--verbose]"
exit 1
}
# accepts single device, comma-separated lists and dash separated ranges and their combinations
# the comma separated list is split so we minimize the effect of unsuccessful freeing
free_device()
{
local DEV DEV_LIST
local DEV
[ -z "$1" ] && return
DEV_LIST=$(echo "$1" | sed 'y/ABCDEF/abcdef/' | sed 's/,/ /g')
for DEV in $DEV_LIST; do
[ $VERBOSE ] && echo "Freeing device(s) $DEV"
if ! echo "free $DEV" > $BLACKLIST 2> /dev/null ; then
echo "Error: can't free device(s) $DEV"
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
if [ -z $ALL_DEVICES ]; then
ALL_DEVICES="$DEV"
else
ALL_DEVICES="$ALL_DEVICES,$DEV"
fi
ALL_DEVICES="$ALL_DEVICES,$DEV"
fi
done
fi
}
# wait until a device appears on the ccw bus
wait_on_single_device()
wait_on_device()
{
local DEVICE_ONLINE DEV
[ -z "$1" ] && return
DEV="$1"
DEVICE_ONLINE="/sys/bus/ccw/devices/$DEV/online"
DEV=$1
DEVICE_ONLINE=/sys/bus/ccw/devices/$DEV/online
[ $VERBOSE ] && echo "Waiting on device $DEV"
[ -f "$DEVICE_ONLINE" ] && return
@ -94,81 +79,52 @@ wait_on_single_device()
echo "Error: device $DEV still not ready"
}
# wait until recently unblocked devices are ready
# at this point we know the content of ALL_DEVICES is syntacticly correct
wait_on_devices()
{
if [ -w $CIO_SETTLE ]; then
[ $VERBOSE ] && echo "Waiting until all pending CIO requests are processed"
echo 1 > $CIO_SETTLE
return
fi
# 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
OLD_IFS=$IFS
IFS=","
set $ALL_DEVICES
for DEV in $*
do
IFS="."
# 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
# 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
if [ ! -f $BLACKLIST ]; then
echo "Error: $BLACKLIST kernel interface doesn't exist"
exit 2
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
i=$L0
while [ $i -le $U0 ]; do
[ $i -eq $L0 ] && LJ=$L1 || LJ=0
[ $i -eq $U0 ] && UJ=$U1 || UJ=3
j=$LJ
while [ $j -le $UJ ]; do
[ $i -eq $L0 -a $j -eq $L1 ] && LK=$L2 || LK=0
[ $i -eq $U0 -a $j -eq $U1 ] && UK=$U2 || UK=65535
k=$LK
while [ $k -le $UK ]; do
wait_on_single_device "$(printf %x.%x.%04x $i $j $k)"
k=$(($k + 1))
done
j=$(($j + 1))
done
i=$(($i + 1))
done
done
}
process_config_file()
{
local CONFIG
[ -z "$1" ] && return
CONFIG="$1"
if [ $MODE = "dasd" -o $MODE = "zfcp" ]; then
# process the config file
if [ -f "$CONFIG" ]; then
while read line; do
case $line in
@ -179,143 +135,93 @@ process_config_file()
free_device $1
;;
esac
done < "$CONFIG"
done < $CONFIG
fi
}
# check how we were called
CMD=${0##*/}
DIR=${0%/*}
ARGS=$@
case $CMD in
"dasd_cio_free")
MODE_DASD="yes"
;;
"zfcp_cio_free")
MODE_ZFCP="yes"
;;
"znet_cio_free")
MODE_ZNET="yes"
;;
"device_cio_free")
MODE_DASD="yes"
MODE_ZFCP="yes"
MODE_ZNET="yes"
;;
*)
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
while [ $# -gt 0 ]; do
case $1 in
-V|--verbose)
VERBOSE=yes
;;
-h|--help)
usage
;;
-d|--device)
shift
if [ "$1" ]; then
if [ "$DEVICE" ]; then
DEVICE="$DEVICE,$1"
else
DEVICE=$1
fi
else
echo "Error: no device given"
usage
fi
;;
*)
echo "Error: unknown option $1"
usage
;;
esac
shift
done
if [ ! -f $BLACKLIST ]; then
echo "Error: $BLACKLIST kernel interface doesn't exist"
exit 2
fi
if [ "$DEVICE" ]; then
[ $VERBOSE ] && echo "Freeing specific devices"
free_device $DEVICE
wait_on_devices
udevadm settle
exit 0
fi
if [ $VERBOSE ]; then
echo -n "Freeing devices:"
[ $MODE_DASD ] && echo -n " dasd"
[ $MODE_ZFCP ] && echo -n " zfcp"
[ $MODE_ZNET ] && echo -n " znet"
echo
fi
[ $MODE_DASD ] && process_config_file $DASDCONFIG
[ $MODE_ZFCP ] && process_config_file $ZFCPCONFIG
if [ $MODE_DASD ]; then
if [ $MODE = "dasd" ]; then
# process the device list defined as option for the dasd module
DEVICES=$(modprobe --showconfig | LANG=C grep "options[[:space:]]\+dasd_mod" | \
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 | sed 's/,/ /g'); do
for DEVRANGE in $(echo $DEVICES | tr ',' ' '); do
free_device $DEVRANGE
done
fi
if [ $MODE_ZNET ]; then
if [ $MODE = "znet" ]; then
# process the config file
if [ -f "$ZNETCONFIG" ]; then
if [ -f "$CONFIG" ]; then
while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
# grep 2 or 3 channels from each "<nettype>,<subchannels>,<options>" line
DEVICES=$(echo $line | LANG=C grep -E -i -o "([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)")
# 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 < "$ZNETCONFIG"
done < $CONFIG
fi
# process channels from network interface configurations
if [ -z "$__sed_discard_ignored_files" ]; then
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
else
# default value copied from initscripts 9.03.10
__sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
fi
fi
for line in $(LANG=C grep -E -i -h \
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" \
$( (ls /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null || echo "__no_config_file") | \
LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
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
for line in $(LANG=C grep -E -i -h \
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){2,3}$" \
$( (ls /etc/NetworkManager/system-connections/*.nmconnection 2> /dev/null || echo "__no_config_file") | \
LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
do
SUBCHANNELS="$(echo $line | sed -e "s/s390-subchannels=//" -e "s/;/,/g")"
free_device $SUBCHANNELS
done
fi
[ -z "$ALL_DEVICES" ] && exit 0
# 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="."
wait_on_devices
# 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

@ -1,12 +0,0 @@
[Unit]
Description=Free all devices on startup
DefaultDependencies=no
Before=sysinit.target systemd-udev-trigger.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/device_cio_free
[Install]
WantedBy=sysinit.target

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

@ -0,0 +1,36 @@
diff -Nrup lib-zfcp-hbaapi-2.0.orig/Makefile.am lib-zfcp-hbaapi-2.0/Makefile.am
--- lib-zfcp-hbaapi-2.0.orig/Makefile.am 2008-11-21 15:08:13.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/Makefile.am 2009-09-25 12:30:07.000000000 +0200
@@ -60,7 +60,7 @@ lib_LTLIBRARIES = libzfcphbaapi.la
libzfcphbaapi_la_SOURCES = vlib.c vlib_callbacks.c vlib_aux.c vlib_sysfs.c \
vlib_sg.c
-libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils
+libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils2
libzfcphbaapi_la_LDFLAGS = \
-version-info $(LIB_CURRENT):$(LIB_REVISION):$(LIB_AGE) \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
diff -Nrup lib-zfcp-hbaapi-2.0.orig/Makefile.in lib-zfcp-hbaapi-2.0/Makefile.in
--- lib-zfcp-hbaapi-2.0.orig/Makefile.in 2008-11-21 15:08:18.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/Makefile.in 2009-09-25 13:22:04.000000000 +0200
@@ -248,7 +248,7 @@ lib_LTLIBRARIES = libzfcphbaapi.la
libzfcphbaapi_la_SOURCES = vlib.c vlib_callbacks.c vlib_aux.c vlib_sysfs.c \
vlib_sg.c
-libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils
+libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils2
libzfcphbaapi_la_LDFLAGS = \
-version-info $(LIB_CURRENT):$(LIB_REVISION):$(LIB_AGE) \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
diff -Nrup lib-zfcp-hbaapi-2.0.orig/vlib_sg.c lib-zfcp-hbaapi-2.0/vlib_sg.c
--- lib-zfcp-hbaapi-2.0.orig/vlib_sg.c 2008-11-20 10:23:34.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/vlib_sg.c 2009-09-25 13:21:52.000000000 +0200
@@ -19,6 +19,8 @@
* @brief All calls that use sg_utils library.
*/
+#include <scsi/sg_lib.h>
+#include <scsi/sg_cmds.h>
#include "vlib.h"
#define INTERVAL 10000000

View File

@ -1,120 +0,0 @@
#!/bin/sh
#
# Copyright 2012 Red Hat, Inc.
# License: GPLv2
# Author: Jesse Keating <jkeating@redhat.com>
#
# Normalize DASD data into valid dasd.conf format
#
# Standard input should be the DASD argument
# Standard otuput is the properly formatted content
#
# it is used in
# dracut generated initramfs
#
# Much of this code was salvaged from linuxrc.s390 from Anaconda:
#
# License GPLv2+
#
# Copyright (C) 2000-2004 by
# Bernhard Rosenkraenzer <bero@redhat.com>
# Oliver Paukstadt <opaukstadt@millenux.com>
# Karsten Hopp <karsten@redhat.de>
# Florian La Roche <laroche@redhat.com>
# Nils Philippsen <nils@redhat.de>
# Helge Deller <hdeller@redhat.de>
# David Sainty <dsainty@redhat.com>
# Copyright (C) IBM Corp. 2008,2009
# Author: Steffen Maier <maier@de.ibm.com>
function canonicalize_devno()
{
case ${#1} in
3) echo "0.0.0${1}" ;;
4) echo "0.0.${1}" ;;
*) echo "${1}" ;;
esac
return 0
}
read DASD
# See if we've gotten a format like <dev>,feature or <dev>,<dev>,<dev>
[[ "$DASD" =~ (\,*=[[:digit:]]) ]]
case $? in
# case of 0 is features, just turn the comma into a space
0) echo $DASD |sed 's/,/ /g';;
*) # We've got no features, do things normally
for dasditem in $(echo $DASD |sed 's/,/ /g')
do
unset range features lo hi attrs devno lodevno hidevno devbusid sys
case $dasditem in
autodetect|probeonly|nopav|nofcx|"") continue ;; # these don't gen a config
*)
IFS='('
read range features <<< "$dasditem"
unset IFS
lo=${range%%-*}
[[ "$lo" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
case $? in
0) # string matched the pattern
lo=$(canonicalize_devno $lo) ;;
1) # string did not match the pattern
echo $"Incorrect format for lower bound of DASD range $range: $lo" 1>&2
exit 1
;;
2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;;
*) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;;
esac
if [ "${range//*-*/}" = "" ]; then
hi=${range##*-}
[[ "$hi" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
case $? in
0) # string matched the pattern
hi=$(canonicalize_devno $hi)
if [ "${lo%.*}" != "${hi%.*}" ]; then
echo $"Prefixes of DASD range $range do not match: ${lo%.*} != ${hi%.*}" 1>&2
exit 1
fi
;;
1) # string did not match the pattern
echo $"Incorrect format for upper bound of DASD range $range: $hi" 1>&2
exit 1
;;
2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;;
*) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;;
esac
fi
if [ "${features//*)/}" != "" ]; then
echo $"Missing closing parenthesis at features of DASD range $range: ($features" 1>&2
exit 1
fi
if [ -n "$features" ]; then
attrs=""
features="${features%)}"
for feature in $(echo $features |sed 's/:/\n/g'); do
case $feature in
ro) attrs=$attrs" readonly" ;;
diag) attrs=$attrs" use_diag" ;;
erplog|failfast) attrs=$attrs" "$feature ;;
*) echo $"Unknown DASD feature for device range $range: $feature" 1>&2
exit 1
;;
esac
done
fi
[ -z "$hi" ] && hi=$lo
lodevno=$((0x${lo##*.}))
hidevno=$((0x${hi##*.}))
for ((devno=$lodevno; $devno <= $hidevno; ++devno)); do
devbusid=$(printf "%s.%04x" ${lo%.*} $devno)
echo -n "$devbusid"
for attr in $attrs; do
echo -n " $attr=1"
done
echo
done
esac
done
;;
esac

View File

@ -1,8 +0,0 @@
---
pathmigration:
excluded_paths:
- /lib/s390-tools
badfuncs:
ignore:
- /usr/sbin/qethqoat

View File

@ -1,348 +0,0 @@
From b2daaa34776ba6afec879e362378f6f7563590a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 20 Jun 2022 17:43:05 +0200
Subject: [PATCH 1/2] Revert "zipl/src: Implement sorting bls entries by
versions"
This reverts commit a0dba6bfdb50ff373fa710ffe2a307cc0748f18b.
---
zipl/src/scan.c | 139 ++----------------------------------------------
1 file changed, 3 insertions(+), 136 deletions(-)
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
index 0cea1d4..9352f76 100644
--- a/zipl/src/scan.c
+++ b/zipl/src/scan.c
@@ -10,7 +10,6 @@
*
*/
-static const char *VERSION_KEYWORD = "version";
/* Need ISOC99 function isblank() in ctype.h */
#ifndef __USE_ISOC99
@@ -646,7 +645,7 @@ scan_file(const char* filename, struct scan_token** token)
static int
-bls_filter_by_names(const struct dirent *ent)
+bls_filter(const struct dirent *ent)
{
int offset = strlen(ent->d_name) - strlen(".conf");
@@ -656,111 +655,13 @@ bls_filter_by_names(const struct dirent *ent)
return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0;
}
-struct version {
- char *line; /* pointer to a line with version keyword */
- int offset; /* offset of version value in the line */
-};
-
-/*
- * Locate version in bls file represented by ENT
- */
-static void get_version(const struct dirent *ent, struct version *v)
-{
- char *line = NULL;
- size_t len = 0;
- char *d_name;
- FILE *stream;
- ssize_t read;
-
- memset(v, 0, sizeof(*v));
- d_name = misc_make_path((char *)blsdir, (char *)ent->d_name);
- if (!d_name)
- return;
-
- stream = fopen(d_name, "r");
- free(d_name);
- if (!stream)
- return;
-
- while ((read = getline(&line, &len, stream)) != -1) {
- if (line[read - 1] == '\n') {
- line[read - 1] = '\0';
- read--;
- }
- if ((size_t)read <= strlen(VERSION_KEYWORD) + 1)
- continue;
- if (strcmp(VERSION_KEYWORD, line) > 0)
- continue;
- if (!isblank(line[strlen(VERSION_KEYWORD)]))
- continue;
- /* skip blanks */
- v->offset = strlen(VERSION_KEYWORD) + 1;
- while (v->offset < read - 1 && isblank(line[v->offset]))
- v->offset++;
- if (isblank(line[v->offset]))
- /*
- * all characters after the keyword
- * are blanks. Invalid version
- */
- continue;
- v->line = line;
- fclose(stream);
- return;
- }
- free(line);
- fclose(stream);
-}
-
-static void put_version(struct version *v)
-{
- free(v->line);
-}
-
-/**
- * Check version in bls file represented by ENT.
- * Return 1 if version is valid. Otherwise return 0
- */
-static int bls_filter_by_versions(const struct dirent *ent)
-{
- struct version v;
-
- if (bls_filter_by_names(ent) == 0)
- return 0;
-
- get_version(ent, &v);
- if (v.line) {
- put_version(&v);
- return 1;
- }
- return 0;
-}
-
static int
-bls_sort_by_names(const struct dirent **ent_a, const struct dirent **ent_b)
+bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
{
return strverscmp((*ent_a)->d_name, (*ent_b)->d_name);
}
-static int
-bls_sort_by_versions(const struct dirent **ent_a, const struct dirent **ent_b)
-{
- struct version v1, v2;
- int ret;
-
- get_version(*ent_a, &v1);
- get_version(*ent_b, &v2);
- /*
- * Both versions are valid.
- * It is guaranteed by bls_filter_by_versions()
- */
- ret = strverscmp(v1.line + v1.offset, v2.line + v2.offset);
-
- put_version(&v1);
- put_version(&v2);
-
- return ret;
-}
static int
scan_append_section_heading(struct scan_token* scan, int* index, char* name);
@@ -1110,40 +1011,6 @@ scan_count_target_keywords(char* keyword[])
return num;
}
-static int bls_scandir(struct dirent ***bls_entries)
-{
- struct dirent **entries1;
- struct dirent **entries2;
- int n1, n2;
-
- /* arrange by names */
- n1 = scandir(blsdir, &entries1,
- bls_filter_by_names, bls_sort_by_names);
- if (n1 <= 0)
- return n1;
- /* arrange by versions */
- n2 = scandir(blsdir, &entries2,
- bls_filter_by_versions, bls_sort_by_versions);
-
- if (n2 <= 0 || n2 < n1) {
- /*
- * failed to sort by versions,
- * fall back to sorting by filenames
- */
- *bls_entries = entries1;
- while (n2--)
- free(entries2[n2]);
- free(entries2);
- return n1;
- }
- /* use arrangement by versions */
- *bls_entries = entries2;
- while (n1--)
- free(entries1[n1]);
- free(entries1);
- return n2;
-}
-
int
scan_check_target_data(char* keyword[], int* line)
{
@@ -1464,7 +1331,7 @@ int scan_bls(struct scan_token **token, int scan_size)
if (!(stat(blsdir, &sb) == 0 && S_ISDIR(sb.st_mode)))
return 0;
- n = bls_scandir(&bls_entries);
+ n = scandir(blsdir, &bls_entries, bls_filter, bls_sort);
if (n <= 0)
return n;
--
2.39.2
From 692e70bcfc32a05e30146bd7077c41e0eaceff03 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 20 Jun 2022 17:46:59 +0200
Subject: [PATCH 2/2] blscfg: sort like rpm nvr, not like a single version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Dan Horák <dan@danny.cz>
---
zipl/src/Makefile | 1 +
zipl/src/scan.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 95 insertions(+), 2 deletions(-)
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
index cab5655..7ec215d 100644
--- a/zipl/src/Makefile
+++ b/zipl/src/Makefile
@@ -9,6 +9,7 @@ ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS)
libs = $(rootdir)/libutil/libutil.a \
$(rootdir)/libvtoc/libvtoc.a \
+ -lrpmio -lrpm
objects = misc.o error.o scan.o job.o boot.o bootmap.o fs-map.o disk.o \
bootmap_header.o envblk.o install.o zipl.o
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
index 9352f76..3327e2d 100644
--- a/zipl/src/scan.c
+++ b/zipl/src/scan.c
@@ -35,6 +35,8 @@
#include "lib/util_base.h"
+#include <rpm/rpmlib.h>
+
#include "boot.h"
#include "error.h"
#include "misc.h"
@@ -655,13 +657,103 @@ bls_filter(const struct dirent *ent)
return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0;
}
+/* returns name/version/release */
+/* NULL string pointer returned if nothing found */
+static void
+split_package_string (char *package_string, char **name,
+ char **version, char **release)
+{
+ char *package_version, *package_release;
+
+ /* Release */
+ package_release = strrchr (package_string, '-');
+
+ if (package_release != NULL)
+ *package_release++ = '\0';
+
+ *release = package_release;
+
+ /* Version */
+ package_version = strrchr(package_string, '-');
+
+ if (package_version != NULL)
+ *package_version++ = '\0';
+
+ *version = package_version;
+ /* Name */
+ *name = package_string;
+
+ /* Bubble up non-null values from release to name */
+ if (name != NULL && *name == NULL) {
+ *name = (*version == NULL ? *release : *version);
+ *version = *release;
+ *release = NULL;
+ }
+ if (*version == NULL) {
+ *version = *release;
+ *release = NULL;
+ }
+}
static int
-bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
+split_cmp(char *nvr0, char *nvr1, int has_name)
+{
+ int ret = 0;
+ char *name0, *version0, *release0;
+ char *name1, *version1, *release1;
+
+ split_package_string(nvr0, has_name ? &name0 : NULL, &version0, &release0);
+ split_package_string(nvr1, has_name ? &name1 : NULL, &version1, &release1);
+
+ if (has_name) {
+ ret = rpmvercmp(name0 == NULL ? "" : name0,
+ name1 == NULL ? "" : name1);
+ if (ret != 0)
+ return ret;
+ }
+
+ ret = rpmvercmp(version0 == NULL ? "" : version0,
+ version1 == NULL ? "" : version1);
+ if (ret != 0)
+ return ret;
+
+ ret = rpmvercmp(release0 == NULL ? "" : release0,
+ release1 == NULL ? "" : release1);
+ return ret;
+}
+
+/* return 1: filename0 is newer than filename1 */
+/* 0: filename0 and filename1 are the same version */
+/* -1: filename1 is newer than filename0 */
+static int bls_cmp(const char *filename0, const char *filename1)
{
- return strverscmp((*ent_a)->d_name, (*ent_b)->d_name);
+ char *id0, *id1;
+ int l, r;
+
+ id0 = strdup(filename0);
+ id1 = strdup(filename1);
+
+ l = strlen(id0);
+ if (l > 5 && strcmp(id0 + l - 5, ".conf"))
+ id0[l-5] = '\0';
+
+ l = strlen(id1);
+ if (l > 5 && strcmp(id1 + l - 5, ".conf"))
+ id1[l-5] = '\0';
+
+ r = split_cmp(id0, id1, 1);
+
+ free(id0);
+ free(id1);
+
+ return r;
}
+static int
+bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
+{
+ return bls_cmp((*ent_a)->d_name, (*ent_b)->d_name);
+}
static int
scan_append_section_heading(struct scan_token* scan, int* index, char* name);
--
2.39.2

View File

@ -1,84 +0,0 @@
From 2faae5cf51c49e3f166b8526eee276dab2fe7308 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Wed, 30 May 2018 14:33:25 +0200
Subject: [PATCH] zipl-switch-to-blscfg: invert ignore-default and
use-version-name options
These options were added because the zipl maintainers wanted a different
default behaviour for the migration script than the one we use. Instead
of requiring to always use these options, just invert the logic for us.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
scripts/zipl-switch-to-blscfg | 16 +++++++++-------
scripts/zipl-switch-to-blscfg.1 | 8 ++++----
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/scripts/zipl-switch-to-blscfg b/scripts/zipl-switch-to-blscfg
index 871935c783f..d8d5eca5867 100755
--- a/scripts/zipl-switch-to-blscfg
+++ b/scripts/zipl-switch-to-blscfg
@@ -57,14 +57,14 @@ Options:
--backup-suffix=SUFFIX suffix used for backup files, defaults to .bak
--bls-directory=DIR path to generate BLS files, defaults to /boot/loader/entries
--config-file=FILE path to zipl configuration file, defaults to /etc/zipl.conf
- --ignore-default ignore the default option from the zipl configuration file
- --use-version-name use the section kernel version as the BLS file name
+ --leave-default leave the default option from the zipl configuration file
+ --use-section-name use the section name as the BLS file name
EOF
}
OPTS="$(getopt -o hv --long help,version,backup-suffix:,bls-directory:,config-file:,\
-ignore-default,use-version-name -n \'$SCRIPTNAME\' -- "$@")"
+leave-default,use-section-name -n \'$SCRIPTNAME\' -- "$@")"
eval set -- "$OPTS"
BACKUP_SUFFIX=.bak
@@ -73,6 +73,8 @@ CMDLINE_LINUX_DEBUG=" systemd.log_level=debug systemd.log_target=kmsg"
LINUX_DEBUG_VERSION_POSTFIX="_with_debugging"
LINUX_DEBUG_TITLE_POSTFIX=" with debugging"
CONFIG="/etc/zipl.conf"
+ignore_default=true
+version_name=true
while [ ${#} -gt 0 ]; do
case "$1" in
@@ -96,11 +98,11 @@ while [ ${#} -gt 0 ]; do
CONFIG=${2}
shift
;;
- --ignore-default)
- ignore_default=true
+ --leave-default)
+ ignore_default=false
;;
- --use-version-name)
- version_name=true
+ --use-section-name)
+ version_name=false
;;
--)
shift
diff --git a/scripts/zipl-switch-to-blscfg.8 b/scripts/zipl-switch-to-blscfg.8
index 6bd14d00d14..71b904ffd1c 100644
--- a/scripts/zipl-switch-to-blscfg.8
+++ b/scripts/zipl-switch-to-blscfg.8
@@ -37,9 +37,9 @@ The DIRECTORY where the BLS fragments will be generated. The directory is create
The FILE used for zipl configuration file, defaults to /etc/zipl.conf.
.TP
-\fB\-\-ignore-default\fP
-Ignore the default option from the zipl configuration file
+\fB\-\-leave-default\fP
+Leave the default option from the zipl configuration file
.TP
-\fB\-\-use-version-name\fP
-Use the section kernel version as the BLS file name
+\fB\-\-use-section-name\fP
+Use the section name as the BLS file name
--
2.17.0

5
s390.csh Normal file
View File

@ -0,0 +1,5 @@
# /etc/profile.d/s390.csh - set TERM variable
if ( `/sbin/consoletype stdout` == "serial" ) then
setenv TERM dumb
endif

6
s390.sh Normal file
View File

@ -0,0 +1,6 @@
# /etc/profile.d/s390.sh - set TERM variable
contype=`/sbin/consoletype stdout`
if [ "$contype" == "serial" ]; then
export TERM=dumb
fi

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,4 @@
SHA512 (s390-tools-2.31.0.tar.gz) = d05722dff760605baad92b25a7a9264b3c936ff851b87a02ab39604a74d02ae4e14632d9b3d83eb9cb82a14bfcbb0d40bb4797896051ed3dd36d7690abfb1c64
SHA512 (s390-tools-2.31.0-rust-vendor.tar.xz) = f9dc2887bb2502ba6f71ef7ea807380c322a46df8c65f0fc7993f3fb4eec4da120369d3e380dbcca9b6250307da0f6236a649504d542f44730e8009ace8ed450
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

@ -0,0 +1,74 @@
From b2f1bf78400c686bbdbcf4c29fbbb93367abe409 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 25 Mar 2009 09:36:08 +0100
Subject: [PATCH] fix location of the library
---
Makefile | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 669b6c6..d395fa8 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,8 @@ INSTALL=install
VERSION=2.0.4
# the path to the .so
-SRC_VIPA_PATH=$(INSTROOT)/usr/lib
+LIBDIR=/usr/lib
+SRC_VIPA_PATH=$(INSTROOT)$(LIBDIR)
# the path to the starter script
SRC_VIPA_STARTER_PATH=$(INSTROOT)/usr/sbin
# path to man page
@@ -34,8 +35,7 @@ src_vipa.so: src_vipa.c
src_vipa.sh:
echo '#!/bin/bash' > src_vipa.sh
- echo 'export LD_LIBRARY_PATH=$(SRC_VIPA_PATH):$$LD_LIBRARY_PATH' >> src_vipa.sh
- echo 'export LD_PRELOAD=$(SRC_VIPA_PATH)/src_vipa.so' >> src_vipa.sh
+ echo 'export LD_PRELOAD=$(LIBDIR)/src_vipa.so' >> src_vipa.sh
echo 'exec $$@' >> src_vipa.sh
chmod 755 src_vipa.sh
@@ -44,7 +44,6 @@ install: src_vipa.so src_vipa.sh
$(INSTALL) -m 755 src_vipa.so $(SRC_VIPA_PATH)
$(INSTALL) -m 755 src_vipa.sh $(SRC_VIPA_STARTER_PATH)
$(INSTALL) -m 644 src_vipa.8 $(SRC_VIPA_MANPAGE_PATH)/man8
- ldconfig
clean:
rm -f src_vipa.{i,s,o,sh,so} core src_vipa-$(VERSION).tar.gz
--
1.6.0.6
From 5c21f29f4d9e82942a997775c111280b85d01bb8 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@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

View File

@ -1 +1 @@
KERNEL=="zfcp", RUN+="/sbin/zfcpconf.sh"
KERNEL=="zfcp_cfdc", RUN+="/sbin/zfcpconf.sh"

View File

@ -1,13 +1,11 @@
#!/bin/sh
#!/bin/bash
# config file syntax:
# deviceno WWPN FCPLUN
# deviceno # allowed when auto LUN scan is enabled and port is in NPIV mode
#
# Example:
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
# 0.0.5000
#
#
# manual setup:
@ -21,57 +19,25 @@
# echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add
CONFIG=/etc/zfcp.conf
PATH=/bin:/sbin
set_online()
{
DEVICE=$1
[ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` = "0" ] \
&& echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
}
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
exit 1
return
fi
sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
set $line
if [ $# -eq 1 ]; then
DEVICE=${1##*0x}
if [ `cat /sys/module/zfcp/parameters/allow_lun_scan` = "Y" ]; then
set_online ${DEVICE}
grep -q NPIV /sys/bus/ccw/devices/${DEVICE}/host*/fc_host/host*/port_type || \
echo "Error: Only device ID (${DEVICE}) given, but port not in NPIV mode"
else
echo "Error: Only device ID (${DEVICE}) given, but LUN scan is disabled for the zfcp module"
fi
continue
fi
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
set_online ${DEVICE}
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
;;
esac
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
echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/online
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/$FCPLUN ] && echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/unit_add
done
fi
exit 0