mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
ipl_tools/lsreipl: Suppress 'clear' output if not supported
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: 7c24855ba1 ("ipl_tools: add support for list-directed IPL from ECKD DASD")
Reviewed-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
3358a30dae
commit
5dc39e87e7
@@ -157,6 +157,7 @@ void print_eckd(int show_ipl, const char *name)
|
|||||||
{
|
{
|
||||||
char *dir = show_ipl ? "ipl" : "reipl/eckd";
|
char *dir = show_ipl ? "ipl" : "reipl/eckd";
|
||||||
char *path_loadparm = util_path_sysfs("firmware/%s/loadparm", dir);
|
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 *path_secure_boot = util_path_sysfs("firmware/ipl/secure");
|
||||||
char *loadparm;
|
char *loadparm;
|
||||||
|
|
||||||
@@ -172,7 +173,7 @@ void print_eckd(int show_ipl, const char *name)
|
|||||||
printf("Loadparm: \"%s\"\n", loadparm);
|
printf("Loadparm: \"%s\"\n", loadparm);
|
||||||
free(loadparm);
|
free(loadparm);
|
||||||
}
|
}
|
||||||
if (!show_ipl)
|
if (!show_ipl && access(path_reipl_clear, R_OK) == 0)
|
||||||
print_fw_str("clear: %s\n", dir, "clear");
|
print_fw_str("clear: %s\n", dir, "clear");
|
||||||
if (access(path_secure_boot, R_OK) == 0)
|
if (access(path_secure_boot, R_OK) == 0)
|
||||||
print_fw_str("Secure boot: %s\n", "ipl", "secure");
|
print_fw_str("Secure boot: %s\n", "ipl", "secure");
|
||||||
|
|||||||
Reference in New Issue
Block a user