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

From: Paul E. McKenney
Date: Fri Aug 04 2023 - 13:33:37 EST


On Fri, Aug 04, 2023 at 08:28:08PM +0300, Alexey Dobriyan wrote:
> On Thu, Jul 27, 2023 at 08:37:01PM -0700, Paul E. McKenney 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.
> >
> > Therefore, provide a /proc/cmdline_image file that shows only those kernel
> > boot parameters that were embedded in the kernel image. The output
> > is in boot-image format, which allows easy reconcilation against the
> > boot-config source file.
> >
> > Why put this in /proc? Because it is quite similar to /proc/cmdline, so
> > it makes sense to put it in the same place that /proc/cmdline is located.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
> > Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> > Cc: <linux-fsdevel@xxxxxxxxxxxxxxx>
> >
> > Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> > ---
> > fs/proc/cmdline.c | 12 ++++++++++++
> > include/linux/init.h | 11 ++++++-----
> > init/main.c | 9 +++++++++
>
> Same thing,
>
> Please if possible put /proc/x into fs/proc/x.c so that it is easier to
> find source. Not all /proc follows this convention but still.
>
> I don't like this name too (but less than the other one).
> Is it Boot Image Format (BIF). If yes, maybe add it as /proc/cmdline.bif ?
>
> I don't know what's the good name.

It turns out that the already existing /proc/bootconfig makes this
new /proc/bootconfig_image unnecessary, so I have dropped this patch.
Imagine my embarrassment upon learning that /proc/bootconfig has been
around since v5.5! ;-)

Thanx, Paul