linux-stable/init
Andrew Halaney 86d1919a4f init: print out unknown kernel parameters
It is easy to foobar setting a kernel parameter on the command line
without realizing it, there's not much output that you can use to assess
what the kernel did with that parameter by default.

Make it a little more explicit which parameters on the command line
_looked_ like a valid parameter for the kernel, but did not match anything
and ultimately got tossed to init.  This is very similar to the unknown
parameter message received when loading a module.

This assumes the parameters are processed in a normal fashion, some
parameters (dyndbg= for example) don't register their parameter with the
rest of the kernel's parameters, and therefore always show up in this list
(and are also given to init - like the rest of this list).

Another example is BOOT_IMAGE= is highlighted as an offender, which it
technically is, but is passed by LILO and GRUB so most systems will see
that complaint.

An example output where "foobared" and "unrecognized" are intentionally
invalid parameters:

  Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.12-dirty debug log_buf_len=4M foobared unrecognized=foo
  Unknown command line parameters: foobared BOOT_IMAGE=/boot/vmlinuz-5.12-dirty unrecognized=foo

Link: https://lkml.kernel.org/r/20210511211009.42259-1-ahalaney@redhat.com
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Borislav Petkov <bp@suse.de>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-07-01 11:06:06 -07:00
..
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2021-05-11 16:05:56 -07:00
Makefile md: move the early init autodetect code to drivers/md/ 2020-07-16 15:34:47 +02:00
calibrate.c
do_mounts.c block: merge struct block_device and struct hd_struct 2020-12-01 14:53:40 -07:00
do_mounts.h init: add an init_mknod helper 2020-07-31 08:17:54 +02:00
do_mounts_initrd.c Merge branch 'hch.init_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 09:40:34 -07:00
do_mounts_rd.c init: add an init_unlink helper 2020-07-31 08:17:52 +02:00
init_task.c seccomp: Fix CONFIG tests for Seccomp_filters 2021-03-30 22:33:50 -07:00
initramfs.c init/initramfs.c: do unpacking asynchronously 2021-05-07 00:26:33 -07:00
main.c init: print out unknown kernel parameters 2021-07-01 11:06:06 -07:00
noinitramfs.c init: add an init_mknod helper 2020-07-31 08:17:54 +02:00
version.c kbuild: add an elfnote for whether vmlinux is built with lto 2021-04-25 05:25:42 +09:00