linux/init
Rasmus Villemoes 212f863fa8 bootconfig: do not put quotes on cmdline items unless necessary
When trying to migrate to using bootconfig to embed the kernel's and
PID1's command line with the kernel image itself, and so allowing changing
that without modifying the bootloader, I noticed that /proc/cmdline
changed from e.g.

  console=ttymxc0,115200n8 cma=128M quiet -- --log-level=notice

to

  console="ttymxc0,115200n8" cma="128M" quiet -- --log-level="notice"

The kernel parameters are parsed just fine, and the quotes are indeed
stripped from the actual argv[] given to PID1.  However, the quoting
doesn't really serve any purpose and looks excessive, and might confuse
some (naive) userspace tool trying to parse /proc/cmdline.  So do not
quote the value unless it contains whitespace.

Link: https://lkml.kernel.org/r/20240320101952.62135-1-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-04-25 21:07:01 -07:00
..
.gitignore kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
build-version kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
calibrate.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
do_mounts_initrd.c init: pass root_device_name explicitly 2023-06-05 10:55:20 -06:00
do_mounts_rd.c init: add an init_unlink helper 2020-07-31 08:17:52 +02:00
do_mounts.c init: flush async file closing 2024-02-08 18:41:03 +01:00
do_mounts.h init: flush async file closing 2024-02-08 18:41:03 +01:00
init_task.c rcu-tasks: Initialize data to eliminate RCU-tasks/do_exit() deadlocks 2024-02-25 14:21:43 -08:00
initramfs.c init: open output files from cpio unpacking with O_LARGEFILE 2024-04-05 11:21:30 -07:00
Kconfig RISC-V Patches for the 6.9 Merge Window 2024-03-22 10:41:13 -07:00
main.c bootconfig: do not put quotes on cmdline items unless necessary 2024-04-25 21:07:01 -07:00
Makefile x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN 2023-10-20 13:02:23 +02:00
noinitramfs.c init: move usermodehelper_enable() to populate_rootfs() 2021-09-08 11:50:27 -07:00
version-timestamp.c init/version-timestamp.c: remove unneeded #include <linux/version.h> 2023-01-09 07:34:38 +09:00
version.c init/version.c: Replace strlcpy with strscpy 2023-09-22 09:50:56 -07:00