forked from pool/s390-tools
Accepting request 535008 from home:markkp:branches:Base:System
Implemented parallel formatting patches, other misc. changes OBS-URL: https://build.opensuse.org/request/show/535008 OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=22
This commit is contained in:
parent
2cfb6d9dfa
commit
b5ca2618dd
@ -25,7 +25,7 @@ index e1877ac..f03cbad 100644
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -588,7 +616,7 @@
|
||||
*/
|
||||
static void check_disk(dasdfmt_info_t *info)
|
||||
static void check_disk(dasdfmt_info_t *info, char *devname)
|
||||
{
|
||||
- int ro, errno_save;
|
||||
+ int ro, errno_save, i = 0;
|
||||
|
@ -225,9 +225,12 @@ sub print_device
|
||||
$output .= "\t$adapter\t$wwpn\t$lun";
|
||||
|
||||
# check for dump record
|
||||
if (system("$ZGETDUMP -d ${device} >/dev/null 2>&1") == 0) {
|
||||
my $zgetdump = `$ZGETDUMP -d $device 2>&1`;
|
||||
if ($? == 0) {
|
||||
my ($dsize) = ($zgetdump =~ /Maximum dump size\.:\s+([0-9]+) MB/m);
|
||||
$dsize = $size unless (defined($dsize));
|
||||
$output = "$device\t${dsize}MB\t$adapter\t$wwpn\t$lun\tdumpdevice";
|
||||
$dump_device = 1;
|
||||
$output .= "\tdumpdevice";
|
||||
}
|
||||
}
|
||||
if ($only_dump_disks) {
|
||||
@ -300,6 +303,8 @@ sub determine_free_disks
|
||||
push(@zfcp, $device);
|
||||
}
|
||||
}
|
||||
# wait for udev to process all events triggered by sysopen(,O_EXCL)
|
||||
system("$UDEVADM settle");
|
||||
}
|
||||
|
||||
return(\@dasd, \@zfcp);
|
||||
|
@ -1,526 +0,0 @@
|
||||
--- s390-tools-1.34.0/dasdfmt/dasdfmt.8 2016-04-14 16:43:51.000000000 -0400
|
||||
+++ s390-tools-1.34.0/dasdfmt/dasdfmt.8 2016-04-14 16:35:01.000000000 -0400
|
||||
@@ -3,11 +3,11 @@
|
||||
dasdfmt \- formatting of DASD (ECKD) disk drives.
|
||||
|
||||
.SH SYNOPSIS
|
||||
-\fBdasdfmt\fR [-h] [-t] [-v] [-y] [-p] [-P] [-m \fIstep\fR]
|
||||
+\fBdasdfmt\fR [-h] [-t] [-v] [-y] [-p] [-Q] [-m \fIstep\fR]
|
||||
.br
|
||||
- [-r \fIcylinder\fR] [-b \fIblksize\fR] [-l \fIvolser\fR] [-d \fIlayout\fR]
|
||||
+ [-r \fIcylinder\fR] [-b \fIblksize\fR] [-l \fIvolser\fR] [-d \fIlayout\fR] [-P maxpar]
|
||||
.br
|
||||
- [-L] [-V] [-F] [-k] [-C] [-M \fImode\fR] \fIdevice\fR
|
||||
+ [-L] [-V] [-F] [-k] [-C] [-M \fImode\fR] \fIdevice\fR ...
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBdasdfmt\fR formats a DASD (ECKD) disk drive to prepare it
|
||||
@@ -95,7 +95,7 @@
|
||||
running in background or redirecting the output to a file.
|
||||
|
||||
.TP
|
||||
-\fB-P\fR or \fB--percentage\fR
|
||||
+\fB-Q\fR or \fB--percentage\fR
|
||||
Print one line for each formatted cylinder showing the number of the
|
||||
cylinder and percentage of formatting process.
|
||||
Intended to be used by higher level interfaces.
|
||||
@@ -152,6 +152,20 @@
|
||||
and always be a power of two. The recommended blocksize is 4096 bytes.
|
||||
|
||||
.TP
|
||||
+\fB-P\fR \fInumdisks\fR or \fB--max_parallel\fR=\fInumdisks\fR
|
||||
+Specify the number of disks to be formatted in
|
||||
+parallel. \FInumdisks\fR specifies the number of formatting processes
|
||||
+which is independent of the overall number of disks to be formatted as
|
||||
+specified on the commandline. The maximum value for \fInumdisks\fR is
|
||||
+1024. Default is 1.
|
||||
+.br
|
||||
+Using this option can
|
||||
+decrease overall processing time when formatting several disks.
|
||||
+Please note that the I/O throughput will dramatically increase when
|
||||
+using this option. Use with care.
|
||||
+.br
|
||||
+
|
||||
+.TP
|
||||
\fB-l\fR \fIvolser\fR or \fB--label\fR=\fIvolser\fR
|
||||
Specify the volume serial number or volume identifier to be written
|
||||
to disk after formatting. If no label is specified, a sensible default
|
||||
--- s390-tools-1.34.0/dasdfmt/dasdfmt.h 2016-04-14 16:43:51.000000000 -0400
|
||||
+++ s390-tools-1.34.0/dasdfmt/dasdfmt.h 2016-04-14 16:35:01.000000000 -0400
|
||||
@@ -260,6 +260,7 @@
|
||||
#define LABEL_LENGTH 14
|
||||
#define VLABEL_CHARS 84
|
||||
#define LINE_LENGTH 80
|
||||
+#define MAX_DEVICES 1024
|
||||
#define ERR_LENGTH 90
|
||||
|
||||
#define DEFAULT_BLOCKSIZE 4096
|
||||
@@ -214,7 +215,7 @@
|
||||
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:r:hpPLtyvVFkC"
|
||||
+#define dasdfmt_getopt_string "b:n:l:f:d:m:r:hpQLtyvVFkCYP:"
|
||||
|
||||
static struct option dasdfmt_getopt_long_options[]=
|
||||
{
|
||||
@@ -225,12 +226,14 @@
|
||||
{ "force", 0, 0, 'F'},
|
||||
{ "progressbar", 0, 0, 'p'},
|
||||
{ "hashmarks", 1, 0, 'm'},
|
||||
- { "percentage", 0, 0, 'P'},
|
||||
+ { "percentage", 0, 0, 'Q'},
|
||||
{ "label", 1, 0, 'l'},
|
||||
{ "device", 1, 0, 'f'},
|
||||
{ "blocksize", 1, 0, 'b'},
|
||||
{ "requestsize", 1, 0, 'r'},
|
||||
{ "help", 0, 0, 'h'},
|
||||
+ { "max_parallel",1, 0, 'P'},
|
||||
+ { "yast_mode", 0, 0, 'Y'},
|
||||
{ "keep_volser", 0, 0, 'k'},
|
||||
{ "norecordzero", 0, 0, 'z'},
|
||||
{ "check_host_count", 0, 0, 'C'},
|
||||
@@ -267,6 +270,8 @@
|
||||
int device_id;
|
||||
int keep_volser;
|
||||
int force_host;
|
||||
+ int yast_mode;
|
||||
+ int procnum;
|
||||
} dasdfmt_info_t;
|
||||
|
||||
|
||||
--- s390-tools-1.34.0/dasdfmt/dasdfmt.c 2016-04-14 16:43:51.000000000 -0400
|
||||
+++ s390-tools-1.34.0/dasdfmt/dasdfmt.c 2016-04-14 16:35:01.000000000 -0400
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "vtoc.h"
|
||||
#include "util_proc.h"
|
||||
#include "dasd_sys.h"
|
||||
+#include <sys/wait.h>
|
||||
|
||||
#define BUSIDSIZE 8
|
||||
|
||||
@@ -48,7 +49,7 @@
|
||||
*/
|
||||
static void exit_usage(int exitcode)
|
||||
{
|
||||
- printf("Usage: %s [-htvypPLVFkC]\n"
|
||||
+ printf("Usage: %s [-htvypQLVFkC]\n"
|
||||
" [-l <volser> | --label=<volser>]\n"
|
||||
" [-b <blocksize> | --blocksize=<blocksize>]\n"
|
||||
" [-d <disk layout> | --disk_layout=<disk layout>]\n"
|
||||
@@ -59,7 +60,7 @@
|
||||
" -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 in percent\n"
|
||||
+ " -Q or --percentage means show a progress in percent\n"
|
||||
" -m x or --hashmarks=x means show a hashmark every x "
|
||||
"cylinders\n"
|
||||
" -r x or --requestsize=x means use x cylinders in one "
|
||||
@@ -143,22 +144,33 @@
|
||||
/*
|
||||
* check given device name for blanks and some special characters
|
||||
*/
|
||||
-static void get_device_name(dasdfmt_info_t *info, char *name, int argc, char * argv[])
|
||||
+static char* getdev(char* sysfs_path)
|
||||
{
|
||||
- struct util_proc_dev_entry dev_entry;
|
||||
- struct stat dev_stat;
|
||||
-
|
||||
- if (info->node_specified && (info->device_id < argc))
|
||||
- ERRMSG_EXIT(EXIT_MISUSE,"%s: Device can only specified once!\n",
|
||||
- prog_name);
|
||||
+ DIR* d;
|
||||
+ struct dirent* de;
|
||||
+
|
||||
+ d = opendir(sysfs_path);
|
||||
+ if(!d) ERRMSG_EXIT(EXIT_FAILURE,"%s: Could not open directory %s.\n",prog_name,sysfs_path);
|
||||
+ while((de = readdir(d)))
|
||||
+ {
|
||||
+ if(strncmp(de->d_name,"block:",6) == 0)
|
||||
+ {
|
||||
+ closedir(d);
|
||||
+ return de->d_name+6;
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
- if (!info->node_specified && (info->device_id >= argc))
|
||||
- ERRMSG_EXIT(EXIT_MISUSE,"%s: No device specified!\n",
|
||||
- prog_name);
|
||||
+static void get_device_name(dasdfmt_info_t *info, char *name)
|
||||
+{
|
||||
+ struct util_proc_dev_entry dev_entry;
|
||||
+ struct stat dev_stat;
|
||||
+ char buf[PATH_MAX];
|
||||
+ char devno[9];
|
||||
+ char* device;
|
||||
+ int i;
|
||||
|
||||
- if (info->device_id < argc) {
|
||||
- strcpy(info->devname, argv[info->device_id]);
|
||||
- } else {
|
||||
if ((strchr(name, ' ') != NULL)||(strchr(name, '#') != NULL)||
|
||||
(strchr(name, '[') != NULL)||(strchr(name, ']') != NULL)||
|
||||
(strchr(name, '!') != NULL)||(strchr(name, '>') != NULL)||
|
||||
@@ -169,9 +181,38 @@
|
||||
"blanks or special characters!\n",
|
||||
prog_name);
|
||||
|
||||
- strncpy(info->devname, name, PATH_MAX - 1);
|
||||
+ if (isxdigit(name[0]) && name[1] == '.' && isxdigit(name[2]) && name[3] == '.' && strlen(name) == 8)
|
||||
+ { /* x.x.xxxx format */
|
||||
+ for(i=0; i<8; i++)
|
||||
+ devno[i] = tolower(name[i]);
|
||||
+ devno[8] = 0;
|
||||
+ sprintf(buf,"/sys/bus/ccw/devices/%s",devno);
|
||||
+ device = getdev(buf);
|
||||
+ if(device)
|
||||
+ {
|
||||
+ strcpy(info->devname,"/dev/");
|
||||
+ strcat(info->devname,device);
|
||||
+ }
|
||||
+ else ERRMSG_EXIT(EXIT_FAILURE,"%s: Could not find device file for device no. %s\n",prog_name,name);
|
||||
+ }
|
||||
+ else if (isxdigit(name[0]) && isxdigit(name[1]) && isxdigit(name[2]) && isxdigit(name[3]))
|
||||
+ { /* xxxx format */
|
||||
+ for(i=0; i<4; i++)
|
||||
+ devno[i] = tolower(name[i]);
|
||||
+ devno[4] = 0;
|
||||
+ sprintf(buf,"/sys/bus/ccw/devices/0.0.%s",devno);
|
||||
+ device = getdev(buf);
|
||||
+ if(device)
|
||||
+ {
|
||||
+ strcpy(info->devname,"/dev/");
|
||||
+ strcat(info->devname,device);
|
||||
+ }
|
||||
+ else ERRMSG_EXIT(EXIT_FAILURE,"%s: Could not find device file for device no. %s\n",prog_name,name);
|
||||
+ }
|
||||
+ else
|
||||
+ strncpy(info->devname, name, PATH_MAX - 1);
|
||||
+
|
||||
info->devname[PATH_MAX - 1] = '\0';
|
||||
- }
|
||||
|
||||
if (stat(info->devname, &dev_stat) != 0)
|
||||
ERRMSG_EXIT(EXIT_MISUSE,
|
||||
@@ -217,8 +258,9 @@
|
||||
info->reqsize_specified = 0;
|
||||
info->node_specified = 0;
|
||||
info->device_id = 0;
|
||||
- info->keep_volser = 0;
|
||||
+ info->keep_volser = 0;
|
||||
info->force_host = 0;
|
||||
+ info->yast_mode = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +313,6 @@
|
||||
}
|
||||
|
||||
|
||||
-
|
||||
/*
|
||||
* check the volume serial for special
|
||||
* characters and move blanks to the end
|
||||
@@ -640,7 +681,7 @@
|
||||
info->hashstep = 10;
|
||||
}
|
||||
|
||||
- printf("Printing hashmark every %d cylinders.\n",
|
||||
+ if(!info->yast_mode) printf("Printing hashmark every %d cylinders.\n",
|
||||
info->hashstep);
|
||||
}
|
||||
|
||||
@@ -649,7 +690,7 @@
|
||||
|
||||
k = 0;
|
||||
cyl = 1;
|
||||
- if (info->print_progressbar || info->print_hashmarks)
|
||||
+ if ((info->print_progressbar || info->print_hashmarks) && !info->yast_mode)
|
||||
printf("\n");
|
||||
|
||||
while (1) {
|
||||
@@ -688,7 +729,7 @@
|
||||
|
||||
if (info->print_hashmarks)
|
||||
if ((cyl / info->hashstep - hashcount) != 0) {
|
||||
- printf("#");
|
||||
+ printf("%d|",info->procnum);
|
||||
fflush(stdout);
|
||||
hashcount++;
|
||||
}
|
||||
@@ -709,7 +750,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
- if (info->print_progressbar || info->print_hashmarks)
|
||||
+ if ((info->print_progressbar || info->print_hashmarks) && !info->yast_mode)
|
||||
printf("\n\n");
|
||||
}
|
||||
|
||||
@@ -884,17 +925,21 @@
|
||||
|
||||
dasdfmt_prepare_and_format(info, cylinders, heads, p);
|
||||
|
||||
- printf("Finished formatting the device.\n");
|
||||
+ if (!info->yast_mode)
|
||||
+ printf("Finished formatting the device.\n");
|
||||
|
||||
if (!info->writenolabel)
|
||||
dasdfmt_write_labels(info, vlabel, cylinders, heads);
|
||||
|
||||
- printf("Rereading the partition table... ");
|
||||
+ if (!info->yast_mode)
|
||||
+ printf("Rereading the partition table... ");
|
||||
if (reread_partition_table()) {
|
||||
ERRMSG("%s: error during rereading the partition "
|
||||
"table: %s.\n", prog_name, strerror(errno));
|
||||
- } else
|
||||
- printf("ok\n");
|
||||
+ } else {
|
||||
+ if (!info->yast_mode)
|
||||
+ printf("ok\n");
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -905,7 +950,8 @@
|
||||
volume_label_t vlabel;
|
||||
char old_volser[7];
|
||||
|
||||
- char dev_filename[PATH_MAX];
|
||||
+ char* dev_filename[MAX_DEVICES];
|
||||
+ int dev_count=0;
|
||||
char str[ERR_LENGTH];
|
||||
char buf[7];
|
||||
|
||||
@@ -913,7 +959,10 @@
|
||||
char *reqsize_param_str = NULL;
|
||||
char *hashstep_str = NULL;
|
||||
|
||||
- int rc, index;
|
||||
+ int rc, index, i;
|
||||
+
|
||||
+ int max_parallel=1;
|
||||
+ int running=0;
|
||||
|
||||
/* Establish a handler for interrupt signals. */
|
||||
signal (SIGTERM, program_interrupt_signal);
|
||||
@@ -990,7 +1039,7 @@
|
||||
}
|
||||
break;
|
||||
|
||||
- case 'P':
|
||||
+ case 'Q':
|
||||
if (!(info.print_hashmarks || info.print_progressbar))
|
||||
info.print_percentage = 1;
|
||||
break;
|
||||
@@ -1034,9 +1083,18 @@
|
||||
info.reqsize_specified = 1;
|
||||
break;
|
||||
case 'f' :
|
||||
- strncpy(dev_filename, optarg, PATH_MAX);
|
||||
+ if(dev_count>=MAX_DEVICES)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE,"%s: too many devices specified.\n",
|
||||
+ prog_name);
|
||||
+ dev_filename[dev_count++]=strdup(optarg);
|
||||
info.node_specified=1;
|
||||
break;
|
||||
+ case 'Y' : /* YaST mode */
|
||||
+ info.yast_mode=1;
|
||||
+ break;
|
||||
+ case 'P' : /* max parallel formatting processes */
|
||||
+ max_parallel=atoi(optarg);
|
||||
+ break;
|
||||
case 'k' :
|
||||
info.keep_volser=1;
|
||||
break;
|
||||
@@ -1059,58 +1117,147 @@
|
||||
CHECK_SPEC_MAX_ONCE(info.labelspec, "label");
|
||||
CHECK_SPEC_MAX_ONCE(info.writenolabel, "omit-label-writing flag");
|
||||
|
||||
- if (info.blksize_specified)
|
||||
- PARSE_PARAM_INTO(format_params.blksize,blksize_param_str,10,
|
||||
- "blocksize");
|
||||
- if (info.reqsize_specified) {
|
||||
- PARSE_PARAM_INTO(reqsize, reqsize_param_str, 10, "requestsize");
|
||||
- if (reqsize < 1 || reqsize > 255)
|
||||
- ERRMSG_EXIT(EXIT_FAILURE,
|
||||
- "invalid requestsize %d specified\n",
|
||||
- reqsize);
|
||||
- } else
|
||||
- reqsize = DEFAULT_REQUESTSIZE;
|
||||
- if (info.print_hashmarks)
|
||||
- PARSE_PARAM_INTO(info.hashstep, hashstep_str,10,"hashstep");
|
||||
-
|
||||
- get_device_name(&info, dev_filename, argc, argv);
|
||||
+ while(info.device_id < argc) { /* devices specified at the end of cmdline */
|
||||
+ if(dev_count>=MAX_DEVICES)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE,"%s: too many devices specified.\n",
|
||||
+ prog_name);
|
||||
+ dev_filename[dev_count++]=strdup(argv[info.device_id]);
|
||||
+ info.node_specified=1;
|
||||
+ info.device_id++;
|
||||
+ }
|
||||
|
||||
- if (!info.blksize_specified)
|
||||
- format_params = ask_user_for_blksize(format_params);
|
||||
+ if (info.node_specified == 0)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE,"%s: No device specified!\n",
|
||||
+ prog_name);
|
||||
|
||||
if (info.keep_volser) {
|
||||
if(info.labelspec) {
|
||||
ERRMSG_EXIT(EXIT_MISUSE,"%s: The -k and -l options are mutually exclusive\n",
|
||||
prog_name);
|
||||
}
|
||||
- if(!(format_params.intensity & DASD_FMT_INT_COMPAT)) {
|
||||
- printf("WARNING: VOLSER cannot be kept " \
|
||||
- "when using the ldl format!\n");
|
||||
- exit(1);
|
||||
+ }
|
||||
+
|
||||
+ if (info.labelspec && max_parallel > 1) {
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE,"%s: The -l option cannot be used with parallel formatting\n",
|
||||
+ prog_name);
|
||||
+ }
|
||||
+
|
||||
+ if(info.yast_mode) {
|
||||
+ for(i=0;i<dev_count;i++) {
|
||||
+ dasd_information_t dasd_info;
|
||||
+ struct dasd_eckd_characteristics *characteristics;
|
||||
+ unsigned int cylinders;
|
||||
+
|
||||
+ get_device_name(&info, dev_filename[i]);
|
||||
+ if ((filedes = open(info.devname, O_RDWR)) == -1) {
|
||||
+ ERRMSG("%s: Unable to open device %s: %s\n",
|
||||
+ prog_name, info.devname, strerror(errno));
|
||||
+ free(dev_filename[i]);
|
||||
+ dev_filename[i]=(char*)-1; /* ignore device */
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (ioctl(filedes, BIODASDINFO, &dasd_info) != 0) {
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE, "%s: (retrieving disk information) "
|
||||
+ "IOCTL BIODASDINFO failed (%s).\n",
|
||||
+ prog_name, strerror(errno));
|
||||
+ free(dev_filename[i]);
|
||||
+ dev_filename[i]=(char*)-1; /* ignore device */
|
||||
+ close(filedes);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ characteristics =
|
||||
+ (struct dasd_eckd_characteristics *) &dasd_info.characteristics;
|
||||
+ if (characteristics->no_cyl == LV_COMPAT_CYL &&
|
||||
+ characteristics->long_no_cyl)
|
||||
+ cylinders = characteristics->long_no_cyl;
|
||||
+ else
|
||||
+ cylinders = characteristics->no_cyl;
|
||||
+
|
||||
+ printf("%d\n", cylinders);
|
||||
+ close(filedes);
|
||||
}
|
||||
-
|
||||
- if(dasdfmt_get_volser(info.devname, old_volser) == 0)
|
||||
- vtoc_volume_label_set_volser(&vlabel, old_volser);
|
||||
- else
|
||||
- ERRMSG_EXIT(EXIT_FAILURE,"%s: VOLSER not found on device %s\n",
|
||||
- prog_name, info.devname);
|
||||
-
|
||||
+ fflush(stdout);
|
||||
}
|
||||
|
||||
- if ((filedes = open(info.devname, O_RDWR)) == -1)
|
||||
- ERRMSG_EXIT(EXIT_FAILURE,"%s: Unable to open device %s: %s\n",
|
||||
- prog_name, info.devname, strerror(errno));
|
||||
+ /* fork one formatting process for each device */
|
||||
+ rc = 0;
|
||||
+ for(i=0;i<dev_count;i++) {
|
||||
+ int chpid; /* child process ID */
|
||||
+ int tmp;
|
||||
|
||||
- check_disk(&info);
|
||||
+ if(dev_filename[i]==(char*)-1) continue; /* ignore device */
|
||||
|
||||
- if (check_param(str, ERR_LENGTH, &format_params) < 0)
|
||||
- ERRMSG_EXIT(EXIT_MISUSE, "%s: %s\n", prog_name, str);
|
||||
+ chpid=fork();
|
||||
+ if(chpid==-1)
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE,"%s: Unable to create child process: %s\n",
|
||||
+ prog_name, strerror(errno));
|
||||
|
||||
- do_format_dasd(&info, &format_params, &vlabel);
|
||||
+ if(!chpid) {
|
||||
+ info.procnum=i;
|
||||
+ if (info.blksize_specified)
|
||||
+ PARSE_PARAM_INTO(format_params.blksize,blksize_param_str,10,
|
||||
+ "blocksize");
|
||||
+ if (info.reqsize_specified) {
|
||||
+ PARSE_PARAM_INTO(reqsize, reqsize_param_str, 10, "requestsize");
|
||||
+ if (reqsize < 1 || reqsize > 255)
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE,
|
||||
+ "invalid requestsize %d specified\n",
|
||||
+ reqsize);
|
||||
+ } else
|
||||
+ reqsize = DEFAULT_REQUESTSIZE;
|
||||
+ if (info.print_hashmarks)
|
||||
+ PARSE_PARAM_INTO(info.hashstep, hashstep_str,10,"hashstep");
|
||||
+
|
||||
+ get_device_name(&info, dev_filename[i]);
|
||||
+
|
||||
+ if (!info.blksize_specified)
|
||||
+ format_params = ask_user_for_blksize(format_params);
|
||||
+
|
||||
+ if (info.keep_volser) {
|
||||
+ if(format_params.intensity == 0x00) {
|
||||
+ printf("WARNING: VOLSER cannot be kept " \
|
||||
+ "when using the ldl format!\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
|
||||
- if (close(filedes) != 0)
|
||||
- ERRMSG("%s: error during close: %s\ncontinuing...\n",
|
||||
- prog_name, strerror(errno));
|
||||
+ if(dasdfmt_get_volser(info.devname, old_volser) == 0)
|
||||
+ vtoc_volume_label_set_volser(&vlabel, old_volser);
|
||||
+ else
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE,"%s: VOLSER not found on device %s\n",
|
||||
+ prog_name, info.devname);
|
||||
|
||||
- return 0;
|
||||
+ }
|
||||
+
|
||||
+ if ((filedes = open(info.devname, O_RDWR)) == -1)
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE,"%s: Unable to open device %s: %s\n",
|
||||
+ prog_name, info.devname, strerror(errno));
|
||||
+
|
||||
+ check_disk(&info);
|
||||
+
|
||||
+ if (check_param(str, ERR_LENGTH, &format_params) < 0)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE, "%s: %s\n", prog_name, str);
|
||||
+
|
||||
+ do_format_dasd(&info, &format_params, &vlabel);
|
||||
+
|
||||
+ if (close(filedes) != 0)
|
||||
+ ERRMSG("%s: error during close: %s\ncontinuing...\n",
|
||||
+ prog_name, strerror(errno));
|
||||
+
|
||||
+ exit(0);
|
||||
+ } else {
|
||||
+ running++;
|
||||
+ if(running>=max_parallel) {
|
||||
+ if(wait(&tmp) > 0 && WEXITSTATUS(tmp))
|
||||
+ rc = WEXITSTATUS(tmp);
|
||||
+ running--;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* wait until all formatting children have finished */
|
||||
+ while(wait(&i) > 0)
|
||||
+ if (WEXITSTATUS(i)) rc = WEXITSTATUS(i);
|
||||
+
|
||||
+ return rc;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
From c261ec990a8259f2540089827309b918e1c31590 Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Fri, 22 Nov 2013 15:34:22 +0100
|
||||
Subject: [PATCH 5/8] dumpconf: Use compatible sysconfig layout
|
||||
Subject: [PATCH] dumpconf: Use compatible sysconfig layout
|
||||
|
||||
SUSE is quite restrictive on how the sysconfig
|
||||
should look like.
|
||||
|
@ -1,7 +1,7 @@
|
||||
From f7a0f391f2c4e8acc96b21ab5de54a178aa60088 Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Fri, 22 Nov 2013 15:39:38 +0100
|
||||
Subject: [PATCH 8/8] 59-dasd.rules: generate by-id links on 'change' and 'add'
|
||||
Subject: [PATCH] 59-dasd.rules: generate by-id links on 'change' and 'add'
|
||||
|
||||
The by-id rules need to be triggered on both, 'change' and 'add',
|
||||
to work correctly during restarting udev.
|
||||
|
278
s390-tools-sles15-Allow-multiple-device-arguments.patch
Normal file
278
s390-tools-sles15-Allow-multiple-device-arguments.patch
Normal file
@ -0,0 +1,278 @@
|
||||
From d6582bbaf0f3986a42f562046dc0caa9de89c75e Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Fri, 6 Oct 2017 08:58:17 +0200
|
||||
Subject: [PATCH] dasdfmt: Allow multiple device arguments
|
||||
|
||||
Allow the user to specify several devices as arguments to dasdfmt.
|
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.com>
|
||||
---
|
||||
dasdfmt/dasdfmt.8 | 5 +-
|
||||
dasdfmt/dasdfmt.c | 175 ++++++++++++++++++++++++++++++------------------------
|
||||
2 files changed, 100 insertions(+), 80 deletions(-)
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.8 b/dasdfmt/dasdfmt.8
|
||||
index 99da9ed..e7fc501 100644
|
||||
--- a/dasdfmt/dasdfmt.8
|
||||
+++ b/dasdfmt/dasdfmt.8
|
||||
@@ -11,14 +11,15 @@ dasdfmt \- formatting of DASD (ECKD) disk drives.
|
||||
.br
|
||||
[-r \fIcylinder\fR] [-b \fIblksize\fR] [-l \fIvolser\fR] [-d \fIlayout\fR]
|
||||
.br
|
||||
- [-L] [-V] [-F] [-k] [-C] [-M \fImode\fR] \fIdevice\fR
|
||||
+ [-L] [-V] [-F] [-k] [-C] [-M \fImode\fR] \fIdevice\fR [\fIdevice\fR]
|
||||
|
||||
.SH DESCRIPTION
|
||||
-\fBdasdfmt\fR formats a DASD (ECKD) disk drive to prepare it
|
||||
+\fBdasdfmt\fR formats one or several DASD (ECKD) disk drive to prepare it
|
||||
for usage with Linux for S/390.
|
||||
The \fIdevice\fR is the node of the device (e.g. '/dev/dasda').
|
||||
Any device node created by udev for kernel 2.6 can be used
|
||||
(e.g. '/dev/dasd/0.0.b100/disc').
|
||||
+It is possible to specify up to 512 devices.
|
||||
.br
|
||||
|
||||
\fBWARNING\fR: Careless usage of \fBdasdfmt\fR can result in
|
||||
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
|
||||
index b79cff0..607fd1c 100644
|
||||
--- a/dasdfmt/dasdfmt.c
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "dasdfmt.h"
|
||||
|
||||
+#define MAX_DEVICES 512
|
||||
#define BUSIDSIZE 8
|
||||
#define SEC_PER_DAY (60 * 60 * 24)
|
||||
#define SEC_PER_HOUR (60 * 60)
|
||||
@@ -456,44 +457,40 @@ static void program_interrupt_signal(int sig)
|
||||
/*
|
||||
* check given device name for blanks and some special characters
|
||||
*/
|
||||
-static void get_device_name(char *devname,
|
||||
- int optind, int argc, char *argv[])
|
||||
+static void get_device_name(char **devname, int numdev,
|
||||
+ char argv[])
|
||||
{
|
||||
struct util_proc_dev_entry dev_entry;
|
||||
struct stat dev_stat;
|
||||
|
||||
- if (optind + 1 < argc)
|
||||
- ERRMSG_EXIT(EXIT_MISUSE,
|
||||
- "%s: More than one device specified!\n", prog_name);
|
||||
-
|
||||
- if (optind >= argc)
|
||||
- ERRMSG_EXIT(EXIT_MISUSE, "%s: No device specified!\n",
|
||||
- prog_name);
|
||||
-
|
||||
- if (strlen(argv[optind]) >= PATH_MAX)
|
||||
+ if (strlen(argv) >= PATH_MAX)
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: device name too long!\n",
|
||||
prog_name);
|
||||
- strcpy(devname, argv[optind]);
|
||||
|
||||
- if (stat(devname, &dev_stat) != 0)
|
||||
- ERRMSG_EXIT(EXIT_MISUSE, "%s: Could not get information for "
|
||||
- "device node %s: %s\n", prog_name, devname,
|
||||
- strerror(errno));
|
||||
+ devname[numdev] = argv;
|
||||
+ if (stat(devname[numdev], &dev_stat) != 0)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE,
|
||||
+ "%s: Could not get information for "
|
||||
+ "device node %s: %s\n", prog_name,
|
||||
+ devname[numdev], strerror(errno));
|
||||
|
||||
if (minor(dev_stat.st_rdev) & PARTN_MASK) {
|
||||
- ERRMSG_EXIT(EXIT_MISUSE, "%s: Unable to format partition %s. "
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE,
|
||||
+ "%s: Unable to format partition %s. "
|
||||
"Please specify a device.\n", prog_name,
|
||||
- devname);
|
||||
+ devname[numdev]);
|
||||
}
|
||||
|
||||
- if (util_proc_dev_get_entry(dev_stat.st_rdev, 1, &dev_entry) == 0) {
|
||||
+ if (util_proc_dev_get_entry(dev_stat.st_rdev, 1,
|
||||
+ &dev_entry) == 0) {
|
||||
if (strncmp(dev_entry.name, "dasd", 4) != 0)
|
||||
ERRMSG_EXIT(EXIT_MISUSE,
|
||||
"%s: Unsupported device type '%s'.\n",
|
||||
prog_name, dev_entry.name);
|
||||
} else {
|
||||
- printf("%s WARNING: Unable to get driver name for device node %s",
|
||||
- prog_name, devname);
|
||||
+ printf("%s WARNING: Unable to get driver name"
|
||||
+ " for device node %s",
|
||||
+ prog_name, devname[numdev]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1457,24 +1454,86 @@ static void do_format_dasd(dasdfmt_info_t *info, char *devname,
|
||||
}
|
||||
}
|
||||
|
||||
+void do_dasdfmt(char *dev_filename, dasdfmt_info_t *info,
|
||||
+ volume_label_t *orig_vlabel)
|
||||
+{
|
||||
+ volume_label_t vlabel;
|
||||
+ char old_volser[7];
|
||||
+ char str[ERR_LENGTH];
|
||||
+ unsigned int cylinders, heads;
|
||||
+
|
||||
+ filedes = open(dev_filename, O_RDWR);
|
||||
+ if (filedes == -1)
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE, "%s: Unable to open device %s: %s\n",
|
||||
+ prog_name, dev_filename, strerror(errno));
|
||||
+
|
||||
+ get_device_info(info);
|
||||
+ memcpy(&vlabel, orig_vlabel, sizeof(vlabel));
|
||||
+ /* Either let the user specify the blksize or get it from the kernel */
|
||||
+ if (!info->blksize_specified) {
|
||||
+ if (!(mode == FULL ||
|
||||
+ info->dasd_info.format == DASD_FORMAT_NONE)
|
||||
+ || info->check)
|
||||
+ get_blocksize(&format_params.blksize);
|
||||
+ else
|
||||
+ format_params = ask_user_for_blksize(format_params);
|
||||
+ }
|
||||
+
|
||||
+ if (info->keep_volser) {
|
||||
+ if (info->labelspec) {
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE, "%s: The -k and -l options "
|
||||
+ "are mutually exclusive\n", prog_name);
|
||||
+ }
|
||||
+ if (!(format_params.intensity & DASD_FMT_INT_COMPAT)) {
|
||||
+ printf("WARNING: VOLSER cannot be kept "
|
||||
+ "when using the ldl format!\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ if (dasdfmt_get_volser(dev_filename,
|
||||
+ &info->dasd_info, old_volser) == 0)
|
||||
+ vtoc_volume_label_set_volser(&vlabel, old_volser);
|
||||
+ else
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE,
|
||||
+ "%s: VOLSER not found on device %s\n",
|
||||
+ prog_name, dev_filename);
|
||||
+ }
|
||||
+
|
||||
+ check_disk(info, dev_filename);
|
||||
+
|
||||
+ if (check_param(str, ERR_LENGTH, &format_params) < 0)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE, "%s: %s\n", prog_name, str);
|
||||
+
|
||||
+ set_geo(info, &cylinders, &heads);
|
||||
+ set_label(info, &vlabel, &format_params, cylinders);
|
||||
+
|
||||
+ if (info->check)
|
||||
+ check_disk_format(info, cylinders, heads, &format_params);
|
||||
+ else
|
||||
+ do_format_dasd(info, dev_filename, &vlabel,
|
||||
+ &format_params, cylinders, heads);
|
||||
+
|
||||
+ if (close(filedes) != 0)
|
||||
+ ERRMSG("%s: error during close: %s\ncontinuing...\n",
|
||||
+ prog_name, strerror(errno));
|
||||
+
|
||||
+}
|
||||
+
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
dasdfmt_info_t info = {
|
||||
.dasd_info = {0},
|
||||
};
|
||||
volume_label_t vlabel;
|
||||
- char old_volser[7];
|
||||
|
||||
- char dev_filename[PATH_MAX];
|
||||
- char str[ERR_LENGTH];
|
||||
+ char *dev_filename[MAX_DEVICES];
|
||||
char buf[7];
|
||||
|
||||
char *blksize_param_str = NULL;
|
||||
char *reqsize_param_str = NULL;
|
||||
char *hashstep_str = NULL;
|
||||
|
||||
- int rc;
|
||||
- unsigned int cylinders, heads;
|
||||
+ int rc, numdev = 0, i;
|
||||
|
||||
/* Establish a handler for interrupt signals. */
|
||||
signal(SIGTERM, program_interrupt_signal);
|
||||
@@ -1634,61 +1693,21 @@ int main(int argc, char *argv[])
|
||||
if (info.print_hashmarks)
|
||||
PARSE_PARAM_INTO(info.hashstep, hashstep_str, 10, "hashstep");
|
||||
|
||||
- get_device_name(dev_filename, optind, argc, argv);
|
||||
-
|
||||
- filedes = open(dev_filename, O_RDWR);
|
||||
- if (filedes == -1)
|
||||
- ERRMSG_EXIT(EXIT_FAILURE, "%s: Unable to open device %s: %s\n",
|
||||
- prog_name, dev_filename, strerror(errno));
|
||||
-
|
||||
- get_device_info(&info);
|
||||
+ while (optind < argc) {
|
||||
+ if (optind >= argc)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE, "%s: No device specified!\n",
|
||||
+ prog_name);
|
||||
|
||||
- /* Either let the user specify the blksize or get it from the kernel */
|
||||
- if (!info.blksize_specified) {
|
||||
- if (!(mode == FULL ||
|
||||
- info.dasd_info.format == DASD_FORMAT_NONE) || info.check)
|
||||
- get_blocksize(&format_params.blksize);
|
||||
- else
|
||||
- format_params = ask_user_for_blksize(format_params);
|
||||
+ get_device_name(dev_filename, numdev, argv[optind]);
|
||||
+ optind++;
|
||||
+ numdev++;
|
||||
}
|
||||
|
||||
- if (info.keep_volser) {
|
||||
- if (info.labelspec) {
|
||||
- ERRMSG_EXIT(EXIT_MISUSE, "%s: The -k and -l options "
|
||||
- "are mutually exclusive\n", prog_name);
|
||||
- }
|
||||
- if (!(format_params.intensity & DASD_FMT_INT_COMPAT)) {
|
||||
- printf("WARNING: VOLSER cannot be kept "
|
||||
- "when using the ldl format!\n");
|
||||
- exit(1);
|
||||
- }
|
||||
-
|
||||
- if (dasdfmt_get_volser(dev_filename,
|
||||
- &info.dasd_info, old_volser) == 0)
|
||||
- vtoc_volume_label_set_volser(&vlabel, old_volser);
|
||||
- else
|
||||
- ERRMSG_EXIT(EXIT_FAILURE,
|
||||
- "%s: VOLSER not found on device %s\n",
|
||||
- prog_name, dev_filename);
|
||||
- }
|
||||
-
|
||||
- check_disk(&info, dev_filename);
|
||||
-
|
||||
- if (check_param(str, ERR_LENGTH, &format_params) < 0)
|
||||
- ERRMSG_EXIT(EXIT_MISUSE, "%s: %s\n", prog_name, str);
|
||||
-
|
||||
- set_geo(&info, &cylinders, &heads);
|
||||
- set_label(&info, &vlabel, &format_params, cylinders);
|
||||
-
|
||||
- if (info.check)
|
||||
- check_disk_format(&info, cylinders, heads, &format_params);
|
||||
- else
|
||||
- do_format_dasd(&info, dev_filename, &vlabel,
|
||||
- &format_params, cylinders, heads);
|
||||
-
|
||||
- if (close(filedes) != 0)
|
||||
- ERRMSG("%s: error during close: %s\ncontinuing...\n",
|
||||
- prog_name, strerror(errno));
|
||||
+ if (!numdev)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE, "%s: No device specified!\n",
|
||||
+ prog_name);
|
||||
|
||||
+ for (i = 0; i < numdev; i++)
|
||||
+ do_dasdfmt(dev_filename[i], &info, &vlabel);
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
1.7.12.4
|
||||
|
81
s390-tools-sles15-Drop-device_id-parameter.patch
Normal file
81
s390-tools-sles15-Drop-device_id-parameter.patch
Normal file
@ -0,0 +1,81 @@
|
||||
From 320946c0e9b2a80c3569d8f736621c99392fc413 Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Thu, 5 Oct 2017 10:11:57 +0200
|
||||
Subject: [PATCH] dasdfmt: drop 'device_id' parameter
|
||||
|
||||
Drop device_id parameter from dasdfmt_info() and pass in 'optind'
|
||||
directly.
|
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.com>
|
||||
---
|
||||
dasdfmt/dasdfmt.c | 15 +++++++--------
|
||||
dasdfmt/dasdfmt.h | 1 -
|
||||
2 files changed, 7 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
|
||||
index 3da7902..b79cff0 100644
|
||||
--- a/dasdfmt/dasdfmt.c
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -456,24 +456,24 @@ static void program_interrupt_signal(int sig)
|
||||
/*
|
||||
* check given device name for blanks and some special characters
|
||||
*/
|
||||
-static void get_device_name(dasdfmt_info_t *info, char *devname, int argc,
|
||||
- char *argv[])
|
||||
+static void get_device_name(char *devname,
|
||||
+ int optind, int argc, char *argv[])
|
||||
{
|
||||
struct util_proc_dev_entry dev_entry;
|
||||
struct stat dev_stat;
|
||||
|
||||
- if (info->device_id + 1 < argc)
|
||||
+ if (optind + 1 < argc)
|
||||
ERRMSG_EXIT(EXIT_MISUSE,
|
||||
"%s: More than one device specified!\n", prog_name);
|
||||
|
||||
- if (info->device_id >= argc)
|
||||
+ if (optind >= argc)
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: No device specified!\n",
|
||||
prog_name);
|
||||
|
||||
- if (strlen(argv[info->device_id]) >= PATH_MAX)
|
||||
+ if (strlen(argv[optind]) >= PATH_MAX)
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: device name too long!\n",
|
||||
prog_name);
|
||||
- strcpy(devname, argv[info->device_id]);
|
||||
+ strcpy(devname, argv[optind]);
|
||||
|
||||
if (stat(devname, &dev_stat) != 0)
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: Could not get information for "
|
||||
@@ -1604,7 +1604,6 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
case -1:
|
||||
/* End of options string - start of devices list */
|
||||
- info.device_id = optind;
|
||||
break;
|
||||
default:
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "Try '%s --help' for more"
|
||||
@@ -1635,7 +1634,7 @@ int main(int argc, char *argv[])
|
||||
if (info.print_hashmarks)
|
||||
PARSE_PARAM_INTO(info.hashstep, hashstep_str, 10, "hashstep");
|
||||
|
||||
- get_device_name(&info, dev_filename, argc, argv);
|
||||
+ get_device_name(dev_filename, optind, argc, argv);
|
||||
|
||||
filedes = open(dev_filename, O_RDWR);
|
||||
if (filedes == -1)
|
||||
diff --git a/dasdfmt/dasdfmt.h b/dasdfmt/dasdfmt.h
|
||||
index 9ce3b92..a5581f1 100644
|
||||
--- a/dasdfmt/dasdfmt.h
|
||||
+++ b/dasdfmt/dasdfmt.h
|
||||
@@ -303,7 +303,6 @@ typedef struct dasdfmt_info {
|
||||
int cdl_format;
|
||||
int blksize_specified;
|
||||
int reqsize_specified;
|
||||
- int device_id;
|
||||
int keep_volser;
|
||||
int force_host;
|
||||
int layout_specified;
|
||||
--
|
||||
1.7.12.4
|
||||
|
69
s390-tools-sles15-Fix-truncation-warning.patch
Normal file
69
s390-tools-sles15-Fix-truncation-warning.patch
Normal file
@ -0,0 +1,69 @@
|
||||
From 1261105fe238ad306db29a9d47bb1a293bddf9aa Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20H=C3=B6ppner?= <hoeppner@linux.vnet.ibm.com>
|
||||
Date: Mon, 16 Oct 2017 15:46:07 +0200
|
||||
Subject: [PATCH] dasdinfo: Fix truncation warning
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Commit 3c80f7e025db ("dasdinfo: fix buffer overflow warning") changed a
|
||||
sprintf call to snprintf to avoid a buffer overflow warning. However,
|
||||
GCC 7 now warns about a potential truncation with snprintf:
|
||||
|
||||
dasdinfo.c: In function 'main':
|
||||
dasdinfo.c:577:18: warning: '%s' directive output may be truncated
|
||||
writing up to 255 bytes into a region of size 69 [-Wformat-truncation=]
|
||||
"/sys/block/%s/device/uid", dir_entry->d_name);
|
||||
^~
|
||||
dasdinfo.c:576:4: note: 'snprintf' output between 23 and 278 bytes into
|
||||
a destination of size 80
|
||||
snprintf(*uidfile, RD_BUFFER_SIZE,
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
"/sys/block/%s/device/uid", dir_entry->d_name);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
We could get around this by increasing the buffer. Though, the current
|
||||
buffer size is already plenty and we know better anyway.
|
||||
Avoid the warning by simply checking the return value of snprintf and
|
||||
display an error in case data was truncated nonetheless.
|
||||
|
||||
Fixes: 3c80f7e025db ("dasdinfo: fix buffer overflow warning")
|
||||
Signed-off-by: Jan Höppner <hoeppner@linux.vnet.ibm.com>
|
||||
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
|
||||
---
|
||||
dasdinfo/dasdinfo.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dasdinfo/dasdinfo.c b/dasdinfo/dasdinfo.c
|
||||
index c8bda3b..f881f03 100644
|
||||
--- a/dasdinfo/dasdinfo.c
|
||||
+++ b/dasdinfo/dasdinfo.c
|
||||
@@ -545,6 +545,7 @@ static int dinfo_get_uid_from_devnode(char **uidfile, char *devnode)
|
||||
char *readbuf;
|
||||
DIR *directory = NULL;
|
||||
struct dirent *dir_entry = NULL;
|
||||
+ int rc = 0;
|
||||
|
||||
if (stat(devnode, &stat_buffer) != 0) {
|
||||
printf("Error: could not stat %s\n", devnode);
|
||||
@@ -573,8 +574,15 @@ static int dinfo_get_uid_from_devnode(char **uidfile, char *devnode)
|
||||
|
||||
if (strncmp(stat_dev, readbuf,
|
||||
MAX(strlen(stat_dev), strlen(readbuf)-1)) == 0) {
|
||||
- snprintf(*uidfile, RD_BUFFER_SIZE,
|
||||
- "/sys/block/%s/device/uid", dir_entry->d_name);
|
||||
+ rc = snprintf(*uidfile, RD_BUFFER_SIZE,
|
||||
+ "/sys/block/%s/device/uid",
|
||||
+ dir_entry->d_name);
|
||||
+ if (rc >= RD_BUFFER_SIZE) {
|
||||
+ fprintf(stderr,
|
||||
+ "Error: Device name was truncated\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
break;
|
||||
}
|
||||
}
|
||||
--
|
||||
1.7.12.4
|
||||
|
67
s390-tools-sles15-Fixup-dasdfmt_get_volser.patch
Normal file
67
s390-tools-sles15-Fixup-dasdfmt_get_volser.patch
Normal file
@ -0,0 +1,67 @@
|
||||
From f3adc9ca7928a8250f31b242335686ad9879ce10 Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Thu, 5 Oct 2017 09:42:42 +0200
|
||||
Subject: [PATCH] dasdfmt: Fixup dasdfmt_get_volser()
|
||||
|
||||
dasdfmt_get_volser() opens its own private filedescriptor
|
||||
despite the global filedes already being opened.
|
||||
And we should be passing in only the bits of the info structure
|
||||
that we actually need.
|
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.com>
|
||||
---
|
||||
dasdfmt/dasdfmt.c | 24 ++++++++----------------
|
||||
1 file changed, 8 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
|
||||
index 6043872..4cf423d 100644
|
||||
--- a/dasdfmt/dasdfmt.c
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -970,28 +970,19 @@ static void dasdfmt_print_info(dasdfmt_info_t *info, volume_label_t *vlabel,
|
||||
/*
|
||||
* get volser
|
||||
*/
|
||||
-static int dasdfmt_get_volser(dasdfmt_info_t *info, char *volser)
|
||||
+static int dasdfmt_get_volser(char *devname, dasd_information2_t *dasd_info,
|
||||
+ char *volser)
|
||||
{
|
||||
unsigned int blksize;
|
||||
- int f;
|
||||
volume_label_t vlabel;
|
||||
|
||||
- f = open(info->devname, O_RDONLY);
|
||||
- if (f == -1)
|
||||
- ERRMSG_EXIT(EXIT_FAILURE, "%s: Unable to open device %s: %s\n",
|
||||
- prog_name, info->devname, strerror(errno));
|
||||
-
|
||||
get_blocksize(&blksize);
|
||||
|
||||
- if (close(f) != 0)
|
||||
- ERRMSG("%s: error during close: %s\ncontinuing...\n",
|
||||
- prog_name, strerror(errno));
|
||||
-
|
||||
- if ((strncmp(info->dasd_info.type, "ECKD", 4) == 0) &&
|
||||
- (!info->dasd_info.FBA_layout)) {
|
||||
+ if ((strncmp(dasd_info->type, "ECKD", 4) == 0) &&
|
||||
+ !dasd_info->FBA_layout) {
|
||||
/* OS/390 and zOS compatible disk layout */
|
||||
- vtoc_read_volume_label(info->devname,
|
||||
- info->dasd_info.label_block * blksize,
|
||||
+ vtoc_read_volume_label(devname,
|
||||
+ dasd_info->label_block * blksize,
|
||||
&vlabel);
|
||||
vtoc_volume_label_get_volser(&vlabel, volser);
|
||||
return 0;
|
||||
@@ -1684,7 +1675,8 @@ int main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- if (dasdfmt_get_volser(&info, old_volser) == 0)
|
||||
+ if (dasdfmt_get_volser(info.devname,
|
||||
+ &info.dasd_info, old_volser) == 0)
|
||||
vtoc_volume_label_set_volser(&vlabel, old_volser);
|
||||
else
|
||||
ERRMSG_EXIT(EXIT_FAILURE,
|
||||
--
|
||||
1.7.12.4
|
||||
|
233
s390-tools-sles15-Fixup-device-name-handling.patch
Normal file
233
s390-tools-sles15-Fixup-device-name-handling.patch
Normal file
@ -0,0 +1,233 @@
|
||||
From a4101cc9bf1d18b698ead344e6be6fe311fda41d Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Thu, 5 Oct 2017 09:59:41 +0200
|
||||
Subject: [PATCH] dasdfmt: Fixup device name handling
|
||||
|
||||
get_device_name() contains a chunk of unreachable code, as the
|
||||
'name' argument is never filled with any value.
|
||||
So turn things around to have get_device_name() always fill the
|
||||
'name' argument with the real device name, and remove the
|
||||
devname entry from the dasdfmt_info_t structure.
|
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.com>
|
||||
---
|
||||
dasdfmt/dasdfmt.c | 70 ++++++++++++++++++++++++-------------------------------
|
||||
dasdfmt/dasdfmt.h | 1 -
|
||||
2 files changed, 30 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
|
||||
index 4cf423d..3da7902 100644
|
||||
--- a/dasdfmt/dasdfmt.c
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -456,7 +456,7 @@ static void program_interrupt_signal(int sig)
|
||||
/*
|
||||
* check given device name for blanks and some special characters
|
||||
*/
|
||||
-static void get_device_name(dasdfmt_info_t *info, char *name, int argc,
|
||||
+static void get_device_name(dasdfmt_info_t *info, char *devname, int argc,
|
||||
char *argv[])
|
||||
{
|
||||
struct util_proc_dev_entry dev_entry;
|
||||
@@ -470,32 +470,20 @@ static void get_device_name(dasdfmt_info_t *info, char *name, int argc,
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: No device specified!\n",
|
||||
prog_name);
|
||||
|
||||
- if (info->device_id < argc) {
|
||||
- strcpy(info->devname, argv[info->device_id]);
|
||||
- } else {
|
||||
- if ((strchr(name, ' ') != NULL) || (strchr(name, '#') != NULL) ||
|
||||
- (strchr(name, '[') != NULL) || (strchr(name, ']') != NULL) ||
|
||||
- (strchr(name, '!') != NULL) || (strchr(name, '>') != NULL) ||
|
||||
- (strchr(name, '(') != NULL) || (strchr(name, '<') != NULL) ||
|
||||
- (strchr(name, ')') != NULL) || (strchr(name, ':') != NULL) ||
|
||||
- (strchr(name, '&') != NULL) || (strchr(name, ';') != NULL))
|
||||
- ERRMSG_EXIT(EXIT_MISUSE, "%s: Your filename contains "
|
||||
- "blanks or special characters!\n",
|
||||
- prog_name);
|
||||
-
|
||||
- strncpy(info->devname, name, PATH_MAX - 1);
|
||||
- info->devname[PATH_MAX - 1] = '\0';
|
||||
- }
|
||||
+ if (strlen(argv[info->device_id]) >= PATH_MAX)
|
||||
+ ERRMSG_EXIT(EXIT_MISUSE, "%s: device name too long!\n",
|
||||
+ prog_name);
|
||||
+ strcpy(devname, argv[info->device_id]);
|
||||
|
||||
- if (stat(info->devname, &dev_stat) != 0)
|
||||
+ if (stat(devname, &dev_stat) != 0)
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: Could not get information for "
|
||||
- "device node %s: %s\n", prog_name, info->devname,
|
||||
+ "device node %s: %s\n", prog_name, devname,
|
||||
strerror(errno));
|
||||
|
||||
if (minor(dev_stat.st_rdev) & PARTN_MASK) {
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: Unable to format partition %s. "
|
||||
"Please specify a device.\n", prog_name,
|
||||
- info->devname);
|
||||
+ devname);
|
||||
}
|
||||
|
||||
if (util_proc_dev_get_entry(dev_stat.st_rdev, 1, &dev_entry) == 0) {
|
||||
@@ -505,7 +493,7 @@ static void get_device_name(dasdfmt_info_t *info, char *name, int argc,
|
||||
prog_name, dev_entry.name);
|
||||
} else {
|
||||
printf("%s WARNING: Unable to get driver name for device node %s",
|
||||
- prog_name, info->devname);
|
||||
+ prog_name, devname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,7 +574,7 @@ static void check_layout(dasdfmt_info_t *info, unsigned int intensity)
|
||||
/*
|
||||
* check for disk type and set some variables (e.g. usage count)
|
||||
*/
|
||||
-static void check_disk(dasdfmt_info_t *info)
|
||||
+static void check_disk(dasdfmt_info_t *info, char *devname)
|
||||
{
|
||||
int ro, errno_save;
|
||||
|
||||
@@ -609,13 +597,13 @@ static void check_disk(dasdfmt_info_t *info)
|
||||
if (strncmp(info->dasd_info.type, "ECKD", 4) != 0) {
|
||||
ERRMSG_EXIT(EXIT_FAILURE,
|
||||
"%s: Unsupported disk type\n%s is not an "
|
||||
- "ECKD disk!\n", prog_name, info->devname);
|
||||
+ "ECKD disk!\n", prog_name, devname);
|
||||
}
|
||||
|
||||
- if (dasd_sys_raw_track_access(info->devname)) {
|
||||
+ if (dasd_sys_raw_track_access(devname)) {
|
||||
ERRMSG_EXIT(EXIT_FAILURE,
|
||||
"%s: Device '%s' is in raw-track access mode\n",
|
||||
- prog_name, info->devname);
|
||||
+ prog_name, devname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,7 +923,8 @@ static format_data_t ask_user_for_blksize(format_data_t params)
|
||||
/*
|
||||
* print all information needed to format the device
|
||||
*/
|
||||
-static void dasdfmt_print_info(dasdfmt_info_t *info, volume_label_t *vlabel,
|
||||
+static void dasdfmt_print_info(dasdfmt_info_t *info, char *devname,
|
||||
+ volume_label_t *vlabel,
|
||||
unsigned int cylinders, unsigned int heads,
|
||||
format_data_t *p)
|
||||
{
|
||||
@@ -945,7 +934,7 @@ static void dasdfmt_print_info(dasdfmt_info_t *info, volume_label_t *vlabel,
|
||||
cylinders, heads, (cylinders * heads));
|
||||
|
||||
printf("\nI am going to format the device ");
|
||||
- printf("%s in the following way:\n", info->devname);
|
||||
+ printf("%s in the following way:\n", devname);
|
||||
printf(" Device number of device : 0x%x\n", info->dasd_info.devno);
|
||||
printf(" Labelling device : %s\n",
|
||||
(info->writenolabel) ? "no" : "yes");
|
||||
@@ -1376,7 +1365,8 @@ static void dasdfmt_quick_format(dasdfmt_info_t *info, unsigned int cylinders,
|
||||
disk_disabled = 0;
|
||||
}
|
||||
|
||||
-static void do_format_dasd(dasdfmt_info_t *info, volume_label_t *vlabel,
|
||||
+static void do_format_dasd(dasdfmt_info_t *info, char *devname,
|
||||
+ volume_label_t *vlabel,
|
||||
format_data_t *p, unsigned int cylinders,
|
||||
unsigned int heads)
|
||||
{
|
||||
@@ -1399,19 +1389,19 @@ static void do_format_dasd(dasdfmt_info_t *info, volume_label_t *vlabel,
|
||||
}
|
||||
|
||||
if ((info->verbosity > 0) || !info->withoutprompt || info->testmode)
|
||||
- dasdfmt_print_info(info, vlabel, cylinders, heads, p);
|
||||
+ dasdfmt_print_info(info, devname, vlabel, cylinders, heads, p);
|
||||
|
||||
- count = u2s_get_host_access_count(info->devname);
|
||||
+ count = u2s_get_host_access_count(devname);
|
||||
if (info->force_host) {
|
||||
if (count > 1) {
|
||||
ERRMSG_EXIT(EXIT_FAILURE,
|
||||
"\n%s: Disk %s is online on OS instances in %d different LPARs.\n"
|
||||
"Note: Your installation might include z/VM systems that are configured to\n"
|
||||
"automatically vary on disks, regardless of whether they are subsequently used.\n\n",
|
||||
- prog_name, info->devname, count);
|
||||
+ prog_name, devname, count);
|
||||
} else if (count < 0) {
|
||||
ERRMSG("\nHosts access information not available for disk %s.\n\n",
|
||||
- info->devname);
|
||||
+ devname);
|
||||
return;
|
||||
}
|
||||
} else if (count > 1)
|
||||
@@ -1420,7 +1410,7 @@ static void do_format_dasd(dasdfmt_info_t *info, volume_label_t *vlabel,
|
||||
"Ensure that the disk is not being used by a system outside your LPAR.\n"
|
||||
"Note: Your installation might include z/VM systems that are configured to\n"
|
||||
"automatically vary on disks, regardless of whether they are subsequently used.\n",
|
||||
- info->devname, count);
|
||||
+ devname, count);
|
||||
|
||||
if (!info->testmode) {
|
||||
if (!info->withoutprompt) {
|
||||
@@ -1471,7 +1461,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
dasdfmt_info_t info = {
|
||||
.dasd_info = {0},
|
||||
- {0}
|
||||
};
|
||||
volume_label_t vlabel;
|
||||
char old_volser[7];
|
||||
@@ -1648,10 +1637,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
get_device_name(&info, dev_filename, argc, argv);
|
||||
|
||||
- filedes = open(info.devname, O_RDWR);
|
||||
+ filedes = open(dev_filename, O_RDWR);
|
||||
if (filedes == -1)
|
||||
ERRMSG_EXIT(EXIT_FAILURE, "%s: Unable to open device %s: %s\n",
|
||||
- prog_name, info.devname, strerror(errno));
|
||||
+ prog_name, dev_filename, strerror(errno));
|
||||
|
||||
get_device_info(&info);
|
||||
|
||||
@@ -1675,16 +1664,16 @@ int main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- if (dasdfmt_get_volser(info.devname,
|
||||
+ if (dasdfmt_get_volser(dev_filename,
|
||||
&info.dasd_info, old_volser) == 0)
|
||||
vtoc_volume_label_set_volser(&vlabel, old_volser);
|
||||
else
|
||||
ERRMSG_EXIT(EXIT_FAILURE,
|
||||
"%s: VOLSER not found on device %s\n",
|
||||
- prog_name, info.devname);
|
||||
+ prog_name, dev_filename);
|
||||
}
|
||||
|
||||
- check_disk(&info);
|
||||
+ check_disk(&info, dev_filename);
|
||||
|
||||
if (check_param(str, ERR_LENGTH, &format_params) < 0)
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: %s\n", prog_name, str);
|
||||
@@ -1695,7 +1684,8 @@ int main(int argc, char *argv[])
|
||||
if (info.check)
|
||||
check_disk_format(&info, cylinders, heads, &format_params);
|
||||
else
|
||||
- do_format_dasd(&info, &vlabel, &format_params, cylinders, heads);
|
||||
+ do_format_dasd(&info, dev_filename, &vlabel,
|
||||
+ &format_params, cylinders, heads);
|
||||
|
||||
if (close(filedes) != 0)
|
||||
ERRMSG("%s: error during close: %s\ncontinuing...\n",
|
||||
diff --git a/dasdfmt/dasdfmt.h b/dasdfmt/dasdfmt.h
|
||||
index 7c6f0bd..9ce3b92 100644
|
||||
--- a/dasdfmt/dasdfmt.h
|
||||
+++ b/dasdfmt/dasdfmt.h
|
||||
@@ -291,7 +291,6 @@ typedef struct bootstrap2 {
|
||||
|
||||
typedef struct dasdfmt_info {
|
||||
dasd_information2_t dasd_info;
|
||||
- char devname[PATH_MAX];
|
||||
int verbosity;
|
||||
int testmode;
|
||||
int withoutprompt;
|
||||
--
|
||||
1.7.12.4
|
||||
|
178
s390-tools-sles15-Format-devices-in-parallel.patch
Normal file
178
s390-tools-sles15-Format-devices-in-parallel.patch
Normal file
@ -0,0 +1,178 @@
|
||||
From a61154fd93122f5a0f2b74f21c3ac29eb437f150 Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Fri, 6 Oct 2017 09:39:36 +0200
|
||||
Subject: [PATCH] dasdfmt: Format devices in parallel
|
||||
|
||||
Allow dasdfmt to run in parallel when several devices are specified.
|
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.com>
|
||||
---
|
||||
dasdfmt/dasdfmt.8 | 16 ++++++++++++++--
|
||||
dasdfmt/dasdfmt.c | 50 +++++++++++++++++++++++++++++++++++++++++++-------
|
||||
dasdfmt/dasdfmt.h | 1 +
|
||||
3 files changed, 58 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.8 b/dasdfmt/dasdfmt.8
|
||||
index e7fc501..07c674b 100644
|
||||
--- a/dasdfmt/dasdfmt.8
|
||||
+++ b/dasdfmt/dasdfmt.8
|
||||
@@ -7,7 +7,7 @@
|
||||
dasdfmt \- formatting of DASD (ECKD) disk drives.
|
||||
|
||||
.SH SYNOPSIS
|
||||
-\fBdasdfmt\fR [-h] [-t] [-v] [-y] [-p] [-P] [-m \fIstep\fR]
|
||||
+\fBdasdfmt\fR [-h] [-t] [-v] [-y] [-p] [-Q] [-P] [-m \fIstep\fR]
|
||||
.br
|
||||
[-r \fIcylinder\fR] [-b \fIblksize\fR] [-l \fIvolser\fR] [-d \fIlayout\fR]
|
||||
.br
|
||||
@@ -96,7 +96,7 @@ Do not use this option if you are using a 3270 console,
|
||||
running in background or redirecting the output to a file.
|
||||
|
||||
.TP
|
||||
-\fB-P\fR or \fB--percentage\fR
|
||||
+\fB-Q\fR or \fB--percentage\fR
|
||||
Print one line for each formatted cylinder showing the number of the
|
||||
cylinder and percentage of formatting process.
|
||||
Intended to be used by higher level interfaces.
|
||||
@@ -153,6 +153,18 @@ Specify blocksize to be used. \fIblksize\fR must be a positive integer
|
||||
and always be a power of two. The recommended blocksize is 4096 bytes.
|
||||
|
||||
.TP
|
||||
+\fB-P\fR \fInumdisks\fR or \fB--max_parallel\fR=\fInumdisks\fR
|
||||
+Specify the number of disks to be formatted in parallel.
|
||||
+\fInumdisks\fR specifies the number of formatting processed,
|
||||
+independent on the overall number of disks to be formatted.
|
||||
+The maximum value for \fInumdisks\fR is 512. Default is 1.
|
||||
+.br
|
||||
+Using this option can decrease overall processing time when formatting
|
||||
+several disks. Please note that the I/O throughput will dramatically
|
||||
+increase when using this option. Use with care.
|
||||
+.br
|
||||
+
|
||||
+.TP
|
||||
\fB-l\fR \fIvolser\fR or \fB--label\fR=\fIvolser\fR
|
||||
Specify the volume serial number or volume identifier to be written
|
||||
to disk after formatting. If no label is specified, a sensible default
|
||||
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
|
||||
index 607fd1c..6dd28fa 100644
|
||||
--- a/dasdfmt/dasdfmt.c
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/utsname.h>
|
||||
+#include <sys/wait.h>
|
||||
|
||||
#include "lib/dasd_sys.h"
|
||||
#include "lib/util_opt.h"
|
||||
@@ -68,6 +69,11 @@ static struct util_opt opt_vec[] = {
|
||||
.desc = "Perform complete format check on device",
|
||||
.flags = UTIL_OPT_FLAG_NOSHORT,
|
||||
},
|
||||
+ {
|
||||
+ .option = { "max_parallel", required_argument, NULL, 'P' },
|
||||
+ .desc = "Format devices in parallel",
|
||||
+ .flags = UTIL_OPT_FLAG_NOLONG,
|
||||
+ },
|
||||
UTIL_OPT_SECTION("FORMAT OPTIONS"),
|
||||
{
|
||||
.option = { "blocksize", required_argument, NULL, 'b' },
|
||||
@@ -120,7 +126,7 @@ static struct util_opt opt_vec[] = {
|
||||
.desc = "Show a progressbar",
|
||||
},
|
||||
{
|
||||
- .option = { "percentage", no_argument, NULL, 'P' },
|
||||
+ .option = { "percentage", no_argument, NULL, 'Q' },
|
||||
.desc = "Show progress in percent",
|
||||
},
|
||||
UTIL_OPT_SECTION("MISC"),
|
||||
@@ -254,7 +260,7 @@ static void draw_progress(dasdfmt_info_t *info, int cyl, unsigned int cylinders,
|
||||
|
||||
if (info->print_hashmarks &&
|
||||
(cyl / info->hashstep - hashcount) != 0) {
|
||||
- printf("#");
|
||||
+ printf("%d|", info->procnum);
|
||||
fflush(stdout);
|
||||
hashcount++;
|
||||
}
|
||||
@@ -1533,7 +1539,8 @@ int main(int argc, char *argv[])
|
||||
char *reqsize_param_str = NULL;
|
||||
char *hashstep_str = NULL;
|
||||
|
||||
- int rc, numdev = 0, i;
|
||||
+ int max_parallel = 1, running = 0;
|
||||
+ int rc, numdev = 0, i, status;
|
||||
|
||||
/* Establish a handler for interrupt signals. */
|
||||
signal(SIGTERM, program_interrupt_signal);
|
||||
@@ -1600,7 +1607,7 @@ int main(int argc, char *argv[])
|
||||
info.print_hashmarks = 1;
|
||||
}
|
||||
break;
|
||||
- case 'P':
|
||||
+ case 'Q':
|
||||
if (!(info.print_hashmarks || info.print_progressbar))
|
||||
info.print_percentage = 1;
|
||||
break;
|
||||
@@ -1658,6 +1665,9 @@ int main(int argc, char *argv[])
|
||||
"more information.\n",
|
||||
prog_name, optarg);
|
||||
break;
|
||||
+ case 'P':
|
||||
+ max_parallel = atoi(optarg);
|
||||
+ break;
|
||||
case OPT_CHECK:
|
||||
info.check = 1;
|
||||
break;
|
||||
@@ -1707,7 +1717,33 @@ int main(int argc, char *argv[])
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: No device specified!\n",
|
||||
prog_name);
|
||||
|
||||
- for (i = 0; i < numdev; i++)
|
||||
- do_dasdfmt(dev_filename[i], &info, &vlabel);
|
||||
- return 0;
|
||||
+ for (i = 0; i < numdev; i++) {
|
||||
+ int chpid;
|
||||
+ int tmp;
|
||||
+
|
||||
+ chpid = fork();
|
||||
+ if (chpid == -1)
|
||||
+ ERRMSG_EXIT(EXIT_FAILURE,
|
||||
+ "%s: Unable to create child process: %s\n",
|
||||
+ prog_name, strerror(errno));
|
||||
+ if (!chpid) {
|
||||
+ info.procnum = i;
|
||||
+ do_dasdfmt(dev_filename[i], &info, &vlabel);
|
||||
+ exit(0);
|
||||
+ } else {
|
||||
+ running++;
|
||||
+ if (running >= max_parallel) {
|
||||
+ if (wait(&tmp) > 0 && WEXITSTATUS(tmp))
|
||||
+ rc = WEXITSTATUS(tmp);
|
||||
+ running--;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* wait until all formatting children have finished */
|
||||
+ while(wait(&status) > 0)
|
||||
+ if (WEXITSTATUS(status))
|
||||
+ rc = WEXITSTATUS(status);
|
||||
+
|
||||
+ return rc;
|
||||
}
|
||||
diff --git a/dasdfmt/dasdfmt.h b/dasdfmt/dasdfmt.h
|
||||
index a5581f1..fb6fc34 100644
|
||||
--- a/dasdfmt/dasdfmt.h
|
||||
+++ b/dasdfmt/dasdfmt.h
|
||||
@@ -307,6 +307,7 @@ typedef struct dasdfmt_info {
|
||||
int force_host;
|
||||
int layout_specified;
|
||||
int check;
|
||||
+ int procnum;
|
||||
} dasdfmt_info_t;
|
||||
|
||||
|
||||
--
|
||||
1.7.12.4
|
||||
|
134
s390-tools-sles15-Implement-Y-yast_mode.patch
Normal file
134
s390-tools-sles15-Implement-Y-yast_mode.patch
Normal file
@ -0,0 +1,134 @@
|
||||
From eabcb26fa4a91d410a6f75a9915a9ebb9f702c6b Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Fri, 6 Oct 2017 09:55:40 +0200
|
||||
Subject: [PATCH] dasdfmt: Implement '-Y/--yast_mode'
|
||||
|
||||
Implement an option '-Y' to suppress most output.
|
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.com>
|
||||
---
|
||||
dasdfmt/dasdfmt.8 | 7 ++++++-
|
||||
dasdfmt/dasdfmt.c | 27 ++++++++++++++++++++-------
|
||||
dasdfmt/dasdfmt.h | 1 +
|
||||
3 files changed, 27 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.8 b/dasdfmt/dasdfmt.8
|
||||
index 07c674b..3fd10a2 100644
|
||||
--- a/dasdfmt/dasdfmt.8
|
||||
+++ b/dasdfmt/dasdfmt.8
|
||||
@@ -7,7 +7,7 @@
|
||||
dasdfmt \- formatting of DASD (ECKD) disk drives.
|
||||
|
||||
.SH SYNOPSIS
|
||||
-\fBdasdfmt\fR [-h] [-t] [-v] [-y] [-p] [-Q] [-P] [-m \fIstep\fR]
|
||||
+\fBdasdfmt\fR [-h] [-t] [-v] [-y] [-p] [-Q] [-P] [-Y] [-m \fIstep\fR]
|
||||
.br
|
||||
[-r \fIcylinder\fR] [-b \fIblksize\fR] [-l \fIvolser\fR] [-d \fIlayout\fR]
|
||||
.br
|
||||
@@ -113,6 +113,11 @@ The value will be at least as big as the -r or --requestsize value.
|
||||
.br
|
||||
|
||||
.TP
|
||||
+\fB-Y\fR or \fB--yast_mode\fR
|
||||
+YaST mode; suppress most output.
|
||||
+.br
|
||||
+
|
||||
+.TP
|
||||
\fB-M\fR \fImode\fR or \fB--mode\fR=\fImode\fR
|
||||
Specify the \fImode\fR to be used to format the device. Valid modes are:
|
||||
.RS
|
||||
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
|
||||
index 6dd28fa..5b6023a 100644
|
||||
--- a/dasdfmt/dasdfmt.c
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -129,6 +129,10 @@ static struct util_opt opt_vec[] = {
|
||||
.option = { "percentage", no_argument, NULL, 'Q' },
|
||||
.desc = "Show progress in percent",
|
||||
},
|
||||
+ {
|
||||
+ .option = { "yast_mode", no_argument, NULL, 'Y' },
|
||||
+ .desc = "YaST mode",
|
||||
+ },
|
||||
UTIL_OPT_SECTION("MISC"),
|
||||
{
|
||||
.option = { "check_host_count", no_argument, NULL, 'C' },
|
||||
@@ -351,7 +355,8 @@ static void evaluate_format_error(dasdfmt_info_t *info, format_check_t *cdata,
|
||||
unsigned int kl = 0;
|
||||
int blksize = cdata->expect.blksize;
|
||||
|
||||
- if (info->print_progressbar || info->print_hashmarks)
|
||||
+ if ((info->print_progressbar || info->print_hashmarks) &&
|
||||
+ !info->yast_mode)
|
||||
printf("\n");
|
||||
|
||||
/*
|
||||
@@ -758,9 +763,9 @@ static void check_hashmarks(dasdfmt_info_t *info)
|
||||
"using the default.\n");
|
||||
info->hashstep = 10;
|
||||
}
|
||||
-
|
||||
- printf("Printing hashmark every %d cylinders.\n",
|
||||
- info->hashstep);
|
||||
+ if (!info->yast_mode)
|
||||
+ printf("Printing hashmark every %d cylinders.\n",
|
||||
+ info->hashstep);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1445,16 +1450,18 @@ static void do_format_dasd(dasdfmt_info_t *info, char *devname,
|
||||
break;
|
||||
}
|
||||
|
||||
- printf("Finished formatting the device.\n");
|
||||
+ if (!info->yast_mode)
|
||||
+ printf("Finished formatting the device.\n");
|
||||
|
||||
if (!(info->writenolabel || mode == EXPAND))
|
||||
dasdfmt_write_labels(info, vlabel, cylinders, heads);
|
||||
|
||||
- printf("Rereading the partition table... ");
|
||||
+ if (!info->yast_mode)
|
||||
+ printf("Rereading the partition table... ");
|
||||
if (reread_partition_table()) {
|
||||
ERRMSG("%s: error during rereading the partition "
|
||||
"table: %s.\n", prog_name, strerror(errno));
|
||||
- } else {
|
||||
+ } else if (!info->yast_mode) {
|
||||
printf("ok\n");
|
||||
}
|
||||
}
|
||||
@@ -1511,6 +1518,8 @@ void do_dasdfmt(char *dev_filename, dasdfmt_info_t *info,
|
||||
ERRMSG_EXIT(EXIT_MISUSE, "%s: %s\n", prog_name, str);
|
||||
|
||||
set_geo(info, &cylinders, &heads);
|
||||
+ if (info->yast_mode)
|
||||
+ printf("%d\n", cylinders);
|
||||
set_label(info, &vlabel, &format_params, cylinders);
|
||||
|
||||
if (info->check)
|
||||
@@ -1665,6 +1674,10 @@ int main(int argc, char *argv[])
|
||||
"more information.\n",
|
||||
prog_name, optarg);
|
||||
break;
|
||||
+ case 'Y':
|
||||
+ /* YaST mode */
|
||||
+ info.yast_mode = 1;
|
||||
+ break;
|
||||
case 'P':
|
||||
max_parallel = atoi(optarg);
|
||||
break;
|
||||
diff --git a/dasdfmt/dasdfmt.h b/dasdfmt/dasdfmt.h
|
||||
index fb6fc34..fe0cc7f 100644
|
||||
--- a/dasdfmt/dasdfmt.h
|
||||
+++ b/dasdfmt/dasdfmt.h
|
||||
@@ -308,6 +308,7 @@ typedef struct dasdfmt_info {
|
||||
int layout_specified;
|
||||
int check;
|
||||
int procnum;
|
||||
+ int yast_mode;
|
||||
} dasdfmt_info_t;
|
||||
|
||||
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -0,0 +1,68 @@
|
||||
From 8f05578d90df49dce6e13ee850fdc8bab84916ba Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Fri, 6 Oct 2017 12:23:32 +0200
|
||||
Subject: [PATCH] dasdfmt: Implement '-f' for backwards compability
|
||||
|
||||
YaST is calling dasdfmt with '-f device', which used to be the old
|
||||
calling convention. So to not keel over when used with an older
|
||||
version of YaST we should accept this option, too.
|
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.com>
|
||||
---
|
||||
dasdfmt/dasdfmt.8 | 6 +++++-
|
||||
dasdfmt/dasdfmt.c | 8 ++++++++
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.8 b/dasdfmt/dasdfmt.8
|
||||
index 3fd10a2..7fdb4bd 100644
|
||||
--- a/dasdfmt/dasdfmt.8
|
||||
+++ b/dasdfmt/dasdfmt.8
|
||||
@@ -11,7 +11,7 @@ dasdfmt \- formatting of DASD (ECKD) disk drives.
|
||||
.br
|
||||
[-r \fIcylinder\fR] [-b \fIblksize\fR] [-l \fIvolser\fR] [-d \fIlayout\fR]
|
||||
.br
|
||||
- [-L] [-V] [-F] [-k] [-C] [-M \fImode\fR] \fIdevice\fR [\fIdevice\fR]
|
||||
+ [-L] [-V] [-F] [-k] [-C] [-M \fImode\fR] [-f \fIdevice\fR] [\fIdevice\fR]
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBdasdfmt\fR formats one or several DASD (ECKD) disk drive to prepare it
|
||||
@@ -42,6 +42,10 @@ out, what it \fBwould\fR do.
|
||||
Increases verbosity.
|
||||
|
||||
.TP
|
||||
+\fB-f\fR \fIdevice\fR or \fB--device\fR=\fIdevice\fR
|
||||
+Specify device to format. For backwards compability only.
|
||||
+
|
||||
+.TP
|
||||
\fB-y\fR
|
||||
Start formatting without further user-confirmation.
|
||||
|
||||
diff --git a/dasdfmt/dasdfmt.c b/dasdfmt/dasdfmt.c
|
||||
index 5b6023a..cdd80df 100644
|
||||
--- a/dasdfmt/dasdfmt.c
|
||||
+++ b/dasdfmt/dasdfmt.c
|
||||
@@ -74,6 +74,10 @@ static struct util_opt opt_vec[] = {
|
||||
.desc = "Format devices in parallel",
|
||||
.flags = UTIL_OPT_FLAG_NOLONG,
|
||||
},
|
||||
+ {
|
||||
+ .option = { "device", required_argument, NULL, 'f' },
|
||||
+ .desc = "Spedify device to format",
|
||||
+ },
|
||||
UTIL_OPT_SECTION("FORMAT OPTIONS"),
|
||||
{
|
||||
.option = { "blocksize", required_argument, NULL, 'b' },
|
||||
@@ -1597,6 +1601,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
info.layout_specified = 1;
|
||||
break;
|
||||
+ case 'f':
|
||||
+ get_device_name(dev_filename, numdev, optarg);
|
||||
+ numdev++;
|
||||
+ break;
|
||||
case 'y':
|
||||
info.withoutprompt = 1;
|
||||
break;
|
||||
--
|
||||
1.7.12.4
|
||||
|
26
s390-tools-sles15-iucvterm-include-ctype-for-toupper.patch
Normal file
26
s390-tools-sles15-iucvterm-include-ctype-for-toupper.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From e179b7a9acdd63caacf352b37e128b5326f151cd Mon Sep 17 00:00:00 2001
|
||||
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
||||
Date: Wed, 18 Oct 2017 11:35:58 +0200
|
||||
Subject: [PATCH] iucvterm: include ctype for toupper()
|
||||
|
||||
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
||||
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
|
||||
---
|
||||
iucvterm/src/getopt.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/iucvterm/src/getopt.c b/iucvterm/src/getopt.c
|
||||
index 503f6dd..b79b6a9 100644
|
||||
--- a/iucvterm/src/getopt.c
|
||||
+++ b/iucvterm/src/getopt.c
|
||||
@@ -8,6 +8,7 @@
|
||||
* s390-tools is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*/
|
||||
+#include <ctype.h>
|
||||
#include <getopt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -1,8 +1,36 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 18 16:22:27 UTC 2017 - mpost@suse.com
|
||||
|
||||
- Deleted s390-tools-sles12-pardasdfmt.patch and replaced it with
|
||||
the following patches (bsc#1063393):
|
||||
* s390-tools-sles15-Allow-multiple-device-arguments.patch
|
||||
* s390-tools-sles15-Drop-device_id-parameter.patch
|
||||
* s390-tools-sles15-Fixup-dasdfmt_get_volser.patch
|
||||
* s390-tools-sles15-Fixup-device-name-handling.patch
|
||||
* s390-tools-sles15-Format-devices-in-parallel.patch
|
||||
* s390-tools-sles15-Implement-f-for-backwards-compability.patch
|
||||
* s390-tools-sles15-Implement-Y-yast_mode.patch
|
||||
- Reworked dasdfmt-retry-BIODASDINFO-if-device-is-busy.patch to fit
|
||||
on top of replacement patches.
|
||||
- Cleaned up the patch headers for the following:
|
||||
* s390-tools-sles12-sysconfig-compatible-dumpconf.patch
|
||||
* s390-tools-sles12-update-by_id-links-on-change-and-add-action.patch
|
||||
- Added the following patches:
|
||||
* s390-tools-sles15-Fix-truncation-warning.patch
|
||||
* s390-tools-sles15-iucvterm-include-ctype-for-toupper.patch
|
||||
- Removed redundant %clean section. Replaced old RPM variables.
|
||||
- Removed %service* macros for iucvtty-login@.service and
|
||||
ttyrun-getty@.service since systemd complained about them.
|
||||
- Replaced all fillup_and_insserv macros with fillup_only since
|
||||
we weren't running the "insserv" part anyway.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 5 20:47:52 UTC 2017 - mpost@suse.com
|
||||
|
||||
- Modified mkdump perl script to work with the updated version
|
||||
of the IBM tools dasdview, zipl and zgetdump. (bsc#1020336).
|
||||
Also changed the method used to determine the maximum dump size
|
||||
for SCSI devices.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 4 19:45:29 UTC 2017 - mpost@suse.com
|
||||
|
132
s390-tools.spec
132
s390-tools.spec
@ -104,10 +104,18 @@ Patch1: s390-tools-sles12-zipl_boot_msg.patch
|
||||
Patch2: s390-tools-sles12-sysconfig-compatible-dumpconf.patch
|
||||
Patch3: s390-tools-sles12-create-filesystem-links.patch
|
||||
Patch4: s390-tools-sles12-update-by_id-links-on-change-and-add-action.patch
|
||||
Patch5: s390-tools-sles12-pardasdfmt.patch
|
||||
Patch6: dasdfmt-retry-BIODASDINFO-if-device-is-busy.patch
|
||||
Patch7: 59-dasd.rules-wait_for.patch
|
||||
Patch8: s390-tools-sles12-fdasd-skip-partition-check-and-BLKRRPART-ioctl.patch
|
||||
Patch5: s390-tools-sles15-Fixup-dasdfmt_get_volser.patch
|
||||
Patch6: s390-tools-sles15-Fixup-device-name-handling.patch
|
||||
Patch7: s390-tools-sles15-Drop-device_id-parameter.patch
|
||||
Patch8: s390-tools-sles15-Allow-multiple-device-arguments.patch
|
||||
Patch9: s390-tools-sles15-Format-devices-in-parallel.patch
|
||||
Patch10: s390-tools-sles15-Implement-Y-yast_mode.patch
|
||||
Patch11: s390-tools-sles15-Implement-f-for-backwards-compability.patch
|
||||
Patch12: dasdfmt-retry-BIODASDINFO-if-device-is-busy.patch
|
||||
Patch13: 59-dasd.rules-wait_for.patch
|
||||
Patch14: s390-tools-sles12-fdasd-skip-partition-check-and-BLKRRPART-ioctl.patch
|
||||
Patch15: s390-tools-sles15-Fix-truncation-warning.patch
|
||||
Patch16: s390-tools-sles15-iucvterm-include-ctype-for-toupper.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: s390 s390x
|
||||
@ -168,10 +176,18 @@ to list files and directories.
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
#patch5 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
|
||||
cp -vi %{S:22} CAUTION
|
||||
|
||||
@ -181,45 +197,45 @@ cp -vi %{S:22} CAUTION
|
||||
# commands, since make install runs sed commands against various scripts to
|
||||
# modify the "-v" output appropriately.
|
||||
|
||||
export OPT_FLAGS="$RPM_OPT_FLAGS"
|
||||
export OPT_FLAGS="%{optflags}"
|
||||
export KERNELIMAGE_MAKEFLAGS="%%{?_smp_mflags}"
|
||||
make ZFCPDUMP_DIR=/usr/lib/s390-tools/zfcpdump DISTRELEASE=%{release}
|
||||
gcc -static -o read_values ${OPT_FLAGS} %{S:86} -lqc
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/boot/zipl
|
||||
mkdir -p %{buildroot}/boot/zipl
|
||||
%make_install \
|
||||
ZFCPDUMP_DIR=/usr/lib/s390-tools/zfcpdump \
|
||||
DISTRELEASE=%{release} \
|
||||
SYSTEMDSYSTEMUNITDIR=%{_unitdir}
|
||||
|
||||
install -m 755 read_values $RPM_BUILD_ROOT/%{_bindir}/
|
||||
install -m644 -t $RPM_BUILD_ROOT/%{_mandir}/man8 %{S:87}
|
||||
install -m 755 read_values %{buildroot}/%{_bindir}/
|
||||
install -m644 -t %{buildroot}/%{_mandir}/man8 %{S:87}
|
||||
|
||||
export ROOT_BUILD_DIR="$RPM_BUILD_DIR/%{name}-%{version}/zfcpdump/kernel"
|
||||
install -D -m600 /boot/image-*-zfcpdump $RPM_BUILD_ROOT/usr/lib/s390-tools/zfcpdump/zfcpdump_part.image
|
||||
export ROOT_BUILD_DIR="%{_builddir}/%{name}-%{version}/zfcpdump/kernel"
|
||||
install -D -m600 /boot/image-*-zfcpdump %{buildroot}/usr/lib/s390-tools/zfcpdump/zfcpdump_part.image
|
||||
|
||||
install -D -m644 etc/udev/rules.d/40-z90crypt.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/40-z90crypt.rules
|
||||
install -D -m644 etc/udev/rules.d/57-osasnmpd.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/57-osasnmpd.rules
|
||||
install -D -m644 etc/udev/rules.d/59-dasd.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/59-dasd.rules
|
||||
install -D -m644 etc/udev/rules.d/90-cpi.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/90-cpi.rules
|
||||
install -D -m644 etc/sysconfig/cpi $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.cpi
|
||||
install -D -m644 etc/sysconfig/dumpconf $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.dumpconf
|
||||
install -D -m644 etc/sysconfig/mon_fsstatd $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mon_fsstatd
|
||||
install -D -m644 etc/sysconfig/mon_procd $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mon_procd
|
||||
install -D -m644 etc/sysconfig/mon_statd $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mon_statd
|
||||
mv iucvterm/doc/ts-shell/iucvconn_on_login $RPM_BUILD_ROOT/usr/bin/iucvconn_on_login
|
||||
install -D -m644 %{S:26} $RPM_BUILD_ROOT/%{_unitdir}/cio_ignore.service
|
||||
install -D -m755 %{S:27} $RPM_BUILD_ROOT/usr/lib/systemd/scripts/setup_cio_ignore.sh
|
||||
install -D -m755 %{S:31} $RPM_BUILD_ROOT/usr/lib/systemd/scripts/detach_disks.sh
|
||||
install -D -m644 %{S:35} $RPM_BUILD_ROOT/%{_unitdir}/virtsetup.service
|
||||
install -D -m755 %{S:36} $RPM_BUILD_ROOT/usr/lib/systemd/scripts/virtsetup.sh
|
||||
install -D -m644 etc/udev/rules.d/40-z90crypt.rules %{buildroot}/usr/lib/udev/rules.d/40-z90crypt.rules
|
||||
install -D -m644 etc/udev/rules.d/57-osasnmpd.rules %{buildroot}/usr/lib/udev/rules.d/57-osasnmpd.rules
|
||||
install -D -m644 etc/udev/rules.d/59-dasd.rules %{buildroot}/usr/lib/udev/rules.d/59-dasd.rules
|
||||
install -D -m644 etc/udev/rules.d/90-cpi.rules %{buildroot}/usr/lib/udev/rules.d/90-cpi.rules
|
||||
install -D -m644 etc/sysconfig/cpi %{buildroot}/var/adm/fillup-templates/sysconfig.cpi
|
||||
install -D -m644 etc/sysconfig/dumpconf %{buildroot}/var/adm/fillup-templates/sysconfig.dumpconf
|
||||
install -D -m644 etc/sysconfig/mon_fsstatd %{buildroot}/var/adm/fillup-templates/sysconfig.mon_fsstatd
|
||||
install -D -m644 etc/sysconfig/mon_procd %{buildroot}/var/adm/fillup-templates/sysconfig.mon_procd
|
||||
install -D -m644 etc/sysconfig/mon_statd %{buildroot}/var/adm/fillup-templates/sysconfig.mon_statd
|
||||
mv iucvterm/doc/ts-shell/iucvconn_on_login %{buildroot}/usr/bin/iucvconn_on_login
|
||||
install -D -m644 %{S:26} %{buildroot}/%{_unitdir}/cio_ignore.service
|
||||
install -D -m755 %{S:27} %{buildroot}/usr/lib/systemd/scripts/setup_cio_ignore.sh
|
||||
install -D -m755 %{S:31} %{buildroot}/usr/lib/systemd/scripts/detach_disks.sh
|
||||
install -D -m644 %{S:35} %{buildroot}/%{_unitdir}/virtsetup.service
|
||||
install -D -m755 %{S:36} %{buildroot}/usr/lib/systemd/scripts/virtsetup.sh
|
||||
|
||||
cp %{S:18} zpxe.rexx
|
||||
cp %{S:2} zipl.conf.sample
|
||||
cp %{S:23} README.SUSE
|
||||
|
||||
cd $RPM_BUILD_ROOT
|
||||
cd %{buildroot}
|
||||
install -D -m755 %{S:3} etc/init.d/hsnc
|
||||
install -D -m644 %{S:4} var/adm/fillup-templates/sysconfig.hsnc
|
||||
install -D -m755 %{S:5} etc/init.d/xpram
|
||||
@ -232,15 +248,15 @@ install -D -m755 %{S:11} sbin/dasd_reload
|
||||
install -D -m755 %{S:12} sbin/mkdump
|
||||
install -D -m644 %{S:13} var/adm/fillup-templates/sysconfig.osasnmpd
|
||||
install -D -m755 %{S:14} sbin/zfcp_san_disc
|
||||
install -D -m644 %{S:15} $RPM_BUILD_ROOT/%{_mandir}/man8
|
||||
install -D -m644 %{S:19} $RPM_BUILD_ROOT/usr/lib/udev/rules.d/52-xpram.rules
|
||||
install -D -m644 %{S:20} $RPM_BUILD_ROOT/usr/lib/udev/rules.d/52-hw_random.rules
|
||||
install -D -m644 %{S:21} $RPM_BUILD_ROOT/usr/lib/udev/rules.d/59-graf.rules
|
||||
install -D -m644 %{S:28} $RPM_BUILD_ROOT/usr/lib/udev/rules.d/59-prng.rules
|
||||
install -D -m644 %{S:29} $RPM_BUILD_ROOT/usr/lib/udev/rules.d/59-zfcp-compat.rules
|
||||
install -D -m644 %{S:30} $RPM_BUILD_ROOT/etc/modprobe.d/90-s390-tools.conf
|
||||
install -D -m755 %{S:32} $RPM_BUILD_ROOT/sbin/killcdl
|
||||
install -D -m755 %{S:33} $RPM_BUILD_ROOT/sbin/lgr_check
|
||||
install -D -m644 %{S:15} %{buildroot}/%{_mandir}/man8
|
||||
install -D -m644 %{S:19} %{buildroot}/usr/lib/udev/rules.d/52-xpram.rules
|
||||
install -D -m644 %{S:20} %{buildroot}/usr/lib/udev/rules.d/52-hw_random.rules
|
||||
install -D -m644 %{S:21} %{buildroot}/usr/lib/udev/rules.d/59-graf.rules
|
||||
install -D -m644 %{S:28} %{buildroot}/usr/lib/udev/rules.d/59-prng.rules
|
||||
install -D -m644 %{S:29} %{buildroot}/usr/lib/udev/rules.d/59-zfcp-compat.rules
|
||||
install -D -m644 %{S:30} %{buildroot}/etc/modprobe.d/90-s390-tools.conf
|
||||
install -D -m755 %{S:32} %{buildroot}/sbin/killcdl
|
||||
install -D -m755 %{S:33} %{buildroot}/sbin/lgr_check
|
||||
install -D -m644 %{S:34} var/adm/fillup-templates/sysconfig.virtsetup
|
||||
|
||||
if [ ! -d %{_sbindir} ]; then
|
||||
@ -266,18 +282,18 @@ if [ ! -d %{_bindir} ]; then
|
||||
fi
|
||||
install -D -m755 %{S:24} usr/bin/cputype
|
||||
|
||||
install -m644 -t $RPM_BUILD_ROOT/%{_mandir}/man8 %{S:25}
|
||||
install -m644 -t %{buildroot}/%{_mandir}/man8 %{S:25}
|
||||
|
||||
### Obsolete scripts and man pages to be removed once changes in other tools are made
|
||||
install -m755 -t sbin/ %{S:88} %{S:89} %{S:90} %{S:91} %{S:92} %{S:93}
|
||||
install -m644 -t $RPM_BUILD_ROOT/%{_mandir}/man8 %{S:94} %{S:95} %{S:96} %{S:97} %{S:98} %{S:99}
|
||||
install -m644 -t %{buildroot}/%{_mandir}/man8 %{S:94} %{S:95} %{S:96} %{S:97} %{S:98} %{S:99}
|
||||
###
|
||||
|
||||
### lsmem/chmem have been added to util-linux
|
||||
rm -fv $RPM_BUILD_ROOT/%{_mandir}/man8/lsmem.8*
|
||||
rm -fv $RPM_BUILD_ROOT/%{_mandir}/man8/chmem.8*
|
||||
rm -fv $RPM_BUILD_ROOT/%{_sbindir}/lsmem
|
||||
rm -fv $RPM_BUILD_ROOT/%{_sbindir}/chmem
|
||||
rm -fv %{buildroot}/%{_mandir}/man8/lsmem.8*
|
||||
rm -fv %{buildroot}/%{_mandir}/man8/chmem.8*
|
||||
rm -fv %{buildroot}/%{_sbindir}/lsmem
|
||||
rm -fv %{buildroot}/%{_sbindir}/chmem
|
||||
|
||||
find . ! -type d |
|
||||
%__sed 's/^.//;\-/man/-s/^.*$/%doc &.gz/' > %{_builddir}/%{name}-filelist
|
||||
@ -313,10 +329,8 @@ getent group ts-shell >/dev/null 2>&1 || groupadd -r ts-shell
|
||||
%service_add_pre cpi.service
|
||||
%service_add_pre cpuplugd.service
|
||||
%service_add_pre dumpconf.service
|
||||
%service_add_pre iucvtty-login@.service
|
||||
%service_add_pre mon_fsstatd.service
|
||||
%service_add_pre mon_procd.service
|
||||
%service_add_pre ttyrun-getty@.service
|
||||
%service_add_pre virtsetup.service
|
||||
|
||||
%post
|
||||
@ -334,29 +348,27 @@ fi
|
||||
%service_add_post cpi.service
|
||||
%service_add_post cpuplugd.service
|
||||
%service_add_post dumpconf.service
|
||||
%service_add_post iucvtty-login@.service
|
||||
%service_add_post mon_fsstatd.service
|
||||
%service_add_post mon_procd.service
|
||||
%service_add_post ttyrun-getty@.service
|
||||
%service_add_post virtsetup.service
|
||||
|
||||
# -i: skip insserv parts - has to be configured before use:
|
||||
%{fillup_and_insserv -i -n appldata}
|
||||
%{fillup_and_insserv -i -n cpi}
|
||||
%{fillup_and_insserv -i -n dumpconf}
|
||||
%{fillup_and_insserv -i -n hsnc}
|
||||
%{fillup_and_insserv -i -n mon_fsstatd}
|
||||
%{fillup_and_insserv -i -n mon_procd}
|
||||
%{fillup_and_insserv -i -n mon_statd}
|
||||
%{fillup_and_insserv -i -n virtsetup}
|
||||
%{fillup_and_insserv -i -n xpram}
|
||||
# Create the initial versions of the sysconfig files:
|
||||
%{fillup_only -n appldata}
|
||||
%{fillup_only -n cpi}
|
||||
%{fillup_only -n dumpconf}
|
||||
%{fillup_only -n hsnc}
|
||||
%{fillup_only -n mon_fsstatd}
|
||||
%{fillup_only -n mon_procd}
|
||||
%{fillup_only -n mon_statd}
|
||||
%{fillup_only -n virtsetup}
|
||||
%{fillup_only -n xpram}
|
||||
|
||||
%triggerin -- kernel-default
|
||||
grep -q '^/usr/bin/ts-shell$' /etc/shells \
|
||||
|| echo "/usr/bin/ts-shell" >> /etc/shells
|
||||
|
||||
%post -n osasnmpd
|
||||
%{fillup_and_insserv -i -n osasnmpd}
|
||||
%{fillup_only -i -n osasnmpd}
|
||||
|
||||
%preun
|
||||
%{stop_on_removal appldata}
|
||||
@ -368,7 +380,6 @@ grep -q '^/usr/bin/ts-shell$' /etc/shells \
|
||||
%service_del_preun cpi.service
|
||||
%service_del_preun cpuplugd.service
|
||||
%service_del_preun dumpconf.service
|
||||
%service_del_preun iucvtty-login@.service
|
||||
%service_del_preun mon_fsstatd.service
|
||||
%service_del_preun mon_procd.service
|
||||
%service_del_preun virtsetup.service
|
||||
@ -383,10 +394,8 @@ grep -q '^/usr/bin/ts-shell$' /etc/shells \
|
||||
%service_del_postun cpi.service
|
||||
%service_del_postun cpuplugd.service
|
||||
%service_del_postun dumpconf.service
|
||||
%service_del_postun iucvtty-login@.service
|
||||
%service_del_postun mon_fsstatd.service
|
||||
%service_del_postun mon_procd.service
|
||||
%service_del_postun ttyrun-getty@.service
|
||||
%service_del_postun virtsetup.service
|
||||
|
||||
read INITPGM < /proc/1/comm
|
||||
@ -410,9 +419,6 @@ fi
|
||||
%preun -n osasnmpd
|
||||
%{stop_on_removal osasnmpd}
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{_builddir}/%{name}.list
|
||||
%defattr(-,root,root)
|
||||
%doc README.md
|
||||
|
Loading…
Reference in New Issue
Block a user