mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl: Add --no-compress option to zipl command
Add --no-compress option to explicitly omit compression for single-volume DASD dumper. Used primarily for test purposes. Since only the lowest byte of mvdump_force field (struct stage2dump_parm_tail) has been used, split it in two byte fields and use one for the new no_compress attribute. Update zipl help and zipl man page with the new parameter info. Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
c08794bdfb
commit
c61783546b
+1
-1
@@ -535,7 +535,7 @@ boot_get_eckd_dump_stage2(void **data, size_t *size,
|
||||
if (buffer == NULL)
|
||||
return -1;
|
||||
memcpy(buffer, DATA_ADDR(eckd2dump_sv), DATA_SIZE(eckd2dump_sv));
|
||||
/* Write mem size to end of dump record */
|
||||
/* Write mem size and no-compression indicator to end of dump record */
|
||||
offset = DATA_SIZE(eckd2dump_sv) - sizeof(struct stage2dump_parm_tail);
|
||||
memcpy(VOID_ADD(buffer, offset), stage2dump_parms,
|
||||
sizeof(struct stage2dump_parm_tail));
|
||||
|
||||
+3
-1
@@ -1040,7 +1040,8 @@ install_dump_tape(int fd, const struct stage2dump_parm_tail *stage2dump_parms)
|
||||
|
||||
|
||||
int
|
||||
install_dump(const char* device, struct job_target_data* target, uint64_t mem)
|
||||
install_dump(const char *device, struct job_target_data *target, uint64_t mem,
|
||||
bool no_compress)
|
||||
{
|
||||
struct stage2dump_parm_tail stage2dump_parms = {0};
|
||||
struct disk_info* info;
|
||||
@@ -1050,6 +1051,7 @@ install_dump(const char* device, struct job_target_data* target, uint64_t mem)
|
||||
int rc;
|
||||
|
||||
stage2dump_parms.mem_upper_limit = mem;
|
||||
stage2dump_parms.no_compress = no_compress;
|
||||
fd = misc_open_exclusive(device);
|
||||
if (fd == -1) {
|
||||
error_text("Could not open dump device '%s'", device);
|
||||
|
||||
@@ -50,6 +50,7 @@ static struct option options[] = {
|
||||
{ "parmfile", required_argument, NULL, 'p'},
|
||||
{ "parameters", required_argument, NULL, 'P'},
|
||||
{ "dumpto", required_argument, NULL, 'd'},
|
||||
{ "no-compress", no_argument, NULL, 0xb1},
|
||||
{ "dumptofs", required_argument, NULL, 'D'},
|
||||
{ "mvdump", required_argument, NULL, 'M'},
|
||||
{ "segment", required_argument, NULL, 's'},
|
||||
@@ -93,6 +94,7 @@ struct command_line {
|
||||
int add_files;
|
||||
int dry_run;
|
||||
int force;
|
||||
int no_compress;
|
||||
int is_secure;
|
||||
int is_ldipl_dump;
|
||||
enum scan_section_type type;
|
||||
@@ -289,6 +291,9 @@ get_command_line(int argc, char* argv[], struct command_line* line)
|
||||
case 0xb0:
|
||||
cmdline.is_ldipl_dump = 1;
|
||||
break;
|
||||
case 0xb1:
|
||||
cmdline.no_compress = 1;
|
||||
break;
|
||||
case 1:
|
||||
/* Non-option is interpreted as section name */
|
||||
if (cmdline.section != NULL) {
|
||||
@@ -1984,6 +1989,7 @@ job_get(int argc, char* argv[], struct job_data** data)
|
||||
job->noninteractive = cmdline.noninteractive;
|
||||
job->verbose = cmdline.verbose;
|
||||
job->add_files = cmdline.add_files;
|
||||
job->data.dump.no_compress = cmdline.no_compress;
|
||||
job->data.mvdump.force = cmdline.force;
|
||||
job->dry_run = cmdline.dry_run;
|
||||
job->is_secure = SECURE_BOOT_UNDEFINED;
|
||||
|
||||
+2
-1
@@ -73,6 +73,7 @@ static const char* usage_text[] = {
|
||||
"-d, --dumpto DUMPDEV[,SIZE] Install a system dump record on tape device",
|
||||
" or disk partition DUMPDEV",
|
||||
" --ldipl-dump Install a List-directed dump",
|
||||
" --no-compress Do not use zlib compression for DASD dump",
|
||||
"-M, --mvdump DEVLIST[,SIZE] Install a multi-volume dump record on each",
|
||||
" disk partition listed in file DEVLIST",
|
||||
"-f, --force Disable sanity check while producing a",
|
||||
@@ -176,7 +177,7 @@ main(int argc, char* argv[])
|
||||
(disk_is_tape(job->data.dump.device) ||
|
||||
!disk_is_scsi(job->data.dump.device, &job->target))) {
|
||||
rc = install_dump(job->data.dump.device, &job->target,
|
||||
job->data.dump.mem);
|
||||
job->data.dump.mem, job->data.dump.no_compress);
|
||||
break;
|
||||
}
|
||||
/* Dump to a raw SCSI partition */
|
||||
|
||||
Reference in New Issue
Block a user