summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
Diffstat (limited to 'discover')
-rw-r--r--discover/boot.c8
-rw-r--r--discover/platform-powerpc.c13
-rw-r--r--discover/platform.c2
3 files changed, 14 insertions, 9 deletions
diff --git a/discover/boot.c b/discover/boot.c
index 0732a50..dc6da7d 100644
--- a/discover/boot.c
+++ b/discover/boot.c
@@ -517,7 +517,7 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt,
struct pb_url *image = NULL, *initrd = NULL, *dtb = NULL;
struct pb_url *image_sig = NULL, *initrd_sig = NULL, *dtb_sig = NULL,
*cmdline_sig = NULL;
- const struct config *config;
+ const struct config *config = config_get();
struct boot_task *boot_task;
const char *boot_desc;
int rc;
@@ -574,12 +574,10 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt,
boot_task->args = NULL;
}
- if (cmd && cmd->console)
+ if (cmd && cmd->console && !config->manual_console)
boot_task->boot_console = talloc_strdup(boot_task, cmd->console);
- else {
- config = config_get();
+ else
boot_task->boot_console = config ? config->boot_console : NULL;
- }
if (boot_task->verify_signature || boot_task->decrypt_files) {
if (cmd && cmd->args_sig_file) {
diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index 57618c3..a4b13e4 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -59,7 +59,7 @@ static const char *known_params[] = {
"petitboot,debug?",
"petitboot,write?",
"petitboot,snapshots?",
- "petitboot,tty",
+ "petitboot,console",
NULL,
};
@@ -567,9 +567,12 @@ static void populate_config(struct platform_powerpc *platform,
if (val)
config->disable_snapshots = !strcmp(val, "false");
- val = get_param(platform, "petitboot,tty");
+ val = get_param(platform, "petitboot,console");
if (val)
config->boot_console = talloc_strdup(config, val);
+ /* If a full path is already set we don't want to override it */
+ config->manual_console = config->boot_console &&
+ !strchr(config->boot_console, '[');
}
static char *iface_config_str(void *ctx, struct interface_config *config)
@@ -746,8 +749,10 @@ static int update_config(struct platform_powerpc *platform,
val = config->allow_writes ? "true" : "false";
update_string_config(platform, "petitboot,write?", val);
- val = config->boot_console ?: "";
- update_string_config(platform, "petitboot,tty", val);
+ if (!config->manual_console) {
+ val = config->boot_console ?: "";
+ update_string_config(platform, "petitboot,console", val);
+ }
update_network_config(platform, config);
diff --git a/discover/platform.c b/discover/platform.c
index 95a905d..93cd057 100644
--- a/discover/platform.c
+++ b/discover/platform.c
@@ -84,6 +84,8 @@ static void dump_config(struct config *config)
pb_log(" Default UI to boot on: %s\n",
config->boot_console ?: "none set");
+ if (config->manual_console)
+ pb_log(" (Manually set)\n");
pb_log(" language: %s\n", config->lang ?: "");
OpenPOWER on IntegriCloud