diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2018-03-02 15:36:40 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2018-03-02 15:36:40 +0000 |
commit | b4778901d740e1d09deaa527e32f0c6e2d3d1ea5 (patch) | |
tree | 8f89e87bd189b35866d44f1ca8a662547478f0e1 /sys | |
parent | 3598f696a0650a3d91081b0fc589a6c3972d9242 (diff) |
Fix the locating of the OpenBSD disklabel on media with 2048 byte
sectors (installXX.iso). The change to properly locate the disklabel,
introduced after 6.0, assumed incorrectly 512 byte sectors.
Diff from miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sgi/stand/boot/diskio.c | 13 | ||||
-rw-r--r-- | sys/arch/sgi/stand/boot/version | 7 |
2 files changed, 13 insertions, 7 deletions
diff --git a/sys/arch/sgi/stand/boot/diskio.c b/sys/arch/sgi/stand/boot/diskio.c index e145ac0417e..baac86d5c89 100644 --- a/sys/arch/sgi/stand/boot/diskio.c +++ b/sys/arch/sgi/stand/boot/diskio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskio.c,v 1.11 2016/10/05 11:55:45 visa Exp $ */ +/* $OpenBSD: diskio.c,v 1.12 2018/03/02 15:36:39 visa Exp $ */ /* * Copyright (c) 2016 Miodrag Vallat. @@ -73,7 +73,8 @@ diostrategy(void *devdata, int rw, daddr32_t bn, size_t reqcnt, void *addr, arc_quad_t offset; long result; - blkoffset = (DL_GETPOFFSET(pp) + bn) * DEV_BSIZE; + blkoffset = + (DL_SECTOBLK(&sc->sc_label, DL_GETPOFFSET(pp)) + bn) * DEV_BSIZE; offset.hi = blkoffset >> 32; offset.lo = blkoffset; @@ -222,14 +223,16 @@ dioopen(struct open_file *f, ...) /* * Assume the OpenBSD partition spans the whole device. */ -#ifdef DEBUG - printf("No native disklabel found\n"); -#endif lp->d_secsize = DEV_BSIZE; lp->d_secpercyl = 1; lp->d_npartitions = MAXPARTITIONS; DL_SETPOFFSET(&lp->d_partitions[partition], native_offset); DL_SETPSIZE(&lp->d_partitions[partition], -1ULL); +#ifdef DEBUG + printf("No native disklabel found, " + "assuming partition %c starts at %lld\n", + 'a' + partition, native_offset); +#endif } return 0; diff --git a/sys/arch/sgi/stand/boot/version b/sys/arch/sgi/stand/boot/version index 9fbbb89627d..f8c6a64f6cf 100644 --- a/sys/arch/sgi/stand/boot/version +++ b/sys/arch/sgi/stand/boot/version @@ -1,4 +1,4 @@ -/* $OpenBSD: version,v 1.9 2016/10/05 11:55:45 visa Exp $ */ +/* $OpenBSD: version,v 1.10 2018/03/02 15:36:39 visa Exp $ */ /* Public domain. Come on, this can hardly be considered as code. */ #if 0 @@ -38,6 +38,9 @@ No version strings up to 2012 Use the OpenBSD disklabel instead of assuming OpenBSD partition `a` starts at the beginning of the volume header partition #0. +1.9 + Fix non-512 byte per sector media, broken in 1.8. + #endif -static const char version[] = "1.8"; +static const char version[] = "1.9"; |