zipl/boot: Fix unused loadparm when SCLP line-mode console is absent

Currently, 'sclp_setup(SCLP_INIT)' fails if no SCLP line-mode console is
available. As a result 'menu_param()' is never called, even though it is
required to retrieve the 'loadparm' value.

However, reading the loadparm via SCLP remains useful even when a SCLP
line-mode console is absent, because this value determines which boot
entry should be selected. Therefore, the boot process should continue by
retrieving the loadparm without requiring an SCLP line-mode console.

It's safe to continue without a SCLP console as 'printf' and
'menu_param' tolerates the absence of a SCLP line-mode console.

Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/196
Reported-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2025-12-03 14:03:18 +01:00
committed by Steffen Eiden
parent f4c4c40b78
commit a2eb03660d
+9 -4
View File
@@ -150,16 +150,17 @@ int menu(void)
{
enum { DEFAULT_MENU_ENTRY = 0 };
unsigned long value = DEFAULT_MENU_ENTRY;
int sclp_lm_available;
char *cmd_line_extra;
char endstring[15];
cmd_line_extra = (char *)COMMAND_LINE_EXTRA;
memset(cmd_line_extra, 0, COMMAND_LINE_EXTRA_SIZE);
if (sclp_setup(SCLP_INIT) != 0) {
/* sclp setup failed boot default */
goto boot;
}
/* Try to initialize SCLP line-mode console. But do not fail in case no
* SCLP line-mode console is available.
*/
sclp_lm_available = sclp_setup(SCLP_INIT) == 0;
switch (menu_param(&value)) {
case NUMBER_FOUND:
@@ -180,6 +181,10 @@ int menu(void)
break;
}
/* SCLP line-mode unavailable; skip menu and input */
if (!sclp_lm_available)
goto boot;
/* print banner */
printf("%s\n", ((void *)&__stage2_params) + __stage2_params.banner);