summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorMaxiwell S. Garcia <maxiwell@linux.ibm.com>2019-09-23 19:30:23 -0300
committerJeremy Kerr <jk@ozlabs.org>2020-01-25 11:54:27 +0800
commit3513c7f934d97b1db34c5e4e1ce9c995844764bd (patch)
tree53c2ab648087f79f4aa67d4bb50d329e98b2fdab /discover
parent0c074025ef345c64af088c78c7f8f0e14a51f700 (diff)
downloadtalos-petitboot-3513c7f934d97b1db34c5e4e1ce9c995844764bd.tar.gz
talos-petitboot-3513c7f934d97b1db34c5e4e1ce9c995844764bd.zip
ui/ncurses: Add preboot check option in the config screen
Petitboot might run some checks to validate the kernel images before call the kexec load. This patch adds both 'preboot check' option in the config UI screen and a NVRAM variable 'petitboot,preboot-check' to make the user choice persistent. The 'preboot check' is enabled by default. The 'petitboot,preboot-check' is created on NVRAM only when 'preboot check' is disabled by the user. NVRAM property changed to preboot-check, small label changes and help text added by Jeremy Kerr <jk@ozlabs.org>. Signed-off-by: Maxiwell S. Garcia <maxiwell@linux.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover')
-rw-r--r--discover/platform-powerpc.c7
-rw-r--r--discover/platform.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index 6ec4a0a..6c19fd6 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -222,6 +222,13 @@ static void params_update_all(struct param_list *pl,
params_update_network_values(pl, "petitboot,network", config);
params_update_bootdev_values(pl, "petitboot,bootdevs", config);
+
+ if (config->preboot_check_enabled == defaults->preboot_check_enabled)
+ val = "";
+ else
+ val = config->preboot_check_enabled ? "true" : "false";
+
+ param_list_set_non_empty(pl, "petitboot,preboot-check", val, true);
}
static void config_set_ipmi_bootdev(struct config *config, enum ipmi_bootdev bootdev,
diff --git a/discover/platform.c b/discover/platform.c
index 8ce52fc..1a340d0 100644
--- a/discover/platform.c
+++ b/discover/platform.c
@@ -159,6 +159,7 @@ void config_set_defaults(struct config *config)
else
config->lang = NULL;
+ config->preboot_check_enabled = true;
}
int platform_init(void *ctx)
@@ -572,6 +573,9 @@ void config_populate_all(struct config *config, const struct param_list *pl)
val = param_list_get_value(pl, "petitboot,https_proxy");
if (val)
config->https_proxy = talloc_strdup(config, val);
+
+ val = param_list_get_value(pl, "petitboot,preboot-check");
+ config->preboot_check_enabled = !val || strcmp(val, "false");
}
static char *interface_config_str(void *ctx, struct interface_config *config)
OpenPOWER on IntegriCloud