From 246e1c8021c27b15aba46d408bb0df35501806a3 Mon Sep 17 00:00:00 2001 From: kn Date: Sat, 8 Jul 2023 15:01:09 +0000 Subject: [PATCH] Floppies don't have bioctl(8) The installer always checks for softraid using it, skip if unavailable. Apply the usual idiom in encrypt_root() to silence stderr noise. Do so in do in get_softraid_chunks() as well which is always called in get_dkdevs_unitialized() and finish_up(); get_softraid_chunks() discards stderr and both users still do the right thing on bioctl failure/empty output from get_dkdevs_unitialized(), but there's no point in trying plus the idiom clarifies how this code is indeed used on floppies. Found and tested by krw OK deraadt krw --- distrib/miniroot/install.sub | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 96ce637c7c4..5260c8197f9 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1250 2023/06/18 15:17:38 deraadt Exp $ +# $OpenBSD: install.sub,v 1.1251 2023/07/08 15:01:09 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -307,6 +307,7 @@ scan_disknames() { get_softraid_chunks() { local _device=${1:-softraid0} + [[ -x /sbin/bioctl ]] || return bioctl $_device 2>/dev/null | sed -n 's/.*<\(.*\).>$/\1/p' } @@ -3081,6 +3082,8 @@ encrypt_root() { # The interactive bioctl(8) passphrase prompt requires a TTY. $AI && return + [[ -x /sbin/bioctl ]] || return + # Do not even try if softraid is in use already, # e.g. auto-assembled at boot or done in (S)hell. [[ -z $(get_softraid_volumes) ]] || return -- 2.20.1