We had previously laid out a prefix convention for the Linux command line options added by bootm, but only the late variant was added as nothing yet needed the early one.
The FIT cmdline support will need it and lives outside bootm.c, so let's introduce LINUX_BOOTARGS_BOOTM_EARLY and move both prefixes into the header. Signed-off-by: Ahmad Fatoum <[email protected]> --- Please reorder before Thomas' FIT command-line series --- Documentation/user/booting-linux.rst | 4 ++++ common/bootm.c | 14 +------------- include/bootm.h | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Documentation/user/booting-linux.rst b/Documentation/user/booting-linux.rst index 529d4de5c5b8..de40b6a57dc0 100644 --- a/Documentation/user/booting-linux.rst +++ b/Documentation/user/booting-linux.rst @@ -112,6 +112,10 @@ their ``linux.bootargs.``-prefixed parameter names. Kernel command line arguments that barebox generates internally are not interleaved with externally provided command-line arguments: +* Following arguments will be concatenated **before** all other options: + + * the ``cmdline`` property of the booted FIT image configuration + * Following arguments will be concatenated **after** all other options: * ``root=`` and ``rootwait=`` controlled by :ref:`global.bootm.appendroot <magicvar_global_bootm_appendroot>` diff --git a/common/bootm.c b/common/bootm.c index 27da1a590bf1..90b99d62b01e 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -22,19 +22,6 @@ #include <security/config.h> #include <security/policy.h> -/* - * All device parameter iteration happens in lexicographical order. - * To ensure that bootm options are consistently applied before or after - * other options from the environment or boot configuration files, we - * employ following convention for the prefix: - * - * ! 0x21 is less than any non-space printable character - * ~ 0x7e is greater than any printable character - * - * Users will never see those as bootm_boot_cleanup() will delete them again. - */ -#define LINUX_BOOTARGS_BOOTM_LATE "linux.bootargs.~bootm." - static LIST_HEAD(handler_list); static struct sconfig_notifier_block sconfig_notifier; @@ -803,6 +790,7 @@ void bootm_boot_cleanup(struct image_data *data) if (data->of_root_node) of_delete_node(data->of_root_node); + globalvar_remove(LINUX_BOOTARGS_BOOTM_EARLY "*"); globalvar_remove(LINUX_BOOTARGS_BOOTM_LATE "*"); free(data->os_header); free(data->os_file); diff --git a/include/bootm.h b/include/bootm.h index 946713971eb5..8e574040f497 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -7,6 +7,20 @@ #include <linux/list.h> #include <loadable.h> +/* + * All device parameter iteration happens in lexicographical order. + * To ensure that bootm options are consistently applied before or after + * other options from the environment or boot configuration files, we + * employ following convention for the prefix: + * + * ! 0x21 is less than any non-space printable character + * ~ 0x7e is greater than any printable character + * + * Users will never see those as bootm_boot_cleanup() will delete them again. + */ +#define LINUX_BOOTARGS_BOOTM_EARLY "linux.bootargs.!bootm." +#define LINUX_BOOTARGS_BOOTM_LATE "linux.bootargs.~bootm." + enum bootm_verify { BOOTM_VERIFY_NONE, BOOTM_VERIFY_HASH, -- 2.47.3
