Don't install the swap stub when we are already the primary drive,
even if -swap is specified.
struct syslinux_memmap *mmap;
struct syslinux_movelist *mlist = NULL;
addr_t dosmem = old_bios_fbm << 10;
+ uint8_t driveno = regs->edx.b[0];
+ uint8_t swapdrive = driveno & 0x80;
mmap = syslinux_memory_map();
return;
}
- if (opt.swap) {
+ if (opt.swap && driveno != swapdrive) {
uint8_t *p;
- uint8_t driveno = regs->edx.b[0];
- uint8_t swapdrive = driveno & 0x80;
regs->edx.b[0] = swapdrive;