|
From: Ning S. <nin...@in...> - 2016-02-24 23:36:50
|
changeset 67eec9fb683b in /hg/p/tboot/code details: http://hg.code.sf.net/p/tboot/code/code?cmd=changeset;node=67eec9fb683b description: Don't skip irst argument in Linux kernel command line Since 429:664e696da669, tboot doesn't skip the first argument of a given command line any more. Condequently, it shoudldn't be skipped either when passed to the kernel in expand_linux_image(). Meanwhile, as skip_filename() isn't used any more, remove the code. Signed-off-by Martin Wilck <mar...@ts...> Signed-off-by Ning Sun <nin...@in...> As skip_filename isn't used any more, remove the code. diffstat: tboot/common/cmdline.c | 17 ----------------- tboot/common/linux.c | 2 +- tboot/include/cmdline.h | 1 - 3 files changed, 1 insertions(+), 19 deletions(-) diffs (50 lines): diff -r 141a0ec8ea73 -r 67eec9fb683b tboot/common/cmdline.c --- a/tboot/common/cmdline.c Tue Feb 23 10:55:40 2016 -0800 +++ b/tboot/common/cmdline.c Wed Feb 24 15:21:58 2016 -0800 @@ -586,23 +586,6 @@ return true; } -const char *skip_filename(const char *cmdline) -{ - if ( cmdline == NULL || *cmdline == '\0' ) - return cmdline; - - /* strip leading spaces, file name, then any spaces until the next - non-space char (e.g. " /foo/bar baz" -> "baz"; "/foo/bar" -> "")*/ - while ( *cmdline != '\0' && isspace(*cmdline) ) - cmdline++; - while ( *cmdline != '\0' && !isspace(*cmdline) ) - cmdline++; - while ( *cmdline != '\0' && isspace(*cmdline) ) - cmdline++; - return cmdline; -} - - /* * Local variables: * mode: C diff -r 141a0ec8ea73 -r 67eec9fb683b tboot/common/linux.c --- a/tboot/common/linux.c Tue Feb 23 10:55:40 2016 -0800 +++ b/tboot/common/linux.c Wed Feb 24 15:21:58 2016 -0800 @@ -302,7 +302,7 @@ (unsigned long)(real_mode_base + real_mode_size)); /* copy cmdline */ - const char *kernel_cmdline = skip_filename(get_cmdline(g_ldr_ctx)); + const char *kernel_cmdline = get_cmdline(g_ldr_ctx); printk(TBOOT_INFO"Linux cmdline placed in header: "); printk_long(kernel_cmdline); diff -r 141a0ec8ea73 -r 67eec9fb683b tboot/include/cmdline.h --- a/tboot/include/cmdline.h Tue Feb 23 10:55:40 2016 -0800 +++ b/tboot/include/cmdline.h Wed Feb 24 15:21:58 2016 -0800 @@ -60,7 +60,6 @@ extern bool get_linux_vga(int *vid_mode); extern bool get_linux_mem(uint64_t *initrd_max_mem); -extern const char *skip_filename(const char *cmdline); extern uint8_t get_loglvl_prefix(char **pbuf, int *len); #endif /* __CMDLINE_H__ */ |