diff options
| author | 2015-10-15 19:27:30 +0000 | |
|---|---|---|
| committer | 2015-10-15 19:27:30 +0000 | |
| commit | 5c8b64e6dcd8e1bd248a2ee79d11cb6b540928ef (patch) | |
| tree | bd8d31a6543695fac69f57d13796dbe1ff1437df /usr.sbin/installboot/bootstrap.c | |
| parent | add missing comma and missing range restriction, found by smilint (diff) | |
| download | wireguard-openbsd-5c8b64e6dcd8e1bd248a2ee79d11cb6b540928ef.tar.xz wireguard-openbsd-5c8b64e6dcd8e1bd248a2ee79d11cb6b540928ef.zip | |
Add an extra argument to bootstrap() to allow for a limited overlap between an
existing partition and the boot blocks span, and update all callers to require
an overlap limit of zero sectors (thus not changing their behaviour).
Then, add proper support for vax: copy the 2nd-stage boot block to /boot and
install the 1st-stage boot block at the beginning of the disk, retaining the
disklabel; allow for an overlap of up to 16 sectors, which is perfectly fine
as long as your `a' partition is FFS.
Note that regular installs will not even have such an overlap, because the
default OpenBSD span on a disk on vax starts at sector 16, but installation
media use sperific layout which require this.
ok krw@
Diffstat (limited to 'usr.sbin/installboot/bootstrap.c')
| -rw-r--r-- | usr.sbin/installboot/bootstrap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/installboot/bootstrap.c b/usr.sbin/installboot/bootstrap.c index c2c6ec3cd01..adabff3767a 100644 --- a/usr.sbin/installboot/bootstrap.c +++ b/usr.sbin/installboot/bootstrap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bootstrap.c,v 1.6 2015/01/16 00:05:12 deraadt Exp $ */ +/* $OpenBSD: bootstrap.c,v 1.7 2015/10/15 19:27:30 miod Exp $ */ /* * Copyright (c) 2013 Joel Sing <jsing@openbsd.org> @@ -32,7 +32,7 @@ #include "installboot.h" void -bootstrap(int devfd, char *dev, char *bootfile) +bootstrap(int devfd, char *dev, char *bootfile, unsigned int overlap_allowance) { struct disklabel dl; struct disklabel *lp; @@ -92,7 +92,7 @@ bootstrap(int devfd, char *dev, char *bootfile) continue; if (DL_GETPSIZE(pp) == 0) continue; - if ((u_int64_t)bootsec <= DL_GETPOFFSET(pp)) + if ((u_int64_t)bootsec <= DL_GETPOFFSET(pp) + overlap_allowance) continue; switch (pp->p_fstype) { case FS_BOOT: |
