aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Goldman <adamg@pobox.com>2017-03-05 17:24:22 -0500
committerGene Cumm <gene.cumm@gmail.com>2017-03-05 17:24:42 -0500
commit346d2278e23f1b9f02903506753263ad7226de58 (patch)
tree0d134874a309fdfdce40db5fccd3d19629cafcb5
parentb4cc12b9db2c6f5df7aa90bb2b8b4d62b22e01ee (diff)
downloadsyslinux-346d2278e23f1b9f02903506753263ad7226de58.tar.gz
syslinux-346d2278e23f1b9f02903506753263ad7226de58.tar.xz
syslinux-346d2278e23f1b9f02903506753263ad7226de58.zip
pxe: Fix recognition of keeppxe option
The preprocessor directive IS_PXELINUX is no longer valid. Submitted-by: Adam Goldman <adamg@pobox.com> Move "keeppxe" processing from com32/elflink/ldlinux/kernel.c:new_linux_kernel() to com32/lib/syslinux/load_linux.c:bios_boot_linux() using strstr() (not find_argument in original patch). Should also be processed by firmware->boot_linux() if not yet done. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
-rw-r--r--com32/elflink/ldlinux/kernel.c8
-rw-r--r--com32/lib/syslinux/load_linux.c12
2 files changed, 11 insertions, 9 deletions
diff --git a/com32/elflink/ldlinux/kernel.c b/com32/elflink/ldlinux/kernel.c
index f3ba37fa..942f97cc 100644
--- a/com32/elflink/ldlinux/kernel.c
+++ b/com32/elflink/ldlinux/kernel.c
@@ -48,14 +48,6 @@ int new_linux_kernel(char *okernel, char *ocmdline)
sprintf(cmdline, "BOOT_IMAGE=%s %s", kernel_name, args);
- /* "keeppxe" handling */
-#if IS_PXELINUX
- extern char KeepPXE;
-
- if (strstr(cmdline, "keeppxe"))
- KeepPXE |= 1;
-#endif
-
if (strstr(cmdline, "quiet"))
opt_quiet = true;
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index 26c39c1a..0edb7712 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -48,6 +48,7 @@
#include <syslinux/movebits.h>
#include <syslinux/firmware.h>
#include <syslinux/video.h>
+#include <syslinux/config.h>
#define BOOT_MAGIC 0xAA55
#define LINUX_MAGIC ('H' + ('d' << 8) + ('r' << 16) + ('S' << 24))
@@ -166,6 +167,7 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size,
struct syslinux_memmap *amap = NULL;
uint32_t memlimit = 0;
uint16_t video_mode = 0;
+ uint16_t bootflags = 0;
const char *arg;
cmdline_size = strlen(cmdline) + 1;
@@ -200,6 +202,14 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size,
}
}
+ if (syslinux_filesystem() == SYSLINUX_FS_PXELINUX &&
+ strstr(cmdline, "keeppxe")) {
+ extern __weak char KeepPXE;
+
+ KeepPXE |= 1; /* for pxelinux_scan_memory */
+ bootflags = 3; /* for unload_pxe */
+ }
+
/* Copy the header into private storage */
/* Use whdr to modify the actual kernel header */
memcpy(&hdr, kernel_buf, sizeof hdr);
@@ -495,7 +505,7 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size,
dprintf("*** vga=current, not calling syslinux_force_text_mode()...\n");
}
- syslinux_shuffle_boot_rm(fraglist, mmap, 0, &regs);
+ syslinux_shuffle_boot_rm(fraglist, mmap, bootflags, &regs);
dprintf("shuffle_boot_rm failed\n");
bail: