mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl/src: Fix problems when image is not on target DASD
This patch fixes a bug in disk_get_info()
Steps to reproduce: Prepare a DASD disk for IPL, specifying an
image ("-i IMAGE_NAME") located on SCSI (dm) and a target directory
("-t /mnt") located on DASD. Don't specify "-a" option.
Actual result: "Run /lib/s390-tools//zipl_helper.device-mapper /mnt
Error: Could not retrieve device-mapper information for device
'dasda1'"
Expected result: "Run /lib/s390-tools//zipl_helper.device-mapper 253:4
Error: Could not add image file 'IMAGE_NAME': File is not on target
device"
The problem is in incorrect calculation by disk_get_info()
parameters for @device associated with the image file. Specifically,
@target->bootmap_dir is passed to the script, which is wrong.
Fixup: Get rid of bogus branching in disk_get_info() in case when
target parameters are evaluated in "source_script" mode. Always pass
major and minor of the @device (whose parameters to be calculated)
to the helper script.
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
7da5a6b9ed
commit
cfaccc5fad
@@ -246,15 +246,9 @@ disk_get_info(const char* device, struct job_target_data* target,
|
||||
(!stat(script_file, &script_stats))) {
|
||||
data->source = source_script;
|
||||
/* Run targetbase script */
|
||||
if (target->bootmap_dir == NULL) {
|
||||
/* happens in case of partition dump */
|
||||
misc_asprintf(&ppn_cmd, "%s %d:%d",
|
||||
script_file, major(stats.st_rdev),
|
||||
minor(stats.st_rdev));
|
||||
} else {
|
||||
misc_asprintf(&ppn_cmd, "%s %s",
|
||||
script_file, target->bootmap_dir);
|
||||
}
|
||||
misc_asprintf(&ppn_cmd, "%s %d:%d",
|
||||
script_file, major(stats.st_rdev),
|
||||
minor(stats.st_rdev));
|
||||
printf("Run %s\n", ppn_cmd);
|
||||
fh = popen(ppn_cmd, "r");
|
||||
if (fh == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user