diff options
author | Brett Grandbois <brett.grandbois@opengear.com> | 2018-06-11 07:54:08 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-06-12 14:43:36 +1000 |
commit | 0e9f4d38b19c2d7557528ef5b11b93377525cd55 (patch) | |
tree | a8448d4ceae557716297c0073c774fe5a67948e9 /discover/syslinux-parser.c | |
parent | 18a47a31b46d916c58a31e8784a7c3a3abcae446 (diff) | |
download | talos-petitboot-0e9f4d38b19c2d7557528ef5b11b93377525cd55.tar.gz talos-petitboot-0e9f4d38b19c2d7557528ef5b11b93377525cd55.zip |
discover/syslinux-parser: consistent cmdline arg processing
In signed-boot environments consistent handling of kernel commandline
options is essential as they must be pre-signed. In the syslinux parser
ensure that in the absence of a global APPEND they are processed
exactly as found and not with the leading space that the current APPEND
processing has as a shortcut.
Signed-off-by: Brett Grandbois <brett.grandbois@opengear.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/syslinux-parser.c')
-rw-r--r-- | discover/syslinux-parser.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/discover/syslinux-parser.c b/discover/syslinux-parser.c index c611ac9..defafd2 100644 --- a/discover/syslinux-parser.c +++ b/discover/syslinux-parser.c @@ -338,11 +338,13 @@ static void syslinux_finalize(struct conf_context *conf) /* '-' can signal do not use global APPEND */ if (!strcmp(syslinux_opt->append, "-")) opt->boot_args = talloc_strdup(opt, ""); - else + else if (global_append) opt->boot_args = talloc_asprintf(opt, "%s %s", global_append, syslinux_opt->append); - } else + else + opt->boot_args = talloc_strdup(opt, syslinux_opt->append); + } else if (global_append) opt->boot_args = talloc_strdup(opt, global_append); if (!opt->boot_args) @@ -455,13 +457,10 @@ static int syslinux_parse(struct discover_context *dc) /* * set the global defaults * by spec 'default' defaults to 'linux' and - * 'implicit' defaults to '1', we also just set - * and empty string in 'append' to make it easier - * in syslinux_finish + * 'implicit' defaults to '1' */ conf_set_global_option(conf, "default", "linux"); conf_set_global_option(conf, "implicit", "1"); - conf_set_global_option(conf, "append", ""); for (filename = syslinux_conf_files; *filename; filename++) { /* |