From 1abb2e8384f94a96ce89990d7afa0b049947a77a Mon Sep 17 00:00:00 2001 From: kn Date: Tue, 17 Jan 2023 16:14:23 +0000 Subject: [PATCH] Skip all interface config questions when there are none Even without any interfaces the installer still asks for one and only continues when the only possible answer 'done' is provided. That means one mandatory but useless answer during installations like # vmctl start -c -d ./install72.img -d ./disk.img test ... System hostname? (short form, e.g. 'foo') test Available network interfaces are: . Network interface to configure? (name, lladdr, '?', or 'done') A response is required. Network interface to configure? (name, lladdr, '?', or 'done') ? Available network interfaces are: . Network interface to configure? (name, lladdr, '?', or 'done') done DNS domain name? (e.g. 'example.com') [my.domain] ... Skip it when there is no viable answer: # vmctl start -c -d ./install72.img -d ./disk.img test ... System hostname? (short form, e.g. 'foo') test DNS domain name? (e.g. 'example.com') [my.domain] ... OK deraadt --- distrib/miniroot/install.sub | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 701b5df1228..4592f371f1a 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1219 2023/01/12 15:03:23 kn Exp $ +# $OpenBSD: install.sub,v 1.1220 2023/01/17 16:14:23 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -1322,6 +1322,10 @@ configure_ifs() { while :; do set -sA _ifs -- $(get_ifs) + # Skip all interface configuration questions if there is no + # physical interface to begin with. + ((${_ifs[*]} == 0)) && break + # Discover last configured vlan interface and increment its # minor for the next offered vlan interface. _vi= -- 2.20.1