summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorAndrew Boie <andrew.p.boie@intel.com>2013-09-09 13:08:17 -0700
committerAndrew Boie <andrew.p.boie@intel.com>2013-09-09 13:11:34 -0700
commit2e63e71f3116f0330b3bf61dde7deca235dd40ac (patch)
tree0e35d0e441f9a2ca0e72589e2934b7c06a0d845c /init
parent596e9c6314e4f2869499bcdbb816680ddb10c88f (diff)
downloadcore-2e63e71f3116f0330b3bf61dde7deca235dd40ac.tar.gz
core-2e63e71f3116f0330b3bf61dde7deca235dd40ac.tar.bz2
core-2e63e71f3116f0330b3bf61dde7deca235dd40ac.zip
init: support longer command lines
The Linux kernel supports command lines up to 2048 bytes on x86, see COMMAND_LINE_SIZE in asm/setup.h. If any androidboot.xxxx arguments were past the 1024 byte limit here, they were lost. Change-Id: I6247c511a7de04109490fffa0125801d274a5501 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Diffstat (limited to 'init')
-rw-r--r--init/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/init/util.c b/init/util.c
index 154bb2dbc..078b99b5b 100644
--- a/init/util.c
+++ b/init/util.c
@@ -450,13 +450,13 @@ void get_hardware_name(char *hardware, unsigned int *revision)
void import_kernel_cmdline(int in_qemu,
void (*import_kernel_nv)(char *name, int in_qemu))
{
- char cmdline[1024];
+ char cmdline[2048];
char *ptr;
int fd;
fd = open("/proc/cmdline", O_RDONLY);
if (fd >= 0) {
- int n = read(fd, cmdline, 1023);
+ int n = read(fd, cmdline, sizeof(cmdline) - 1);
if (n < 0) n = 0;
/* get rid of trailing newline, it happens */