History log of /openbsd-current/usr.sbin/installboot/landisk_installboot.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.12 28-Dec-2022 jmc

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech


Revision tags: OPENBSD_7_2_BASE
# 1.11 31-Aug-2022 miod

Make installboot on landisk aware of a possible MBR on the disk, and in this
case install the first level bootstrap at the beginning of the of the wd0a
filesystem, rather than at the beginning of the disk.

Both locations work but the previous behaviour overwriting an existing MBR
is a violation of POLA.

tweaks & ok krw@


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.10 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.9 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.8 15-Jan-2016 tobiasu

sync() needs unistd.h


# 1.7 30-Nov-2015 jsing

Revert the sync -> fsync conversion (at least for the time being) - there
is a good chance that this is causing the 'No blocks to load' errors that
various people have encountered.


# 1.6 26-Nov-2015 deraadt

Apply pledge.
The people I asked to review this did not get back to me, so
we will test this a different way.


# 1.5 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@


# 1.4 11-Oct-2015 deraadt

needs at least some include love; choosing <stdlib.h>


# 1.3 08-Oct-2015 krw

Refactor fileprefix() and filecopy() to use warn() instead of err()
to display error message, and to return error indications (NULL and
-1 respectively). Use the error indications in write_efisystem()
to unwind in the face of more error conditions. In other cases just
exit(1) to emulation current behaviour.

ok deraadt@


# 1.2 05-Oct-2015 miod

Copy the stage2 file to / in md_installboot().


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.1 19-Jan-2014 jsing

Rework installboot and use a single directory with a single makefile. The
directory per machine model is arguably cleaner, however it does not play
well with distrib/special and instbin.

Discussed with deraadt@


# 1.11 31-Aug-2022 miod

Make installboot on landisk aware of a possible MBR on the disk, and in this
case install the first level bootstrap at the beginning of the of the wd0a
filesystem, rather than at the beginning of the disk.

Both locations work but the previous behaviour overwriting an existing MBR
is a violation of POLA.

tweaks & ok krw@


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.10 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.9 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.8 15-Jan-2016 tobiasu

sync() needs unistd.h


# 1.7 30-Nov-2015 jsing

Revert the sync -> fsync conversion (at least for the time being) - there
is a good chance that this is causing the 'No blocks to load' errors that
various people have encountered.


# 1.6 26-Nov-2015 deraadt

Apply pledge.
The people I asked to review this did not get back to me, so
we will test this a different way.


# 1.5 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@


# 1.4 11-Oct-2015 deraadt

needs at least some include love; choosing <stdlib.h>


# 1.3 08-Oct-2015 krw

Refactor fileprefix() and filecopy() to use warn() instead of err()
to display error message, and to return error indications (NULL and
-1 respectively). Use the error indications in write_efisystem()
to unwind in the face of more error conditions. In other cases just
exit(1) to emulation current behaviour.

ok deraadt@


# 1.2 05-Oct-2015 miod

Copy the stage2 file to / in md_installboot().


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.1 19-Jan-2014 jsing

Rework installboot and use a single directory with a single makefile. The
directory per machine model is arguably cleaner, however it does not play
well with distrib/special and instbin.

Discussed with deraadt@


# 1.10 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.9 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.8 15-Jan-2016 tobiasu

sync() needs unistd.h


# 1.7 30-Nov-2015 jsing

Revert the sync -> fsync conversion (at least for the time being) - there
is a good chance that this is causing the 'No blocks to load' errors that
various people have encountered.


# 1.6 26-Nov-2015 deraadt

Apply pledge.
The people I asked to review this did not get back to me, so
we will test this a different way.


# 1.5 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@


# 1.4 11-Oct-2015 deraadt

needs at least some include love; choosing <stdlib.h>


# 1.3 08-Oct-2015 krw

Refactor fileprefix() and filecopy() to use warn() instead of err()
to display error message, and to return error indications (NULL and
-1 respectively). Use the error indications in write_efisystem()
to unwind in the face of more error conditions. In other cases just
exit(1) to emulation current behaviour.

ok deraadt@


# 1.2 05-Oct-2015 miod

Copy the stage2 file to / in md_installboot().


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.1 19-Jan-2014 jsing

Rework installboot and use a single directory with a single makefile. The
directory per machine model is arguably cleaner, however it does not play
well with distrib/special and instbin.

Discussed with deraadt@


# 1.9 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.8 15-Jan-2016 tobiasu

sync() needs unistd.h


# 1.7 30-Nov-2015 jsing

Revert the sync -> fsync conversion (at least for the time being) - there
is a good chance that this is causing the 'No blocks to load' errors that
various people have encountered.


# 1.6 26-Nov-2015 deraadt

Apply pledge.
The people I asked to review this did not get back to me, so
we will test this a different way.


# 1.5 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@


# 1.4 11-Oct-2015 deraadt

needs at least some include love; choosing <stdlib.h>


# 1.3 08-Oct-2015 krw

Refactor fileprefix() and filecopy() to use warn() instead of err()
to display error message, and to return error indications (NULL and
-1 respectively). Use the error indications in write_efisystem()
to unwind in the face of more error conditions. In other cases just
exit(1) to emulation current behaviour.

ok deraadt@


# 1.2 05-Oct-2015 miod

Copy the stage2 file to / in md_installboot().


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.1 19-Jan-2014 jsing

Rework installboot and use a single directory with a single makefile. The
directory per machine model is arguably cleaner, however it does not play
well with distrib/special and instbin.

Discussed with deraadt@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.8 15-Jan-2016 tobiasu

sync() needs unistd.h


# 1.7 30-Nov-2015 jsing

Revert the sync -> fsync conversion (at least for the time being) - there
is a good chance that this is causing the 'No blocks to load' errors that
various people have encountered.


# 1.6 26-Nov-2015 deraadt

Apply pledge.
The people I asked to review this did not get back to me, so
we will test this a different way.


# 1.5 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@


# 1.4 11-Oct-2015 deraadt

needs at least some include love; choosing <stdlib.h>


# 1.3 08-Oct-2015 krw

Refactor fileprefix() and filecopy() to use warn() instead of err()
to display error message, and to return error indications (NULL and
-1 respectively). Use the error indications in write_efisystem()
to unwind in the face of more error conditions. In other cases just
exit(1) to emulation current behaviour.

ok deraadt@


# 1.2 05-Oct-2015 miod

Copy the stage2 file to / in md_installboot().


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.1 19-Jan-2014 jsing

Rework installboot and use a single directory with a single makefile. The
directory per machine model is arguably cleaner, however it does not play
well with distrib/special and instbin.

Discussed with deraadt@