[PATCH] Provide mechanism for editing builtin command-line in zImage binary.

Paul Mackerras paulus at samba.org
Fri Jun 9 19:47:29 EST 2006


Michal Ostrowski writes:

> -BOOTCFLAGS	+= -I$(obj) -I$(srctree)/$(obj)
> +BOOTCFLAGS	+= -I$(obj) -I$(srctree)/$(obj) -I$(O)/include -I$(O)/include2\
> +			-D__KERNEL__

I don't like this; we are trying to keep the boot wrapper separate,
not make it more dependent on the rest of the kernel.

> +#include <linux/autoconf.h>
> +#include <asm/setup.h>

We don't really need COMMAND_LINE_SIZE here - nothing says the command
line from the firmware or the boot wrapper *has* to be the same size
as the kernel's command-line buffer.

> +static char builtin_cmdline[COMMAND_LINE_SIZE]
> +		__attribute__((section("__builtin_cmdline"))) = CONFIG_CMDLINE;
> +#endif

If CONFIG_CMDLINE is set, then the kernel image *already* has the
default in it, and we don't need another copy here.  Just make your
buffer here some fixed, known size and uninitialized (i.e. all
zeroes).  Do the setprop if the /chosen/bootargs is empty and your
buffer has been edited to be non-null.

Paul.



More information about the Linuxppc-dev mailing list