initial import

This commit is contained in:
Dan Horák 2009-04-07 08:03:09 +00:00
parent f0c0a853a8
commit 0fff4296ad
24 changed files with 2326 additions and 0 deletions

View File

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

View File

@ -0,0 +1,33 @@
From 118f2f03b639dd2ccfb518ceb82e89fcb1eaf024 Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sat, 19 Jul 2008 16:30:04 +0200
Subject: [PATCH] s390-tools-1.5.0-su
---
fdasd/fdasd.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index 5bec7cc..dce9ed3 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -1851,10 +1851,12 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
if (anc->verbose) printf("disk type check : ok\n");
if (dasd_info.FBA_layout != 0) {
- snprintf(err_str, ERROR_STRING_SIZE,
- "%s is not formatted with z/OS compatible "
- "disk layout!", options.device);
- fdasd_error(anc, wrong_disk_format, err_str);
+ if(!anc->silent) {
+ snprintf(err_str, ERROR_STRING_SIZE,
+ "%s is not formatted with z/OS compatible "
+ "disk layout!", options.device);
+ fdasd_error(anc, wrong_disk_format, err_str);
+ }
}
if (anc->verbose) printf("disk layout check : ok\n");
--
1.6.0.6

View File

@ -0,0 +1,143 @@
From b492189d95a523e9176c1dac4de0fb1216a3af14 Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sat, 19 Jul 2008 16:32:00 +0200
Subject: [PATCH] s390-tools-1.5.0-fdasd-raid
---
fdasd/fdasd.c | 55 +++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index dce9ed3..d011b69 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -214,10 +214,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;
@@ -278,6 +278,8 @@ 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
strcpy(str, "unknown");
@@ -1062,6 +1064,7 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
strncpy(c1, s2, 31);
}
else {
+ char str[20];
char *tmp = strstr(ch, "SWAP");
/* create a new data set name */
@@ -1069,7 +1072,15 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
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);
@@ -1087,8 +1098,16 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
c1 += 4;
if (tmp)
strncpy(c1, ".SWAP", 5);
- else
- strncpy(c1, ".NATIVE", 7);
+ 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("f1 ");
@@ -1325,9 +1344,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;
@@ -1340,6 +1360,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);
}
@@ -1503,7 +1526,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;
@@ -1538,14 +1561,26 @@ fdasd_process_valid_vtoc(fdasd_anchor_t *anc, unsigned long blk)
vtoc_ebcdic_enc(part_info->f1->DS1DSNAM,
part_info->f1->DS1DSNAM, 44);
- if ((part_no < 0) || (part_no >= USABLE_PARTITIONS))
+ /* this dasd has data set names 0000-0002
+ but we use now 0001-0003 */
+ if (part_no == -1)
+ oldfmt++;
+
+ if (((oldfmt == 0) && (part_no < 0))
+ || (part_no >= USABLE_PARTITIONS))
printf("WARNING: partition number (%i) found "
"in data set name of an existing "
"partition\ndoes not match range of "
"possible partition numbers (1-%d)\n\n",
part_no + 1, USABLE_PARTITIONS);
- else
- setpos(anc, part_no, f1_counter);
+ else {
+ if (oldfmt) /* correct +1 */ {
+ setpos(anc, part_no+1, f1_counter);
+ printf("Correcting f1 header number!\n");
+ }
+ else
+ setpos(anc, part_no, f1_counter);
+ }
part_info = part_info->next;
f1_counter++;
--
1.6.0.6

View File

@ -0,0 +1,116 @@
From 6e939e7804c33e54577a6801e266bab9a8c6a24c Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sat, 19 Jul 2008 16:32:52 +0200
Subject: [PATCH] s390-tools-1.5.0-fmtpercentage
---
dasdfmt/dasdfmt.c | 32 +++++++++++++++++++++++++++++---
dasdfmt/dasdfmt.h | 4 +++-
2 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
index 55616cc..54e8950 100644
--- a/dasdfmt/dasdfmt.c
+++ b/dasdfmt/dasdfmt.c
@@ -47,6 +47,7 @@ static void exit_usage(int exitcode)
" -V or --version means print version\n"
" -L or --no_label means don't write disk label\n"
" -p or --progressbar means show a progress bar\n"
+ " -P or --percentage means show a progress bar\n"
" -m x or --hashmarks=x means show a hashmark every x "
"cylinders\n"
" -v means verbose mode\n"
@@ -169,6 +170,7 @@ static void init_info(dasdfmt_info_t *info)
info->print_progressbar = 0;
info->print_hashmarks = 0;
info->hashstep = 0;
+ info->print_percentage = 0;
info->force = 0;
info->writenolabel = 0;
info->labelspec = 0;
@@ -550,7 +552,7 @@ static void dasdfmt_format(dasdfmt_info_t *info, struct hd_geometry *drive_geo,
format_data_t *format_params)
{
format_data_t format_step;
- int j, k, cyl, tmp, p1, p2;
+ int j, k, cyl, tmp, p1, p2, p;
if (info->print_hashmarks) {
if ((info->hashstep < 1) || (info->hashstep > 1000)) {
@@ -609,6 +611,24 @@ static void dasdfmt_format(dasdfmt_info_t *info, struct hd_geometry *drive_geo,
printf("#");
fflush(stdout);
}
+ if(info->print_percentage)
+ {
+ p2 = p1;
+ p1 = cyl*100/drive_geo->cylinders;
+ if (p1 != p2)
+ {
+ p = (k - format_params->start_unit) * 100 /
+ (format_params->stop_unit
+ - format_params->start_unit);
+ printf("cyl %5d of %5d | %3d%%\n",
+ (k - format_params->start_unit)
+ / drive_geo->heads,
+ (format_params->stop_unit
+ - format_params->start_unit)
+ / drive_geo->heads, p);
+ fflush(stdout);
+ }
+ }
if (k % drive_geo->heads == 0) {
k += drive_geo->heads;
@@ -840,11 +860,17 @@ int main(int argc,char *argv[])
break;
case 'p':
- if (!info.print_hashmarks) info.print_progressbar=1;
+ if (!info.print_hashmarks && !info.print_percentage)
+ info.print_progressbar=1;
+ break;
+
+ case 'P':
+ if (!info.print_hashmarks && !info.print_progressbar)
+ info.print_percentage=1;
break;
case 'm':
- if (!info.print_progressbar)
+ if (!info.print_progressbar && !info.print_percentage)
{
hashstep_str=optarg;
info.print_hashmarks=1;
diff --git a/dasdfmt/dasdfmt.h b/dasdfmt/dasdfmt.h
index 2dc1583..32d0803 100644
--- a/dasdfmt/dasdfmt.h
+++ b/dasdfmt/dasdfmt.h
@@ -147,7 +147,7 @@ struct hd_geometry {
if (*endptr) ERRMSG_EXIT(EXIT_MISUSE,"%s: " str " " \
"is in invalid format\n",prog_name);}
-#define dasdfmt_getopt_string "b:n:l:f:d:m:hpLtyvVFk"
+#define dasdfmt_getopt_string "b:n:l:f:d:m:hpPLtyvVFk"
static struct option dasdfmt_getopt_long_options[]=
{
@@ -158,6 +158,7 @@ static struct option dasdfmt_getopt_long_options[]=
{ "force", 0, 0, 'F'},
{ "progressbar", 0, 0, 'p'},
{ "hashmarks", 1, 0, 'm'},
+ { "percentage", 0, 0, 'P'},
{ "label", 1, 0, 'l'},
{ "devno", 1, 0, 'n'},
{ "device", 1, 0, 'f'},
@@ -192,6 +193,7 @@ typedef struct dasdfmt_info {
int withoutprompt;
int print_progressbar;
int print_hashmarks, hashstep;
+ int print_percentage;
int force;
int writenolabel;
int labelspec;
--
1.6.0.6

View File

@ -0,0 +1,360 @@
From 91275200e3d22d56d8722ec308617c6b3ba9911b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Mar 2009 10:33:22 +0100
Subject: [PATCH] s390-tools-1.8.0-automenu.patch
---
zipl/man/zipl.8 | 7 +++
zipl/src/job.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
zipl/src/scan.c | 4 +-
zipl/src/zipl.c | 1 +
4 files changed, 168 insertions(+), 6 deletions(-)
diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8
index 8a83c01..6ebf240 100644
--- a/zipl/man/zipl.8
+++ b/zipl/man/zipl.8
@@ -249,6 +249,13 @@ whether they contain a dump signature or not.
This option can only be used together with
.BR \-\-mvdump .
+.TP
+.BR "\-x" " or " "\-\-no-automenu"
+Disables the automatic creation of a multiboot menu. Specifying a menu with the
+"-m <MENU>" option or a section disables this feature, too. This option was
+added for compatibility with previous versions of the multiboot version of
+zipl.
+
.SH EXAMPLE
1. Scenario: prepare disk for booting a Linux kernel image using the
following parameters:
diff --git a/zipl/src/job.c b/zipl/src/job.c
index 2f69104..388e63a 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,10 @@ 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;
+ scan_key_table[1][8] = req;
/* Config file mode */
if ((cmdline.menu != NULL) && (cmdline.section != NULL)) {
error_reason("Option 'menu' cannot be used when "
@@ -832,7 +865,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 +1142,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) {
@@ -1268,10 +1310,109 @@ 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 *seclist[1024];
+ char *defaultsection;
+ char buf[1024];
+ struct scan_token *tmp;
+
+ /* Count # of sections */
+ numsec = 0;
+ name = NULL;
+ target = 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;
+ }
+ 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;
+ 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 +1444,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..7227a33 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, inv, 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 e466e34..9dfb469 100644
--- a/zipl/src/zipl.c
+++ b/zipl/src/zipl.c
@@ -71,6 +71,7 @@ static const char* usage_text[] = {
"-n, --noninteractive Answer all confirmation questions with 'yes'",
"-V, --verbose Provide more verbose output",
"-a, --add-files Add all referenced files to bootmap file",
+"-x, --no-automenu Don't autogenerate multiboot menu",
" --dry-run Simulate run but don't modify IPL records"
};
--
1.6.0.6

View File

@ -0,0 +1,25 @@
From 1e1e66f65675343567b47406ceb4d4ff50a25dce Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:14:30 +0200
Subject: [PATCH] s390-tools-1.5.3-lvm
---
fdasd/fdasd.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index d011b69..9101c01 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -280,6 +280,8 @@ fdasd_partition_type (char *str)
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");
--
1.6.0.6

View File

@ -0,0 +1,33 @@
From 52473d7292d58ec0343123ee10b1005d9ff62d37 Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:22:48 +0200
Subject: [PATCH] s390-tools-1.5.3-dumpconf-vmlinuz
---
etc/init.d/dumpconf | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
mode change 100755 => 100644 etc/init.d/dumpconf
diff --git a/etc/init.d/dumpconf b/etc/init.d/dumpconf
old mode 100755
new mode 100644
index 17a7c29..1f719f5
--- a/etc/init.d/dumpconf
+++ b/etc/init.d/dumpconf
@@ -287,6 +287,13 @@ status_vmcmd()
start()
{
+ # create zfcp dump symlink
+ if [ -f /boot/vmlinuz-`uname -r`kdump ]; then
+ ln -sf /boot/vmlinuz-`uname -r`kdump /boot/zfcpdump
+ else
+ rm -f /boot/zfcpdump
+ fi
+
if [ "$ON_PANIC" == "" ]; then
ON_PANIC="stop"
fi
--
1.6.0.6

View File

@ -0,0 +1,27 @@
From 1536e0140cbce3c8837478cfc25ea45dc3681cce Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:24:05 +0200
Subject: [PATCH] s390-tools-1.5.3-zipl-zfcpdump-2
---
common.mak | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/common.mak b/common.mak
index 62c17e2..3acb534 100644
--- a/common.mak
+++ b/common.mak
@@ -38,8 +38,8 @@ GROUP = $(shell id -gn)
export INSTROOT BINDIR LIBDIR MANDIR OWNER GROUP
# Special defines for zfcpdump
-ZFCPDUMP_DIR = /usr/local/share/zfcpdump
-ZFCPDUMP_IMAGE = zfcpdump.image
+ZFCPDUMP_DIR = /boot
+ZFCPDUMP_IMAGE = zfcpdump
ZFCPDUMP_RD = zfcpdump.rd
export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
endif
--
1.6.0.6

View File

@ -0,0 +1,69 @@
From a43e6e889fe44cae8a4da73ac3d81c1389fee905 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Mar 2009 10:34:50 +0100
Subject: [PATCH] s390-tools-1.8.0-zipl-timeout
---
zipl/src/job.c | 11 ++++++++++-
zipl/src/scan.c | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/zipl/src/job.c b/zipl/src/job.c
index 388e63a..fe3286e 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -1318,6 +1318,7 @@ 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];
@@ -1327,6 +1328,7 @@ create_fake_menu(struct scan_token *scan)
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;
@@ -1343,6 +1345,10 @@ create_fake_menu(struct scan_token *scan)
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);
@@ -1396,7 +1402,10 @@ create_fake_menu(struct scan_token *scan)
scan[i].id = scan_id_keyword_assignment;
scan[i].line = i;
scan[i].content.keyword.keyword = scan_keyword_timeout;
- scan[i++].content.keyword.value = misc_strdup("15");
+ 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++) {
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
index 7227a33..caca3cf 100644
--- a/zipl/src/scan.c
+++ b/zipl/src/scan.c
@@ -33,7 +33,7 @@ enum scan_key_state scan_key_table[SCAN_SECTION_NUM][SCAN_KEYWORD_NUM] = {
* rs enu
*/
/* defaultboot */
- {opt, inv, inv, inv, inv, inv, inv, inv, req, 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, opt, inv, inv, inv, inv, inv},
/* segment load */
--
1.6.0.6

View File

@ -0,0 +1,63 @@
From a4d2366cc716f8ce3f159fd8e8b585b04b7a5924 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Mar 2009 10:35:14 +0100
Subject: [PATCH] s390-tools-1.8.0-zipl-target
---
zipl/src/job.c | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/zipl/src/job.c b/zipl/src/job.c
index fe3286e..3be5520 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -246,7 +246,6 @@ get_command_line(int argc, char* argv[], struct command_line* line)
/* If either menu or section has been selected disable
automenu generation */
cmdline.automenu = 0;
- scan_key_table[1][8] = req;
/* Config file mode */
if ((cmdline.menu != NULL) && (cmdline.section != NULL)) {
error_reason("Option 'menu' cannot be used when "
@@ -1226,19 +1225,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");
--
1.6.0.6

View File

@ -0,0 +1,27 @@
From eedf33ef46224a67e09c38ee58c57f3dd8d9acf8 Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:26:13 +0200
Subject: [PATCH] s390-tools-1.5.3-zipl-zfcpdump-man
---
zipl/man/zipl.8 | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8
index 6ebf240..8d2b42c 100644
--- a/zipl/man/zipl.8
+++ b/zipl/man/zipl.8
@@ -198,6 +198,10 @@ larger than any single ECKD DASD partition could hold.
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.
+Note that before using this option the "kernel-kdump" rpm has to be installed
+and the dumpconf service script has to be started using
+"service dumpconf start".
+
.TP
.BR "\-m <MENU>" " or " "--menu=<MENU>"
Install the multi-boot configuration defined in menu section <MENU> of the
--
1.6.0.6

View File

@ -0,0 +1,40 @@
From 1fc8467cdb52feb751a711c304ef0fc88ec82155 Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Fri, 25 Jul 2008 13:57:00 +0200
Subject: [PATCH] s390-tools-1.5.3-fdasd-raid
---
fdasd/fdasd.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index 9101c01..f63ce5a 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -1068,6 +1068,7 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
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)
@@ -1098,9 +1099,12 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
strncpy(c1, dsno, 4);
c1 += 4;
- if (tmp)
- strncpy(c1, ".SWAP", 5);
- else {
+ 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);
}
--
1.6.0.6

View File

@ -0,0 +1,171 @@
From 6235108700462cc4b425ae7a697915f8147f46c3 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Mar 2009 10:37:36 +0100
Subject: [PATCH] s390-tools-1.8.0-initscript-fix
---
etc/init.d/cpuplugd | 21 +++++++++++++++------
etc/init.d/dumpconf | 9 ++++++---
etc/init.d/mon_statd | 31 ++++++++++++++++++++++---------
3 files changed, 43 insertions(+), 18 deletions(-)
diff --git a/etc/init.d/cpuplugd b/etc/init.d/cpuplugd
index f8df06b..cbd5f90 100755
--- a/etc/init.d/cpuplugd
+++ b/etc/init.d/cpuplugd
@@ -1,16 +1,18 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: cpuplugd
-# Required-Start: $remote_fs
-# Required-Stop: $remote_fs
-# Default-Start: 1 2 3 4 5
-# Default-Stop: 0 6
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Should-Start:
+# Should-Stop:
+# Default-Start:
+# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Start the cpu hotplug daemon for Linux on System z
# Description: Starts the cpuplugd. It uses the configuration
# file /etc/sysconfig/cpuplugd
### END INIT INFO
-# chkconfig: 12345 01 99
+# chkconfig: - 01 99
DAEMON=cpuplugd
DAEMON_PATH=/usr/sbin/cpuplugd
@@ -26,7 +28,13 @@ start()
{
if [ ! -f $RUN_PID_FILE ]; then
echo -n $"Starting $DAEMON:"
- $DAEMON_PATH $OPTIONS && log_success_msg || log_failure_msg
+ $DAEMON_PATH $OPTIONS
+ if [ $? == "0" ]; then
+ touch /var/lock/subsys/cpuplugd
+ log_success_msg
+ else
+ log_failure_msg
+ fi
echo
else
echo "$DAEMON (pid $(cat $RUN_PID_FILE)) is already running..."
@@ -41,6 +49,7 @@ stop()
killproc $DAEMON_PATH -TERM
log_success_msg
rm -f $RUN_PID_FILE
+ rm -f /var/lock/subsys/cpuplugd
else
log_failure_msg
fi
diff --git a/etc/init.d/dumpconf b/etc/init.d/dumpconf
index 1f719f5..3935582 100644
--- a/etc/init.d/dumpconf
+++ b/etc/init.d/dumpconf
@@ -3,14 +3,14 @@
# Provides: dumpconf
# Required-Start: $local_fs
# Required-Stop: $local_fs
-# Default-Start: 1 2 3 4 5
-# Default-Stop: 0 6
+# Default-Start:
+# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Configure s390 dump feature
# Description: Configures the s390 dump feature. It uses the configuration file
# /etc/sysconfig/dumpconf
### END INIT INFO
-# chkconfig: 12345 01 99
+# chkconfig: - 01 99
DUMP_CONFIG_FILE=/etc/sysconfig/dumpconf
@@ -320,6 +320,8 @@ start()
echo stop > $ON_PANIC_CONFIG_FILE
echo "ERROR: $ERRMSG Check $DUMP_CONFIG_FILE!" >&2
return $RETVAL
+ else
+ touch /var/lock/subsys/dumpconf
fi
return $RETVAL
@@ -334,6 +336,7 @@ stop()
else
echo "Disabling dump on panic failed" >&2
fi
+ rm -f /var/lock/subsys/dumpconf
return $RETVAL
}
diff --git a/etc/init.d/mon_statd b/etc/init.d/mon_statd
index 18f920b..fe1e0e4 100755
--- a/etc/init.d/mon_statd
+++ b/etc/init.d/mon_statd
@@ -1,16 +1,18 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: mon_statd
-# Required-Start: $remote_fs
-# Required-Stop: $remote_fs
-# Default-Start: 1 2 3 4 5
-# Default-Stop: 0 6
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Should-Start:
+# Should-Stop:
+# Default-Start:
+# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Configure the mon_fsstatd and mon_procd daemons.
# Description: Configures the mon_fsstatd and mon_procd daemons. It uses the
# configuration file /etc/sysconfig/mon_statd.
### END INIT INFO
-# chkconfig: 12345 01 99
+# chkconfig: - 01 99
DAEMON=mon_statd
FSSTATD=mon_fsstatd
@@ -45,16 +47,26 @@ start()
if [ ! -f $FSSTATD_PID_FILE -a "$FSSTAT" = "yes" ]; then
echo -n $"Starting $FSSTATD:"
- $FSSTATD_PATH -i $FSSTAT_INTERVAL && log_success_msg ||
- log_failure_msg
+ $FSSTATD_PATH -i $FSSTAT_INTERVAL
+ if [ $? == 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..."
fi
if [ ! -f $PROCD_PID_FILE -a "$PROC" = "yes" ]; then
echo -n $"Starting $PROCD:"
- $PROCD_PATH -i $PROC_INTERVAL && log_success_msg ||
- log_failure_msg
+ $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..."
fi
@@ -80,6 +92,7 @@ stop()
else
log_failure_msg
fi
+ rm -f /var/lock/subsys/mon_statd
echo
}
--
1.6.0.6

View File

@ -0,0 +1,25 @@
From a6ca2114c948a71c0bb5c9a5e7d0392315f1cefd Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 25 Mar 2009 08:56:38 +0100
Subject: [PATCH] allow override of default optimization level
---
common.mak | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common.mak b/common.mak
index 3acb534..0aff3ba 100644
--- a/common.mak
+++ b/common.mak
@@ -22,7 +22,7 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
INSTALL = install # FIXME: We need s390-install (strip)
-CFLAGS = $(OPT_FLAGS) -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE)
+CFLAGS = -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) $(OPT_FLAGS)
export AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP INSTALL CFLAGS
# Support alternate install root
--
1.6.0.6

View File

@ -0,0 +1,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++)
{

2
dasd.udev Normal file
View File

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

5
s390.csh Normal file
View File

@ -0,0 +1,5 @@
# /etc/profile.d/s390.csh - set TERM variable
if ( `/sbin/consoletype` == "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`
if [ "$contype" == "serial" ]; then
export TERM=dumb
fi

1059
s390utils.spec Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
5033eee356663d160784e37b193f93fa s390-tools-1.8.0.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,44 @@
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

1
zfcp.udev Normal file
View File

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

46
zfcpconf.sh Normal file
View File

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