aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-02-07 11:28:58 +0000
committerMatt Fleming <matt.fleming@intel.com>2013-02-07 11:40:35 +0000
commit281e6e2253e737675458e75624a5ba42f0a5f4d6 (patch)
tree0d44e5938347141cb0d82587b0e1ec776ab72cd7 /com32/elflink/ldlinux
parent52443dc7dc5a203d053b70e870e6b83986ebb530 (diff)
downloadsyslinux-281e6e2253e737675458e75624a5ba42f0a5f4d6.tar.gz
syslinux-281e6e2253e737675458e75624a5ba42f0a5f4d6.tar.xz
syslinux-281e6e2253e737675458e75624a5ba42f0a5f4d6.zip
ldlinux: Append BOOT_IMAGE= to kernel cmdline
Some users rely on the syntax of the kernel cmdline from 4.xx and this is currently different in 5.xx. Fix things to match the 4.xx syntax. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
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