Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aaeegg authored and geneC committed Mar 5, 2017
1 parent b4cc12b commit 346d227
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 0 additions & 8 deletions com32/elflink/ldlinux/kernel.c
Expand Up @@ -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;

Expand Down
12 changes: 11 additions & 1 deletion com32/lib/syslinux/load_linux.c
Expand Up @@ -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))
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 346d227

Please sign in to comment.