From 7b9dcf52639271931dadbc2c137ff0b9dc8ccb34 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Thu, 26 May 2022 16:20:03 -0600 Subject: [PATCH] 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 14fbdd0d67f..9a15bd719f5 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 -- 2.45.0