mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
The commitfb0b6263d1("zipl/src: Fix problems when target parameters are specified by user") breaks the case where the user has to provide all target attributes via the zipl command line, because the target device cannot be used to retrieve those attributes. $ zipl -V --blsdir /tmp/tmp.xHmFUdgBCi/boot//loader/entries/ --config /tmp/tmp.dSv9MJ3svs Looking for components in '/lib/s390-tools' Using config file '/tmp/tmp.dSv9MJ3svs' (from command line) Using BLS config file '/tmp/tmp.xHmFUdgBCi/boot//loader/entries//50_normal.conf' Using BLS config file '/tmp/tmp.xHmFUdgBCi/boot//loader/entries//45_normal_swiotlb.conf' Using BLS config file '/tmp/tmp.xHmFUdgBCi/boot//loader/entries//40_pv.conf' Using BLS config file '/tmp/tmp.xHmFUdgBCi/boot//loader/entries//30_pv_reboot.conf' Secure boot support: yes Target device information Device..........................: 2b:00 Device name.....................: nbd0 *) Device driver name..............: nbd Type............................: disk device Disk layout.....................: SCSI disk layout *) Geometry - start................: 2048 *) File system block size..........: 4096 Physical block size.............: 512 *) Device size in physical blocks..: 2095071 *) Data provided by user. Building bootmap in '/tmp/tmp.xHmFUdgBCi/boot/' Building menu 'zipl-automatic-menu' Adding #1: IPL section 'Normal Guest' (default) initial ramdisk...: /tmp/tmp.xHmFUdgBCi/boot//ramdisk-s390x kernel image......: /tmp/tmp.xHmFUdgBCi/boot//vmlinux-s390x zIPL environment block content: Error: Could not add image file '/tmp/tmp.xHmFUdgBCi/boot//vmlinux-s390x': Could not get disk geometry This reverts commitfb0b6263d1. Acked-by: Eduard Shishkin <edward6@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
161 lines
2.9 KiB
C
161 lines
2.9 KiB
C
/*
|
|
* s390-tools/zipl/include/job.h
|
|
* Functions and data structures representing the actual 'job' that the
|
|
* user wants us to execute.
|
|
*
|
|
* Copyright IBM Corp. 2001, 2017
|
|
*
|
|
* s390-tools is free software; you can redistribute it and/or modify
|
|
* it under the terms of the MIT license. See LICENSE for details.
|
|
*
|
|
*/
|
|
|
|
#ifndef JOB_H
|
|
#define JOB_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "disk.h"
|
|
#include "zipl.h"
|
|
|
|
|
|
enum job_id {
|
|
job_print_usage = 1,
|
|
job_print_version = 2,
|
|
job_ipl = 3,
|
|
job_segment = 4,
|
|
job_dump_partition = 5,
|
|
job_menu = 6,
|
|
job_ipl_tape = 7,
|
|
job_mvdump = 8,
|
|
};
|
|
|
|
/* target information source */
|
|
typedef enum {
|
|
source_unknown = 0,
|
|
source_auto = 1,
|
|
source_user = 2,
|
|
source_script = 3
|
|
} source_t;
|
|
|
|
struct job_target_data {
|
|
char* bootmap_dir;
|
|
char* targetbase;
|
|
disk_type_t targettype;
|
|
int targetcylinders;
|
|
int targetheads;
|
|
int targetsectors;
|
|
int targetblocksize;
|
|
blocknum_t targetoffset;
|
|
source_t source;
|
|
};
|
|
|
|
struct job_common_ipl_data {
|
|
char* image;
|
|
char* parmline;
|
|
char* ramdisk;
|
|
address_t image_addr;
|
|
address_t parm_addr;
|
|
address_t ramdisk_addr;
|
|
bool optional;
|
|
bool ignore;
|
|
};
|
|
|
|
struct job_ipl_data {
|
|
struct job_common_ipl_data common;
|
|
address_t envblk_addr;
|
|
int is_kdump;
|
|
};
|
|
|
|
struct job_envblk_data {
|
|
int size;
|
|
char *buf;
|
|
};
|
|
|
|
struct job_segment_data {
|
|
char* segment;
|
|
address_t segment_addr;
|
|
};
|
|
|
|
struct job_dump_data {
|
|
struct job_common_ipl_data common;
|
|
char* device;
|
|
uint64_t mem;
|
|
bool no_compress;
|
|
};
|
|
|
|
struct job_mvdump_data {
|
|
char* device_list;
|
|
int device_count;
|
|
char* device[MAX_DUMP_VOLUMES];
|
|
uint64_t mem;
|
|
uint8_t force;
|
|
};
|
|
|
|
struct job_ipl_tape_data {
|
|
struct job_common_ipl_data common;
|
|
char* device;
|
|
};
|
|
|
|
union job_menu_entry_data {
|
|
struct job_ipl_data ipl;
|
|
struct job_dump_data dump;
|
|
};
|
|
|
|
struct job_menu_entry {
|
|
int pos;
|
|
char* name;
|
|
enum job_id id;
|
|
union job_menu_entry_data data;
|
|
int is_secure;
|
|
};
|
|
|
|
struct job_menu_data {
|
|
int num;
|
|
int default_pos;
|
|
int prompt;
|
|
int timeout;
|
|
struct job_menu_entry* entry;
|
|
};
|
|
|
|
struct job_data {
|
|
enum job_id id;
|
|
struct job_target_data target;
|
|
struct job_envblk_data envblk;
|
|
char* name;
|
|
union {
|
|
struct job_ipl_data ipl;
|
|
struct job_menu_data menu;
|
|
struct job_segment_data segment;
|
|
struct job_dump_data dump;
|
|
struct job_ipl_tape_data ipl_tape;
|
|
struct job_mvdump_data mvdump;
|
|
} data;
|
|
int dump_mounted;
|
|
int bootmap_dir_created;
|
|
int noninteractive;
|
|
int verbose;
|
|
int add_files;
|
|
int dry_run;
|
|
int command_line;
|
|
int is_secure;
|
|
int is_ldipl_dump;
|
|
};
|
|
|
|
/**
|
|
* Return true, if target parameters for the base disk are set
|
|
*/
|
|
static inline int target_parameters_are_set(struct job_target_data *td)
|
|
{
|
|
return td->targetbase != NULL;
|
|
}
|
|
|
|
int job_get(int argc, char* argv[], struct job_data** data);
|
|
void job_free(struct job_data* job);
|
|
int type_from_target(char *target, disk_type_t *type);
|
|
int check_job_dump_images(struct job_dump_data* dump, char* name);
|
|
int check_job_images_ngdump(struct job_dump_data* dump, char* name);
|
|
bool is_ngdump_enabled(struct job_data *job);
|
|
|
|
#endif /* not JOB_H */
|