From ebde75eedaaf359bc03104f784229990deedf6c4 Mon Sep 17 00:00:00 2001 From: Eduard Shishkin Date: Tue, 22 Jun 2021 14:21:18 +0200 Subject: [PATCH] zipl: add an ability to specify components location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When creating a bootmap, look for zipl components (stage3.bin and zipl helpers) in a directory specified by S390TOOLS_LIBDIR shell environment variable. If that variable is not set, then look for them at the default location. In verbose mode print the name of s390-tools library directory, where the search was implemented. Signed-off-by: Eduard Shishkin Reviewed-by: Jan Höppner Signed-off-by: Jan Höppner --- zipl/include/zipl.h | 3 ++- zipl/src/bootmap.c | 2 +- zipl/src/disk.c | 2 +- zipl/src/job.c | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/zipl/include/zipl.h b/zipl/include/zipl.h index 8a088810..9040d425 100644 --- a/zipl/include/zipl.h +++ b/zipl/include/zipl.h @@ -14,6 +14,7 @@ #include #include "lib/zt_common.h" +#include "lib/util_base.h" #include "boot/loaders_layout.h" #define ZIPL_MAGIC "zIPL" @@ -35,7 +36,7 @@ #define ZIPL_DEFAULT_CONF TOOLS_SYSCONFDIR "/zipl.conf" #define ZIPL_MINIMAL_CONF TOOLS_LIBDIR "/zipl.conf" #define ZIPL_DEFAULT_BLSDIR "/boot/loader/entries" -#define ZIPL_STAGE3_PATH TOOLS_LIBDIR "/stage3.bin" +#define ZIPL_STAGE3_PATH util_libdir_path("stage3.bin") #define ZIPL_SIPL_PATH "/sys/firmware/ipl/has_secure" #define MENU_DEFAULT_PROMPT 0 diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c index 86571639..6928f1ee 100644 --- a/zipl/src/bootmap.c +++ b/zipl/src/bootmap.c @@ -440,7 +440,7 @@ print_components(const char *name[], struct component_loc *loc, int num) } static int -extract_signature(char *filename, void **ret_signature, +extract_signature(const char *filename, void **ret_signature, struct signature_header *sig_head) { struct file_signature *file_sig; diff --git a/zipl/src/disk.c b/zipl/src/disk.c index c77cdf43..b32884b4 100644 --- a/zipl/src/disk.c +++ b/zipl/src/disk.c @@ -198,7 +198,7 @@ disk_get_info(const char* device, struct job_target_data* target, int fd; long devsize; FILE *fh; - char *script_pre = TOOLS_LIBDIR "/zipl_helper."; + const char *script_pre = util_libdir_path("/zipl_helper."); char *script_file = NULL; char *ppn_cmd = NULL; char buffer[80]; diff --git a/zipl/src/job.c b/zipl/src/job.c index 93ccd49c..f28fac9b 100644 --- a/zipl/src/job.c +++ b/zipl/src/job.c @@ -1920,6 +1920,9 @@ job_get(int argc, char* argv[], struct job_data** data) job->data.mvdump.force = cmdline.force; job->dry_run = cmdline.dry_run; job->is_secure = SECURE_BOOT_UNDEFINED; + if (job->verbose) + printf("Looking for components in '%s'\n", util_libdir()); + /* Get job data from user input */ if (cmdline.help) { job->command_line = 1;