SHA256
1
0
forked from pool/s390-tools
s390-tools/s390-tools-sles15sp3-Implement-Y-yast_mode.patch
Mark Post 1df1badd32 Accepting request 931282 from home:markkp:branches:Base:System
- Upgraded to version 2.19.0 (jsc#SLE-18324)
  * v2.19.0 (2021-11-10)__
    Add new tools / libraries:
    - chreipl-fcp-mpath: New toolset that uses multipath information to change
      the configured FCP re-IPL path on detecting issues with the current path
    Changes of existing tools:
    - dbginfo.sh: Add retry timeout and remove possible blocking "blockdev --report"
    - dbginfo.sh: Collect config- and debug-data for chreipl-fcp-mpath
    - hsci: Add support for multiple MAC addresses
    Bug Fixes:
    - lshwc: Fix compile error for gcc <8.1
    - zdump: Various clean-ups and fixes
    - ziomon: Correct throughput calculation in ziorep_printers
    - zipl: Fix segmentation fault when setting stage3_parms
  * v2.18.0 (2021-10-01)__
    Add new tools:
    - scripts: Add tool for parsing sclp s390dbf logs
    - zdev: Add udev rule helper tool
    - zipl-editenv: Add tool to operate with zIPL environment installed in the boot record
    Changes of existing tools:
    - Makefile: Fix order of build of libraries for parallel builds
    - dbginfo.sh: Add collection in area of timedate, coredump and --check option
    - dbginfo.sh: Add exception on dump2tar for /sys/kernel/mm/page_idle/bitmap
    - dbginfo.sh: Cleanup of outdated sections and general code rework
    - dbginfo.sh: Collect zipl boot menu entries from boot loader specification
    - lszcrypt: Add support for vfio-ap status field
    - lszcrypt: Improved output for deconfig cards and queues
    - lszfcp: Add linkdown case to host marker of extended output
    - zdev: Add auto-config for PCI and crypto devices
    - zdump: Introduce multi-level message logging
    - zipl: Add support for environment block interpretation
    - zkey-cryptsetup: Support LUKS2 volumes with integrity support enabled
    Bug Fixes:
    - hsavmcore: Avoid recompilation of overlay during install step
    - libkmipclient: Fix parsing of hex values for XML and JSON encoding
    - vmur/vmur.cpp: Fix error handling on transfer failure
    - zdump: Lots of smaller fixes across the board
  * v2.17.0 (2021-07-07)__
    Add new tools / libraries:
    - hsavmcore: New utility to make the dump process with kdump more efficient
    - libkmipclient: Add KMIP client shared library
    - libseckey: Add a secure key library
    - lshwc: New tool to extract and list complete counter sets
    Changes of existing tools:
    - genprotimg: Add '--(enable|disable)-pckmo' options
    - genprotimg: Add OpenSSL 3.0 support
    - genprotimg: Change plaintext control flags defaults so PCKMO functions are allowed
    - libutil: Introduce multi-level message logging (util_log)
    - libutil: Introduce util_arch module
    - udev/dasd: Change DASD udev-rule to set none scheduler
    - zdsfs: Add transparent codepage conversion
    - zkey: Add support for KMIP-based key management systems
    Bug Fixes:
    - ttyrun-getty: Avoid conflicts with serial-getty@
    - dbginfo: add /proc/kallsyms - refresh zVM, lscpu - fix WORKARCHIVE handling
    - dbginfo: add KVM data collection for server and guest - fix lszdev
    - genprotimg: Add missing return values in error paths
    - zkey: Fix conversion of CCA DATA keys to CCA CIPHER keys
    - znetconf: avoid conflict with "chzdev -e"
  * v2.16.0 (2021-02-19)__
    Add new tool:
    - hsci: New tool to manage HSCI (HiperSockets Converged Interfaces)
    Changes of existing tools:
    - genprotimg: Add host-key document verification support
    - genprotimg: boot: Make boot loader -march=z900 compatible
    - libekmfweb: Make install directory for shared libraries configurable
    - lsdasd: Add FC Endpoint Security information
    - make: Add address sanitizer support
    - netboot: Add version information to scripts
    - netboot: Bump busybox version in pxelinux.0 build
    - zdev: Add FC Endpoint Security information for DASD devices
    - zdev: Add build option to update initial RAM-disk by default
    - zkey-ekmfweb: Avoid sequence number clash when generating keys
    - zkey/zkey-ekmfweb: Install KMS plugins into configurable location
    - zkey: Add support to store LUKS2 dummy passphrase in key repository
    Bug Fixes:
    - dasdfmt: Fix segfault when an incorrect option is specified
    - genprotimg: Fix several build issues
    - genprotimg: Require argument for 'ramdisk' and 'parmfile' options
    - zcryptstats: Fix handling of partial results with many domains
    - zfcpdbf: Deal with crash 7.2.9 change in caller name formatting
    - zipl/boot: Fix memory use after free in stage2
    - zipl/boot: Fix potential heap overflow in stage2
    - zipl: Fix reading 4k disk's geometry
- Removed the following obsolete patches
  * s390-tools-sles15sp3-dasdfmt-Fix-segfault-when-an-incorrect-option-is-spe.patch
  * s390-tools-sles15sp3-libutil-Compare-proc-entries-to-vfstype.patch
  * s390-tools-sles15sp3-01-zdev-Add-FC-Endpoint-Security-information-for-DASD-d.patch
  * s390-tools-sles15sp3-02-lsdasd-Add-FC-Endpoint-Security-information.patch
  * s390-tools-sles15sp3-hsci-Add-new-tool-to-control-HiperSockets-Converged-.patch
  * s390-tools-sles15sp3-zcryptstats-Fix-handling-of-partial-results-with-man.patch
  * s390-tools-sles15sp3-01-genprotimg-abort-if-one-of-the-recursive-targets-is-.patch
  * s390-tools-sles15sp3-02-genprotimg-fix-two-memory-leaks.patch
  * s390-tools-sles15sp3-03-genprotimg-require-argument-for-ramdisk-and-parmfile.patch
  * s390-tools-sles15sp3-04-genprotimg-add-host-key-document-verification-suppor.patch
  * s390-tools-sles15sp3-zkey-Fix-APQN-property-names.patch
  * s390-tools-sles15sp3-zipl-fix-4k-scsi-ipl.patch
  * s390-tools-sles15sp3-dasd-change-DASD-udev-rule-to-set-none-scheduler.patch
  * s390-tools-sles15sp3-check-return-code-from-util_file_read_l.patch  
- Removed an obsolete "export ROOT_BUILD_DIR" statement from the spec file.
- Removed unnecessary defattr statements in the files section.
- Updated the spec file to correspond to the changes made to the
  location and name of the kernel image in the kernel-zfcpdump
  package (bsc#1189841)
- Did some spec file cleanup based on the recommendations from
  spec-cleaner.

OBS-URL: https://build.opensuse.org/request/show/931282
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=124
2021-11-13 20:06:12 +00:00

205 lines
5.5 KiB
Diff

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
@@ -83,6 +83,7 @@ static struct dasdfmt_globals {
int ese;
int no_discard;
int procnum;
+ int yast_mode;
} g = {
.dasd_info = { 0 },
};
@@ -172,6 +173,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' },
@@ -318,7 +323,9 @@ static void draw_progress(int cyl, unsig
}
if (g.print_hashmarks && (cyl / g.hashstep - hashcount) != 0) {
- printf("%d|", g.procnum);
+ if (g.yast_mode)
+ printf("%d|", g.procnum);
+ else printf("#");
fflush(stdout);
hashcount++;
}
@@ -392,7 +399,7 @@ static void evaluate_format_error(format
unsigned int kl = 0;
int blksize = cdata->expect.blksize;
- if (g.print_progressbar || g.print_hashmarks)
+ if ((g.print_progressbar || g.print_hashmarks) && !g.yast_mode)
printf("\n");
/*
@@ -780,8 +787,9 @@ static void check_hashmarks(void)
g.hashstep = 10;
}
- printf("Printing hashmark every %d cylinders.\n",
- g.hashstep);
+ if (!g.yast_mode)
+ printf("Printing hashmark every %d cylinders.\n",
+ g.hashstep);
}
}
@@ -1462,17 +1470,19 @@ static void do_format_dasd(volume_label_
break;
}
- printf("Finished formatting the %s device.\n", g.dev_path);
+ if (!g.yast_mode)
+ printf("Finished formatting the %s device.\n", g.dev_path);
if (!(g.writenolabel || mode == EXPAND))
dasdfmt_write_labels(vlabel, cylinders, heads);
- printf("Rereading the partition table for %s... ", g.dev_path);
+ if (!g.yast_mode)
+ printf("Rereading the partition table for %s... ", g.dev_path);
err = dasd_reread_partition_table(g.dev_node, 5);
if (err != 0) {
ERRMSG("%s: error during rereading the partition "
"table: %s.\n", prog_name, strerror(err));
- } else {
+ } else if (!g.yast_mode) {
printf("ok\n");
}
}
@@ -1548,6 +1558,7 @@ void process_dasd(volume_label_t *orig_v
error("%s", str);
set_geo(&cylinders, &heads);
+
set_label(&vlabel, &format_params, cylinders);
if (g.check)
@@ -1557,6 +1568,29 @@ void process_dasd(volume_label_t *orig_v
}
+static void yast_print_cylinfo(const char *dev_filename)
+{
+ unsigned int cylinders = -1u;
+ int fd;
+ dasd_information2_t dasd_info;
+ struct dasd_eckd_characteristics *characteristics;
+
+ fd = open(dev_filename, O_RDONLY);
+ if ((fd != -1) && ( ! ioctl(fd, BIODASDINFO2, &dasd_info))) {
+
+ 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;
+ }
+
+ if (fd != -1)
+ close(fd);
+ printf("%u\n", cylinders);
+ fflush(stdout);
+}
+
int main(int argc, char *argv[])
{
volume_label_t vlabel;
@@ -1693,6 +1727,10 @@ int main(int argc, char *argv[])
case OPT_NODISCARD:
g.no_discard = 1;
break;
+ case 'Y':
+ /* YaST mode */
+ g.yast_mode = 1;
+ break;
case 'P':
max_parallel = atoi(optarg);
break;
@@ -1728,6 +1766,21 @@ int main(int argc, char *argv[])
reqsize = DEFAULT_REQUESTSIZE;
}
+/* If -Y (YaST mode) was specified by the caller, then we need to suppress
+ * most of all the other output that might be generated. But, we _do_ want
+ * hashmarks printed so that YaST can track what's going on. If it wasn't
+ * specified on the command line, set it to a default of 10 cylinders.
+ */
+ if (g.yast_mode) {
+ g.verbosity = 0;
+ g.print_progressbar = 0;
+ g.print_percentage = 0;
+ if (! g.print_hashmarks) {
+ g.print_hashmarks = 1;
+ hashstep_str = "10";
+ }
+ }
+
if (g.print_hashmarks)
PARSE_PARAM_INTO(g.hashstep, hashstep_str, 10, "hashstep");
@@ -1747,6 +1800,12 @@ int main(int argc, char *argv[])
if (numdev > 1 && g.labelspec)
error("Specifying a volser to be written doesn't make sense when formatting multiple DASD volumes.");
+ if (g.yast_mode) {
+ for (numproc = 0; numproc < numdev; numproc++)
+ yast_print_cylinfo(g.dev_path_array[numproc]);
+
+ }
+
for (numproc = 0; numproc < numdev; numproc++) {
chpid = fork();
if (chpid == -1 )
--
1.7.12.4