Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jul 2022 15:40:41 GMT
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 7b9dcf526392 - stable/13 - bsdinstall: fix prepopulating the ZFS disk menu with ZFSBOOT_DISKS
Message-ID:  <202207241540.26OFefJS017663@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by asomers:

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

commit 7b9dcf52639271931dadbc2c137ff0b9dc8ccb34
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2022-05-26 22:20:03 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2022-07-24 15:39:44 +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
    
    (cherry picked from commit caf73e58579343fc1661f43554b30115bb940535)
    
    Fix a memory leak from caf73e58579
    
    Don't shadow an already-local variable with another local declaration.
    
    Reported by:    dteske
    MFC after:      13 days
    MFC with:       caf73e58579343fc1661f43554b30115bb940535
    Sponsored by:   Axcient
    Differential Revision:  https://reviews.freebsd.org/D35331
    
    (cherry picked from commit 77d678b7a4075a056be621b46be50377f08bfc9e)
---
 usr.sbin/bsdinstall/scripts/zfsboot | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index 14fbdd0d67fb..9a15bd719f5a 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -644,7 +644,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
@@ -654,7 +654,7 @@ dialog_menu_layout()
 					$disk $DEVICE_TYPE_DISK disk
 				f_isset _${disk}_status ||
 					local _${disk}_status
-				_${disk}_status=on
+				setvar _${disk}_status on
 			done
 
 			# Create the checklist menu of discovered disk devices



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207241540.26OFefJS017663>