History log of /openbsd-current/usr.sbin/installboot/bootstrap.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.13 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_5_BASE
# 1.12 13-Dec-2018 krw

Revert last. Breaks landisk snap building for currently unknown
reason.

Noticed by deraadt@


# 1.11 25-Nov-2018 krw

Don't allow the bootstrap to overlap the start of the OpenBSD area of
the disk. Even if the OpenBSD area starts with FS_UNUSED or FS_BOOT
partitions.

ok deraadt@ as part of larger diff


Revision tags: OPENBSD_6_4_BASE
# 1.10 01-Sep-2018 krw

Remove 'overlap_allowance' parameter from bootstrap().

It was added to support Vax. Vax is dead Jim.

ok deraadt@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.9 28-Dec-2015 krw

Replace lseek/[read|write] with pread|pwrite.

ok millert@ a while ago.


# 1.8 19-Oct-2015 krw

LABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and not
d_secsize when calculating disklabel location.

ok jsing@


# 1.7 15-Oct-2015 miod

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@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.6 16-Jan-2015 deraadt

first batch of cleanup to programs based upon the namespace cleanups
in net/pfvar.h sys/proc.h sys/ucred.h arpa/nameser.h
change to PATH_MAX, reduce use of MIN() and MAX(), HOST_NAME_MAX+1,
LOGIN_NAME_MAX, etc etc
ok millert guenther, some review by doug


Revision tags: OPENBSD_5_6_BASE
# 1.5 25-Jun-2014 tobias

Apply/fix OpenBSD tag.

ok jsing@


# 1.4 09-Jun-2014 jsing

Use calloc() instead of malloc()/memset().

From Benjamin Baier.


Revision tags: OPENBSD_5_5_BASE
# 1.3 28-Dec-2013 jsing

Round the size of the bootstrap up to a multiple of the disk sector size.
Some bootstraps are already built this way, however others are not.


# 1.2 28-Dec-2013 jsing

Various code clean ups - add a missing header, add a missing prototype,
add some casts, tweak some types and variable names.


# 1.1 27-Dec-2013 jsing

Provide a bootstrap implementation (effectively a `disklabel -B'
equivalent) for use with architectures like hppa, landisk and vax.


# 1.12 13-Dec-2018 krw

Revert last. Breaks landisk snap building for currently unknown
reason.

Noticed by deraadt@


# 1.11 25-Nov-2018 krw

Don't allow the bootstrap to overlap the start of the OpenBSD area of
the disk. Even if the OpenBSD area starts with FS_UNUSED or FS_BOOT
partitions.

ok deraadt@ as part of larger diff


Revision tags: OPENBSD_6_4_BASE
# 1.10 01-Sep-2018 krw

Remove 'overlap_allowance' parameter from bootstrap().

It was added to support Vax. Vax is dead Jim.

ok deraadt@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.9 28-Dec-2015 krw

Replace lseek/[read|write] with pread|pwrite.

ok millert@ a while ago.


# 1.8 19-Oct-2015 krw

LABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and not
d_secsize when calculating disklabel location.

ok jsing@


# 1.7 15-Oct-2015 miod

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@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.6 16-Jan-2015 deraadt

first batch of cleanup to programs based upon the namespace cleanups
in net/pfvar.h sys/proc.h sys/ucred.h arpa/nameser.h
change to PATH_MAX, reduce use of MIN() and MAX(), HOST_NAME_MAX+1,
LOGIN_NAME_MAX, etc etc
ok millert guenther, some review by doug


Revision tags: OPENBSD_5_6_BASE
# 1.5 25-Jun-2014 tobias

Apply/fix OpenBSD tag.

ok jsing@


# 1.4 09-Jun-2014 jsing

Use calloc() instead of malloc()/memset().

From Benjamin Baier.


Revision tags: OPENBSD_5_5_BASE
# 1.3 28-Dec-2013 jsing

Round the size of the bootstrap up to a multiple of the disk sector size.
Some bootstraps are already built this way, however others are not.


# 1.2 28-Dec-2013 jsing

Various code clean ups - add a missing header, add a missing prototype,
add some casts, tweak some types and variable names.


# 1.1 27-Dec-2013 jsing

Provide a bootstrap implementation (effectively a `disklabel -B'
equivalent) for use with architectures like hppa, landisk and vax.


# 1.10 01-Sep-2018 krw

Remove 'overlap_allowance' parameter from bootstrap().

It was added to support Vax. Vax is dead Jim.

ok deraadt@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.9 28-Dec-2015 krw

Replace lseek/[read|write] with pread|pwrite.

ok millert@ a while ago.


# 1.8 19-Oct-2015 krw

LABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and not
d_secsize when calculating disklabel location.

ok jsing@


# 1.7 15-Oct-2015 miod

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@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.6 16-Jan-2015 deraadt

first batch of cleanup to programs based upon the namespace cleanups
in net/pfvar.h sys/proc.h sys/ucred.h arpa/nameser.h
change to PATH_MAX, reduce use of MIN() and MAX(), HOST_NAME_MAX+1,
LOGIN_NAME_MAX, etc etc
ok millert guenther, some review by doug


Revision tags: OPENBSD_5_6_BASE
# 1.5 25-Jun-2014 tobias

Apply/fix OpenBSD tag.

ok jsing@


# 1.4 09-Jun-2014 jsing

Use calloc() instead of malloc()/memset().

From Benjamin Baier.


Revision tags: OPENBSD_5_5_BASE
# 1.3 28-Dec-2013 jsing

Round the size of the bootstrap up to a multiple of the disk sector size.
Some bootstraps are already built this way, however others are not.


# 1.2 28-Dec-2013 jsing

Various code clean ups - add a missing header, add a missing prototype,
add some casts, tweak some types and variable names.


# 1.1 27-Dec-2013 jsing

Provide a bootstrap implementation (effectively a `disklabel -B'
equivalent) for use with architectures like hppa, landisk and vax.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.9 28-Dec-2015 krw

Replace lseek/[read|write] with pread|pwrite.

ok millert@ a while ago.


# 1.8 19-Oct-2015 krw

LABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and not
d_secsize when calculating disklabel location.

ok jsing@


# 1.7 15-Oct-2015 miod

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@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.6 16-Jan-2015 deraadt

first batch of cleanup to programs based upon the namespace cleanups
in net/pfvar.h sys/proc.h sys/ucred.h arpa/nameser.h
change to PATH_MAX, reduce use of MIN() and MAX(), HOST_NAME_MAX+1,
LOGIN_NAME_MAX, etc etc
ok millert guenther, some review by doug


Revision tags: OPENBSD_5_6_BASE
# 1.5 25-Jun-2014 tobias

Apply/fix OpenBSD tag.

ok jsing@


# 1.4 09-Jun-2014 jsing

Use calloc() instead of malloc()/memset().

From Benjamin Baier.


Revision tags: OPENBSD_5_5_BASE
# 1.3 28-Dec-2013 jsing

Round the size of the bootstrap up to a multiple of the disk sector size.
Some bootstraps are already built this way, however others are not.


# 1.2 28-Dec-2013 jsing

Various code clean ups - add a missing header, add a missing prototype,
add some casts, tweak some types and variable names.


# 1.1 27-Dec-2013 jsing

Provide a bootstrap implementation (effectively a `disklabel -B'
equivalent) for use with architectures like hppa, landisk and vax.