mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl/src: fix bugs in SCSI dump installation
This fixes d6b702d57 which introduces a problem: SCSI dump
installation fails:
zipl -V -d /dev/mapper/mpathd1
Error: Invalid dump device: Could not read partition table
The reasons:
1) Wrong (logical) device is passed as a target base;
2) In case of 'source_script' the check to make sure that specified
target is over a partition isn't applicable any more after zipl
support of complex logical targets (e.g. mirrors).
The fixup passes the physical device as a target base (instead of
the logical one). Also the fixup removes invalid check from
check_dump_device_late() and instead adds a more generic check to
the helper script that data starts beyong the boot area.
Reported-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Tested-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
136e5eed8c
commit
f43789e16a
@@ -971,9 +971,18 @@ check_dump_device_late(char *partition, struct disk_info *target_info,
|
||||
return rc;
|
||||
}
|
||||
if ((job->is_ldipl_dump && info->type != disk_type_eckd_cdl) ||
|
||||
(!job->is_ldipl_dump && info->type != disk_type_scsi) ||
|
||||
info->partnum == 0) {
|
||||
error_reason("Device '%s' is not a SCSI or DASD partition",
|
||||
(!job->is_ldipl_dump && info->type != disk_type_scsi)) {
|
||||
error_reason("Device '%s' is not of SCSI or DASD-CDL type",
|
||||
partition);
|
||||
disk_free_info(info);
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* Check that data starts beyong the boot area on the base disk.
|
||||
* In case of source_script the check is performed by the script
|
||||
*/
|
||||
if (target->source == source_auto && info->partnum == 0) {
|
||||
error_reason("Device '%s' is not a partition",
|
||||
partition);
|
||||
disk_free_info(info);
|
||||
return -1;
|
||||
@@ -1489,7 +1498,7 @@ static int prepare_build_program_table_device(struct job_data *job,
|
||||
printf("Target device information\n");
|
||||
disk_print_info(bis->info, job->target.source);
|
||||
}
|
||||
if (misc_temp_dev(bis->info->device, 1, &bis->basetmp[0]))
|
||||
if (misc_temp_dev(bis->info->basedisks[0], 1, &bis->basetmp[0]))
|
||||
return -1;
|
||||
if (check_dump_device(job, bis->info, bis->basetmp[0]))
|
||||
return -1;
|
||||
@@ -1710,7 +1719,7 @@ static int prepare_bootloader_ngdump(struct job_data *job,
|
||||
/* Retrieve target device information */
|
||||
if (disk_get_info(job->data.dump.device, &job->target, &info))
|
||||
return -1;
|
||||
if (misc_temp_dev(info->device, 1, &bis->basetmp[0]))
|
||||
if (misc_temp_dev(info->basedisks[0], 1, &bis->basetmp[0]))
|
||||
return -1;
|
||||
if (check_dump_device(job, info, bis->basetmp[0]))
|
||||
return -1;
|
||||
|
||||
@@ -1364,6 +1364,11 @@ static int dm_dev_to_zipl_params(struct ext_dev *dev, char *dir)
|
||||
return -1;
|
||||
if (complete_physical_device(&pd, &base_dev))
|
||||
goto error;
|
||||
if (pd.offset < pd.dc.bootsectors) {
|
||||
ERR("Unsupported setup: data starts at boot area on (%u:%u)\n",
|
||||
major(base_dev), minor(base_dev));
|
||||
return -1;
|
||||
}
|
||||
base_dev_to_params(base_dev, &pd.dc, pd.offset);
|
||||
|
||||
if (pd.mirror) {
|
||||
|
||||
Reference in New Issue
Block a user