mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Malat <oss@malat.biz>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-kernel@vger.kernel.org, paulmck@kernel.org, rostedt@goodmis.org
Subject: Re: [PATCH 2/2] bootconfig: Apply early options from embedded config
Date: Tue, 5 Dec 2023 11:25:03 +0100	[thread overview]
Message-ID: <ZW76f0Rt8TM0h56I@ntb.petris.klfree.czf> (raw)
In-Reply-To: <20231128071355.1fd8b2857f4622bd111d8647@kernel.org>

Hi!
Sorry for late reply, I didn't have much time to work on this the last week.

On Tue, Nov 28, 2023 at 07:13:55AM +0900, Masami Hiramatsu wrote:
> On Mon, 27 Nov 2023 16:02:22 +0100
> Petr Malat <oss@malat.biz> wrote:
> 
> > Hi Masami,
> > On Mon, Nov 27, 2023 at 07:46:30AM +0900, Masami Hiramatsu wrote:
> > 
> > Shortened the mail as this seems to be the last open point
> > 
> > > > > And as I pointed, we can remove CONFIG_BOOT_CONFIG_EMBED_APPEND_INITRD so this case
> > > > > should be removed.
> > > > 
> > > > I have added BOOT_CONFIG_EMBED_APPEND_INITRD, because it's not backward
> > > > compatible change and I didn't want to risk breaking current use cases.
> > > > My change tries to get early options working without affecting how
> > > > other options are handled, but I think appending the config is more
> > > > reasonable behavior and if you do not see it as a problem to not be
> > > > backward compatible here, I will delete the "replace" behavior.
> > > 
> > > That's a good point. OK if disabling CONFIG_BOOT_CONFIG_EMBED_APPEND_INITRD,
> > > it must skip setting early_params to avoid "hidden setting" from the
> > > embedded bootconfig.
> >  
> > That's not a good idea because then disabling BOOT_CONFIG_EMBED_APPEND_INITRD
> > would disable early options handling even if the user doesn't use initrd at
> > all, which we do not want.
> 
> Yes, so the config name and comment needs to be updated. The problematic point
> is that we can not know where there is an initrd (and bootconfig on initrd)
> until parsing/applying the early params. And we have to avoid setting "hidden"
> parameter.
> 
> > 
> > I suggest logging a KERN_NOTICE message if any early option was applied and
> > at the same time embedded bootconfig was replaced.
> 
> No, that's no good because kernel log can be cleared.
> Usually user will check /proc/cmdline to check what parameters are set, so at
> least it needs to be updated, but also, we need to keep the original cmdline
> for make sure the user can reuse it for kexec. To solve this issue without
> contradiction, we need to ask user to set BOOT_CONFIG_EMBED_APPEND_INITRD=y
> to support early params in bootconfig. (Thus it will be something like
> "BOOT_CONFIG_EMBED_EARLY_PARAM")

I made a bit of prototyping and I can add applied early options from embedded
config to /proc/cmdline even when the embedded config is replaced. I don't like
applying these options conditionally, because that leads to confusing behavior
of seeing these options in /proc/cmdline and /proc/bootconfig without actually
applying them. I find that worst than the opposite behavior as if user sets
options in the config and then sees them in both cmdline and bootconfig, he
assumes they have been applied.

We can also introduce BOOT_CONFIG_EMBED_REPLACE_INITRD for backward compatibility
and write that this option will be removed in the future. If nobody complains
for a while, we drop it. Then we are left with the appending only.
  Petr

  reply	other threads:[~2023-12-05 10:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 23:13 [PATCH 0/2] bootconfig: Support early options in " Petr Malat
2023-11-21 23:13 ` [PATCH 1/2] bootconfig: Support appending initrd config to embedded one Petr Malat
2023-11-23  2:30   ` Masami Hiramatsu
2023-11-21 23:13 ` [PATCH 2/2] bootconfig: Apply early options from embedded config Petr Malat
2023-11-22 22:47   ` Randy Dunlap
2023-11-22 23:38     ` Paul E. McKenney
2023-11-23  2:22       ` Masami Hiramatsu
2023-11-23 10:04         ` Petr Malat
2023-11-23 14:18           ` Masami Hiramatsu
2023-11-24  2:12             ` Petr Malat
2023-11-23 17:40         ` Paul E. McKenney
2023-11-23  9:50     ` Petr Malat
2023-11-23 10:41   ` Masami Hiramatsu
2023-11-24  1:58     ` Petr Malat
2023-11-26 22:46       ` Masami Hiramatsu
2023-11-27 15:02         ` Petr Malat
2023-11-27 22:13           ` Masami Hiramatsu
2023-12-05 10:25             ` Petr Malat [this message]
2023-11-22 23:34 ` [PATCH 0/2] bootconfig: Support early options in " Paul E. McKenney
2023-11-23  1:58 ` Masami Hiramatsu
2025-07-08 21:00 ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZW76f0Rt8TM0h56I@ntb.petris.klfree.czf \
    --to=oss@malat.biz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®