Re: [PATCH RFC bootconfig] 2/2] fs/proc: Add /proc/cmdline_image for embedded arguments

Masami Hiramatsu
2023-07-30T01:56:09Z

On Sat, 29 Jul 2023 08:41:46 -0700
"Paul E. McKenney" <paulmck@kernel.org> wrote:

> On Sat, Jul 29, 2023 at 11:23:46PM +0900, Masami Hiramatsu wrote:
> > Hi Paul,
> >
> > On Thu, 27 Jul 2023 20:37:01 -0700
> > "Paul E. McKenney" <paulmck@kernel.org> wrote:
> >
> > > In kernels built with CONFIG_BOOT_CONFIG_FORCE=y, /proc/cmdline will show
> > > all kernel boot parameters, both those supplied by the boot loader and
> > > those embedded in the kernel image. This works well for those who just
> > > want to see all of the kernel boot parameters, but is not helpful to those
> > > who need to see only those parameters that were embedded into the kernel
> > > image. This is especially important in situations where there are many
> > > kernel images for different kernel versions and kernel configurations,
> > > all of which opens the door to a great deal of human error.
> >
> > There is /proc/bootconfig file which shows all bootconfig entries and is
> > formatted as easily filter by grep (or any other line-based commands).
> > (e.g. `grep ^kernel\\. /proc/cmdline` will filter all kernel cmdline
> > parameters in the bootconfig)
> > Could you clarify the reason why you need a dump of bootconfig file?
>
> Because I was unaware of /proc/bootconfig? ;-)

Oh :)

>
> So how about if I replace this patch of mine with the following?

Yes, I missed to update the proc.rst. Thanks!

>
> And thank you for pointing me at /proc/bootconfig.
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
> index 98c43c5ef1ee..832d66d4e396 100644
> --- a/Documentation/filesystems/proc.rst
> +++ b/Documentation/filesystems/proc.rst
> @@ -684,6 +684,7 @@ files are there, and which are missing.
> File Content
> ============ ===============================================================
> apm Advanced power management info
> + bootconfig Kernel command line obtained from boot config (5.5)
> buddyinfo Kernel memory allocator information (see text) (2.5)
> bus Directory containing bus specific information
> cmdline Kernel command line, both from bootloader and embedded

--
Masami Hiramatsu (Google) <mhiramat@kernel.org>