Commit 6b5f0e45 authored by Mike Hibler's avatar Mike Hibler

Add option to force generation of relocations.

parent 628478f9
/*
* Copyright (c) 2000-2014 University of Utah and the Flux Group.
* Copyright (c) 2000-2015 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -66,7 +66,7 @@ read_linuxslice(int slice, iz_type stype, iz_lba start, iz_size size,
* Check for a LILO boot block and create relocations as necessary
* (if the partition starts at 0, the values are already relative)
*/
if (dorelocs && start > 0 &&
if (dorelocs && (start > 0 || forcerelocs) &&
fixup_lilo(slice, stype, start, size, sname, infd, &rval) != 0)
return 1;
......
/*
* Copyright (c) 2000-2014 University of Utah and the Flux Group.
* Copyright (c) 2000-2015 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -254,8 +254,8 @@ _read_bsdslice(int slice, iz_type bsdtype, iz_lba start, iz_size size,
* Note that event if partitions were relative (absoffset == 0) we
* have converted the value in dlabel to absolute by this point.
*/
if (dorelocs &&
start != 0 && dlabel.label.d_partitions[0].p_offset == start) {
if (dorelocs && (start > 0 || forcerelocs) &&
dlabel.label.d_partitions[0].p_offset == start) {
for (i = 0; i < npart; i++) {
if (dlabel.label.d_partitions[i].p_size == 0)
continue;
......
......@@ -30,6 +30,7 @@ extern int slicemode;
extern int dorelocs;
extern int metaoptimize;
extern int excludenonfs;
extern int forcerelocs;
extern off_t devlseek(int fd, off_t off, int whence);
extern ssize_t devread(int fd, void *buf, size_t nbytes);
......
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