diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-08-09 16:16:48 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-09-08 14:26:27 +1000 |
commit | d9e70bb63227a683f808a21be20b3d5e1a474f95 (patch) | |
tree | 7ff86e842006776e1f124ec1397e28567d39aabf /discover/platform-powerpc.c | |
parent | 9f42e56fc5968fcb34edfad017adb73960c2bb61 (diff) | |
download | petitboot-d9e70bb63227a683f808a21be20b3d5e1a474f95.zip petitboot-d9e70bb63227a683f808a21be20b3d5e1a474f95.tar.gz |
Consolidate petitboot,tty and petitboot,console
Commit ce54f86 "Add petitboot,tty and track available consoles" added
the petitboot,tty parameter, but the petitboot,console parameter is also
recognised by Petitboot. These are ultimately handled by the 30-add-offb
and 80-set-stdout hooks respectively, but exist for mostly the same
purpose.
We consolidate these down to just the original petitboot,console
parameter. If the contents of petitboot,console have been configured by
Petitboot (ie. it is of the form /dev/dev# [ Description ]) we behave as
normal, otherwise we assume that petitboot,console contains a full
OF path to the intended console device and do not allow it to be
modified. This follows petitboot,console's original intent to be a debug
aid, and takes precedence over any other use.
The 80-set-stdout hook is removed as 30-add-offb now accounts for both
use cases.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/platform-powerpc.c')
-rw-r--r-- | discover/platform-powerpc.c | 13 |
1 files changed, 9 insertions, 4 deletions
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); |