diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-02-01 14:14:55 +0000 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-02-02 16:21:00 +0000 |
commit | 6414cda12d09d39b894e5d7f5af20fa71bfb9e04 (patch) | |
tree | 5dd04e49cb53e4fec755427c6f15a167e39df378 | |
parent | 43ac5e363c66b5f12e2cb31125dcb7032b5abb18 (diff) | |
download | syslinux-6414cda12d09d39b894e5d7f5af20fa71bfb9e04.tar.gz syslinux-6414cda12d09d39b894e5d7f5af20fa71bfb9e04.tar.xz syslinux-6414cda12d09d39b894e5d7f5af20fa71bfb9e04.zip |
ldlinux: Handle multiple arguments to initrd=
The linux COM32 module handles a comma-separated list of initrd files
to load but the ldlinux code does not. Copy the code from the COM32
module so kernels can be loaded with multiple initrds.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | com32/elflink/ldlinux/kernel.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/com32/elflink/ldlinux/kernel.c b/com32/elflink/ldlinux/kernel.c index 2438d116..bdcd3cb1 100644 --- a/com32/elflink/ldlinux/kernel.c +++ b/com32/elflink/ldlinux/kernel.c @@ -106,14 +106,22 @@ int new_linux_kernel(char *okernel, char *ocmdline) /* Find and load initramfs */ temp = strstr(cmdline, "initrd="); if (temp) { - i = 0; + char *p; temp += strlen("initrd="); - while (*temp != ' ' && *temp) - initrd_name[i++] = *temp++; - initrd_name[i] = '\0'; - - initramfs_load_archive(initramfs, initrd_name); + do { + p = strchr(temp, ','); + if (p) + *p = '\0'; + + if (initramfs_load_archive(initramfs, temp)) { + printf("failed!\n"); + goto bail; + } + + if (p) + *p++ = ','; + } while ((temp = p)); } //dprintf("loading initrd done"); |