zipl: add support for ldipl dump from ECKD DASD

Add the required code to install ngdump on DASDs.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Sven Schnelle
2023-03-01 13:10:00 +00:00
committed by Steffen Eiden
parent 41108c98aa
commit 24bcc3141d
5 changed files with 42 additions and 13 deletions
+3
View File
@@ -80,6 +80,9 @@ function create_initrd()
device=$(readlink -f $1)
dryrun=$2
type=$(lsblk -dno type "$device")
[ "$type" != "part" ] && { echo "$device with type $type is not a partition." >&2; exit 1; }
disk_path=$(create_dumpfs $device)
kernel_version=$(get_kernel_version)
kernel=$(get_kernel_image "$kernel_version")
@@ -55,6 +55,10 @@ function create_initrd()
device=$(readlink -f $1)
dryrun=$2
type=$(lsblk -dno type "$device")
[ "$type" != "part" ] && { echo "$device with type $type is not a partition." >&2; exit 1; }
disk_path=$(create_dumpfs $device)
kernel_version=$(get_kernel_version)
kernel=$(get_kernel_image "$kernel_version")
+22 -9
View File
@@ -947,7 +947,8 @@ static int add_segment_program(struct install_set *bis,
static int
check_dump_device_late(char *partition, struct disk_info *target_info,
struct job_target_data *target)
struct job_target_data *target,
struct job_data *job)
{
struct disk_info* info;
int rc;
@@ -959,8 +960,10 @@ check_dump_device_late(char *partition, struct disk_info *target_info,
partition);
return rc;
}
if ((info->type != disk_type_scsi) || (info->partnum == 0)) {
error_reason("Device '%s' is not a SCSI partition",
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",
partition);
disk_free_info(info);
return -1;
@@ -975,12 +978,13 @@ check_dump_device_late(char *partition, struct disk_info *target_info,
return 0;
}
static int add_dump_program(struct install_set *bis, struct job_dump_data *dump,
static int add_dump_program(struct install_set *bis, struct job_data *job,
disk_blockptr_t *program, int verbose,
component_header_type type,
struct job_target_data *target,
int program_table_id)
{
struct job_dump_data *dump = &job->data.dump;
struct job_target_data *target = &job->target;
struct job_ipl_data ipl;
int rc;
@@ -989,7 +993,7 @@ static int add_dump_program(struct install_set *bis, struct job_dump_data *dump,
ipl.common = dump->common;
/* Get file system dump parmline */
rc = check_dump_device_late(dump->device, bis->info, target);
rc = check_dump_device_late(dump->device, bis->info, target, job);
if (rc)
return rc;
ipl.common.parmline = dump->common.parmline;
@@ -1065,9 +1069,9 @@ static int build_program_table(struct job_data *job,
printf("Adding dump section '%s' (default)\n",
job->name);
}
rc = add_dump_program(bis, &job->data.dump, &table[0],
rc = add_dump_program(bis, job, &table[0],
verbose || job->command_line,
COMPONENT_HEADER_DUMP, &job->target,
COMPONENT_HEADER_DUMP,
program_table_id);
break;
case job_menu:
@@ -1389,11 +1393,17 @@ static int disk_is_appropriate(const struct job_data *job,
error_reason("Secure boot forced for improper disk type");
return 0;
}
if (job->id == job_dump_partition &&
job->is_ldipl_dump &&
info->type != disk_type_eckd_cdl) {
error_reason("List-directed dump not support on DASD with LDL format");
return 0;
}
return 1;
}
static int
check_dump_device(const struct job_data *job, const struct disk_info *info,
check_dump_device(struct job_data *job, const struct disk_info *info,
const char *device)
{
int rc, part_ext;
@@ -1407,6 +1417,9 @@ check_dump_device(const struct job_data *job, const struct disk_info *info,
if (!disk_is_appropriate(job, info))
return -1;
if (is_ngdump_enabled(job))
return 0;
rc = util_part_search(device, info->geo.start,
info->phy_blocks, info->phy_block_size, &part_ext);
if (rc <= 0 || part_ext) {
+2
View File
@@ -2028,5 +2028,7 @@ job_get(int argc, char* argv[], struct job_data** data)
bool
is_ngdump_enabled(struct job_data *job)
{
if (job->is_ldipl_dump)
return true;
return disk_is_nvme(job->data.dump.device, &job->target);
}
+11 -4
View File
@@ -172,8 +172,9 @@ main(int argc, char* argv[])
/* Do it */
switch (job->id) {
case job_dump_partition:
if (disk_is_tape(job->data.dump.device) ||
!disk_is_scsi(job->data.dump.device, &job->target)) {
if (!is_ngdump_enabled(job) &&
(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);
break;
@@ -185,10 +186,16 @@ main(int argc, char* argv[])
rc = -1;
break;
}
if (is_ngdump_enabled(job))
if (is_ngdump_enabled(job)) {
if (disk_is_eckd_ldl(job->data.dump.device, &job->target)) {
error_reason("List-directed dump on ECKD with LDL not supported");
rc = -1;
break;
}
rc = check_job_images_ngdump(&job->data.dump, job->name);
else
} else {
rc = check_job_dump_images(&job->data.dump, job->name);
}
if (rc != 0)
break;
/* Fall through. */