aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: