git: caf73e585793 - main - bsdinstall: fix prepopulating the ZFS disk menu with ZFSBOOT_DISKS

From: Alan Somers <asomers_at_FreeBSD.org>
Date: Fri, 27 May 2022 15:09:55 UTC
The branch main has been updated by asomers:

URL: https://cgit.FreeBSD.org/src/commit/?id=caf73e58579343fc1661f43554b30115bb940535

commit caf73e58579343fc1661f43554b30115bb940535
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2022-05-26 22:20:03 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2022-05-27 15:09:33 +0000

    bsdinstall: fix prepopulating the ZFS disk menu with ZFSBOOT_DISKS
    
    If the ZFSBOOT_DISKS variable is set to one or more disk names, then
    those disks should be preselected in the disk menu.  However, the code
    wasn't correctly setting the variable, leaving all disks unselected.
    
    MFC after:      2 weeks
    Sponsored by:   Axcient
    Reviewed by:    dteske
    Differential Revision: https://reviews.freebsd.org/D35331
---
 usr.sbin/bsdinstall/scripts/zfsboot | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index a98cf4a33f28..40973f737761 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -659,7 +659,7 @@ dialog_menu_layout()
 		while :; do
 			# Loop over list of available disks, resetting state
 			for disk in $disks; do
-				f_isset _${disk}_status && _${disk}_status=
+				f_isset _${disk}_status && setvar _${disk}_status
 			done
 
 			# Loop over list of selected disks and create temporary
@@ -667,9 +667,8 @@ dialog_menu_layout()
 			for disk in $ZFSBOOT_DISKS; do
 				debug= f_device_find -1 \
 					$disk $DEVICE_TYPE_DISK disk
-				f_isset _${disk}_status ||
-					local _${disk}_status
-				_${disk}_status=on
+				local _${disk}_status
+				setvar _${disk}_status on
 			done
 
 			# Create the checklist menu of discovered disk devices