From cf2fb296f08874cd381c21f51f90c39fd1dbc56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Thu, 26 May 2022 09:58:35 +0000 Subject: [PATCH] zipl: be verbose about secure boot support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Report the details about the state of secure boot on the system when running zipl in verbose mode. GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/133 Signed-off-by: Dan Horák Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- zipl/src/bootmap.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c index 4104e1bc..657e10c1 100644 --- a/zipl/src/bootmap.c +++ b/zipl/src/bootmap.c @@ -128,16 +128,27 @@ check_secure_boot_support(void) unsigned int val; FILE *fp; + if (verbose) + printf("Secure boot support: "); + fp = fopen(ZIPL_SIPL_PATH, "r"); - if (!fp) + if (!fp) { + if (verbose) + printf("not available\n"); return false; + } if (fscanf(fp, "%d", &val) != 1) { + if (verbose) + printf("error\n"); fclose(fp); return false; } fclose(fp); + if (verbose) + printf("%s\n", val ? "yes" : "no"); + return val ? true : false; }