Do not attempt to write to read-only softraid
authorkn <kn@openbsd.org>
Tue, 25 Apr 2023 10:06:12 +0000 (10:06 +0000)
committerkn <kn@openbsd.org>
Tue, 25 Apr 2023 10:06:12 +0000 (10:06 +0000)
commit5a8378277327e8433b632bd9bef26d30b93e329c
tree13757c67cce0602c41b4a6afb6d5ffc4e5fd1ce4
parentcaa52935dd761efce7fff45a153f656f4a1e8eb4
Do not attempt to write to read-only softraid

Bootloaders have no write support for softraid volumes, which manifests in,
e.g. /bsd.upgrade not being stripped of its 'x' permission bit to prevent
sysupgrade loops in case of upgrade failure.

Set a no-write flag handled by libsa to bail out early in write calls.
There should be no real behaviour change, writes just fail earlier now.

amd64 BIOS bits first, rest to come.  Crank minor.

"seems sensible" jsing
sys/arch/amd64/stand/boot/conf.c
sys/arch/amd64/stand/cdboot/conf.c
sys/arch/amd64/stand/libsa/biosdev.c
sys/arch/amd64/stand/pxeboot/conf.c