From abe8f1cd98ca455369dafa897ade51f6fcb92972 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 20 Aug 2018 19:38:38 +0800 Subject: [PATCH] rk: init/main.c: support print long kernel command line With features AVB / dm-verity enabled, cmdline content is about to exceed previous maximum 2048 bytes. printk can not support long line exceed LOG_LINE_MAX which less than 1024. So loop printk until all content are printed in init/main.c. Change-Id: I4c40b5302d82122b93161fe30082f5abcfcad069 Signed-off-by: Tao Huang --- init/main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init/main.c b/init/main.c index 6baa2b3d08ed..17cce3658a8b 100644 --- a/init/main.c +++ b/init/main.c @@ -882,7 +882,23 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void) build_all_zonelists(NULL); page_alloc_init(); +#ifdef CONFIG_ARCH_ROCKCHIP + { + const char *s = saved_command_line; + const char *e = &saved_command_line[strlen(saved_command_line)]; + int n = + pr_notice("Kernel command line: %s\n", saved_command_line); + n -= strlen("Kernel command line: "); + s += n; + /* command line maybe too long to print one time */ + while (n > 0 && s < e) { + n = pr_cont("%s\n", s); + s += n; + } + } +#else pr_notice("Kernel command line: %s\n", saved_command_line); +#endif /* parameters may set static keys */ jump_label_init(); parse_early_param();