1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-22 18:43:09 +02:00

qi-add-append_device_specific_cmdline-API.patch

Add a board API callback that allows a device-specific
commandline area to be created at the time the kernel
commandline is being composed.

Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
Andy Green 2009-02-03 18:06:38 +00:00 committed by Andy Green
parent 72ecb60392
commit a5f8c6f2f8
2 changed files with 16 additions and 4 deletions

View File

@ -102,6 +102,7 @@ struct board_api {
void (*early_port_init)(void); void (*early_port_init)(void);
void (*port_init)(void); void (*port_init)(void);
void (*post_serial_init)(void); /* print device-specific things */ void (*post_serial_init)(void); /* print device-specific things */
char * (*append_device_specific_cmdline)(char *);
void (*putc)(char); void (*putc)(char);
void (*close)(void); void (*close)(void);
u8 (*get_ui_keys)(void); u8 (*get_ui_keys)(void);

View File

@ -185,7 +185,6 @@ static void do_params(unsigned initramfs_len,
(this_board->get_board_variant)(); (this_board->get_board_variant)();
const char *p; const char *p;
char * cmdline; char * cmdline;
char * p1;
struct tag *params = (struct tag *)this_board->linux_tag_placement; struct tag *params = (struct tag *)this_board->linux_tag_placement;
/* eat leading white space */ /* eat leading white space */
@ -225,7 +224,18 @@ static void do_params(unsigned initramfs_len,
/* kernel commandline */ /* kernel commandline */
cmdline = params->u.cmdline.cmdline; cmdline = params->u.cmdline.cmdline;
/* start with the fixed device part of the commandline */
cmdline += strlen(strcpy(cmdline, p)); cmdline += strlen(strcpy(cmdline, p));
/* if the board itself needs a computed commandline, add it now */
if (this_board->append_device_specific_cmdline)
cmdline = (this_board->append_device_specific_cmdline)(cmdline);
/* If he is giving an append commandline for this rootfs, apply that */
if (this_kernel->commandline_append) if (this_kernel->commandline_append)
cmdline += strlen(strcpy(cmdline, cmdline += strlen(strcpy(cmdline,
this_kernel->commandline_append)); this_kernel->commandline_append));
@ -235,9 +245,10 @@ static void do_params(unsigned initramfs_len,
/* deal with any trailing newlines that hitched a ride */ /* deal with any trailing newlines that hitched a ride */
p1 = cmdline + strlen(cmdline) - 1; while (*(cmdline - 1) == '\n')
while (*p1 == '\n') cmdline--;
*p1-- = '\0';
*cmdline = '\0';
/* /*
* if he's still holding down the UI_ACTION_SKIPKERNEL key * if he's still holding down the UI_ACTION_SKIPKERNEL key