Do not attempt to write to read-only softraid
authorkn <kn@openbsd.org>
Tue, 25 Apr 2023 14:48:16 +0000 (14:48 +0000)
committerkn <kn@openbsd.org>
Tue, 25 Apr 2023 14:48:16 +0000 (14:48 +0000)
commitd55930ef1b6ad790e1b3c26e97731adb23b31473
tree629cc7ded0dac0955bd485fe9ca677a75376889c
parente4feca10065612ec940b7e5eaf2ebfbb6f974dd0
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.

i386 BIOS.  Crank minor.
Tested inside amd64 vmm.
sys/arch/i386/stand/boot/conf.c
sys/arch/i386/stand/cdboot/conf.c
sys/arch/i386/stand/libsa/biosdev.c
sys/arch/i386/stand/pxeboot/conf.c