OpenBSD CVS

CVS log for src/usr.sbin/installboot/sparc64_softraid.c


[BACK] Up to [local] / src / usr.sbin / installboot

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.9 / (download) - annotate - [select for diffs], Tue Nov 8 12:08:53 2022 UTC (19 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.8: +1 -6 lines
Diff to previous 1.8 (colored)

Make "prepare filesystem" softraid aware, fix arm64 softraid install

On EFI platforms, 'installboot -p' on a softraid volume will only prepare
the filesysem inside the volume and leave physical softraid chunks untouched
which leaves you with unbootable chunks.

The current workaround is to prepare chunks manually (see regress).

Fix it in the same spirit the actual "install" already works in softraid.c.

This is what mlarkin has already been tested in a combined diff with the
MD -> MI softraid merge bits from the previous commit.

Works fine on amd64, arm64 and sparc64 upgrades and installations.

OK jsing

Revision 1.8 / (download) - annotate - [select for diffs], Mon Nov 7 15:56:09 2022 UTC (19 months ago) by kn
Branch: MAIN
Changes since 1.7: +3 -32 lines
Diff to previous 1.7 (colored)

Merge duplicate MD code into MI sr_open_chunk()

It does not have the prettiest signature, but nicely folds identical copies
into softraid.c, which then allows us to reuse sr_open_chunk() yet again in
an upcoming diff to make -p softraid aware (fixes arm64 installations).

Regress keeps passing.
Works fine on amd64, arm64 and sparc64.
"looks fine" mlarkin for whom this unbreaks a fresh arm64 softraid install

Revision 1.7 / (download) - annotate - [select for diffs], Wed Oct 5 09:58:43 2022 UTC (20 months ago) by kn
Branch: MAIN
Changes since 1.6: +8 -1 lines
Diff to previous 1.6 (colored)

Skip softraid(4) keydisks

Keydisks appear as chunks internally (with special properties) and
installboot(8) thus treated them like actual data chunks.

Most users probably don't hit this as their keydisk is detached and thus
appears "offline" and gets skipped.

Installing to online keydisks may work but is neither expected nor intended
to work, so properly skip them.

Odd setups like keydisk and CRYPTO chunk on the same physical disk would
end up installing getting bootblocks installed twice.

Pointed out by Mikolaj Kucharski <mikolaj AT kucharski DOT name> who also
provided the actual diff (minor wording tweaks by me)

OK jsing

Revision 1.6 / (download) - annotate - [select for diffs], Mon Aug 29 18:54:43 2022 UTC (21 months, 1 week ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.5: +6 -6 lines
Diff to previous 1.5 (colored)

softraid: make verbose messages -n/nowrite aware

Using installboot(8) in dry-run mode aka. -vn (verbose + nowrite) and first
reading "would install" followed by an "installing" made me uneasy.

Luckily, nothing was written in dry-run mode, it's just that the
softraid specific code fails to honour -n/nowrite.

So make sure it does and pull the printf out of `if (!nowrite)' so we
see the "would install" messages in dry-run mode in the first place.

Output diff for root on CRYPTO softraid on biosboot(8/amd64) to illustrate:

    -# installboot -nv sd1
    +# ./obj/installboot -nv sd1
     would install bootstrap on /dev/rsd1c
     using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot
     sd1: softraid volume with 1 disk(s)
    +sd1: would install boot loader on softraid volume
     /usr/mdec/boot is 6 blocks x 16384 bytes
    -sd0a: installing boot blocks on /dev/rsd0c, part offset 144
    +sd0a: would install boot blocks on /dev/rsd0c, part offset 144
     master boot record (MBR) at sector 0
     	partition 3: type 0xA6 offset 64 size 488392001
     /usr/mdec/biosboot will be written at sector 64

OK jsing

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 8 19:17:12 2020 UTC (4 years ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

Provide clear errors when trying to install oversized boot loader

sparc64 installboot(8) on softraid(4) with too large files, e.g. unstripped
builds, fails poorly with "installboot: softraid installboot failed".

This is due to the BIOCINSTALLBOOT ioctl(2) returing the default EINVAL
rather than using softraid's sr_error() interface properly;  additionally,
installboot does not check for such message from the bio(4) layer.


Make the kernel generate "boot block too large" and "boot loader too large"
messages for softraid devices and have installboot act upon them analogous
to bioctl(8), by adapting its bio_status() into the new sr_status() helper.

Input, reminder to look at bioctl, same kernel diff from, OK jsing

Revision 1.4 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:48 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

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 1.3 / (download) - annotate - [select for diffs], Sat Oct 3 16:56:52 2015 UTC (8 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Nuke trailing whitespace to avoid cluttering possible upcoming diffs.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jan 16 00:05:12 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

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 1.1 / (download) - annotate - [select for diffs], Sun Jan 19 02:58:50 2014 UTC (10 years, 4 months ago) by jsing
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5

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@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.