From 5dc39e87e7ef32bf2e9f0ad32a2c447a07a23bc1 Mon Sep 17 00:00:00 2001 From: Vasily Gorbik Date: Mon, 9 Feb 2026 00:35:29 +0100 Subject: [PATCH] ipl_tools/lsreipl: Suppress 'clear' output if not supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some environments do not expose the /sys/firmware/reipl/*/clear attribute (e.g. z/VM guests without "Load Normal" support). lsreipl currently tries to read the attribute unconditionally for ECKD re-IPL and emits a confusing "Could not read file .../clear" error when it is missing. Re-IPL type: eckd Device: 0.0.6d74 bootprog: 0 br_chr: auto Bootparm: "" Loadparm: "" Could not read file /sys/firmware/reipl/eckd/clear: No such file or directory clear: (null) Secure boot: 0 Only print the "clear" field when the corresponding sysfs attribute is present, avoiding the spurious error output. Fixes: 7c24855ba112 ("ipl_tools: add support for list-directed IPL from ECKD DASD") Reviewed-by: Jan Polensky Signed-off-by: Vasily Gorbik Signed-off-by: Jan Höppner --- ipl_tools/cmd_lsreipl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipl_tools/cmd_lsreipl.c b/ipl_tools/cmd_lsreipl.c index 795a728c..c8a872c1 100644 --- a/ipl_tools/cmd_lsreipl.c +++ b/ipl_tools/cmd_lsreipl.c @@ -157,6 +157,7 @@ void print_eckd(int show_ipl, const char *name) { char *dir = show_ipl ? "ipl" : "reipl/eckd"; char *path_loadparm = util_path_sysfs("firmware/%s/loadparm", dir); + char *path_reipl_clear = util_path_sysfs("firmware/reipl/eckd/clear"); char *path_secure_boot = util_path_sysfs("firmware/ipl/secure"); char *loadparm; @@ -172,7 +173,7 @@ void print_eckd(int show_ipl, const char *name) printf("Loadparm: \"%s\"\n", loadparm); free(loadparm); } - if (!show_ipl) + if (!show_ipl && access(path_reipl_clear, R_OK) == 0) print_fw_str("clear: %s\n", dir, "clear"); if (access(path_secure_boot, R_OK) == 0) print_fw_str("Secure boot: %s\n", "ipl", "secure");