Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756634AbYHKTYY (ORCPT ); Mon, 11 Aug 2008 15:24:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753642AbYHKTYL (ORCPT ); Mon, 11 Aug 2008 15:24:11 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37457 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753658AbYHKTYK (ORCPT ); Mon, 11 Aug 2008 15:24:10 -0400 Message-ID: <48A091B7.6050601@zytor.com> Date: Mon, 11 Aug 2008 12:23:35 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Ingo Molnar CC: Tim Bird , linux kernel , linux-embedded , Matt Mackall , Thomas Gleixner Subject: Re: [PATCH] bootup: Add built-in kernel command line for x86 References: <489A1844.3090502@am.sony.com> <20080811191012.GA16553@elte.hu> In-Reply-To: <20080811191012.GA16553@elte.hu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1803 Lines: 53 Ingo Molnar wrote: > * Tim Bird 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) > > 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. > 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 -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/