0975e08340
- Modified mkdump perl script to work with the updated version of the IBM tools dasdview, zipl and zgetdump. (bsc#1020336). - Upgraded to version 2.1.0 (Fate#323291). Changes from 2.0.0 to 2.1.0 * Added the following tools: netboot: Scripts for building a PXE-style netboot image for KVM 90-cpi.rules/cpictl: New udev rule to update CPI when KVM is used * Modified lsqeth/zdev to add VNIC Characteristics support Bug fixes * chzcrypt: Corrected handling of insufficient permissions * cpacfstats: Add size setting to perf event * fdasd: Skip partition check with the force option * ttyrun: Fix deprecated BindTo usage in ttyrun-getty@.service.in * lszcrypt: Fix core dump caused by stack overwrite * lszcrypt: Fix random domain printout when no config available * zdev: Fix segfault with unknown qeth attribute * zdev: Fix IPv6 NDP proxy description * zdev: Fix zdev dracut module temp file location * zkey: Correctly detect abbreviated commands * zkey: Validate XTS key: ignore domain and card * zkey: Use octal values instead of S_IRWX* constants * zkey: Properly set umask to prohibit permissions to group and others * zkey: Add -ldl to LDLIBS (not LDFLAGS) * znetconf: Re-add missing line in lsznet.raw * Fix several gcc 7 warnings - Modified s390-tools-sles12-fdasd-skip-partition-check-and-BLKRRPART-ioctl.patch to apply cleanly to this version. - Removed the following obsolete patches: * s390-tools-sles15-zgetdump-Fix-gcc-7-warning.patch * s390-tools-sles15-lscss-Get-rid-of-gcc-7-buffer-truncation-warnings.patch * s390-tools-sles15-Get-rid-of-gcc-7-fall-through-warnings.patch * s390-tools-sles15-lszcrypt-Fix-core-dump-caused-by-stack-overwrite.patch * s390-tools-sles15-dasdinfo-Fix-GCC-7-overflow-warning.patch - Added the following patches (bsc#1056498) - s390-tools-sles15-zgetdump-Fix-gcc-7-warning.patch - s390-tools-sles15-lscss-Get-rid-of-gcc-7-buffer-truncation-warnings.patch - s390-tools-sles15-Get-rid-of-gcc-7-fall-through-warnings.patch - s390-tools-sles15-lszcrypt-Fix-core-dump-caused-by-stack-overwrite.patch - s390-tools-sles15-dasdinfo-Fix-GCC-7-overflow-warning.patch - Upgraded to version 2.0.0 (Fate#323291). - Changes from 1.34.0 to 1.35.0 - cpuplugd: Make default config file location more distribution agnostic Add systemd service unit to start/stop the cpuplug daemon Add force-reload action to init script for LSB-compliance - mon_statd: Add force-reload action to init script for LSB-compliance - chiucvallow: corrected verification return code - lczdev/chzdev: Add support for resolving iSCSI block devices Bug fixes - chzdev, lszdev: Fix incorrect zfcp module parameter name - chreipl: Fix chreipl node for virtio devices - libus2s: Fix busid parsing - zipl/boot: Fix failed start subchannel in FBA loader - Changes from 1.35.0 to 1.36.0 - chzdev/lszdev: Add device resolution for vlan and bonding devices - dasdfmt: Add quick format support - lsdasd/fdasd/dasdfmt/zdsfs: Add query host access to volume support - zfcpdbf: Make timestamp the first field in record output Exclude Payload hex field from log message record output Add Area field to record output Add missing header fields to area record output Print the Record id field for Area area class records Mark oldest and newest trace area records Mark oldest and newest def_err pseudo area records Mark oldest and newest foreign area records Mark oldest and newest log message records Add a warning about low resolution timestamps Add Trace Area Statistics table to script output Add time zone command line option Add collection of domain xml files Bug fixes - zfcpdbf: Move and fix CPU id field output to print_header function Include microseconds in warning threshold calculation Fix parsing of precise syslog timestamps Fix labels for REC ERP action status and ERP step fields - Changes from 1.36.0 to 1.36.1 - zfcpdbf: Support basic HBA record type without warning Restore tracing of handle for port and LUN with HBA records Print full payload for all SAN traces (req, resp, iels) Print payload length everywhere applicable Disambiguate printing of payload record content Bug fixes - fdasd: Prevent buffer overflow - znetconf: Fix detection of chpids as OSX instead of OSM - Changes from 1.36.1 to 1.37.0 - Added dump2tar: sysfs collection helper for dbginfo.sh - qethconf: Remove check for OSN-device - znetconf: Remove OSN-support - lsdasd/tunedasd: Add channel path aware erp - zcrypt: Add multi domain support for zcrypt device driver - scm: Reimplement lsscm in C - chp: Reimplement chchp and lschp in C - dbginfo.sh: Make use of sysinfo collection helper Bug fixes - zfcpdbf: Only cap SAN short payload if pl_len exists - chzdev: Fix bug when configuring QETH devices - libu2s: Prevent buffer overflow - ziomon: No blktrace kill which can corrupt kernel blktrace state - Changes from 1.37.0 to 1.37.1 - dbginfo.sh: Add Docker debug data Bug fixes - lsdasd: Replace continue with return - lscss: Allow to specify devices from subchannel set 3 - mon_fsstatd: Only use physical filesystems Fix double free in error path - mon_procd: Fix segmentation fault - Changes from 1.37.1 to 1.38.0 - systemd: Add new units for cpi, dumpconf, mon_fsstatd, and mon_procd - fdasd: Add new command action 'l' to list known partition types - chmem: Try to online memory to zone movable Starting with kernel 4.13 (commit f1dd2cd1), the default zone for hotplug memory is changed from zone movable to zone normal. In order to preserve the previous default behaviour, chmem will now always try to set memory online to the zone movable, before trying to set it online to the default zone. - zfcpdbf: Print high part of "new" 64 bit SCSI LUN Print payload with full FCP_RSP IU in SCSI trace records - util_opt: Add command specific command line parsing - util_rec: Implement util_rec_iterate() function - util_rec: Record field values can be stored and processed in argz format Bug fixes - zipl/zgetdump: Add missing SCSI multipath dump information to man pages - lsqeth: Fix attributes name: ipa -> ipa_takeover and parp -> rxip Fix lsqeth output of ipa/vipa/rxip addresses of interfaces - zfcpdbf: Fix payload length for zfcp_dbf_hba_bit_err - chzdev: Add implicit qeth layer settings handling - qethqoat: Fix OSA 6S detection - Changes from 1.38.0 to 2.0.0 (also known as 1.39.0) - IBM changed the license to MIT. - Added zkey: Generate, re-encipher, and validate secure AES keys - cpumf: Add hardware counters for z13 and z13s - lscss: Reimplement lscss script in C - lsqeth: Reimplement lsqeth script in C Bug fixes - lscpumf: Fix Perl warnings - Removed the following obsolete patches: s390-tools-sles12sp2-chiucvallow-verify.patch s390-tools-sles12sp2-chreipl-virtio.patch s390-tools-sles12sp2-chzdev-disable-root-update.patch s390-tools-sles12sp2-lscss-allow-to-specify-devices-from-ssid-3.patch s390-tools-sles12sp2-zipl-fix-failed-start-subchannel.patch s390-tools-sles12sp3-chmem-try-to-online-zone-movable.patch s390-tools-sles12sp3-dasdfmt-01-Fix-behaviour-of-t-combined-with-y.patch s390-tools-sles12sp3-dasdfmt-02-Fix-trailing-whitespace.patch s390-tools-sles12sp3-dasdfmt-03-Apply-coding-convention.patch s390-tools-sles12sp3-dasdfmt-04-Use-enhanced-DASD-information.patch s390-tools-sles12sp3-dasdfmt-05-Refactor-do_format_dasd.patch s390-tools-sles12sp3-dasdfmt-06-Make-the-IOCTL-BLKSSZGET-reusable.patch s390-tools-sles12sp3-dasdfmt-07-Add-quick-format-support.patch s390-tools-sles12sp3-dasdfmt-08-Make-progress-output-reusable-and-add-ETR.patch s390-tools-sles12sp3-dasdfmt-09-Add-command-line-argument-check.patch s390-tools-sles12sp3-dasdfmt-10-Add-expand-format-mode.patch s390-tools-sles12sp3-dbginfo-01-libutil-Add-utility-functions.patch s390-tools-sles12sp3-dbginfo-02-dump2tar-Add-sysfs-collection-helper-for-dbginfo.sh-v2.patch s390-tools-sles12sp3-dbginfo-03-dbginfo.sh-Make-use-of-sysinfo-collection-helper.patch s390-tools-sles12sp3-dbginfo-Collect-docker-debug-data.patch s390-tools-sles12sp3-lsdasd-tunedasd-Add-channel-path-aware-erp.patch s390-tools-sles12sp3-mon_fsstatd-fix-double-free-in-error-path-and-skip-virtual-fs.patch s390-tools-sles12sp3-util_proc-fix-memory-allocation-error-messages.patch s390-tools-sles12sp3-ziomon-no-blktrace-kill-which-can-corrupt-kernel-blk.patch - Added s390-tools-sles15-add--ldl-to-LDLIBS.patch to fix a problem with zkey/Makefile. OBS-URL: https://build.opensuse.org/request/show/531958 OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=19
527 lines
16 KiB
Diff
527 lines
16 KiB
Diff
--- 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;
|
|
}
|