zipl: be verbose about secure boot support

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 <dan@danny.cz>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Dan Horák
2022-05-26 09:58:35 +00:00
committed by Jan Höppner
parent 6cbd81f997
commit cf2fb296f0

View File

@@ -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;
}