From owner-freebsd-sysinstall@FreeBSD.ORG Mon Oct 7 11:06:53 2013 Return-Path: Delivered-To: freebsd-sysinstall@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C1D318E4 for ; Mon, 7 Oct 2013 11:06:53 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F8042848 for ; Mon, 7 Oct 2013 11:06:53 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r97B6rj7077874 for ; Mon, 7 Oct 2013 11:06:53 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r97B6r4e077872 for freebsd-sysinstall@FreeBSD.org; Mon, 7 Oct 2013 11:06:53 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 7 Oct 2013 11:06:53 GMT Message-Id: <201310071106.r97B6r4e077872@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-sysinstall@FreeBSD.org Subject: Current problem reports assigned to freebsd-sysinstall@FreeBSD.org X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2013 11:06:53 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/175730 sysinstall Segfault in bsdinstall(8) when no disks are present o bin/174475 sysinstall bsdinstall(8): should remember user input o bin/174473 sysinstall bsdinstall(8): cannot handle some or all partitions ot o bin/174472 sysinstall bsdinstall(8) partition editor is annoying to use when o bin/174471 sysinstall bsdinstall(8): does not newfs and cannot mount any non o bin/174470 sysinstall sysinstall(8): should be fixed to work with bsdinstall o bin/173301 sysinstall [patch] bsdinstall(8): default to SU instead of SU+J o bin/172905 sysinstall bsdinstall(8): Old mirroselect file in bdsinstall o bin/172847 sysinstall bsdinstall(8): missing boot loader location selection o bin/172846 sysinstall bsdinstall(8) - setting hostname o bin/171113 sysinstall bsdinstall(8): FreeBSD 9.1-beta1 installer refuses to o misc/170821 sysinstall sysinstall(1): unexpected directory name in 8,3-RELEAS o kern/170707 sysinstall bsdinstall(8) Partition editor (modify) option does no f bin/170264 sysinstall bsdinstall(8) into jail doesn't find FTP distribution o bin/169750 sysinstall bsdinstall(8): cannot run more than once with DHCP/SLA o bin/169748 sysinstall [patch] bsdinstall(8): when distfile fetch is complete o bin/168582 sysinstall [request] bsdinstall(8): Select 'server' or 'desktop' o bin/168314 sysinstall bsdinstall(8): 9.0 install "live CD" option can't crea o bin/168269 sysinstall comments on bsdinstall(8) o bin/168188 sysinstall bsdinstall(8) partitioner segmentation fault o bin/167222 sysinstall sysinstall(8): FreeBSD 8.3 corrupting MBR partition ta o kern/166801 sysinstall bsdinstall(8): FreeBSD install is apparently not writi o bin/166241 sysinstall [patch] Speedup and some improvements of sysinstall(8) o bin/165600 sysinstall sysinstall(8): 8.3 installation DVD asking for non exi s bin/164752 sysinstall [request] bsdinstall(8): No option of ZFS in FreeBSD 9 o bin/164399 sysinstall bsdinstall(8): 9.0 installer failures o bin/164294 sysinstall bsdinstall(8): FreeBSD 9.0-RELEASE bsdinstall dvd does o bin/164291 sysinstall bsdinstall(8): bsdinstall and filestetyem selection / o bin/164284 sysinstall bsdinstall(8): FreeBSD install assign incorrect dev as o bin/164281 sysinstall bsdinstall(8): please allow sysinstall as installer op o bin/164267 sysinstall bsdinstall(8) bugs when RE-installing to GPT partition o bin/164097 sysinstall bsdinstall(8): always installs GPT f bin/164094 sysinstall bsdinstall(8): installer progress over 100% o bin/163943 sysinstall bsdinstall(8) fails to detect CD device when booting w o bin/163123 sysinstall bsdinstall(8): IPV6 only errors connecting o bin/162605 sysinstall sysinstall(8) doesn't identify CD/DVD drives for the u o bin/162429 sysinstall bsdinstall(8): 9.x installer: selecting ZFS for the ro o bin/162428 sysinstall bsdinstall(8): should check available disk space from o bin/162364 sysinstall sysinstall(8): update sysinstall ftp mirror list for c o bin/162258 sysinstall sysinstall(8): long-time bugs o bin/162175 sysinstall [patch] bsdinstall(8): add keymap selection loop and t o bin/161929 sysinstall bsdinstall(8): (change partition editor screen default o bin/161928 sysinstall bsdinstall(8): (add option to enable 2 button mouse co o bin/161924 sysinstall bsdinstall(8): add msg box telling user to remove inst o bin/161923 sysinstall bsdinstall(8) games & ports install options o kern/161837 sysinstall [libdisk] [patch] sysinstall(8) has a 32 disk limit o bin/161720 sysinstall bsdinstall(8): partition editor does not put partition o bin/161547 sysinstall [patch] bsdinstall(8) should identify wireless network f bin/161113 sysinstall bsdinstall(8): 9.0-BETA3: overwrites Win*-bootcodes wi o bin/161101 sysinstall bsdinstall(8): 9.0-BETA3: partition editor: UFS-option o bin/161100 sysinstall bsdinstall(8): 9.0-BETA3: Add User but no Add Group o bin/161056 sysinstall bsdinstall(8): could allow full control over newfs arg o bin/161055 sysinstall bsdinstall(8): partitioner should auto-populate GPT la f bin/161054 sysinstall bsdinstall(8): partitioner should list valid "type"s o bin/161053 sysinstall bsdinstall(8): network setup dialog is hard to navigat o bin/161052 sysinstall bsdinstall(8): should be consistent about saving confi o bin/161050 sysinstall bsdinstall(8): should use new syntax for IPv4 in rc.co o bin/161049 sysinstall bsdinstall(8): could try to tell if SSDs support TRIM o bin/161047 sysinstall [patch] bsdinstall(8): should not run on vt0 o bin/157635 sysinstall sysinstall(8): "none" Do not install a boot manager - o conf/157189 sysinstall bsdinstall(8): Default /etc/sysctl.conf should be remo o bin/157117 sysinstall sysinstall(8): Add ftp4.se.freebsd.org to list of IPv6 o bin/154788 sysinstall sysinstall(8) crashes if no network interface found o bin/154613 sysinstall sysinstall(8) does not rescan USB automatically o bin/150995 sysinstall sysinstall(8): corruption of partition table s bin/150237 sysinstall sysinstall(8): Suggestion: installer should suggest th o bin/148805 sysinstall [hang] FreeBSD 7.2, 8.0, and 9.0 hang during install a f bin/148220 sysinstall sysinstall(8): 9.0-current gets "Cannot resolv hostnam o bin/148201 sysinstall sysinstall(8): core dump (Error 10) while trying to in o bin/148053 sysinstall sysinstall(8) labeling o bin/146299 sysinstall sysinstall(8): cannot create slice o bin/145735 sysinstall sysinstall(8) trashes Vista-created partition tables o bin/145027 sysinstall Remove all sysinstall(8) references to floppy and slip o bin/142867 sysinstall sysinstall(8): in a custom installation re-entering th o misc/142335 sysinstall Download of Release 8.0 LIVE is NOT a "live" from CD p o bin/140972 sysinstall sysintall(8): 8.0-RELEASE-i386-memstick Fixit broken - o bin/140843 sysinstall sysinstall(8): cannot software install from usb o bin/140842 sysinstall sysinstall(8): destroyed ncurses interface with FBSD8. o bin/140595 sysinstall [request] sysinstall(8): Replace "Country Selection" w o bin/139181 sysinstall WITHOUT_LEGACY_CONSOLE=1 breaks sysinstall(8) o bin/138423 sysinstall sysinstall(8): Installer (and sade) get wrong number o o bin/138025 sysinstall sysinstall(8) fails to create big partition o bin/137864 sysinstall [patch] sysinstall(8): add possibility to shutdown/pow o bin/137713 sysinstall sysinstall(8): installer partition editor generates in o bin/135317 sysinstall install.cfg feature request o bin/134425 sysinstall sysinstall(8) custom distributions select all and dese o bin/132114 sysinstall [patch] add new 'docs' virtual category to sysinstall o bin/130655 sysinstall sysinstall(8): no IPV4 if answer "no" when "Do you wan o bin/129762 sysinstall sysinstall(8) doesn't seem to support GPT for EFI boar o bin/126819 sysinstall sysinstall(8) During install if initial name look-up f s bin/123304 sysinstall sysinstall(8): missing sensible and user friendly prog o bin/121503 sysinstall sysinstall(8): 7.0 upgrade doesn't let me mount all of a bin/121124 sysinstall sysinstall(8): FreeBSD 6.3 installation deletes MBR pa o bin/119077 sysinstall [patch] sysinstall(8) - reading packages from index is o bin/118449 sysinstall sysinstall(8): Installer failing dns lookups o kern/118021 sysinstall [keyboard] 7.0 Beta 2 sysinstall keyboard emits contro o bin/113682 sysinstall [patch] sysinstall(8) warns for invalid geometry which o bin/112757 sysinstall sysinstall(8): sysinstall(8): in the FDISK tool we can o bin/110151 sysinstall sysinstall(8): sysinstall(8) don't respects install ro o bin/108191 sysinstall sysinstall(8): Disklabel editor help text (by F1 key) o bin/107830 sysinstall sysinstall(8): Change Units (Z) in fdisk doesn't work o bin/102498 sysinstall sysinstall(8): Cursor doesn't track sysinstall hilight a bin/101762 sysinstall sysinstall(8) does not obey /usr/ports symlink while i o bin/97108 sysinstall sysinstall(8): write failure on transfer (wrote -1 byt o bin/93275 sysinstall sysinstall(8): Failure to install after restarting ins o bin/90656 sysinstall sysinstall(8): 6.0-RELEASE (i386) cannot be installed o bin/88826 sysinstall sysinstall(8): sysinstall infinity wait for da0 s bin/86859 sysinstall sysinstall(8): Installer should ask about Linux earlie o bin/86665 sysinstall sysinstall(8): sysinstall binary upgrade clobbers name o bin/86454 sysinstall sysinstall(8): sysinstall terminates with signal 10 if o bin/80117 sysinstall sysinstall(8): [patch] smbfs install option for sysins o bin/79910 sysinstall sysinstall(8): Cannot escape from failed port/package o bin/79840 sysinstall sysinstall(8): Partitioning and formating a new disk f o bin/79621 sysinstall sysinstall(8): sysinstall(8) does not create a device o bin/78964 sysinstall sysinstall(8): can not write labels to hdd on installa o bin/77001 sysinstall sysinstall(8): sysinstall binary upgrade clobbers /etc s bin/73617 sysinstall sysinstall(8): fdisk editor unmarks active partition o bin/73410 sysinstall sysinstall(8): Sysinstall could not allocate disklabel o bin/72895 sysinstall sysinstall(8): Sysinstall generates invalid partition o bin/70002 sysinstall sysinstall(8): fails to locate FTP dirs if the OS has o bin/69986 sysinstall sysinstall(8): [patch] no job control in fixit shell o o bin/69942 sysinstall sysinstall(8): sysinstall changes /etc/rc.conf after i o bin/69723 sysinstall sysinstall(8): [request] allow to continue from packag o bin/65774 sysinstall sysinstall(8): cannot run repair disk when booted from o bin/62702 sysinstall sysinstall(8): backup of /etc and /root during sysinst o bin/62367 sysinstall sysinstall(8): 5.2.1-RC installation problems o bin/61890 sysinstall sysinstall(8): fdisk(8) uses incorrect calculations fo o bin/61603 sysinstall sysinstall(8): wrong geometry guessed o bin/60632 sysinstall sysinstall(8): UI bug in partition label screen in sys o bin/53341 sysinstall sysinstall(8): [patch] dump frequency in sysinstall is o bin/53131 sysinstall sysinstall(8): "ALL" could not turn check BOXes ON at o bin/48989 sysinstall sysinstall(8): Sysinstall's partition editor gets con s bin/48341 sysinstall sysinstall(8): changes the active slice flag when it p o bin/46905 sysinstall sysinstall(8): FreeBSD 5.x cannot be installed from mu o bin/46235 sysinstall sysinstall(8): NTP servers for Finland require updatin o bin/45608 sysinstall sysinstall(8): install should config all ether devices o bin/44915 sysinstall sysinstall(8): 'choose installation media' choose CD-R o bin/42162 sysinstall sysinstall(8): after restart, installation crashes, md o bin/42022 sysinstall sysinstall(8): non-interactive mode prompts when only o bin/41949 sysinstall sysinstall(8): sysinstall sorts /etc/rc.conf during ne o bin/41850 sysinstall sysinstall(8): sysinstall fails to create root filesys o bin/40260 sysinstall sysinstall(8): hang when detecting devices (No CD/DVD s conf/39580 sysinstall sysinstall(8): [request] more secure mount options o bin/38854 sysinstall sysinstall(8): resetting during setup causes the targe o bin/38610 sysinstall sysinstall(8): should be able to mount ISO images on D o bin/38478 sysinstall sysinstall(8): In Choose Distributions screen, it's di o bin/38057 sysinstall sysinstall(8): "install" document doesn't display corr o bin/38056 sysinstall sysinstall(8): User (creation)'s "Member groups" item o bin/38055 sysinstall sysinstall(8): Groups (creation) item should be before o bin/37710 sysinstall sysinstall(8): LAN interface in wrong state after atte o kern/36916 sysinstall [libdisk] [patch] DOS active partition flag lost in li o bin/35400 sysinstall sysinstall(8): sysinstall could improve manipulation o a bin/32375 sysinstall sysinstall(8): sysinstall doesn't respect User generat o bin/31363 sysinstall sysinstall(8): "partition editor" silently corrects pa a bin/30737 sysinstall sysinstall(8): sysinstall leaks file descriptors on re o bin/30517 sysinstall sysinstall(8): using sysinstall with install.cfg has n o bin/29375 sysinstall sysinstall(8): disk editor gets confused by slices tha o bin/27216 sysinstall sysinstall(8): can not get to shell prompt from serial a bin/23402 sysinstall sysinstall(8): upgrade ought to check partition sizes o bin/20282 sysinstall sysinstall(8): sysinstall does not recover some /etc f o bin/16948 sysinstall sysinstall(8): sysinstall/disklabel: bad partition tab o bin/15038 sysinstall sysinstall(8): easy to not notice that selection lists o bin/14318 sysinstall sysinstall(8): sysinstall upon install has some counte o bin/8867 sysinstall sysinstall(8): [patch] /stand/sysinstall core dumps (s s bin/7232 sysinstall sysinstall(8): suggestion for FreeBSD installation dia 165 problems total. From owner-freebsd-sysinstall@FreeBSD.ORG Fri Oct 11 21:20:02 2013 Return-Path: Delivered-To: freebsd-sysinstall@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 463D7408 for ; Fri, 11 Oct 2013 21:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A41624BE for ; Fri, 11 Oct 2013 21:20:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BLK18c025184 for ; Fri, 11 Oct 2013 21:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r9BLK1pe025183; Fri, 11 Oct 2013 21:20:01 GMT (envelope-from gnats) Date: Fri, 11 Oct 2013 21:20:01 GMT Message-Id: <201310112120.r9BLK1pe025183@freefall.freebsd.org> To: freebsd-sysinstall@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: bin/161547: commit references a PR X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Oct 2013 21:20:02 -0000 The following reply was made to PR bin/161547; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/161547: commit references a PR Date: Fri, 11 Oct 2013 21:12:55 +0000 (UTC) Author: dteske Date: Fri Oct 11 21:12:48 2013 New Revision: 256347 URL: http://svnweb.freebsd.org/changeset/base/256347 Log: Incorporate PR bin/161547 to detect when an interface is wireless. Patch from PR modified slightly for whitespace and style. PR: bin/161547 Submitted by: Warren Block Reviewed by: Allan Jude Approved by: re (glebius) Modified: head/usr.sbin/bsdinstall/scripts/netconfig Modified: head/usr.sbin/bsdinstall/scripts/netconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig Fri Oct 11 20:53:25 2013 (r256346) +++ head/usr.sbin/bsdinstall/scripts/netconfig Fri Oct 11 21:12:48 2013 (r256347) @@ -41,11 +41,19 @@ DIALOG_TAGS="" : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +# Do a dirty check to see if this a wireless interface -- there should be a +# better way +is_wireless_if() { + ifconfig $1 | grep -q 'media: IEEE 802.11 Wireless' +} + for IF in `ifconfig -l`; do test "$IF" = "lo0" && continue (ifconfig -g wlan | egrep -wq $IF) && continue INTERFACES="$INTERFACES $IF" DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc` + is_wireless_if $IF && echo $DESC | + grep -iqv wireless && DESC="Wireless $DESC" DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\"" done @@ -63,10 +71,8 @@ exec 3>&- : > $BSDINSTALL_TMPETC/._rc.conf.net -# Do a dirty check to see if this a wireless interface -- there should be a -# better way IFCONFIG_PREFIX="" -if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then +if is_wireless_if $INTERFACE; then NEXT_WLAN_IFACE=wlan0 # XXX echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/._rc.conf.net IFCONFIG_PREFIX="WPA " _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-sysinstall@FreeBSD.ORG Fri Oct 11 23:20:01 2013 Return-Path: Delivered-To: freebsd-sysinstall@smarthost.ysv.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 ESMTP id 3A354944 for ; Fri, 11 Oct 2013 23:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 258152AA9 for ; Fri, 11 Oct 2013 23:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BNK1St065052 for ; Fri, 11 Oct 2013 23:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r9BNK01g065043; Fri, 11 Oct 2013 23:20:00 GMT (envelope-from gnats) Date: Fri, 11 Oct 2013 23:20:00 GMT Message-Id: <201310112320.r9BNK01g065043@freefall.freebsd.org> To: freebsd-sysinstall@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: bin/161547: commit references a PR X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Oct 2013 23:20:01 -0000 The following reply was made to PR bin/161547; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/161547: commit references a PR Date: Fri, 11 Oct 2013 23:12:16 +0000 (UTC) Author: dteske Date: Fri Oct 11 23:12:05 2013 New Revision: 256361 URL: http://svnweb.freebsd.org/changeset/base/256361 Log: MFC revisions 256321-256323,256331,256333,256335,256343: Bring in a new zfsboot auto script for performing automatic setup of a boot pool (optionally encrypted) with many other options, validations, features. Originally submitted by Allan Jude; modified in collaboration. MFC revisions 256325,256330,256345: Rewrite the keymap selection menu to display keymaps and provide a test mechanism. Test mechanism originally submitted by Warren Block; modified. MFC r256347: Prominently display "Wireless" for each wireless network interface. Part of PR bin/161547; submitted by Warren Block; slightly modified. MFC r256348: Remove the dumpdev configuration dialog, merge it into the regular services configuration and enable it by default. Originally submitted by Allan Jude; slightly modified. PR: bin/161547 Submitted by: Allan Jude, Warren Block In collaboration with: Allan Jude Approved by: re (glebius) Added: stable/10/usr.sbin/bsdconfig/share/keymap.subr - copied unchanged from r256325, head/usr.sbin/bsdconfig/share/keymap.subr stable/10/usr.sbin/bsdinstall/scripts/zfsboot - copied unchanged from r256343, head/usr.sbin/bsdinstall/scripts/zfsboot Modified: stable/10/usr.sbin/bsdconfig/include/messages.subr stable/10/usr.sbin/bsdconfig/share/Makefile stable/10/usr.sbin/bsdconfig/share/device.subr stable/10/usr.sbin/bsdconfig/share/dialog.subr stable/10/usr.sbin/bsdconfig/share/strings.subr stable/10/usr.sbin/bsdconfig/share/variable.subr stable/10/usr.sbin/bsdinstall/bsdinstall stable/10/usr.sbin/bsdinstall/scripts/Makefile stable/10/usr.sbin/bsdinstall/scripts/auto stable/10/usr.sbin/bsdinstall/scripts/config stable/10/usr.sbin/bsdinstall/scripts/keymap stable/10/usr.sbin/bsdinstall/scripts/netconfig stable/10/usr.sbin/bsdinstall/scripts/services Directory Properties: stable/10/usr.sbin/bsdconfig/ (props changed) stable/10/usr.sbin/bsdinstall/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/include/messages.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/include/messages.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -201,6 +201,7 @@ msg_lithuania="Lithuania" msg_loading_of_dependent_package_failed="Loading of dependent package %s failed" msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." +msg_looking_for_keymap_files="Looking for keymap files..." msg_looking_up_host="Looking up host %s" msg_mail_desc="Electronic mail packages and utilities." msg_main_menu="Main Menu" Modified: stable/10/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/Makefile Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/Makefile Fri Oct 11 23:12:05 2013 (r256361) @@ -5,8 +5,9 @@ NO_OBJ= SUBDIR= media packages FILESDIR= ${SHAREDIR}/bsdconfig -FILES= common.subr device.subr dialog.subr mustberoot.subr \ - script.subr strings.subr struct.subr sysrc.subr variable.subr +FILES= common.subr device.subr dialog.subr keymap.subr \ + mustberoot.subr script.subr strings.subr struct.subr \ + sysrc.subr variable.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: stable/10/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -49,6 +49,7 @@ f_struct_define DEVICE \ desc \ devname \ type \ + capacity \ enabled \ init \ get \ @@ -114,7 +115,7 @@ f_device_try() } # f_device_register $name $desc $devname $type $enabled $init_function \ -# $get_function $shutdown_function $private +# $get_function $shutdown_function $private $capacity # # Register a device. A `structure' (see struct.subr) is created with the name # device_$name (so make sure $name contains only alpha-numeric characters or @@ -128,6 +129,7 @@ f_device_register() { local name="$1" desc="$2" devname="$3" type="$4" enabled="$5" local init_func="$6" get_func="$7" shutdown_func="$8" private="$9" + local capacity="${10}" f_struct_new DEVICE "device_$name" || return $FAILURE device_$name set name "$name" @@ -139,6 +141,7 @@ f_device_register() device_$name set get "$get_func" device_$name set shutdown "$shutdown_func" device_$name set private "$private" + device_$name set capacity "$capacity" # Scan our global register to see if it needs ammending local dev found= @@ -196,7 +199,7 @@ f_device_get_all() f_dprintf "Found a network device named %s" "$devname" f_device_register $devname \ "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \ - f_media_init_network "" f_media_shutdown_network "" + f_media_init_network "" f_media_shutdown_network "" -1 done # Next, try to find all the types of devices one might use @@ -208,6 +211,10 @@ f_device_get_all() n=$(( $n + 1 )) # Get the desc, type, and max (with debugging disabled) # NOTE: Bypassing f_device_name_get() for efficiency + # ASIDE: This would be equivalent to the following: + # debug= f_device_name_get $dev desc + # debug= f_device_name_get $dev type + # debug= f_device_name_get $dev max debug= f_getvar _device_desc$n desc debug= f_getvar _device_type$n type debug= f_getvar _device_max$n max @@ -222,7 +229,8 @@ f_device_get_all() f_device_register "${devname##*/}" "$desc" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" \ "$devname" ;; @@ -232,7 +240,8 @@ f_device_get_all() "$devname" $DEVICE_TYPE_FLOPPY 1 \ f_media_init_floppy \ f_media_get_floppy \ - f_media_shutdown_floppy "" + f_media_shutdown_floppy "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a floppy device for %s" \ "$devname" ;; @@ -241,7 +250,8 @@ f_device_get_all() f_device_register "${devname##*/}" "$desc" \ "$devname" $DEVICE_TYPE_USB 1 \ f_media_init_usb f_media_get_usb \ - f_media_shutdown_usb "" + f_media_shutdown_usb "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a USB disk for %s" "$devname" ;; esac @@ -254,7 +264,8 @@ f_device_get_all() f_device_register "${devname##*/}" "ISO9660 file system" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" "$devname" done @@ -281,7 +292,8 @@ f_device_get_all() "md(4) vnode file system" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" "$devname" ;; esac @@ -313,8 +325,13 @@ f_device_get_all() continue fi - f_device_register "$diskname" "" \ - "/dev/$diskname" $DEVICE_TYPE_DISK 0 + # Try and find its description + f_device_desc "$diskname" $DEVICE_TYPE_DISK desc + + f_device_register "$diskname" "$desc" \ + "/dev/$diskname" $DEVICE_TYPE_DISK 0 \ + "" "" "" "" \ + "$( f_device_capacity "$diskname" )" f_dprintf "Found a disk device named %s" "$diskname" # Look for existing partitions to register @@ -327,7 +344,8 @@ f_device_get_all() f_device_register "$slice" "" \ "/dev/$slice" $DEVICE_TYPE_DOS 1 \ f_media_init_dos f_media_get_dos \ - f_media_shutdown_dos "" + f_media_shutdown_dos "" \ + "$( f_device_capacity "/dev/$slice" )" f_dprintf "Found a DOS partition %s" "$slice" ;; 0xa5) # FreeBSD partition @@ -347,7 +365,9 @@ f_device_get_all() $DEVICE_TYPE_UFS 1 \ f_media_init_ufs \ f_media_get_ufs \ - f_media_shutdown_ufs "" + f_media_shutdown_ufs "" \ + "$( f_device_capacity \ + "$/dev/$part" )" f_dprintf "Found a UFS partition %s" \ "$part" done # parts @@ -379,10 +399,27 @@ f_device_name_get() case "$__prop" in type|desc|max) : good ;; *) return $FAILURE; esac + # + # Attempt to create an alternate-form of $__name that contains the + # first contiguous string of numbers replaced with `%d' for comparison + # against stored pattern names (see MAIN). + # + local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname= + if [ "$__left" != "$__name" ]; then + # Chop leading digits from right 'til we hit first non-digit + while :; do + case "$__right" in + [0-9]*) __right="${__right#[0-9]}" ;; + *) break + esac + done + __dname="${__left}%d$__right" + fi + [ "$__type" = "$DEVICE_TYPE_ANY" ] && __type= for __dev in $DEVICE_NAMES; do __n=$(( $__n + 1 )) - [ "$__dev" = "$__name" ] || continue + [ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] || continue f_getvar _device_type$__n __devtype [ "${__type:-$__devtype}" = "$__devtype" ] || continue f_getvar _device_$__prop$__n $__var_to_set @@ -463,6 +500,39 @@ f_device_desc() fi fi + # + # For disks, attempt to return camcontrol(8) descriptions. + # Otherwise fall through to below static list. + # + f_have camcontrol && + [ "${__type:-$DEVICE_TYPE_DISK}" = "$DEVICE_TYPE_DISK" ] && + __cp=$( camcontrol devlist 2> /dev/null | awk -v disk="$__name" ' + $0~"(\\(|,)"disk"(,|\\))" { + if (!match($0, "<[^>]+>")) next + print substr($0, RSTART+1, RLENGTH-2) + found = 1 + exit + } + END { exit ! found } + ' ) && setvar "$__var_to_set" "$__cp" && return $SUCCESS + + # + # Attempt to create an alternate-form of $__name that contains the + # first contiguous string of numbers replaced with `%d' for comparison + # against stored pattern names (see MAIN). + # + local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname= + if [ "$__left" != "$__name" ]; then + # Chop leading digits from right 'til we hit first non-digit + while :; do + case "$__right" in + [0-9]*) __right="${__right#[0-9]}" ;; + *) break + esac + done + __dname="${__left}%d$__right" + fi + local __dev __devtype __n=0 for __dev in $DEVICE_NAMES; do __n=$(( $__n + 1 )) @@ -472,11 +542,8 @@ f_device_desc() __devname=$( f_substr "$__name" 0 ${#__dev} ) [ "$__devname" = "$__dev" ] || continue else - __devname="${__name%%[0-9]*}" - __devunit="${__name#$__devname}" - __devunit="${__devunit%%[!0-9]*}" - __devname=$( printf "$__dev" $__devunit ) - [ "$__devname" = "$__name" ] || continue + [ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] || + continue fi debug= f_getvar _device_desc$__n $__var_to_set return $? @@ -655,6 +722,25 @@ f_device_menu() return $retval } +# f_device_capacity $device [$var_to_set] +# +# Return the capacity of $device in bytes. +# +f_device_capacity() +{ + local __dev="$1" __var_to_set="$2" + local __bytes + + __bytes=$( diskinfo -v "$__dev" 2> /dev/null | + awk '/# mediasize in bytes/{print $1}' ) || __bytes=-1 + + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "$__bytes" + else + echo "$__bytes" + fi +} + # # Short-hand # @@ -680,6 +766,7 @@ f_disk "ipsd%d" "IBM ServeRAID RAID ar f_disk "mfid%d" "LSI MegaRAID SAS array" 4 f_disk "mlxd%d" "Mylex RAID disk" 4 f_disk "twed%d" "3ware ATA RAID array" 4 +f_disk "vtbd%d" "VirtIO Block Device" 16 f_floppy "fd%d" "Floppy Drive unit A" 4 f_serial "cuau%d" "%s on device %s (COM%d)" 16 f_usb "da%da" "USB Mass Storage Device" 16 Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -415,8 +415,8 @@ f_dialog_size_constrain() if [ "$debug" ]; then # Print final constrained values to debugging - f_quietly f_getvar "$__var_height" - f_quietly f_getvar "$__var_width" + [ "$__var_height" ] && f_quietly f_getvar "$__var_height" + [ "$__var_width" ] && f_quietly f_getvar "$__var_width" fi return $__retval # success if no debug warnings were printed @@ -532,10 +532,10 @@ f_dialog_menu_constrain() fi if [ "$debug" ]; then - # Print final constrained values to debuggin - f_quietly f_getvar "$__var_height" - f_quietly f_getvar "$__var_width" - f_quietly f_getvar "$__var_rows" + # Print final constrained values to debugging + [ "$__var_height" ] && f_quietly f_getvar "$__var_height" + [ "$__var_width" ] && f_quietly f_getvar "$__var_width" + [ "$__var_rows" ] && f_quietly f_getvar "$__var_rows" fi return $__retval # success if no debug warnings were printed @@ -2044,6 +2044,7 @@ f_dialog_menutag2index_with_help() f_dialog_init() { DIALOG_SELF_INITIALIZE= + USE_DIALOG=1 # # Clone terminal stdout so we can redirect to it from within sub-shells @@ -2087,7 +2088,7 @@ f_dialog_init() # # Process `-X' command-line option # - [ "$USE_XDIALOG" ] && DIALOG=Xdialog + [ "$USE_XDIALOG" ] && DIALOG=Xdialog USE_DIALOG= # # Sanity check, or die gracefully Copied: stable/10/usr.sbin/bsdconfig/share/keymap.subr (from r256325, head/usr.sbin/bsdconfig/share/keymap.subr) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bsdconfig/share/keymap.subr Fri Oct 11 23:12:05 2013 (r256361, copy of r256325, head/usr.sbin/bsdconfig/share/keymap.subr) @@ -0,0 +1,262 @@ +if [ ! "$_KEYMAP_SUBR" ]; then _KEYMAP_SUBR=1 +# +# Copyright (c) 2013 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." keymap.subr +f_include $BSDCFG_SHARE/struct.subr + +############################################################ CONFIGURATION + +# +# Defaults taken from usr.sbin/kbdmap/kbdmap.h +# +: ${DEFAULT_LANG:=en} +: ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} + +############################################################ GLOBALS + +KEYMAPS= + +# A "keymap" from kbdmap's point of view +f_struct_define KEYMAP \ + desc \ + keym \ + mark + +# +# Default behavior is to call f_keymap_get_all() automatically when loaded. +# +: ${KEYMAP_SELF_SCAN_ALL=1} + +############################################################ FUNCTIONS + +# f_keymap_register $name $desc $keym $mark +# +# Register a keymap. A `structure' (see struct.subr) is created with the name +# keymap_$name (so make sure $name contains only alpha-numeric characters or +# the underscore, `_'). The remaining arguments after $name correspond to the +# propertise of the `KEYMAP' structure-type (defined above). +# +# If not already registered, the keymap is then appended to the KEYMAPS +# environment variable, a space-separated list of all registered keymaps. +# +f_keymap_register() +{ + local name="$1" desc="$2" keym="$3" mark="$4" + + f_struct_new KEYMAP "keymap_$name" || return $FAILURE + keymap_$name set desc "$desc" + keymap_$name set keym "$keym" + keymap_$name set mark "$mark" + + # Scan our global register to see if needs ammending + local k found= + for k in $KEYMAPS; do + [ "$k" = "$name" ] || continue + found=1 && break + done + [ "$found" ] || KEYMAPS="$KEYMAPS $name" + + return $SUCCESS +} + +# f_keymap_checkfile $keymap +# +# Check that $keymap is a readable kbdmap(5) file. Returns success if $keymap +# is a file, is readable, and exists in $DEFAULT_KEYMAP_DIR; otherwise failure. +# If debugging is enabled, an appropriate debug error message is printed if +# $keymap is not available. +# +f_keymap_checkfile() +{ + local keym="$1" + + # Fixup keymap if it doesn't already contain at least one `/' + [ "${keym#*/}" = "$keym" ] && keym="$DEFAULT_KEYMAP_DIR/$keym" + + # Short-cuts + [ -f "$keym" -a -r "$keym" ] && return $SUCCESS + f_debugging || return $FAILURE + + # Print an appropriate debug error message + if [ ! -e "$keym" ]; then + f_dprintf "%s: No such file or directory" "$keym" + elif [ ! -f "$keym" ]; then + f_dprintf "%s: Not a file!" "$keym" + elif [ ! -r "$keym" ]; then + f_dprintf "%s: Permission denied" "$keym" + fi + + return $FAILURE +} + +# f_keymap_get_all +# +# Get all keymap information for kbdmap(5) entries both in the database and +# loosely existing in $DEFAULT_KEYMAP_DIR. +# +f_keymap_get_all() +{ + local fname=f_keymap_get_all + local lang="${LC_ALL:-${LC_CTYPE:-${LANG:-$DEFAULT_LANG}}}" + [ "$lang" = "C" ] && lang="$DEFAULT_LANG" + + f_dprintf "%s: Looking for keymap files..." $fname + f_dialog_info "$msg_looking_for_keymap_files" + f_dprintf "DEFAULT_LANG=[%s]" "$DEFAULT_LANG" + + eval "$( awk -F: -v lang="$lang" -v lang_default="$DEFAULT_LANG" ' + BEGIN { + # en_US.ISO8859-1 -> en_..\.ISO8859-1 + dialect = lang + if (length(dialect) >= 6 && + substr(dialect, 3, 1) == "_") + dialect = substr(dialect, 1, 3) ".." \ + substr(dialect, 6) + printf "f_dprintf \"dialect=[%%s]\" \"%s\";\n", dialect + + # en_US.ISO8859-1 -> en + lang_abk = lang + if (length(lang_abk) >= 3 && + substr(lang_abk, 3, 1) == "_") + lang_abk = substr(lang_abk, 1, 2) + printf "f_dprintf \"lang_abk=[%%s]\" \"%s\";\n", + lang_abk + } + function find_token(buffer, token) + { + if (split(buffer, tokens, /,/) == 0) return 0 + found = 0 + for (t in tokens) + if (token == tokens[t]) { found = 1; break } + return found + } + function add_keymap(desc,mark,keym) + { + marks[keym] = mark + name = keym + gsub(/[^[:alnum:]_]/, "_", name) + gsub(/'\''/, "'\''\\'\'''\''", desc); + printf "f_keymap_checkfile %s && " \ + "f_keymap_register %s '\'%s\'' %s %u\n", + keym, name, desc, keym, mark + } + !/^[[:space:]]*(#|$)/ { + sub(/^[[:space:]]*/, "", $0) + keym = $1 + if (keym ~ /^(MENU|FONT)$/) next + lg = ($2 == "" ? lang_default : $2) + + # Match the entry and store the type of match we made + # as the mark value (so that if we make a better match + # later on with a higher mark, it overwrites previous) + + mark = marks[keym]; + if (find_token(lg, lang)) + add_keymap($3, 4, keym) # Best match + else if (mark <= 3 && find_token(lg, dialect)) + add_keymap($3, 3, keym) + else if (mark <= 2 && find_token(lg, lang_abk)) + add_keymap($3, 2, keym) + else if (mark <= 1 && find_token(lg, lang_default)) + add_keymap($3, 1, keym) + else if (mark <= 0) + add_keymap($3, 0, keym) + } + ' "$DEFAULT_KEYMAP_DIR/INDEX.${DEFAULT_KEYMAP_DIR##*/}" )" + + + # + # Look for keymaps not in database + # + local direntry keym name + set +f # glob + for direntry in "$DEFAULT_KEYMAP_DIR"/*; do + [ "${direntry##*.}" = ".kbd" ] || continue + keym="${direntry##*/}" + f_str2varname "$keym" name + f_struct keymap_$name && continue + f_keymap_checkfile "$keym" && + f_keymap_register $name "${keym%.*}" "$keym" 0 + f_dprintf "%s: not in kbdmap(5) database" "$keym" + done + + # + # Sort the items by their descriptions + # + f_dprintf "%s: Sorting keymap entries by description..." $fname + KEYMAPS=$( + for k in $KEYMAPS; do + echo -n "$k " + # NOTE: Translate '8x8' to '8x08' before sending to + # sort(1) so that things work out as we might expect. + debug= keymap_$k get desc | sed -e 's/8x8/8x08/g' + done | sort -k2 | awk '{ + printf "%s%s", (started ? " " : ""), $1; started = 1 + }' + ) + + return $SUCCESS +} + +# f_keymap_kbdcontrol $keymap +# +# Install keyboard map file from $keymap. +# +f_keymap_kbdcontrol() +{ + local keymap="$1" + + [ "$keymap" ] || return $SUCCESS + + # Fixup keymap if it doesn't already contain at least one `/' + [ "${keymap#*/}" = "$keymap" ] && keymap="$DEFAULT_KEYMAP_DIR/$keymap" + + [ "$USE_XDIALOG" ] || kbdcontrol -l "$keymap" +} + +############################################################ MAIN + +# +# Scan for keymaps unless requeted otherwise +# +f_dprintf "%s: KEYMAP_SELF_SCAN_ALL=[%s]" keymap.subr "$KEYMAP_SELF_SCAN_ALL" +case "$KEYMAP_SELF_SCAN_ALL" in +""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;; +*) f_keymap_get_all +esac + +f_dprintf "%s: Found %u keymap file(s)." keymap.subr \ + "$( set -- $KEYMAPS; echo $# )" + +f_dprintf "%s: Successfully loaded." keymap.subr + +fi # ! $_KEYMAP_SUBR Modified: stable/10/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -26,6 +26,11 @@ if [ ! "$_STRINGS_SUBR" ]; then _STRINGS # # $FreeBSD$ # +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + ############################################################ GLOBALS # @@ -319,6 +324,112 @@ f_shell_unescape() f_replaceall "$__string" "'\\''" "'" "$__var_to_set" } +# f_expand_number $string [$var_to_set] +# +# Unformat $string into a number, optionally to be stored in $var_to_set. This +# function follows the SI power of two convention. +# +# The prefixes are: +# +# Prefix Description Multiplier +# k kilo 1024 +# M mega 1048576 +# G giga 1073741824 +# T tera 1099511627776 +# P peta 1125899906842624 +# E exa 1152921504606846976 +# +# NOTE: Prefixes are case-insensitive. +# +# Upon successful completion, the value 0 is returned (or stored to +# $var_to_set); otherwise -1. Reasons for a -1 return include: +# +# Given $string contains no digits. +# An unrecognized prefix was given. +# Result too large to calculate. +# +f_expand_number() +{ + local __string="$1" __var_to_set="$2" + local __cp __num + + # Remove any leading non-digits + while :; do + __cp="$__string" + __string="${__cp#[!0-9]}" + [ "$__string" = "$__cp" ] && break + done + + # Return `-1' if string didn't contain any digits + if [ ! "$__string" ]; then + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + fi + + # Store the numbers + __num="${__string%%[!0-9]*}" + + # Shortcut + if [ $__num -eq 0 ]; then + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" 0 + else + echo 0 + fi + return $SUCCESS + fi + + # Remove all the leading numbers from the string to get at the prefix + while :; do + __cp="$__string" + __string="${__cp#[0-9]}" + [ "$__string" = "$__cp" ] && break + done + + # Test for invalid prefix + case "$__string" in + ""|[KkMmGgTtPpEe]*) : known prefix ;; + *) + # Unknown prefix + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + esac + + # Multiply the number out + case "$__string" in + [Kk]) __num=$(( $__num * 1024 )) ;; + [Mm]) __num=$(( $__num * 1048576 )) ;; + [Gg]) __num=$(( $__num * 1073741824 )) ;; + [Tt]) __num=$(( $__num * 1099511627776 )) ;; + [Pp]) __num=$(( $__num * 1125899906842624 )) ;; + [Ee]) __num=$(( $__num * 1152921504606846976 )) ;; + esac + if [ $__num -le 0 ]; then + # Arithmetic overflow + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + fi + + # Return the number + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" $__num + else + echo $__num + fi +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." strings.subr Modified: stable/10/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -205,6 +205,21 @@ f_netinteractive() f_getvar $VAR_NETINTERACTIVE value && [ "$value" ] } +# f_zfsinteractive() +# +# Has the user specifically requested the ZFS-portion of configuration and +# setup to be performed interactively? Returns success if the user has asked +# for the ZFS configuration to be done interactively even if perhaps overall +# non-interactive mode has been requested (by setting nonInteractive). +# +# Returns success if $zfsInteractive is set and non-NULL. +# +f_zfsinteractive() +{ + local value + f_getvar $VAR_ZFSINTERACTIVE value && [ "$value" ] +} + ############################################################ MAIN # @@ -240,6 +255,7 @@ f_variable_new VAR_IFCONFIG ifconfig_ f_variable_new VAR_IPADDR ipaddr f_variable_new VAR_IPV6ADDR ipv6addr f_variable_new VAR_IPV6_ENABLE ipv6_activate_all_interfaces +f_variable_new VAR_KEYMAP keymap f_variable_new VAR_MEDIA_TIMEOUT MEDIA_TIMEOUT f_variable_new VAR_MEDIA_TYPE mediaType f_variable_new VAR_NAMESERVER nameserver @@ -263,6 +279,7 @@ f_variable_new VAR_SLOW_ETHER slowEther f_variable_new VAR_TRY_DHCP tryDHCP f_variable_new VAR_TRY_RTSOL tryRTSOL f_variable_new VAR_UFS_PATH ufs +f_variable_new VAR_ZFSINTERACTIVE zfsInteractive # # Self-initialize unless requested otherwise Modified: stable/10/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/bsdinstall Fri Oct 11 23:12:05 2013 (r256361) @@ -28,6 +28,7 @@ : ${BSDINSTALL_LOG="/tmp/bsdinstall_log"}; export BSDINSTALL_LOG : ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC +: ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT : ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT @@ -35,5 +36,6 @@ VERB=${1:-auto}; shift [ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC" +[ -d "$BSDINSTALL_TMPBOOT" ] || mkdir -p "$BSDINSTALL_TMPBOOT" echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG" exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$BSDINSTALL_LOG" Modified: stable/10/usr.sbin/bsdinstall/scripts/Makefile ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 23:12:05 2013 (r256361) @@ -2,7 +2,7 @@ SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ - rootpass script services time umount wlanconfig + rootpass script services time umount wlanconfig zfsboot BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 23:12:05 2013 (r256361) @@ -93,24 +93,46 @@ fi rm $PATH_FSTAB touch $PATH_FSTAB -dialog --backtitle "FreeBSD Installer" --title "Partitioning" --extra-button \ - --extra-label "Manual" --ok-label "Guided" --cancel-label "Shell" \ - --yesno "Would you like to use the guided partitioning tool (recommended for beginners) or to set up partitions manually (experts)? You can also open a shell and set up partitions entirely by hand." 0 0 +PMODES="\ +Guided \"Partitioning Tool (Recommended for Beginners)\" \ +Manual \"Manually Configure Partitions (Expert)\" \ +Shell \"Open a shell and partition by hand\"" + +CURARCH=$( uname -m ) +case $CURARCH in + amd64|i386) # Booting ZFS Supported + PMODES="$PMODES ZFS \"Automatic Root-on-ZFS (Experimental)\"" + ;; + *) # Booting ZFS Unspported + ;; +esac -case $? in -0) # Guided +exec 3>&1 +PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ + --title "Partitioning" \ + --menu "How would you like to partition your disk?" \ + 0 0 0 2>&1 1>&3` +if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi +exec 3>&- + +case "$PARTMODE" in +"Guided") # Guided bsdinstall autopart || error bsdinstall mount || error ;; -1) # Shell +"Shell") # Shell clear echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." sh 2>&1 ;; -3) # Manual +"Manual") # Manual bsdinstall partedit || error bsdinstall mount || error ;; +"ZFS") # ZFS + bsdinstall zfsboot || error + bsdinstall mount || error + ;; *) error ;; Modified: stable/10/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/config Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/config Fri Oct 11 23:12:05 2013 (r256361) @@ -31,6 +31,11 @@ rm $BSDINSTALL_TMPETC/rc.conf.* cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc +cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf +rm $BSDINSTALL_TMPBOOT/loader.conf.* + +cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot + # Set up other things from installed config chroot $BSDINSTALL_CHROOT /usr/bin/newaliases Modified: stable/10/usr.sbin/bsdinstall/scripts/keymap ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/keymap Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/keymap Fri Oct 11 23:12:05 2013 (r256361) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,11 +26,212 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/keymap.subr +f_include $BSDCFG_SHARE/sysrc.subr + +############################################################ CONFIGURATION + +# +# Default file to store keymap selection in +# +: ${KEYMAPFILE:=$BSDINSTALL_TMPETC/rc.conf.keymap} + +# +# Default path to keymap INDEX containing descriptions +# +: ${MAPDESCFILE:=/usr/share/syscons/keymaps/INDEX.keymaps} + +############################################################ GLOBALS + +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# +hline_arrows_tab_enter="Press arrows, TAB or ENTER" +msg_continue_with_keymap="Continue with %s keymap" +msg_default="default" +msg_error="Error" +msg_freebsd_installer="FreeBSD Installer" +msg_keymap_menu_text="The system console driver for FreeBSD defaults to standard \"US\"\nkeyboard map. Other keymaps can be chosen below." +msg_keymap_selection="Keymap Selection" +msg_ok="OK" +msg_select="Select" +msg_test_keymap="Test %s keymap" +msg_test_the_currently_selected_keymap="Test the currently selected keymap" +msg_test_the_keymap_by_typing="Test the keymap by typing letters, numbers, and symbols. Characters\nshould match labels on the keyboard keys. Press Enter to stop testing." + +############################################################ FUNCTIONS + +# dialog_keymap_test $keymap +# +# Activate $keymap and display an input box (without cancel button) for the +# user to test keyboard input and return. Always returns success. +# +dialog_keymap_test() +{ + local keym="$1" + local title= # Calculated below + local btitle= # Calculated below + local prompt="$msg_test_the_keymap_by_typing" + local hline= + + # Attempt to activate the keymap + if [ "$keym" ]; then + local err + err=$( f_keymap_kbdcontrol "$keym" 2>&1 > /dev/null ) + if [ "$err" ]; then + f_dialog_title "$msg_error" + f_dialog_msgbox "$err" + f_dialog_title_restore + return $FAILURE + fi + fi + + f_dialog_title "$( printf "$msg_test_keymap" "${keym:-$msg_default}" )" + title="$DIALOG_TITLE" + btitle="$DIALOG_BACKTITLE" + f_dialog_title_restore + + local height width + f_dialog_inputbox_size height width \ + "$title" "$btitle" "$prompt" "" "$hline" + + $DIALOG \ + --title "$title" \ + --backtitle "$btitle" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --no-cancel \ + --inputbox "$prompt" \ + $height $width \ + 2>/dev/null >&$DIALOG_TERMINAL_PASSTHRU_FD -kbdcontrol -d >/dev/null 2>&1 -if [ $? -eq 0 ]; then - dialog --backtitle "FreeBSD Installer" --title "Keymap Selection" \ - --yesno "Would you like to set a non-default key mapping for your keyboard?" 0 0 || exit 0 - exec 3>&1 - kbdmap 2>&1 1>&3 | grep 'keymap=' > $BSDINSTALL_TMPETC/rc.conf.keymap + return $DIALOG_OK +} + +############################################################ MAIN + +# +# Initialize +# +f_dialog_title "$msg_keymap_selection" +f_dialog_backtitle "$msg_freebsd_installer" + +# +# Die immediately if we can't dump the current keyboard map +# +#error=$( kbdcontrol -d 2>&1 > /dev/null ) || f_die $FAILURE "%s" "$error" + +# Capture Ctrl-C for clean-up +trap 'rm -f $KEYMAPFILE; exit $FAILURE' SIGINT + +# Get a value from rc.conf(5) as initial value (if not being scripted) +f_getvar $VAR_KEYMAP keymap +if [ ! "$keymap" ]; then + keymap=$( f_sysrc_get keymap ) + case "$keymap" in [Nn][Oo]) keymap="";; esac fi + +# +# Loop until the user has finalized their selection (by clicking the +# [relabeled] Cancel button). +# +width=67 first_pass=1 back_from_testing= +[ "$USE_XDIALOG" ] && width=70 +prompt="$msg_keymap_menu_text" +hline="$hline_arrows_tab_enter" +while :; do + # *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"