Commit 63f5224c authored by Mike Hibler's avatar Mike Hibler

I cannot believe I did this...fix the LILO relocation code.

No one has used this code in 10 years and not one will ever use it again,
but it broke my testing...and PISSED ME OFF!

Time for a LILO revival!
parent 5117b27a
/* /*
* Copyright (c) 2000-2004, 2009 University of Utah and the Flux Group. * Copyright (c) 2000-2015 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -170,7 +170,8 @@ fixup_lilo(int slice, int stype, u_int32_t start, u_int32_t size, ...@@ -170,7 +170,8 @@ fixup_lilo(int slice, int stype, u_int32_t start, u_int32_t size,
/* /*
* Check for aliases which produce a map entry pointing * Check for aliases which produce a map entry pointing
* to the same sectors as the original. We don't want to * to the same sectors as the original. We don't want to
* relocate those sectors multiple times! * relocate those sectors multiple times! But we do need
* to relocate the pointers.
*/ */
s0 = getsector(&ip->start); s0 = getsector(&ip->start);
for (a_ip = dtab.idtab.images; a_ip < ip; a_ip++) { for (a_ip = dtab.idtab.images; a_ip < ip; a_ip++) {
...@@ -180,14 +181,6 @@ fixup_lilo(int slice, int stype, u_int32_t start, u_int32_t size, ...@@ -180,14 +181,6 @@ fixup_lilo(int slice, int stype, u_int32_t start, u_int32_t size,
if (s0 == a_s0) if (s0 == a_s0)
break; break;
} }
if (a_ip < ip) {
if (debug > 1)
fprintf(stderr, " LILO parse: "
"skipping %s (alias for %s)\n",
ip->name, a_ip->name);
ip++;
continue;
}
/* /*
* Fixup initrd (if present) and map sector(s) * Fixup initrd (if present) and map sector(s)
...@@ -202,7 +195,14 @@ fixup_lilo(int slice, int stype, u_int32_t start, u_int32_t size, ...@@ -202,7 +195,14 @@ fixup_lilo(int slice, int stype, u_int32_t start, u_int32_t size,
} }
fixup_sector(FOFFSET(poff, struct idtab, images[i].start), fixup_sector(FOFFSET(poff, struct idtab, images[i].start),
&ip->start); &ip->start);
fixup_map(infd, s0);
if (a_ip < ip) {
if (debug > 1)
fprintf(stderr, " LILO parse: "
"skipping %s (alias for %s)\n",
ip->name, a_ip->name);
} else
fixup_map(infd, s0);
ip++; ip++;
} }
......
...@@ -2227,6 +2227,7 @@ reloc_lilo(void *addr, int reloctype, uint32_t size) ...@@ -2227,6 +2227,7 @@ reloc_lilo(void *addr, int reloctype, uint32_t size)
if (sector == 0) if (sector == 0)
break; break;
sector += outputminsec; sector += outputminsec;
assert(outputmaxsec == 0 || sector <= outputmaxsec);
putsector(sect, sector, sect->device, sect->nsect); putsector(sect, sector, sect->device, sect->nsect);
sect++; sect++;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment