aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux
diff options
context:
space:
mode:
Diffstat (limited to 'com32/elflink/ldlinux')
-rw-r--r--com32/elflink/ldlinux/execute.c2
-rw-r--r--com32/elflink/ldlinux/kernel.c17
2 files changed, 6 insertions, 13 deletions
diff --git a/com32/elflink/ldlinux/execute.c b/com32/elflink/ldlinux/execute.c
index 5c53b995..c6fa8d85 100644
--- a/com32/elflink/ldlinux/execute.c
+++ b/com32/elflink/ldlinux/execute.c
@@ -142,7 +142,7 @@ __export void execute(const char *cmdline, uint32_t type)
} else {
/* Need add one item for kernel load, as we don't use
* the assembly runkernel.inc any more */
- new_linux_kernel((char *)kernel, (char *)cmdline);
+ new_linux_kernel((char *)kernel, (char *)args);
}
free((void *)kernel);
diff --git a/com32/elflink/ldlinux/kernel.c b/com32/elflink/ldlinux/kernel.c
index 920246fc..f3ba37fa 100644
--- a/com32/elflink/ldlinux/kernel.c
+++ b/com32/elflink/ldlinux/kernel.c
@@ -35,14 +35,10 @@ int new_linux_kernel(char *okernel, char *ocmdline)
else if (append)
args = append;
- cmdline_len = strlen(kernel_name);
- if (args) {
- /* +1 for the space (' ') between kernel and args */
- cmdline_len += strlen(args) + 1;
- }
-
- /* +1 for NUL termination */
- cmdline_len++;
+ cmdline_len = strlen("BOOT_IMAGE=") + strlen(kernel_name);
+ cmdline_len += 1; /* space between BOOT_IMAGE and args */
+ cmdline_len += strlen(args);
+ cmdline_len += 1; /* NUL-termination */
cmdline = malloc(cmdline_len);
if (!cmdline) {
@@ -50,10 +46,7 @@ int new_linux_kernel(char *okernel, char *ocmdline)
return 1;
}
- if (args)
- snprintf(cmdline, cmdline_len, "%s %s", kernel_name, args);
- else
- snprintf(cmdline, cmdline_len, "%s", kernel_name);
+ sprintf(cmdline, "BOOT_IMAGE=%s %s", kernel_name, args);
/* "keeppxe" handling */
#if IS_PXELINUX