From owner-svn-soc-all@FreeBSD.ORG Sun Aug 17 21:36:23 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7640CA88 for ; Sun, 17 Aug 2014 21:36:23 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5805B34FC for ; Sun, 17 Aug 2014 21:36:23 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7HLaNeE058449 for ; Sun, 17 Aug 2014 21:36:23 GMT (envelope-from kczekirda@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7HLaMLN058447 for svn-soc-all@FreeBSD.org; Sun, 17 Aug 2014 21:36:22 GMT (envelope-from kczekirda@FreeBSD.org) Date: Sun, 17 Aug 2014 21:36:22 GMT Message-Id: <201408172136.s7HLaMLN058447@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to kczekirda@FreeBSD.org using -f From: kczekirda@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272574 - soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Aug 2014 21:36:23 -0000 Author: kczekirda Date: Sun Aug 17 21:36:22 2014 New Revision: 272574 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272574 Log: disk selection TOFILE Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto Sun Aug 17 21:36:17 2014 (r272573) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto Sun Aug 17 21:36:22 2014 (r272574) @@ -31,6 +31,8 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/device.subr ############################################################ FUNCTIONS @@ -85,7 +87,7 @@ done FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space -if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" -z "$TOFILE" ]; then +if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" -a -z "$TOFILE" ]; then dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "No installation files were found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 bsdinstall netconfig || error NETCONFIG_DONE=yes @@ -110,6 +112,11 @@ Manual \"Manually Configure Partitions (Expert)\" \ Shell \"Open a shell and partition by hand\"" +if [ ! -z "$TOFILE" ]; then + PMODES="\ + Classic \"Choose disk for installation\"" +fi + CURARCH=$( uname -m ) case $CURARCH in amd64|i386) # Booting ZFS Supported @@ -145,6 +152,29 @@ fi bsdinstall mount || error ;; +"Classic") # only disk choise + disks= + debug= f_device_find "" $DEVICE_TYPE_DISK disks + f_device_sort_by name disks disks + + disk_check_list= + for disk in $disks; do + desc= + $disk get name name + $disk get desc desc + f_shell_escape "$desc" desc + f_getvar _${disk}_status:-off onoff + disk_check_list="$disk_check_list + $name '$desc' " + done + + exec 3>&1 + DISK=`echo "$disk_check_list" | xargs dialog --backtitle 'FreeBSD Installer' --title 'Target Selection' --menu 'Please select a disk to install FreeBSD:' 0 0 0 2>&1 1>&3` + if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi + exec 3>&- + + echo "PARTITIONS=\"$DISK { auto freebsd-ufs /}\"" >> "$TOFILE" + ;; "ZFS") # ZFS bsdinstall zfsboot || error bsdinstall mount || error @@ -154,7 +184,7 @@ ;; esac -if [ ! -z "$FETCH_DISTRIBUTIONS" && -z "$TOFILE" ]; then +if [ ! -z "$FETCH_DISTRIBUTIONS" -a -z "$TOFILE" ]; then ALL_DISTRIBUTIONS="$DISTRIBUTIONS" # Download to a directory in the new system as scratch space