Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F112611467
D33331.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33331.diff
View Options
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -1573,6 +1573,28 @@
return $SUCCESS
}
+dialog_zpool_name()
+{
+ local prompt="$* is already taken, please enter a name for the ZFS pool \
+ (Or confirm using the same name by just pressing enter)"
+ local hline=
+ local value="$*"
+ local height width
+
+ f_dialog_inputbox_size height width \
+ "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" "$value" "$hline"
+
+ $DIALOG \
+ --title "$DIALOG_TITLE" \
+ --backtitle "$DIALOG_BACKTITLE" \
+ --hline "$hline" \
+ --ok-label "Ok" \
+ --no-cancel \
+ --inputbox "$prompt" \
+ $height $width "$value" \
+ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
+}
+
############################################################ MAIN
#
@@ -1591,6 +1613,16 @@
f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSDINSTALL_TMPETC"
f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT"
+pools=$(zpool import | awk '$1 == "pool:" { print $2}')
+for pool in ${pools}; do
+ f_dprintf "Checking ${pool} against ${ZFSBOOT_POOL_NAME}"
+ if [ "${pool}" = "${ZFSBOOT_POOL_NAME}" ]; then
+ f_dprintf "Pool ${pool} already taken"
+ ZFSBOOT_POOL_NAME=$(dialog_zpool_name "${ZFSBOOT_POOL_NAME}")
+ break;
+ fi
+done
+
#
# Determine default boot type
#
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 12:27 PM (10 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17242516
Default Alt Text
D33331.diff (1 KB)
Attached To
Mode
D33331: bsdinstall: zfsboot: Prompt user for zpool name if the pool already exists
Attached
Detach File
Event Timeline
Log In to Comment