Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1579091
| From | Kishore Karanala <kishore.karanala@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] Staging: setup.c : boot loader kernel arguments are secured over cmdline.txt arguments for some systems |
| Date | 2017-02-11 20:40 +0100 |
| Message-ID | <t9LGy-4H8-13@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
boot loader kernel arguments are secured over cmdline.txt
arguments for some systems
Signed-off-by: Kishore Karanala <kishore.karanala@gmail.com>
---
arch/x86/Kconfig | 3 +++
arch/x86/kernel/setup.c | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e487493..3077fb0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2224,6 +2224,9 @@ config CMDLINE
In most cases, the command line (whether built-in or provided
by the boot loader) should specify the device for the root
file system.
+ In some of the systems boot loader arguments needs dominated over
+ cmdline arguments in systems like automotive , this can be done using
+ CMDLINE="!root=/dev/mmcblk0p1 ro"
config CMDLINE_OVERRIDE
bool "Built-in command line overrides boot loader arguments"
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 4cfba94..5fa3194 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -962,11 +962,16 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_CMDLINE_OVERRIDE
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
#else
- if (builtin_cmdline[0]) {
+ if (builtin_cmdline[0] != '!') {
/* append boot loader cmdline to builtin */
strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
+ } else {
+ /* This will provide additional secuirty to cmdline */
+ /* arguments not overriding bootloader arguments */
+ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+ strlcat(boot_command_line, &builtin_cmdline[1], COMMAND_LINE_SIZE);
}
#endif
#endif
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] Staging: setup.c : boot loader kernel arguments are secured over cmdline.txt arguments for some systems Kishore Karanala <kishore.karanala@gmail.com> - 2017-02-11 20:40 +0100 Re: [PATCH] Staging: setup.c : boot loader kernel arguments are secured over cmdline.txt arguments for some systems Thomas Gleixner <tglx@linutronix.de> - 2017-02-11 21:10 +0100 Re: [PATCH] Staging: setup.c : boot loader kernel arguments are secured over cmdline.txt arguments for some systems kbuild test robot <lkp@intel.com> - 2017-02-11 21:30 +0100
csiph-web