From: kn Date: Fri, 3 Feb 2023 14:18:56 +0000 (+0000) Subject: Make softraid helper return disk not device names X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d9823da2edec4325997e1d5e71e64663bca0d301;p=openbsd Make softraid helper return disk not device names get_softraid_chunks() yields full device names with labels, e.g. "sd0a", but the installer largely deals with disk names "sd0". The only user of this, MAKEDEV, behaves identically with either form. Rename to get_softraid_disks(), clarify comments and return disk names so it can be reused without pattern matching or stripping labels. OK afresh1 --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index acc8f0e92f5..cb551586f2e 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1224 2023/02/02 13:29:16 kn Exp $ +# $OpenBSD: install.sub,v 1.1225 2023/02/03 14:18:56 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -346,11 +346,11 @@ get_dkdevs_root() { echo -n $_disks } -# Return list of softraid chunks, optionally limited to the volume $1. -get_softraid_chunks() { +# Return list of disks with softraid chunks, optionally limited to the volume $1. +get_softraid_disks() { local _device=${1:-softraid0} - bioctl $_device 2>/dev/null | sed -n 's/.*<\(.*\)>$/\1/p' + bioctl $_device 2>/dev/null | sed -n 's/.*<\(.*\).>$/\1/p' } # Return list of all network devices, optionally limited by parameters to @@ -2952,9 +2952,9 @@ finish_up() { ) fi - # In case this is a softraid device, make sure all underlying + # In case root is on a softraid volume, make sure all underlying # device nodes exist before installing boot-blocks on disk. - make_dev $(get_softraid_chunks $ROOTDISK) + make_dev $(get_softraid_disks $ROOTDISK) md_installboot $ROOTDISK chmod og-rwx /mnt/bsd{,.mp,.rd} 2>/dev/null