diff options
author | phk <phk@FreeBSD.org> | 2002-10-07 13:11:28 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-07 13:11:28 +0000 |
commit | 87986ee87a74dbaaecf2888e8d3c6bd2c9b46964 (patch) | |
tree | 9c78bec00246c66f1f2e83114133efbc5df5e145 /sys/boot | |
parent | 8d204bd6cbcb6866f999579a9e24ae03b124aeaf (diff) | |
download | FreeBSD-src-87986ee87a74dbaaecf2888e8d3c6bd2c9b46964.zip FreeBSD-src-87986ee87a74dbaaecf2888e8d3c6bd2c9b46964.tar.gz |
Correctly compensate for both offset and unoffset on-disk BSD disklabels.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/i386/boot2/boot2.c | 3 | ||||
-rw-r--r-- | sys/boot/i386/gptboot/gptboot.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index ae3e3b3..cc858c8 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -526,7 +526,8 @@ dskread(void *buf, unsigned lba, unsigned nblk) printf("Invalid %s\n", "partition"); return -1; } - dsk.start = d->d_partitions[dsk.part].p_offset; + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; } } return drvread(buf, dsk.start + lba, nblk); diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index ae3e3b3..cc858c8 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -526,7 +526,8 @@ dskread(void *buf, unsigned lba, unsigned nblk) printf("Invalid %s\n", "partition"); return -1; } - dsk.start = d->d_partitions[dsk.part].p_offset; + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; } } return drvread(buf, dsk.start + lba, nblk); |