All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Bird <tim.bird@am.sony.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux kernel <linux-kernel@vger.kernel.org>,
	linux-embedded <linux-embedded@vger.kernel.org>,
	Matt Mackall <mpm@selenic.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] bootup: Add built-in kernel command line for x86
Date: Mon, 11 Aug 2008 15:40:35 -0700	[thread overview]
Message-ID: <48A0BFE3.2060403@am.sony.com> (raw)
In-Reply-To: <48A091B7.6050601@zytor.com>

H. Peter Anvin wrote:
> Ingo Molnar wrote:
>> * Tim Bird <tim.bird@am.sony.com> wrote:
>>
>>> Add support for a built-in command line for x86 architectures. The
>>> Kconfig help gives the major rationale for this addition.
>>
>> i have actually used a local hack quite similar to this to inject boot
>> options into bzImages via randconfig - so i would find this feature
>> rather useful.
>>
>> a small observation:
>>
>>> +    /* append boot loader cmdline to builtin, unless builtin
>>> overrides it */
>>> +    if (builtin_cmdline[0] != '!') {
>>> +        strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
>>> +        strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
>>> +        strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>>> +    } else {
>>> +        strlcpy(boot_command_line, &builtin_cmdline[1],
>>> +            COMMAND_LINE_SIZE);
>>> +    }
>>
>> the default branch changes existing command lines slightly: it appends
>> a space to them. This could break scripts that rely on the precise
>> contents of /proc/cmdline output. (i have some - they are arguably dodgy)

Yeah, I wasn't too comfortable with that.

>> Best would be to make it really apparent in the code that nothing
>> changes if this config option is not set. Preferably there should be
>> no extra code at all in that case.

Agreed.

> 
> I would like to see this:
> 
> #ifdef CONFIG_BUILTIN_CMDLINE
> # ifdef CONFIG_BUILTIN_CMDLINE_OVERRIDE
>     strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
> # else
>     if (boot_command_line) {
>         strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
>         strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
>     }
> # endif
> #endif

You missed copying builtin_cmdline back to boot_command_line, but
in general this looks OK to me.  If nobody objects to the ifdef
multiplicity, I'll work up a version tomorrow for review.  (Sorry,
I'm a bit swamped today.)
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================

  reply	other threads:[~2008-08-11 22:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 21:31 [PATCH] bootup: Add built-in kernel command line for x86 Tim Bird
2008-08-06 21:31 ` Tim Bird
2008-08-06 22:04 ` Robert Schwebel
2008-08-06 22:22   ` Tim Bird
2008-08-06 22:48     ` H. Peter Anvin
2008-08-06 22:52       ` Matt Mackall
2008-08-06 23:02         ` H. Peter Anvin
2008-08-06 23:00       ` Tim Bird
2008-08-06 23:03         ` H. Peter Anvin
2008-08-06 22:14 ` Matt Mackall
2008-08-06 22:31   ` Tim Bird
2008-08-06 22:48     ` Matt Mackall
2008-08-11 19:10 ` Ingo Molnar
2008-08-11 19:23   ` H. Peter Anvin
2008-08-11 22:40     ` Tim Bird [this message]
2008-08-12 19:52     ` [PATCH] bootup: Add built-in kernel command line for x86 (v2) Tim Bird
2008-08-15 14:03       ` Ingo Molnar
2008-08-15 14:12       ` Ingo Molnar

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=48A0BFE3.2060403@am.sony.com \
    --to=tim.bird@am.sony.com \
    --cc=hpa@zytor.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mpm@selenic.com \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.