From owner-svn-src-user@FreeBSD.ORG Sun Jan 2 01:26:51 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0018106564A; Sun, 2 Jan 2011 01:26:51 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A451A8FC12; Sun, 2 Jan 2011 01:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p021QpXp027870; Sun, 2 Jan 2011 01:26:51 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p021QpPv027868; Sun, 2 Jan 2011 01:26:51 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101020126.p021QpPv027868@svn.freebsd.org> From: Doug Barton Date: Sun, 2 Jan 2011 01:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216879 - user/dougb/portmaster/files X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 01:26:51 -0000 Author: dougb Date: Sun Jan 2 01:26:51 2011 New Revision: 216879 URL: http://svn.freebsd.org/changeset/base/216879 Log: Document the various changes for the 3.6 version including the new support for -n/-y Re-sort some of the option descriptions to match usage() in the script, and explicitly show the grouping of common flags and features. Expand the descriptions of a few options, and otherwise improve the markup Update the copyright Modified: user/dougb/portmaster/files/portmaster.8 Modified: user/dougb/portmaster/files/portmaster.8 ============================================================================== --- user/dougb/portmaster/files/portmaster.8 Sat Jan 1 22:22:57 2011 (r216878) +++ user/dougb/portmaster/files/portmaster.8 Sun Jan 2 01:26:51 2011 (r216879) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006-2010 Doug Barton dougb@FreeBSD.org +.\" Copyright (c) 2006-2011 Doug Barton dougb@FreeBSD.org .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2010 +.Dd January 1, 2011 .Dt PORTMASTER 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd manage your ports without external databases or languages .Sh SYNOPSIS Common Flags: -.Op Fl -force-config CGHgntvw [B|b] [f|i] [D|d] +.Op Fl -force-config CGHKgntvw [B|b] [f|i] [D|d] .Op Sy [[--packages|-P]|[--packages-only|-PP]] | [--packages-build] .Op Fl -packages-if-newer .Op Fl -delete-build-only @@ -68,7 +68,8 @@ and/or multiple globs from /var/db/pkg . (Use in /usr/ports/foo/bar to build that port) .Nm .Fl -show-work -.Op Fl Gv m Ar args +.Op Fl Gv +.Op Fl m Ar args .Nm .Op Common Flags @@ -106,34 +107,37 @@ and/or multiple globs from /var/db/pkg .Nm .Fl [l|L] .Nm -.Op Fl b [D|d] -.Fl e Ar name/glob of a single port directory in /var/db/pkg -.Nm -.Op Fl b [D|d] -.Fl s +.Fl -list-origins .Nm .Op Fl -force-config|-G .Op Fl aftv .Fl F .Nm -.Op Fl t -.Fl -clean-distfiles +.Op Fl n|y +.Op Fl b +.Op Fl D|d +.Fl e Ar name/glob of a single port directory in /var/db/pkg +.Nm +.Op Fl n|y +.Op Fl b +.Op Fl D|d +.Fl s .Nm +.Op Fl n|y .Op Fl t -.Fl -clean-distfiles-all +.Fl -clean-distfiles .Nm -.Op Fl -index +.Op Fl n|y +.Op Fl -index|-index-only .Fl -clean-packages .Nm -.Op Fl -index -.Fl -clean-packages-all -.Nm +.Op Fl n|y +.Op Fl v .Fl -check-depends .Nm -.Fl -check-port-dbdir +.Op Fl n|y .Op Fl v -.Nm -.Fl -list-origins +.Fl -check-port-dbdir .Nm .Fl h|--help .Nm @@ -335,11 +339,11 @@ user would like to have for this problem Manual intervention is therefore required. .Sh OPTIONS The options are as follows: +.Pp +Common Flags: .Bl -tag -width F1 .It Fl -force-config run 'make config' for all ports (overrides -G) -.It Fl B -prevents creation of the backup package for the installed port .It Fl C prevents 'make clean' from being run before building .It Fl G @@ -348,6 +352,8 @@ prevents 'make config' hide details of the port build and install in a log file .It Fl K prevents 'make clean' from being run after building +.It Fl B +prevents creation of the backup package for the installed port .It Fl b create and keep a backup package of an installed port .It Fl g @@ -358,7 +364,7 @@ run through all steps, but do not make o recurse dependencies thoroughly, using all-depends-list. .Sy RECOMMENDED FOR USE ONLY WHEN NEEDED, NOT ROUTINELY. When applied to the -.Fl -clean-distfiles[-all] +.Fl -clean-distfiles option it allows a distfile to be valid if it matches any up to date port, not just the ones that are installed. @@ -384,6 +390,33 @@ Can be specified more than once. If a port is not already installed the exclude pattern will be run against the directory name from .Pa /usr/ports . +.It Fl -no-confirm +do not ask the user to confirm the list of ports to +be installed and/or updated before proceeding +.It Fl -no-term-title +do not update the xterm title bar +.It Fl -no-index-fetch +skip fetching the INDEX file +.It Fl -index +use INDEX-[7-9] exclusively to check if a port is up to date +.It Fl -index-first +use the INDEX for status, but double-check with the port +.It Fl -index-only +do not try to use +.Pa /usr/ports . +For updating ports when no +.Pa /usr/ports +directory is present the +.Fl PP|--packages-only +option is required. +See the ENVIRONMENT section below for additional +requirements. +.El +.Pp +Features: +.Bl -tag -width F1 +.It Fl a +check all ports, update as necessary .It Fl -show-work show what dependent ports are, and are not installed (implies .Fl t ) . @@ -397,8 +430,10 @@ used with the or .Fl f options to skip ports updated on a previous run. -.It Fl a -check all ports, update as necessary +When used with +.Fl r +it will also prevent the rebuild of the parent port if it, +and all of its dependencies are up to date. .It Fl -delete-build-only delete ports that are build-only dependencies after a successful run, only if installed this run @@ -443,32 +478,23 @@ use packages from only .It Fl -delete-packages after installing from a package, delete it -.It Fl -no-confirm -do not ask the user to confirm the list of ports to -be installed and/or updated before proceeding -.It Fl -no-term-title -do not update the xterm title bar -.It Fl -no-index-fetch -skip fetching the INDEX file -.It Fl -index -use INDEX-[6-9] exclusively to check if a port is up to date -.It Fl -index-first -use the INDEX for status, but double-check with the port -.It Fl -index-only -do not try to use -.Pa /usr/ports . -For updating ports when no -.Pa /usr/ports -directory is present the -.Fl PP|--packages-only -option is required. -See the ENVIRONMENT section below for additional -requirements. .It Fl l list all installed ports by category .It Fl L list all installed ports by category, and search for updates -.It Fl e Ar name/glob of a single port directory in /var/db/pkg +.It Fl -list-origins +list directories from /usr/ports for root and leaf ports. +This list is suitable for feeding to +.Nm +either on another machine or for reinstalling all ports. +See EXAMPLES below. +.It [--force-config|-G] [-aftv] Fl F +fetch distfiles only +.It Fl n +answer no to all user prompts for the features below +.It Fl y +answer yes to all user prompts for the features below +.It [-n|y] [-b] [-D|d] Fl e Ar name/glob of a single port directory in /var/db/pkg expunge a port using .Xr pkg_delete 1 , and optionally remove all distfiles. @@ -477,17 +503,9 @@ Calls after it is done expunging in case removing the port causes a dependency to no longer be necessary. -.It Fl s +.It [-n|y] [-b] [-D|d] Fl s clean out stale ports that used to be depended on -.It Fl F -fetch distfiles only. -Cannot be used with -.Fl G , -but may be used with -.Fl -force-config -and -.Fl [aftv] . -.It [-t] Fl -clean-distfiles +.It [-t] [-n] Fl -clean-distfiles recurse through the installed ports to get a list of distinfo files, then recurse through all files in @@ -495,28 +513,32 @@ then recurse through all files in to make sure that they are still associated with an installed port. If not, offer to delete the stale file. -.It [-t] Fl -clean-distfiles-all +With +.Fl t +distfile is valid from any port, not just those installed. +.It [-t] +.Fl y +.Fl -clean-distfiles does the same as above, but deletes all files without prompting. -.It [--index] Fl -clean-packages -offer to delete stale packages -.It [--index] Fl -clean-packages-all +.It [--index|--index-only] [-n] Fl -clean-packages +offer to delete stale packages. +The +.Fl -index-only +option is required if no ports tree is available. +.It [--index|--index-only] +.Fl y +.Fl -clean-packages does the same as above, but deletes all out of date files without prompting. -.It Fl -check-depends +.It [-n|y] [-v] Fl -check-depends cross-check and update dependency information for all ports -.It [-v] Fl -check-port-dbdir +.It [-n|y] [-v] Fl -check-port-dbdir check for stale entries in .Pa /var/db/ports -.It Fl -list-origins -list directories from /usr/ports for root and leaf ports. -This list is suitable for feeding to -.Nm -either on another machine or for reinstalling all ports. -See EXAMPLES below. .It Fl h|--help display help message .It Fl -version -display the version only. +display the version number .El .Sh ENVIRONMENT The directory pointed to by the @@ -527,7 +549,7 @@ will be used to store new and backup pac When using 'make package' for the .Fl g option, the ports infrastructure will store packages in -.Pa /usr/ports/packages/All , +.Pa ${PACKAGES}/All , aka .Ev PKGREPOSITORY . When using the @@ -535,7 +557,7 @@ When using the option, .Nm stores its backup packages in -.Pa /usr/ports/packages/portmaster-backup +.Pa ${PACKAGES}/portmaster-backup so that you can create both a backup package and a package of the newly installed port even if they have the same version. @@ -796,7 +818,7 @@ Using to do a complete reinstallation of all your ports: .Dl "1. portmaster --list-origins > ~/installed-port-list" .Dl "2. Update your ports tree" -.Dl "3. portmaster -t --clean-distfiles-all" +.Dl "3. portmaster -ty --clean-distfiles" .Dl "4. portmaster --check-port-dbdir" .Dl "5. portmaster -Faf" .Dl "6. pkg_delete '*'" @@ -809,7 +831,7 @@ to do a complete reinstallation of all y .Dl "11. portmaster `cat ~/installed-port-list`" .Pp You probably want to use the -D option for the installation -and then run --clean-distfiles[-all] again when you are done. +and then run --clean-distfiles [-y] again when you are done. You might also want to consider using the --force-config option when installing the new ports. .Pp From owner-svn-src-user@FreeBSD.ORG Sun Jan 2 02:36:09 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C45E106566C; Sun, 2 Jan 2011 02:36:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FA178FC0A; Sun, 2 Jan 2011 02:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p022a99c029588; Sun, 2 Jan 2011 02:36:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p022a9Xb029585; Sun, 2 Jan 2011 02:36:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101020236.p022a9Xb029585@svn.freebsd.org> From: Doug Barton Date: Sun, 2 Jan 2011 02:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216880 - in user/dougb/portmaster: . files X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 02:36:09 -0000 Author: dougb Date: Sun Jan 2 02:36:08 2011 New Revision: 216880 URL: http://svn.freebsd.org/changeset/base/216880 Log: Further improvements to usage() and the man page to make them more consistent, and hopefully more sensible. Modified: user/dougb/portmaster/files/portmaster.8 user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/files/portmaster.8 ============================================================================== --- user/dougb/portmaster/files/portmaster.8 Sun Jan 2 01:26:51 2011 (r216879) +++ user/dougb/portmaster/files/portmaster.8 Sun Jan 2 02:36:08 2011 (r216880) @@ -67,6 +67,9 @@ and/or multiple globs from /var/db/pkg .Op Common Flags . (Use in /usr/ports/foo/bar to build that port) .Nm +.Op Common Flags +.Fl a +.Nm .Fl -show-work .Op Fl Gv .Op Fl m Ar args @@ -79,32 +82,6 @@ and/or multiple globs from /var/db/pkg .Op Fl R .Fl r Ar name/glob of port in /var/db/pkg .Nm -.Op Common Flags -.Fl a -.Nm -.Fl -delete-build-only -.Nm -.Op Fl -packages-if-newer -.Op Fl -always-fetch -.Op Fl -local-packagedir= -.Op Fl -packages-local -.Op Fl -delete-packages -.Fl P|--packages -.Nm -.Op Fl -packages-if-newer -.Op Fl -always-fetch -.Op Fl -local-packagedir= -.Op Fl -packages-local -.Op Fl -delete-packages -.Fl PP|--packages-only -.Nm -.Op Fl -packages-if-newer -.Op Fl -always-fetch -.Op Fl -local-packagedir= -.Op Fl -packages-local -.Op Fl -delete-packages -.Fl -packages-build -.Nm .Fl [l|L] .Nm .Fl -list-origins @@ -411,29 +388,6 @@ directory is present the option is required. See the ENVIRONMENT section below for additional requirements. -.El -.Pp -Features: -.Bl -tag -width F1 -.It Fl a -check all ports, update as necessary -.It Fl -show-work -show what dependent ports are, and are not installed (implies -.Fl t ) . -.It Fl o Ar -replace the installed port with a port from a different origin -.It [-R] Fl r Ar name/glob of port directory in /var/db/pkg -rebuild the specified port, and all ports that depend on it -.It Fl R -used with the -.Fl r -or -.Fl f -options to skip ports updated on a previous run. -When used with -.Fl r -it will also prevent the rebuild of the parent port if it, -and all of its dependencies are up to date. .It Fl -delete-build-only delete ports that are build-only dependencies after a successful run, only if installed this run @@ -478,6 +432,29 @@ use packages from only .It Fl -delete-packages after installing from a package, delete it +.El +.Pp +Features: +.Bl -tag -width F1 +.It Fl a +check all ports, update as necessary +.It Fl -show-work +show what dependent ports are, and are not installed (implies +.Fl t ) . +.It Fl o Ar +replace the installed port with a port from a different origin +.It [-R] Fl r Ar name/glob of port directory in /var/db/pkg +rebuild the specified port, and all ports that depend on it +.It Fl R +used with the +.Fl r +or +.Fl f +options to skip ports updated on a previous run. +When used with +.Fl r +it will also prevent the rebuild of the parent port if it, +and all of its dependencies are up to date. .It Fl l list all installed ports by category .It Fl L Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sun Jan 2 01:26:51 2011 (r216879) +++ user/dougb/portmaster/portmaster Sun Jan 2 02:36:08 2011 (r216880) @@ -347,13 +347,13 @@ usage () { version echo '' echo 'Usage:' - echo "Common flags: [--force-config] [-CGHKgntvw B|b f|i D|d]" + echo "Common flags: [--force-config -CGHKgntvw -[B|b] -[f|i] -[D|d]]" echo " [[[--packages|-P]|[--packages-only|-PP]] | [--packages-build]]" echo " [--packages-if-newer] [--delete-build-only] [--always-fetch]" echo " [--local-packagedir=] [--packages-local] [--delete-packages]" echo " [--no-confirm] [--no-term-title] [--no-index-fetch]" - echo " [--index|--index-first|--index-only]" - echo " [-m ] [-x ]" + echo " [--index|--index-first|--index-only] [-m ]" + echo " [-x ]" echo "${0##*/} [Common flags] " echo "${0##*/} [Common flags] " echo "${0##*/} [Common flags] " @@ -362,34 +362,34 @@ usage () { echo '' echo "${0##*/} [Common flags] . [Use in $pd/foo/bar to build that port]" echo '' + echo "${0##*/} [Common flags] -a" + echo '' echo "${0##*/} --show-work [-Gv] [-m ] " echo '' echo "${0##*/} [Common flags] -o " echo "${0##*/} [Common flags] [-R] -r " echo '' - echo "${0##*/} [Common flags] -a" - echo '' echo "${0##*/} -[l|L]" echo '' echo "${0##*/} --list-origins" echo '' echo "${0##*/} [--force-config|-G] [-aftv] -F" echo '' - echo "${0##*/} [-n|y] [-b D|d] -e " - echo "${0##*/} [-n|y] [-b D|d] -s" + echo "${0##*/} [-n|y] [-b] [-D|d] -e " + echo "${0##*/} [-n|y] [-b] [-D|d] -s" echo '' echo "${0##*/} [-n|y] [-t] --clean-distfiles" echo '' echo "${0##*/} [-n|y] [--index|--index-only] --clean-packages" echo '' - echo "${0##*/} [-n|y] --check-depends" + echo "${0##*/} [-n|y] [-v] --check-depends" echo '' echo "${0##*/} [-n|y] [-v] --check-port-dbdir" echo '' echo "${0##*/} -h|--help" echo "${0##*/} --version" echo '' - echo "--force-config 'make config' for all ports (overrides -G)" + echo "--force-config run 'make config' for all ports (overrides -G)" echo "-C prevents 'make clean' from being run before building" echo "-G prevents 'make config'" echo "-H hide details of the port build and install in a log file" @@ -402,7 +402,7 @@ usage () { echo '-v verbose output' echo '-w save old shared libraries before deinstall' echo '[-R] -f always rebuild ports (overrides -i)' - echo '-i interactive update -- ask whether to rebuild ports' + echo '-i interactive update mode -- ask whether to rebuild ports' echo '-D no cleaning of distfiles' echo '-d always clean distfiles' echo "-m " @@ -414,18 +414,10 @@ usage () { echo '--no-term-title do not update the xterm title bar' echo '' echo '--no-index-fetch skip fetching the INDEX file' - echo '--index use INDEX-[6-9] exclusively to check if a port is up to date' + echo '--index use INDEX-[7-9] exclusively to check if a port is up to date' echo '--index-first use the INDEX for status, but double-check with the port' echo '--index-only do not try to use /usr/ports' echo '' - echo '--show-work list what ports are and would be installed' - echo '' - echo '-o replace the installed port with a port from a different origin' - echo '[-R] -r rebuild port, and all ports that depend on it' - echo '-R used with -[rf] to skip ports updated on a previous run' - echo '' - echo '-a check all ports, update as necessary' - echo '' echo '--delete-build-only delete ports that are build-only dependencies' echo ' after a successful run, only if installed this run' echo '' @@ -440,27 +432,38 @@ usage () { echo '--packages-local use packages from --local-packagedir only' echo '--delete-packages after installing from a package, delete it' echo '' - echo '-l list installed ports by category' - echo '-L list installed ports by category, and search for updates' + echo '-a check all ports, update as necessary' + echo '' + echo '--show-work list what ports are and would be installed' + echo '' + echo '-o replace the installed port with a port from a different origin' + echo '[-R] -r rebuild port, and all ports that depend on it' + echo '-R used with -[rf] to skip ports updated on a previous run' + echo '' + echo '-l list all installed ports by category' + echo '-L list all installed ports by category, and search for updates' echo '' echo "--list-origins list directories from $pd for root and leaf ports" echo '' echo '[--force-config|-G] [-aftv] -F fetch distfiles only' echo '' - echo '-e expunge a single port via pkg_delete, and remove its distfiles' - echo '-s clean out stale ports that used to be depended on' + echo '-n answer no to all user prompts for the features below' + echo '-y answer yes to all user prompts for the features below' + echo '' + echo '[-n|y] [-b] [-D|d] -e expunge one port via pkg_delete, and remove its distfiles' + echo '[-n|y] [-b] [-D|d] -s clean out stale ports that used to be depended on' echo '' - echo '[-t] --clean-distfiles offer to delete stale distfiles' + echo '[-t] [-n] --clean-distfiles offer to delete stale distfiles' echo '[-t] -y --clean-distfiles delete stale distfiles without prompting' echo ' with -t distfile is valid from any port, not just those installed' echo '' - echo '[--index|--index-only] --clean-packages offer to delete stale packages' + echo '[--index|--index-only] [-n] --clean-packages offer to delete stale packages' echo '[--index|--index-only] -y --clean-packages delete without prompting' echo ' --index-only is required if no ports tree is available' echo '' - echo '--check-depends cross-check and update dependency information for all ports' + echo '[-n|y] [-v] --check-depends cross-check and update dependency info for all ports' echo '' - echo "--check-port-dbdir [-v] check for stale entries in $port_dbdir" + echo "[-n|y] [-v] --check-port-dbdir check for stale entries in $port_dbdir" echo '' echo '-h|--help display this help message' echo '--version display the version number' From owner-svn-src-user@FreeBSD.ORG Sun Jan 2 02:45:44 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2CE7106566C; Sun, 2 Jan 2011 02:45:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2BAD8FC08; Sun, 2 Jan 2011 02:45:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p022jiKt029843; Sun, 2 Jan 2011 02:45:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p022ji7o029841; Sun, 2 Jan 2011 02:45:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101020245.p022ji7o029841@svn.freebsd.org> From: Doug Barton Date: Sun, 2 Jan 2011 02:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216881 - user/dougb/portmaster/files X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 02:45:44 -0000 Author: dougb Date: Sun Jan 2 02:45:44 2011 New Revision: 216881 URL: http://svn.freebsd.org/changeset/base/216881 Log: Remove -all variants Modified: user/dougb/portmaster/files/bash-completions Modified: user/dougb/portmaster/files/bash-completions ============================================================================== --- user/dougb/portmaster/files/bash-completions Sun Jan 2 02:36:08 2011 (r216880) +++ user/dougb/portmaster/files/bash-completions Sun Jan 2 02:45:44 2011 (r216881) @@ -15,8 +15,7 @@ _portmaster () { --local-packagedir= --packages-local \ --no-confirm --no-term-title --no-index-fetch \ --index --index-first --index-only \ - --clean-distfiles --clean-distfiles-all \ - --clean-packages --clean-packages-all \ + --clean-distfiles --clean-packages \ --check-depends --check-port-dbdir --list-origins \ --help --version' -- $cur ) ) ;; From owner-svn-src-user@FreeBSD.ORG Sun Jan 2 02:46:07 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 215E0106564A; Sun, 2 Jan 2011 02:46:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAEF48FC08; Sun, 2 Jan 2011 02:46:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p022k68v029890; Sun, 2 Jan 2011 02:46:06 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p022k6rF029888; Sun, 2 Jan 2011 02:46:06 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101020246.p022k6rF029888@svn.freebsd.org> From: Doug Barton Date: Sun, 2 Jan 2011 02:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216882 - user/dougb/portmaster/files X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 02:46:07 -0000 Author: dougb Date: Sun Jan 2 02:46:06 2011 New Revision: 216882 URL: http://svn.freebsd.org/changeset/base/216882 Log: Re-sort to match usage() Remove -all variants Modified: user/dougb/portmaster/files/zsh-completions Modified: user/dougb/portmaster/files/zsh-completions ============================================================================== --- user/dougb/portmaster/files/zsh-completions Sun Jan 2 02:45:44 2011 (r216881) +++ user/dougb/portmaster/files/zsh-completions Sun Jan 2 02:46:06 2011 (r216882) @@ -30,11 +30,6 @@ _arguments -A "-*" : \ "--index[use INDEX exclusively to check if a port is up to date]" \ "--index-first[use the INDEX for status, but double-check with the port]" \ "--index-only[do not try to use /usr/ports]" \ - "--show-work[list what ports are and would be installed]" \ - "-o[replace the installed port with a port from a different origin]:new port dir in /usr/ports:->ports" \ - "-r[rebuild port, and all ports that depend on it]:name/glob of port in /var/db/pkg:->pkgs" \ - "-R[used with -\[rf\] to skip ports updated on a previous run]" \ - "-a[check all ports, update as necessary]" \ "--delete-build-only[delete ports that are build-only dependencies after a successful run]" \ {-P,--packages}"[use packages, but build port if not available]" \ {-PP,--packages-only}"[fail if no package is available]" \ @@ -44,18 +39,21 @@ _arguments -A "-*" : \ "--local-packagedir=-[where local packages can be found]:path:_files -/" \ "--packages-local[use packages from --local-packagedir only]" \ "--delete-packages[after installing from a package, delete it]" \ + "-a[check all ports, update as necessary]" \ + "--show-work[list what ports are and would be installed]" \ + "-o[replace the installed port with a port from a different origin]:new port dir in /usr/ports:->ports" \ + "-r[rebuild port, and all ports that depend on it]:name/glob of port in /var/db/pkg:->pkgs" \ + "-R[used with -\[rf\] to skip ports updated on a previous run]" \ "-l[list all installed ports by category]" \ "-L[list all installed ports by category, and search for updates]" \ + "--list-origins[list directories from /usr/ports for root and leaf ports]" \ + "-F[fetch distfiles only]" \ "-e[expunge a port via pkg_delete, and remove its distfiles]:full name of port directory in /var/db/pkg:->pkgs" \ "-s[clean out stale ports that used to be depended on]" \ - "-F[fetch distfiles only]" \ "--clean-distfiles[offer to delete stale distfiles]" \ - "--clean-distfiles-all[delete stale distfiles without prompting]" \ "--clean-packages[offer to delete stale packages]" \ - "--clean-packages-all[delete stale packages without prompting]" \ "--check-depends[cross-check and update dependency information for all ports]" \ "--check-port-dbdir[check for stale entries in /var/db/ports]" \ - "--list-origins[list directories from /usr/ports for root and leaf ports]" \ "(-h --help)"{-h,--help}"[display help message]" \ "--version[display the version number]" \ '*:Packages and Ports:->pkgs_ports' From owner-svn-src-user@FreeBSD.ORG Sun Jan 2 03:16:07 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99413106566B; Sun, 2 Jan 2011 03:16:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88CD18FC1D; Sun, 2 Jan 2011 03:16:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p023G7AB030870; Sun, 2 Jan 2011 03:16:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p023G7VZ030868; Sun, 2 Jan 2011 03:16:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101020316.p023G7VZ030868@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 2 Jan 2011 03:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216883 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 03:16:07 -0000 Author: nwhitehorn Date: Sun Jan 2 03:16:07 2011 New Revision: 216883 URL: http://svn.freebsd.org/changeset/base/216883 Log: Titling the installation completion dialog "Welcome" has a certain zen aspect to it, but is ultimately wrong. Modified: user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Sun Jan 2 02:46:06 2011 (r216882) +++ user/nwhitehorn/bsdinstall/scripts/auto Sun Jan 2 03:16:07 2011 (r216883) @@ -35,7 +35,7 @@ bsdinstall rootpass bsdinstall adduser bsdinstall config -cdialog --backtitle "FreeBSD Installer" --title "Welcome" --msgbox "Installation of FreeBSD complete!" 0 0 +cdialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0 echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG From owner-svn-src-user@FreeBSD.ORG Sun Jan 2 03:16:48 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5D84106566B; Sun, 2 Jan 2011 03:16:47 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D40D38FC22; Sun, 2 Jan 2011 03:16:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p023GlDj030923; Sun, 2 Jan 2011 03:16:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p023GlEX030915; Sun, 2 Jan 2011 03:16:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101020316.p023GlEX030915@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 2 Jan 2011 03:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216884 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 03:16:48 -0000 Author: nwhitehorn Date: Sun Jan 2 03:16:47 2011 New Revision: 216884 URL: http://svn.freebsd.org/changeset/base/216884 Log: Add support for installations on sparc64 [tested] and pc98 [speculative]. Added: user/nwhitehorn/bsdinstall/partedit/partedit_pc98.c user/nwhitehorn/bsdinstall/partedit/partedit_sparc64.c Modified: user/nwhitehorn/bsdinstall/partedit/Makefile user/nwhitehorn/bsdinstall/partedit/gpart_ops.c user/nwhitehorn/bsdinstall/partedit/partedit.h user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c user/nwhitehorn/bsdinstall/partedit/partedit_x86.c Modified: user/nwhitehorn/bsdinstall/partedit/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/Makefile Sun Jan 2 03:16:07 2011 (r216883) +++ user/nwhitehorn/bsdinstall/partedit/Makefile Sun Jan 2 03:16:47 2011 (r216884) @@ -8,6 +8,9 @@ PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" PARTEDIT_ARCH= x86 .endif +.if ${MACHINE} == "sun4v" +PARTEDIT_ARCH= sparc64 +.endif .if !exists(partedit_${PARTEDIT_ARCH}.c) PARTEDIT_ARCH= generic .endif Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 2 03:16:07 2011 (r216883) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 2 03:16:47 2011 (r216884) @@ -11,8 +11,8 @@ #define GPART_FLAGS "x" /* Do not commit changes by default */ -static void set_part_metadata(const char *name, const char *type, - const char *mountpoint, int newfs); +static void set_part_metadata(const char *name, const char *scheme, + const char *type, const char *mountpoint, int newfs); static void gpart_show_error(const char *title, const char *explanation, const char *errstr) @@ -223,6 +223,10 @@ gpart_partcode(struct gprovider *pp) } } + /* Make sure this partition scheme needs partcode on this platform */ + if (partcode_path(scheme) == NULL) + return; + LIST_FOREACH(gc, &pp->lg_config, lg_config) { if (strcmp(gc->lg_name, "index") == 0) { indexstr = gc->lg_val; @@ -248,7 +252,7 @@ gpart_edit(struct gprovider *pp) struct gconsumer *cp; struct gprovider *spp; struct ggeom *geom; - const char *errstr, *oldtype; + const char *errstr, *oldtype, *scheme; struct partition_metadata *md; char sizestr[32]; intmax_t index; @@ -330,6 +334,13 @@ gpart_edit(struct gprovider *pp) return; } + LIST_FOREACH(gc, &geom->lg_config, lg_config) { + if (strcmp(gc->lg_name, "scheme") == 0) { + scheme = gc->lg_val; + break; + } + } + /* Edit editable parameters of a partition */ hadlabel = 0; LIST_FOREACH(gc, &pp->lg_config, lg_config) { @@ -391,7 +402,7 @@ editpart: } gctl_free(r); - set_part_metadata(pp->lg_name, items[0].text, items[3].text, + set_part_metadata(pp->lg_name, scheme, items[0].text, items[3].text, strcmp(oldtype, items[0].text) != 0); for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++) @@ -400,8 +411,8 @@ editpart: } static void -set_part_metadata(const char *name, const char *type, const char *mountpoint, - int newfs) +set_part_metadata(const char *name, const char *scheme, const char *type, + const char *mountpoint, int newfs) { struct partition_metadata *md; @@ -424,6 +435,10 @@ set_part_metadata(const char *name, cons mountpoint = "none"; if (strcmp(type, "freebsd-boot") == 0) md->bootcode = 1; + + /* VTOC8 needs partcode in UFS partitions */ + if (strcmp(scheme, "VTOC8") == 0 && strcmp(type, "freebsd-ufs") == 0) + md->bootcode = 1; if (mountpoint != NULL && mountpoint[0] != '\0') { if (md->fstab == NULL) { @@ -571,7 +586,7 @@ gpart_create(struct gprovider *pp) items[1].text = sizestr; /* Special-case the MBR default type for nested partitions */ - if (strcmp(scheme, "MBR") == 0) + if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "PC98") == 0) items[0].text = "freebsd"; addpartform: @@ -602,8 +617,11 @@ addpartform: goto addpartform; } - /* If this is the root partition, and we need partcode, ask the user */ - if (strcmp(items[3].text, "/") == 0 && partcode_size(scheme) > 0) { + /* + * If this is the root partition, and we need a boot partition, ask + * the user to add one. + */ + if (strcmp(items[3].text, "/") == 0 && bootpart_size(scheme) > 0) { choice = dialog_yesno("Boot Partition", "This partition scheme " "requires a boot partition for the disk to be bootable. " "Would you like to make one now?", 0, 0); @@ -616,7 +634,7 @@ addpartform: gctl_ro_param(r, "verb", -1, "add"); gctl_ro_param(r, "type", -1, "freebsd-boot"); snprintf(sizestr, sizeof(sizestr), "%jd", - partcode_size(scheme) / sector); + bootpart_size(scheme) / sector); gctl_ro_param(r, "size", -1, sizestr); snprintf(startstr, sizeof(startstr), "%jd", firstfree); gctl_ro_param(r, "start", -1, startstr); @@ -629,7 +647,7 @@ addpartform: get_part_metadata(strtok(output, " "), 1)->bootcode = 1; /* Now adjust the part we are really adding forward */ - firstfree += partcode_size(scheme) / sector; + firstfree += bootpart_size(scheme) / sector; if (stripe > 0 && (firstfree*sector % stripe) != 0) firstfree += (stripe - ((firstfree*sector) % stripe)) / sector; @@ -663,7 +681,7 @@ addpartform: else if (strcmp(items[0].text, "freebsd") == 0) gpart_partition(strtok(output, " "), "BSD"); else - set_part_metadata(strtok(output, " "), items[0].text, + set_part_metadata(strtok(output, " "), scheme, items[0].text, items[3].text, 1); for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++) Modified: user/nwhitehorn/bsdinstall/partedit/partedit.h ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.h Sun Jan 2 03:16:07 2011 (r216883) +++ user/nwhitehorn/bsdinstall/partedit/partedit.h Sun Jan 2 03:16:47 2011 (r216884) @@ -31,6 +31,6 @@ void gpart_commit(struct gmesh *mesh); /* machine-dependent bootability checks */ int is_scheme_bootable(const char *part_type); -size_t partcode_size(const char *part_type); +size_t bootpart_size(const char *part_type); const char *bootcode_path(const char *part_type); const char *partcode_path(const char *part_type); Added: user/nwhitehorn/bsdinstall/partedit/partedit_pc98.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/partedit/partedit_pc98.c Sun Jan 2 03:16:47 2011 (r216884) @@ -0,0 +1,34 @@ +#include + +#include "partedit.h" + +int +is_scheme_bootable(const char *part_type) { + if (strcmp(part_type, "PC98") == 0) + return (1); + if (strcmp(part_type, "BSD") == 0) + return (1); + + return (0); +} + +size_t +bootpart_size(const char *part_type) { + /* No boot partition */ + return (0); +} + +const char * +bootcode_path(const char *part_type) { + if (strcmp(part_type, "BSD") == 0) + return ("/boot/boot"); + + return (NULL); +} + +const char * +partcode_path(const char *part_type) { + /* No partcode */ + return (NULL); +} + Modified: user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c Sun Jan 2 03:16:07 2011 (r216883) +++ user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c Sun Jan 2 03:16:47 2011 (r216884) @@ -10,7 +10,7 @@ is_scheme_bootable(const char *part_type } size_t -partcode_size(const char *part_type) { +bootpart_size(const char *part_type) { if (strcmp(part_type, "APM") == 0) return (800*1024); return (0); Added: user/nwhitehorn/bsdinstall/partedit/partedit_sparc64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/partedit/partedit_sparc64.c Sun Jan 2 03:16:47 2011 (r216884) @@ -0,0 +1,30 @@ +#include + +#include "partedit.h" + +int +is_scheme_bootable(const char *part_type) { + if (strcmp(part_type, "VTOC8") == 0) + return (1); + return (0); +} + +size_t +bootpart_size(const char *part_type) { + /* No standalone boot partition */ + + return (0); +} + +const char * +bootcode_path(const char *part_type) { + return (NULL); +} + +const char * +partcode_path(const char *part_type) { + if (strcmp(part_type, "VTOC8") == 0) + return ("/boot/boot1"); + return (NULL); +} + Modified: user/nwhitehorn/bsdinstall/partedit/partedit_x86.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit_x86.c Sun Jan 2 03:16:07 2011 (r216883) +++ user/nwhitehorn/bsdinstall/partedit/partedit_x86.c Sun Jan 2 03:16:47 2011 (r216884) @@ -15,7 +15,7 @@ is_scheme_bootable(const char *part_type } size_t -partcode_size(const char *part_type) { +bootpart_size(const char *part_type) { if (strcmp(part_type, "GPT") == 0) return (64*1024); From owner-svn-src-user@FreeBSD.ORG Mon Jan 3 00:11:10 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6EAE106564A; Mon, 3 Jan 2011 00:11:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D67A48FC14; Mon, 3 Jan 2011 00:11:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p030BAo7062882; Mon, 3 Jan 2011 00:11:10 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p030BAaj062880; Mon, 3 Jan 2011 00:11:10 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101030011.p030BAaj062880@svn.freebsd.org> From: Doug Barton Date: Mon, 3 Jan 2011 00:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216896 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 00:11:11 -0000 Author: dougb Date: Mon Jan 3 00:11:10 2011 New Revision: 216896 URL: http://svn.freebsd.org/changeset/base/216896 Log: Add an error check for -y and -n both supplied Add get_answer_g(), a generic version of the previous get_answer() Use this function to wrap all of the remaining cases of user input Convert get_answer() to get_answer_yn() and call get_answer_g() if we need to prompt the user, otherwise use the same logic to handle the -y and -n options. Update the callers of the former get_answer() to match. Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sun Jan 2 23:38:05 2011 (r216895) +++ user/dougb/portmaster/portmaster Mon Jan 3 00:11:10 2011 (r216896) @@ -680,6 +680,7 @@ done shift $(( $OPTIND - 1 )) [ -n "$UNATTENDED" ] && fail 'The -u option has been deprecated' +[ -n "$PM_YES" -a -n "$NO_ACTION" ] && fail 'The -y and -n options are mutually exclusive' [ -n "$PM_EXCL" ] && export PM_EXCL @@ -886,38 +887,57 @@ check_dependency_files () { return 0 } -# Takes a default value and message as input +# Takes default value, optional value, and message as input # Return values: -# 0 - Answer is "Yes" -# 1 - Answer is "No" +# 0 - Default value chosen +# 1 - Optional value chosen # -get_answer () { - local default answer +get_answer_g () { + local default option answer - default=$1 ; shift + default=$1 ; option=$2 ; shift 2 while : ; do - if [ -z "$PM_YES" -a -z "$NO_ACTION" ]; then - echo -n " ===>>> ${*}? y/n [${default}] " - read answer - echo '' - else - if [ -n "$PM_YES" ]; then - answer=y - elif [ -n "$NO_ACTION" ]; then - answer=n - fi - fi + echo -n "${*} [${default}] " + read answer + echo '' + + case "$answer" in + [A-Z]) answer=`echo $answer | tr [:upper:] [:lower:]` ;; + esac case "$answer" in - [yY]) return 0 ;; - [nN]) return 1 ;; - '') [ "$default" = y ] && return 0 || return 1 ;; + ${default}|'') return 0 ;; + ${option}) return 1 ;; *) echo " ===>>> $answer is not a valid response" ; echo '' ;; esac done } +# Takes a default value and message as input +# Return values: +# 0 - Answer is "Yes" +# 1 - Answer is "No" +# +get_answer_yn () { + local default option + + default=$1 ; shift + + [ "$default" = 'y' ] && option=n || option=y + + if [ -z "$PM_YES" -a -z "$NO_ACTION" ]; then + get_answer_g $default $option "${*}? y/n" + case "${?}${default}" in + 0y|1n) return 0 ;; + 0n|1y) return 1 ;; + esac + else + [ -n "$PM_YES" ] && return 0 + return 1 + fi +} + update_contents () { local IFS delete contents origin n_port old_origin iport new_cont local o_seen line d_missing d_origin d_iport prev_line answer @@ -957,7 +977,7 @@ IFS=' echo " ===>>> but there is no installed version" echo '' if [ -n "$CHECK_DEPENDS" ]; then - get_answer n Delete this dependency data + get_answer_yn n Delete this dependency data case "$?" in 0) unset prev_line line ; continue ;; esac else echo " ===>>> Try ${0##*/} --check-depends" @@ -1223,7 +1243,7 @@ if [ -n "$CLEAN_DISTFILES" ]; then for df in `find $DISTDIR -type f | sort`; do f=${df#$DISTDIR} if ! grep -ql $f $DI_FILES; then - get_answer n Delete stale file: ${f} + get_answer_yn n Delete stale file: ${f} case "$?" in 0) echo " Deleting $f" ; echo '' pm_unlink $df ;; @@ -1266,7 +1286,7 @@ if [ -n "$CLEAN_PACKAGES" ]; then if [ -z "$PM_YES" ]; then if [ ! -d "${pdb}/${pkg_dir}" ]; then echo " ===>>> $pkg_dir is not installed" - get_answer y Delete stale package: ${package##*/} + get_answer_yn y Delete stale package: ${package##*/} case "$?" in 0) echo " ===>>> Deleting $package" pm_unlink_s $package ;; @@ -1291,7 +1311,7 @@ if [ -n "$CLEAN_PACKAGES" ]; then echo " ===>>> Path: ${package}" - get_answer n Delete stale package: ${package##*/} + get_answer_yn n Delete stale package: ${package##*/} case "$?" in 0) echo " ===>>> Deleting $package" pm_unlink_s $package ;; @@ -1413,7 +1433,7 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then *:${dbdir}:*) pm_v "Ok" ;; *) pm_v echo " ===>>> $dbdir does not seem to be installed" - get_answer n Delete ${dir} + get_answer_yn n Delete ${dir} case "$?" in 0) pm_rm_s -rf $dir ;; esac echo '' ;; esac @@ -1647,11 +1667,8 @@ pm_pkg_create () { echo "===>>> Ignore this error [i]" echo "===>>> Abort [a]" echo '' - echo -n "===>>> How would you like to proceed? [i] " - local answer ; read answer - case "$answer" in - [aA]) fail "Package creation failed for $2" ;; - esac + get_answer_g i a "===>>> How would you like to proceed?" + case "$?" in 1) fail "Package creation failed for $2" ;; esac fi } @@ -1736,11 +1753,10 @@ find_and_delete_distfiles () { continue fi - echo -n "===>>> Delete $file? y/n [n] " - read answer - case "$answer" in - [yY]) pm_unlink $file ;; - *) distfiles_checked="${distfiles_checked}${file}:" ;; + get_answer_g n y "===>>> Delete $file? y/n" + case "$?" in + 1) pm_unlink $file ;; + 0) distfiles_checked="${distfiles_checked}${file}:" ;; esac ;; esac done @@ -1812,11 +1828,10 @@ delete_stale_distfiles () { continue fi - echo -n "===>>> Delete $file? y/n [n] " - read answer - case "$answer" in - [yY]) pm_unlink $file ;; - *) distfiles_checked="${distfiles_checked}${file}:" ;; + get_answer_g n y "===>>> Delete $file? y/n" + case "$?" in + 1) pm_unlink $file ;; + 0) distfiles_checked="${distfiles_checked}${file}:" ;; esac done fi @@ -1848,12 +1863,11 @@ delete_all_distfiles () { if [ -n "$dist_list_files" ]; then local answer f + answer=y if [ -z "$ALWAYS_SCRUB_DISTFILES" ]; then echo "===>>> However, the list of files in $dist_list" - echo -n " should be current. Delete the files on this list? y/n [n] " - read answer - else - answer=y + get_answer_g n y " should be current. Delete the files on this list? y/n" + case "$?" in 0) answer=n ;; esac fi case "$answer" in @@ -1875,15 +1889,11 @@ delete_all_distfiles () { delete_all=delete_all else echo "===>>> Delete old and new distfiles for $origin" - echo -n " without prompting? y/n [n] " - local answer ; read answer - case "$answer" in - [yY]) delete_all=delete_all2 ;; - *) echo -n "===>>> Delete the current distfiles? y/n [n] " - read answer - case "$answer" in - [yY]) delete_current=delete_current ;; - esac ;; + get_answer_g n y " without prompting? y/n" + case "$?" in + 1) delete_all=delete_all2 ;; + 0) get_answer_g n y "===>>> Delete the current distfiles? y/n" + case "$?" in 1) delete_current=delete_current ;; esac ;; esac fi @@ -1968,7 +1978,7 @@ if [ -n "$EXPUNGE" ]; then dep=${dep%/+CON*} ; echo " ${dep##*/}" done echo '' - get_answer n Delete this dependency data + get_answer_yn n Delete this dependency data case "$?" in 0) for f in $deplist; do update_contents delete $f $origin @@ -2012,7 +2022,7 @@ if [ -n "$CLEAN_STALE" ]; then pkg_info $iport - get_answer n ${iport} is no longer depended on, delete + get_answer_yn n ${iport} is no longer depended on, delete case "$?" in 0) [ -n "$BACKUP" ] && { init_packages ; pm_pkg_create $pbu $iport; } [ -z "$DONT_SCRUB_DISTFILES" ] && { delete_all_distfiles $origin; delete_dist_list; } @@ -2021,7 +2031,7 @@ if [ -n "$CLEAN_STALE" ]; then pm_pkg_delete_s -f $iport || fail 'pkg_delete failed' exec $0 -s $ARGS ;; - *) get_answer y Delete this dependency data + *) get_answer_yn y Delete this dependency data case "$?" in 0) pm_unlink_s $file ;; *) no_del_list="${no_del_list}${iport}:" ;; @@ -2069,12 +2079,11 @@ check_interactive () { echo '' echo "===>>> +IGNOREME file is present for $1" fi - - echo '' ; echo -n "===>>> Update ${1}${update_to}? y/n [y] " - local answer ; read answer - case "$answer" in - [yY]|'') INTERACTIVE_YES="${INTERACTIVE_YES}${1}:" ;; - *) INTERACTIVE_NO="${INTERACTIVE_NO}${1}:" ; return 1 ;; + echo '' + get_answer_g y n "===>>> Update ${1}${update_to}? y/n" + case "$?" in + 0) INTERACTIVE_YES="${INTERACTIVE_YES}${1}:" ;; + 1) INTERACTIVE_NO="${INTERACTIVE_NO}${1}:" ; return 1 ;; esac return 0 } @@ -2489,11 +2498,9 @@ post_first_pass () { echo '' echo "===>>> The following actions will be taken if you choose to proceed:" echo -e "$build_l" - echo -n "===>>> Proceed? y/n [y] " - read answer - case "$answer" in - [yY]|'') ;; - *) echo '' + get_answer_g y n "===>>> Proceed? y/n" + case "$?" in + 1) echo '' echo "===>>> If you would like to upgrade or install some, but not" echo " all of the above try adding '-i' to the command line." safe_exit 1 ;; @@ -2754,16 +2761,12 @@ if [ "$$" -eq "$PM_PARENT_PID" -a -z "$S files=`find $pdb -type f -name PM_UPGRADE_DONE_FLAG` if [ -n "$files" ]; then echo "===>>> There are 'install complete' flags from a previous" - echo -n " -[rf] run of ${0##*/}, delete them? y/n [n] " - read answer - case "$answer" in - [yY]) pm_sv Deleting \'install complete\' flags + get_answer_g n y " -[rf] run of ${0##*/}, delete them? y/n" + case "$?" in + 1) pm_sv Deleting \'install complete\' flags pm_find_s $pdb -type f -name PM_UPGRADE_DONE_FLAG -delete ;; - *) echo -n "===>>> Enable the -R option? y/n [n] " - read answer - case "$answer" in - [yY]) RESTART=Ropt ; ARGS="-R $ARGS" ;; - esac ;; + 0) get_answer_g n y "===>>> Enable the -R option? y/n" + case "$?" in 1) RESTART=Ropt ; ARGS="-R $ARGS" ;; esac ;; esac fi fi @@ -2985,11 +2988,10 @@ if [ -e "$pdb/$upg_port/+IGNOREME" ]; th echo '' echo "===>>> $upg_port has an +IGNOREME file" echo '' - echo -n "===>>> Update anyway? y/n [n] " - read answer - case "$answer" in - [yY]) ;; # Let it build - *) CUR_DEPS="${CUR_DEPS}${upg_port}:${portdir}:" + get_answer_g n y "===>>> Update anyway? y/n" + case "$?" in + 1) ;; # Let it build + 0) CUR_DEPS="${CUR_DEPS}${upg_port}:${portdir}:" if [ ${dep_of_deps:-0} -gt 0 ]; then dep_of_deps=$(( $dep_of_deps - 1 )) [ -n "$PM_FIRST_PASS" ] && From owner-svn-src-user@FreeBSD.ORG Mon Jan 3 06:56:44 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7CD2106564A; Mon, 3 Jan 2011 06:56:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18F028FC1E; Mon, 3 Jan 2011 06:56:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p036uhjO078019; Mon, 3 Jan 2011 06:56:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p036uh9W078016; Mon, 3 Jan 2011 06:56:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101030656.p036uh9W078016@svn.freebsd.org> From: Doug Barton Date: Mon, 3 Jan 2011 06:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216916 - in user/dougb/portmaster: . files X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 06:56:44 -0000 Author: dougb Date: Mon Jan 3 06:56:43 2011 New Revision: 216916 URL: http://svn.freebsd.org/changeset/base/216916 Log: Add support and documentation for the PT_NO_INSTALL_PACKAGE make variable which will cause a port to always be compiled, instead of being installed from a package. It cannot be used in combination with the --packages-only option. Modified: user/dougb/portmaster/files/portmaster.8 user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/files/portmaster.8 ============================================================================== --- user/dougb/portmaster/files/portmaster.8 Mon Jan 3 06:40:39 2011 (r216915) +++ user/dougb/portmaster/files/portmaster.8 Mon Jan 3 06:56:43 2011 (r216916) @@ -589,7 +589,7 @@ file so that the dependencies match. .Pp If you wish to customize your build environment on a per-port basis you might want to take a look at -.Pa ports/ports-mgmt/portconf +.Pa /usr/ports/ports-mgmt/portconf .Pp To log actions taken by .Nm @@ -618,6 +618,21 @@ In situations where the user is ABSOLUTE that lack of a backup package should not be a fatal error .Ev PM_IGNORE_FAILED_BACKUP_PACKAGE can be defined to any value in the rc file. +.Pp +For those who wish to be sure that specific ports are always +compiled instead of being installed from packages the +.Ev PT_NO_INSTALL_PACKAGE +variable can be defined in the +.Xr make 1 +environment, perhaps in +.Pa /usr/local/etc/ports.conf +if using +.Pa /usr/ports/ports-mgmt/portconf , +or in +.Pa /etc/make.conf . +This setting is not compatible with the +.Fl PP/--packages-only +option. .Sh FILES .Bl -tag -width "1234" -compact .It Pa /usr/local/etc/portmaster.rc Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Jan 3 06:40:39 2011 (r216915) +++ user/dougb/portmaster/portmaster Mon Jan 3 06:56:43 2011 (r216916) @@ -3239,6 +3239,21 @@ fi [ -n "$PM_REQ_BY_SKIP_PARENT" ] && urb_final if [ -n "$PM_PACKAGES" -o "$PM_PACKAGES_BUILD" = doing_build_only_dep ]; then + case `pm_make_b -V PT_NO_INSTALL_PACKAGE` in + '') pm_package_time=yes ;; + *) if [ "$PM_PACKAGES" = 'only' ]; then + echo "===>>> The -PP/--packages-only option was specified, but" + echo " PT_NO_INSTALL_PACKAGE is defined for $portdir" + fail These 2 options are mutually exclusive + fi + echo "===>>> PT_NO_INSTALL_PACKAGE is set, building port" + echo '' ;; + esac +fi + +if [ -n "$pm_package_time" ]; then + unset pm_package_time + fetch_package () { local do_fetch @@ -3430,7 +3445,7 @@ notnewer () { echo '' fi fi -fi # [ -n "$PM_PACKAGES" -o "$PM_PACKAGES_BUILD" = doing_build_only_dep ] +fi # [ -n "$pm_package_time" ] if [ -z "$use_package" ]; then if [ -n "$PM_PACKAGES" ]; then From owner-svn-src-user@FreeBSD.ORG Mon Jan 3 15:31:02 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 831C81065679; Mon, 3 Jan 2011 15:31:02 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 726828FC1E; Mon, 3 Jan 2011 15:31:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p03FV2rV097007; Mon, 3 Jan 2011 15:31:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p03FV27W097005; Mon, 3 Jan 2011 15:31:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101031531.p03FV27W097005@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 3 Jan 2011 15:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216920 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 15:31:02 -0000 Author: nwhitehorn Date: Mon Jan 3 15:31:02 2011 New Revision: 216920 URL: http://svn.freebsd.org/changeset/base/216920 Log: Allow partition mountpoints to be deleted. Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Mon Jan 3 12:57:07 2011 (r216919) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Mon Jan 3 15:31:02 2011 (r216920) @@ -439,8 +439,18 @@ set_part_metadata(const char *name, cons /* VTOC8 needs partcode in UFS partitions */ if (strcmp(scheme, "VTOC8") == 0 && strcmp(type, "freebsd-ufs") == 0) md->bootcode = 1; - - if (mountpoint != NULL && mountpoint[0] != '\0') { + + if (mountpoint == NULL || mountpoint[0] == '\0') { + if (md->fstab != NULL) { + free(md->fstab->fs_spec); + free(md->fstab->fs_file); + free(md->fstab->fs_vfstype); + free(md->fstab->fs_mntops); + free(md->fstab->fs_type); + free(md->fstab); + md->fstab = NULL; + } + } else { if (md->fstab == NULL) { md->fstab = malloc(sizeof(struct fstab)); } else { From owner-svn-src-user@FreeBSD.ORG Wed Jan 5 01:07:32 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B44D1106566C; Wed, 5 Jan 2011 01:07:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A380A8FC14; Wed, 5 Jan 2011 01:07:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0517W0S060654; Wed, 5 Jan 2011 01:07:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0517WPf060652; Wed, 5 Jan 2011 01:07:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101050107.p0517WPf060652@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 5 Jan 2011 01:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216985 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 01:07:32 -0000 Author: nwhitehorn Date: Wed Jan 5 01:07:32 2011 New Revision: 216985 URL: http://svn.freebsd.org/changeset/base/216985 Log: Add a new variable (BSDINSTALL_CONFIGCURRENT), which, if set, will cause the installer to configure the current system in addition to the new one. This is for use by the network configuration script, which now does the appropriate thing in this case. Modified: user/nwhitehorn/bsdinstall/scripts/netconfig Modified: user/nwhitehorn/bsdinstall/scripts/netconfig ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/netconfig Wed Jan 5 00:19:40 2011 (r216984) +++ user/nwhitehorn/bsdinstall/scripts/netconfig Wed Jan 5 01:07:32 2011 (r216985) @@ -26,6 +26,15 @@ exec 3>&- cdialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 if [ $? -eq $DIALOG_OK ]; then echo ifconfig_$INTERFACE=\"DHCP\" >> /tmp/rc.conf + + if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then + cdialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 + dhclient $INTERFACE 2>> $BSDINSTALL_LOG + if [ $? -ne 0 ]; then + cdialog --backtitle 'FreeBSD Installer' --msgbox "DHCP lease acquisition failed." 0 0 + exec $0 + fi + fi exit 0 fi @@ -51,6 +60,14 @@ echo $INTERFACE $IF_CONFIG | printf("defaultrouter=\"%s\"\n", $4); }' >> /tmp/rc.conf +if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then + . /tmp/rc.conf + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` + route delete default + route add default $defaultrouter +fi + + echo $IF_CONFIG | awk '{ if ($4 != "") @@ -59,3 +76,6 @@ echo $IF_CONFIG | printf("search %s\n", $5); }' > /tmp/resolv.conf +if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then + cp /tmp/resolv.conf /etc/resolv.conf +fi From owner-svn-src-user@FreeBSD.ORG Thu Jan 6 02:21:15 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D5EF1065672; Thu, 6 Jan 2011 02:21:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5B68FC14; Thu, 6 Jan 2011 02:21:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p062LFQ6098417; Thu, 6 Jan 2011 02:21:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p062LFSp098415; Thu, 6 Jan 2011 02:21:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101060221.p062LFSp098415@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 6 Jan 2011 02:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217037 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 02:21:15 -0000 Author: nwhitehorn Date: Thu Jan 6 02:21:14 2011 New Revision: 217037 URL: http://svn.freebsd.org/changeset/base/217037 Log: Actually return the error code if we had an error. Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Wed Jan 5 23:45:07 2011 (r217036) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Thu Jan 6 02:21:14 2011 (r217037) @@ -113,7 +113,7 @@ main(void) { free(items); end_dialog(); - return (0); + return (error); } struct partition_metadata * From owner-svn-src-user@FreeBSD.ORG Thu Jan 6 02:36:29 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 729E31065672; Thu, 6 Jan 2011 02:36:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 494AE8FC15; Thu, 6 Jan 2011 02:36:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p062aT3d098775; Thu, 6 Jan 2011 02:36:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p062aTsH098773; Thu, 6 Jan 2011 02:36:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101060236.p062aTsH098773@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 6 Jan 2011 02:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217038 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 02:36:29 -0000 Author: nwhitehorn Date: Thu Jan 6 02:36:29 2011 New Revision: 217038 URL: http://svn.freebsd.org/changeset/base/217038 Log: Check for cntrl-C, errors, user choosing "Don't Save" in partedit, etc. Modified: user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Thu Jan 6 02:21:14 2011 (r217037) +++ user/nwhitehorn/bsdinstall/scripts/auto Thu Jan 6 02:36:29 2011 (r217038) @@ -4,8 +4,22 @@ echo "Begun Installation at $(date)" > $ cdialog --backtitle "FreeBSD Installer" --title "Welcome" --msgbox "Welcome to the FreeBSD Installer." 0 0 +checkerror() { + if [ $? -ne 0 ]; then + cdialog --backtitle "FreeBSD Installer" --title "Abort" \ + --no-label "Exit" --yes-label "Restart" --yesno \ + "You have canceled an installation step. Would you like to restart the installation or exit the installer?" 0 0 + if [ $? -ne 0 ]; then + exit + else + exec $0 $@ + fi + fi +} + rm /tmp/rc.conf bsdinstall hostname +checkerror FETCH_DISTRIBUTIONS="" for dist in $DISTRIBUTIONS; do @@ -16,24 +30,31 @@ done if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then cdialog --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 mirrorselect + bsdinstall netconfig + checkerror fi rm $PATH_FSTAB bsdinstall partedit +checkerror bsdinstall mount if [ ! -z $FETCH_DISTRIBUTIONS ]; then ALL_DISTRIBUTIONS=$DISTRIBUTIONS DISTRIBUTIONS=$FETCH_DISTRIBUTIONS bsdinstall distfetch + checkerror DISTRIBUTIONS=$ALL_DISTRIBUTIONS fi bsdinstall distextract +checkerror bsdinstall rootpass +checkerror bsdinstall adduser +checkerror bsdinstall config +checkerror cdialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0 From owner-svn-src-user@FreeBSD.ORG Thu Jan 6 03:56:01 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF763106564A; Thu, 6 Jan 2011 03:56:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0E9B8FC08; Thu, 6 Jan 2011 03:56:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p063u1QN001115; Thu, 6 Jan 2011 03:56:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p063u1hN001113; Thu, 6 Jan 2011 03:56:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101060356.p063u1hN001113@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 6 Jan 2011 03:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217041 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 03:56:02 -0000 Author: nwhitehorn Date: Thu Jan 6 03:56:01 2011 New Revision: 217041 URL: http://svn.freebsd.org/changeset/base/217041 Log: Use the newly-available "modified" attribute in gpart to determine if we have to do anything. This avoids an unnecessary warning due to an EPERM trying to commit/undo changes on an unmodified geom. Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Thu Jan 6 03:36:04 2011 (r217040) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Thu Jan 6 03:56:01 2011 (r217041) @@ -99,6 +99,7 @@ main(void) { error = apply_changes(&mesh); break; } else if (op == 3) { /* Don't save => Quit */ + gpart_revert_all(&mesh); error = -1; break; } From owner-svn-src-user@FreeBSD.ORG Thu Jan 6 03:57:06 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33A65106564A; Thu, 6 Jan 2011 03:57:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 01F4A8FC12; Thu, 6 Jan 2011 03:57:05 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 324B358137; Wed, 5 Jan 2011 21:57:05 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id e7YsOBaVBJuX; Wed, 5 Jan 2011 21:57:05 -0600 (CST) Received: from comporellon.tachypleus.net (unknown [76.210.75.5]) by mail.icecube.wisc.edu (Postfix) with ESMTP id A88DA58133; Wed, 5 Jan 2011 21:57:04 -0600 (CST) Message-ID: <4D253D8F.6080408@freebsd.org> Date: Wed, 05 Jan 2011 21:57:03 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101214 Thunderbird/3.1.7 MIME-Version: 1.0 To: Nathan Whitehorn References: <201101060356.p063u1hN001113@svn.freebsd.org> In-Reply-To: <201101060356.p063u1hN001113@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r217041 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 03:57:06 -0000 On 01/05/11 21:56, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Jan 6 03:56:01 2011 > New Revision: 217041 > URL: http://svn.freebsd.org/changeset/base/217041 > > Log: > Use the newly-available "modified" attribute in gpart to determine if we > have to do anything. This avoids an unnecessary warning due to an EPERM > trying to commit/undo changes on an unmodified geom. This was the wrong commit message. It should have been: Revert changes to all modified gparts if the user elects not to save changes. -Nathan > Modified: > user/nwhitehorn/bsdinstall/partedit/partedit.c > > Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c > ============================================================================== > --- user/nwhitehorn/bsdinstall/partedit/partedit.c Thu Jan 6 03:36:04 2011 (r217040) > +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Thu Jan 6 03:56:01 2011 (r217041) > @@ -99,6 +99,7 @@ main(void) { > error = apply_changes(&mesh); > break; > } else if (op == 3) { /* Don't save => Quit */ > + gpart_revert_all(&mesh); > error = -1; > break; > } From owner-svn-src-user@FreeBSD.ORG Thu Jan 6 03:57:25 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DCA1106564A; Thu, 6 Jan 2011 03:57:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 751228FC0A; Thu, 6 Jan 2011 03:57:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p063vP94001233; Thu, 6 Jan 2011 03:57:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p063vPHc001231; Thu, 6 Jan 2011 03:57:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101060357.p063vPHc001231@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 6 Jan 2011 03:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217042 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 03:57:25 -0000 Author: nwhitehorn Date: Thu Jan 6 03:57:25 2011 New Revision: 217042 URL: http://svn.freebsd.org/changeset/base/217042 Log: Use the newly-available "modified" attribute in gpart to determine if we have to do anything. This avoids an unnecessary warning due to an EPERM trying to commit/undo changes on an unmodified geom. Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Thu Jan 6 03:56:01 2011 (r217041) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Thu Jan 6 03:57:25 2011 (r217042) @@ -744,9 +744,11 @@ void gpart_revert_all(struct gmesh *mesh) { struct gclass *classp; + struct gconfig *gc; struct ggeom *gp; struct gctl_req *r; const char *errstr; + const char *modified; LIST_FOREACH(classp, &mesh->lg_class, lg_class) { if (strcmp(classp->lg_name, "PART") == 0) @@ -759,6 +761,18 @@ gpart_revert_all(struct gmesh *mesh) } LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + modified = "true"; /* XXX: If we don't know (kernel too old), + * assume there are modifications. */ + LIST_FOREACH(gc, &gp->lg_config, lg_config) { + if (strcmp(gc->lg_name, "modified") == 0) { + modified = gc->lg_val; + break; + } + } + + if (strcmp(modified, "false") == 0) + continue; + r = gctl_get_handle(); gctl_ro_param(r, "class", -1, "PART"); gctl_ro_param(r, "arg0", -1, gp->lg_name); @@ -772,51 +786,17 @@ gpart_revert_all(struct gmesh *mesh) } void -gpart_revert(struct gprovider *pp) -{ - struct gctl_req *r; - struct ggeom *geom; - struct gconsumer *cp; - const char *errstr; - - /* - * Find the PART geom we are manipulating. This may be a consumer of - * this provider, or its parent. Check the consumer case first. - */ - geom = NULL; - LIST_FOREACH(cp, &pp->lg_consumers, lg_consumers) - if (strcmp(cp->lg_geom->lg_class->lg_name, "PART") == 0) { - geom = cp->lg_geom; - break; - } - - if (geom == NULL && strcmp(pp->lg_geom->lg_class->lg_name, "PART") == 0) - geom = pp->lg_geom; - - if (geom == NULL) /* Things that aren't gpart we can't have changed */ - return; - - r = gctl_get_handle(); - gctl_ro_param(r, "class", -1, "PART"); - gctl_ro_param(r, "arg0", -1, geom->lg_name); - gctl_ro_param(r, "verb", -1, "undo"); - - errstr = gctl_issue(r); - if (errstr != NULL && errstr[0] != '\0') - gpart_show_error("Error", NULL, errstr); - gctl_free(r); -} - -void gpart_commit(struct gmesh *mesh) { struct partition_metadata *md; struct gclass *classp; struct ggeom *gp; + struct gconfig *gc; struct gconsumer *cp; struct gprovider *pp; struct gctl_req *r; const char *errstr; + const char *modified; LIST_FOREACH(classp, &mesh->lg_class, lg_class) { if (strcmp(classp->lg_name, "PART") == 0) @@ -829,6 +809,16 @@ gpart_commit(struct gmesh *mesh) } LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + LIST_FOREACH(gc, &gp->lg_config, lg_config) { + if (strcmp(gc->lg_name, "modified") == 0) { + modified = gc->lg_val; + break; + } + } + + if (strcmp(modified, "false") == 0) + continue; + /* Add bootcode if necessary, before the commit */ md = get_part_metadata(gp->lg_name, 0); if (md != NULL && md->bootcode) From owner-svn-src-user@FreeBSD.ORG Thu Jan 6 04:38:10 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E756106566C; Thu, 6 Jan 2011 04:38:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F99D8FC12; Thu, 6 Jan 2011 04:38:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p064cATb002519; Thu, 6 Jan 2011 04:38:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p064cA4M002515; Thu, 6 Jan 2011 04:38:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101060438.p064cA4M002515@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 6 Jan 2011 04:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217045 - in user/nwhitehorn/bsdinstall: . distextract partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 04:38:10 -0000 Author: nwhitehorn Date: Thu Jan 6 04:38:10 2011 New Revision: 217045 URL: http://svn.freebsd.org/changeset/base/217045 Log: Improve error handling. Modified: user/nwhitehorn/bsdinstall/bsdinstall user/nwhitehorn/bsdinstall/distextract/distextract.c user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/bsdinstall ============================================================================== --- user/nwhitehorn/bsdinstall/bsdinstall Thu Jan 6 04:12:29 2011 (r217044) +++ user/nwhitehorn/bsdinstall/bsdinstall Thu Jan 6 04:38:10 2011 (r217045) @@ -8,5 +8,5 @@ BSDINSTALL_CHROOT="/mnt"; export BSDINST VERB=$1 -$(dirname $0)/libexec/$VERB +exec $(dirname $0)/libexec/$VERB Modified: user/nwhitehorn/bsdinstall/distextract/distextract.c ============================================================================== --- user/nwhitehorn/bsdinstall/distextract/distextract.c Thu Jan 6 04:12:29 2011 (r217044) +++ user/nwhitehorn/bsdinstall/distextract/distextract.c Thu Jan 6 04:38:10 2011 (r217045) @@ -165,6 +165,7 @@ extract_files(int nfiles, const char **f archive_read_free(archive); } + err = 0; exit: end_dialog(); Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Thu Jan 6 04:12:29 2011 (r217044) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Thu Jan 6 04:38:10 2011 (r217045) @@ -809,6 +809,8 @@ gpart_commit(struct gmesh *mesh) } LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + modified = "true"; /* XXX: If we don't know (kernel too old), + * assume there are modifications. */ LIST_FOREACH(gc, &gp->lg_config, lg_config) { if (strcmp(gc->lg_name, "modified") == 0) { modified = gc->lg_val; From owner-svn-src-user@FreeBSD.ORG Thu Jan 6 18:23:36 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1B0B106566B; Thu, 6 Jan 2011 18:23:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6D6C8FC16; Thu, 6 Jan 2011 18:23:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06INa02024373; Thu, 6 Jan 2011 18:23:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06INaR9024371; Thu, 6 Jan 2011 18:23:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101061823.p06INaR9024371@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 6 Jan 2011 18:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217060 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 18:23:37 -0000 Author: nwhitehorn Date: Thu Jan 6 18:23:36 2011 New Revision: 217060 URL: http://svn.freebsd.org/changeset/base/217060 Log: Make error handling a little cleaner. Modified: user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Thu Jan 6 18:00:34 2011 (r217059) +++ user/nwhitehorn/bsdinstall/scripts/auto Thu Jan 6 18:23:36 2011 (r217060) @@ -4,22 +4,19 @@ echo "Begun Installation at $(date)" > $ cdialog --backtitle "FreeBSD Installer" --title "Welcome" --msgbox "Welcome to the FreeBSD Installer." 0 0 -checkerror() { +error() { + cdialog --backtitle "FreeBSD Installer" --title "Abort" \ + --no-label "Exit" --yes-label "Restart" --yesno \ + "You have canceled an installation step. Would you like to restart the installation or exit the installer?" 0 0 if [ $? -ne 0 ]; then - cdialog --backtitle "FreeBSD Installer" --title "Abort" \ - --no-label "Exit" --yes-label "Restart" --yesno \ - "You have canceled an installation step. Would you like to restart the installation or exit the installer?" 0 0 - if [ $? -ne 0 ]; then - exit - else - exec $0 $@ - fi + exit + else + exec $0 fi } rm /tmp/rc.conf -bsdinstall hostname -checkerror +bsdinstall hostname || error FETCH_DISTRIBUTIONS="" for dist in $DISTRIBUTIONS; do @@ -30,31 +27,24 @@ done if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then cdialog --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 - checkerror + bsdinstall netconfig || error fi rm $PATH_FSTAB -bsdinstall partedit -checkerror -bsdinstall mount +bsdinstall partedit || error +bsdinstall mount || error if [ ! -z $FETCH_DISTRIBUTIONS ]; then ALL_DISTRIBUTIONS=$DISTRIBUTIONS DISTRIBUTIONS=$FETCH_DISTRIBUTIONS - bsdinstall distfetch - checkerror + bsdinstall distfetch || error DISTRIBUTIONS=$ALL_DISTRIBUTIONS fi -bsdinstall distextract -checkerror -bsdinstall rootpass -checkerror -bsdinstall adduser -checkerror -bsdinstall config -checkerror +bsdinstall distextract || error +bsdinstall rootpass || error +bsdinstall adduser || error +bsdinstall config || error cdialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0 From owner-svn-src-user@FreeBSD.ORG Fri Jan 7 16:51:47 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD0C1106566B; Fri, 7 Jan 2011 16:51:47 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91CBA8FC12; Fri, 7 Jan 2011 16:51:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p07GplxG059156; Fri, 7 Jan 2011 16:51:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p07Gplt0059151; Fri, 7 Jan 2011 16:51:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101071651.p07Gplt0059151@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 7 Jan 2011 16:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217111 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 16:51:47 -0000 Author: nwhitehorn Date: Fri Jan 7 16:51:47 2011 New Revision: 217111 URL: http://svn.freebsd.org/changeset/base/217111 Log: Split application of configuration and setting up ssh, etc. into two scripts and allow the user to set the system time zone by running tzsetup in a chroot. The 'time' script could potentially allow setting the system clock as well, depending on how fancy we want to get. Added: user/nwhitehorn/bsdinstall/scripts/services - copied, changed from r217084, user/nwhitehorn/bsdinstall/scripts/config user/nwhitehorn/bsdinstall/scripts/time Modified: user/nwhitehorn/bsdinstall/scripts/auto user/nwhitehorn/bsdinstall/scripts/config Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Fri Jan 7 16:47:20 2011 (r217110) +++ user/nwhitehorn/bsdinstall/scripts/auto Fri Jan 7 16:51:47 2011 (r217111) @@ -43,6 +43,8 @@ fi bsdinstall distextract || error bsdinstall rootpass || error +bsdinstall time || error +bsdinstall services || error bsdinstall adduser || error bsdinstall config || error Modified: user/nwhitehorn/bsdinstall/scripts/config ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/config Fri Jan 7 16:47:20 2011 (r217110) +++ user/nwhitehorn/bsdinstall/scripts/config Fri Jan 7 16:51:47 2011 (r217111) @@ -1,20 +1,5 @@ #!/bin/sh -exec 3>&1 -DAEMONS=$(cdialog --backtitle "FreeBSD Installer" \ - --title "System Configuration" --nocancel --separate-output \ - --checklist "Choose the services you would like to be started at boot:" \ - 0 0 0 \ - sshd "Secure shell daemon" on \ - ntpd "Synchronize system and network time" off \ - powerd "Adjust CPU frequency dynamically" off \ -2>&1 1>&3) -exec 3>&- - -for daemon in $DAEMONS; do - echo ${daemon}_enable=\"YES\" >> /tmp/rc.conf -done - cp $PATH_FSTAB $BSDINSTALL_CHROOT/etc/fstab cp /tmp/rc.conf $BSDINSTALL_CHROOT/etc/rc.conf cp /tmp/resolv.conf $BSDINSTALL_CHROOT/etc/resolv.conf Copied and modified: user/nwhitehorn/bsdinstall/scripts/services (from r217084, user/nwhitehorn/bsdinstall/scripts/config) ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/config Thu Jan 6 22:57:06 2011 (r217084, copy source) +++ user/nwhitehorn/bsdinstall/scripts/services Fri Jan 7 16:51:47 2011 (r217111) @@ -15,6 +15,3 @@ for daemon in $DAEMONS; do echo ${daemon}_enable=\"YES\" >> /tmp/rc.conf done -cp $PATH_FSTAB $BSDINSTALL_CHROOT/etc/fstab -cp /tmp/rc.conf $BSDINSTALL_CHROOT/etc/rc.conf -cp /tmp/resolv.conf $BSDINSTALL_CHROOT/etc/resolv.conf Added: user/nwhitehorn/bsdinstall/scripts/time ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/scripts/time Fri Jan 7 16:51:47 2011 (r217111) @@ -0,0 +1,3 @@ +#!/bin/sh + +chroot $BSDINSTALL_CHROOT tzsetup From owner-svn-src-user@FreeBSD.ORG Fri Jan 7 16:54:30 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A47B106564A; Fri, 7 Jan 2011 16:54:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2960E8FC12; Fri, 7 Jan 2011 16:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p07GsUl9059251; Fri, 7 Jan 2011 16:54:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p07GsUDT059250; Fri, 7 Jan 2011 16:54:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101071654.p07GsUDT059250@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 7 Jan 2011 16:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217112 - in user/nwhitehorn/bsdinstall: libexec scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 16:54:30 -0000 Author: nwhitehorn Date: Fri Jan 7 16:54:29 2011 New Revision: 217112 URL: http://svn.freebsd.org/changeset/base/217112 Log: Missed a file and an svn property. Added: user/nwhitehorn/bsdinstall/libexec/time (contents, props changed) Modified: Directory Properties: user/nwhitehorn/bsdinstall/scripts/time (props changed) Added: user/nwhitehorn/bsdinstall/libexec/time ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/libexec/time Fri Jan 7 16:54:29 2011 (r217112) @@ -0,0 +1 @@ +link ../scripts/time \ No newline at end of file From owner-svn-src-user@FreeBSD.ORG Sat Jan 8 00:48:01 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5B910656BA; Sat, 8 Jan 2011 00:48:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC2F8FC15; Sat, 8 Jan 2011 00:48:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p080m1FI071239; Sat, 8 Jan 2011 00:48:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p080m1ia071230; Sat, 8 Jan 2011 00:48:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101080048.p080m1ia071230@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 8 Jan 2011 00:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217136 - in user/nwhitehorn/bsdinstall: . libexec scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 00:48:01 -0000 Author: nwhitehorn Date: Sat Jan 8 00:48:00 2011 New Revision: 217136 URL: http://svn.freebsd.org/changeset/base/217136 Log: Change the way files destined for the new system's /etc are stored and add a missed file. Added: user/nwhitehorn/bsdinstall/libexec/services (contents, props changed) Modified: user/nwhitehorn/bsdinstall/bsdinstall user/nwhitehorn/bsdinstall/scripts/auto user/nwhitehorn/bsdinstall/scripts/config user/nwhitehorn/bsdinstall/scripts/hostname user/nwhitehorn/bsdinstall/scripts/mount user/nwhitehorn/bsdinstall/scripts/netconfig user/nwhitehorn/bsdinstall/scripts/services Modified: user/nwhitehorn/bsdinstall/bsdinstall ============================================================================== --- user/nwhitehorn/bsdinstall/bsdinstall Sat Jan 8 00:44:17 2011 (r217135) +++ user/nwhitehorn/bsdinstall/bsdinstall Sat Jan 8 00:48:00 2011 (r217136) @@ -2,7 +2,8 @@ DISTRIBUTIONS="kernel.tgz world.tgz distribution.tgz"; export DISTRIBUTIONS BSDINSTALL_LOG="/tmp/bsdinstall_log"; export BSDINSTALL_LOG -PATH_FSTAB="/tmp/fstab"; export PATH_FSTAB +BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"; export BSDINSTALL_TMPETC +PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"; export PATH_FSTAB BSDINSTALL_DISTDIR="/var/dist"; export BSDINSTALL_DISTDIR BSDINSTALL_CHROOT="/mnt"; export BSDINSTALL_CHROOT Added: user/nwhitehorn/bsdinstall/libexec/services ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/libexec/services Sat Jan 8 00:48:00 2011 (r217136) @@ -0,0 +1 @@ +link ../scripts/services \ No newline at end of file Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Sat Jan 8 00:44:17 2011 (r217135) +++ user/nwhitehorn/bsdinstall/scripts/auto Sat Jan 8 00:48:00 2011 (r217136) @@ -15,7 +15,8 @@ error() { fi } -rm /tmp/rc.conf +rm -rf $BSDINSTALL_TMPETC +mkdir $BSDINSTALL_TMPETC bsdinstall hostname || error FETCH_DISTRIBUTIONS="" Modified: user/nwhitehorn/bsdinstall/scripts/config ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/config Sat Jan 8 00:44:17 2011 (r217135) +++ user/nwhitehorn/bsdinstall/scripts/config Sat Jan 8 00:48:00 2011 (r217136) @@ -1,5 +1,3 @@ #!/bin/sh -cp $PATH_FSTAB $BSDINSTALL_CHROOT/etc/fstab -cp /tmp/rc.conf $BSDINSTALL_CHROOT/etc/rc.conf -cp /tmp/resolv.conf $BSDINSTALL_CHROOT/etc/resolv.conf +cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc Modified: user/nwhitehorn/bsdinstall/scripts/hostname ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/hostname Sat Jan 8 00:44:17 2011 (r217135) +++ user/nwhitehorn/bsdinstall/scripts/hostname Sat Jan 8 00:48:00 2011 (r217136) @@ -16,4 +16,4 @@ If you are running on a managed network, if [ $? -eq $DIALOG_CANCEL ]; then exec $0; fi exec 3>&- -echo "hostname=\"$HOSTNAME\"" >> /tmp/rc.conf +echo "hostname=\"$HOSTNAME\"" >> $BSDINSTALL_TMPETC/rc.conf Modified: user/nwhitehorn/bsdinstall/scripts/mount ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/mount Sat Jan 8 00:44:17 2011 (r217135) +++ user/nwhitehorn/bsdinstall/scripts/mount Sat Jan 8 00:48:00 2011 (r217136) @@ -1,5 +1,7 @@ #!/bin/sh +TMP_FSTAB=/tmp/bsdinstall-tmp-fstab + cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL_CHROOT '{ if ($2 ~ "^/.*") { fsname = $2; @@ -8,16 +10,20 @@ cat $PATH_FSTAB | awk -v BSDINSTALL_CHRO printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, fsname, $3, $4, $5, $6); } -}' > $PATH_FSTAB.tmp +}' > $TMP_FSTAB -FILESYSTEMS=`cat $PATH_FSTAB.tmp | awk '/^[^#].*/ {if ($2 ~ "^/.*") printf("%s\n", $2);}' | sort -t /` +FILESYSTEMS=`cat $TMP_FSTAB | awk '/^[^#].*/ {if ($2 ~ "^/.*") printf("%s\n", $2);}' | sort -t /` for i in $FILESYSTEMS; do mkdir $i 2>/dev/null - MNTERROR=`mount -F $PATH_FSTAB.tmp $i 2>&1` + MNTERROR=`mount -F $TMP_FSTAB $i 2>&1` if [ $? -ne 0 ]; then cdialog --backtitle "FreeBSD Installer" --title "Error" \ --msgbox "Error mounting partition $i:\n$MNTERROR" 0 0 exit 1 fi done + +# User might want a shell and require devfs, so mount it +mkdir $BSDINSTALL_CHROOT/dev +mount -t devfs devfs $BSDINSTALL_CHROOT/dev Modified: user/nwhitehorn/bsdinstall/scripts/netconfig ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/netconfig Sat Jan 8 00:44:17 2011 (r217135) +++ user/nwhitehorn/bsdinstall/scripts/netconfig Sat Jan 8 00:48:00 2011 (r217136) @@ -25,7 +25,7 @@ exec 3>&- cdialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 if [ $? -eq $DIALOG_OK ]; then - echo ifconfig_$INTERFACE=\"DHCP\" >> /tmp/rc.conf + echo ifconfig_$INTERFACE=\"DHCP\" >> $BSDINSTALL_TMPETC/rc.conf if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then cdialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 @@ -58,10 +58,10 @@ echo $INTERFACE $IF_CONFIG | awk '{ printf("ifconfig_%s=\"%s netmask %s\"\n", $1, $2, $3); printf("defaultrouter=\"%s\"\n", $4); - }' >> /tmp/rc.conf + }' >> $BSDINSTALL_TMPETC/rc.conf if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then - . /tmp/rc.conf + . $BSDINSTALL_TMPETC/rc.conf ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` route delete default route add default $defaultrouter @@ -74,8 +74,5 @@ echo $IF_CONFIG | printf("nameserver %s\n", $4); if ($5 != "") printf("search %s\n", $5); - }' > /tmp/resolv.conf + }' > $BSDINSTALL_TMPETC/resolv.conf -if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then - cp /tmp/resolv.conf /etc/resolv.conf -fi Modified: user/nwhitehorn/bsdinstall/scripts/services ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/services Sat Jan 8 00:44:17 2011 (r217135) +++ user/nwhitehorn/bsdinstall/scripts/services Sat Jan 8 00:48:00 2011 (r217136) @@ -12,6 +12,6 @@ DAEMONS=$(cdialog --backtitle "FreeBSD I exec 3>&- for daemon in $DAEMONS; do - echo ${daemon}_enable=\"YES\" >> /tmp/rc.conf + echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf done From owner-svn-src-user@FreeBSD.ORG Sat Jan 8 01:39:43 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68DFD1065698; Sat, 8 Jan 2011 01:39:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 581A48FC0C; Sat, 8 Jan 2011 01:39:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p081dhv2072396; Sat, 8 Jan 2011 01:39:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p081dhtX072394; Sat, 8 Jan 2011 01:39:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101080139.p081dhtX072394@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 8 Jan 2011 01:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217139 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 01:39:43 -0000 Author: nwhitehorn Date: Sat Jan 8 01:39:43 2011 New Revision: 217139 URL: http://svn.freebsd.org/changeset/base/217139 Log: Most users want network access. Although them to configure it from the installer even if this is not a network install. Modified: user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Sat Jan 8 01:15:32 2011 (r217138) +++ user/nwhitehorn/bsdinstall/scripts/auto Sat Jan 8 01:39:43 2011 (r217139) @@ -29,6 +29,7 @@ done if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then cdialog --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 fi rm $PATH_FSTAB @@ -44,6 +45,9 @@ fi bsdinstall distextract || error bsdinstall rootpass || error +if [ "$NETCONFIG_DONE" != yes ]; then + bsdinstall netconfig # Don't check for errors -- the user may cancel +fi bsdinstall time || error bsdinstall services || error bsdinstall adduser || error From owner-svn-src-user@FreeBSD.ORG Sat Jan 8 15:59:15 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58DEF1065694; Sat, 8 Jan 2011 15:59:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E2638FC16; Sat, 8 Jan 2011 15:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08FxFqO096539; Sat, 8 Jan 2011 15:59:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08FxFWS096538; Sat, 8 Jan 2011 15:59:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101081559.p08FxFWS096538@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 8 Jan 2011 15:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217149 - in user/nwhitehorn/bsdinstall: libexec scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 15:59:15 -0000 Author: nwhitehorn Date: Sat Jan 8 15:59:14 2011 New Revision: 217149 URL: http://svn.freebsd.org/changeset/base/217149 Log: Media selection just makes things complicated. If we have the distfiles, install them. If we don't, download them. Simple. Deleted: user/nwhitehorn/bsdinstall/libexec/mediaselect user/nwhitehorn/bsdinstall/scripts/mediaselect From owner-svn-src-user@FreeBSD.ORG Sat Jan 8 18:30:08 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6528B10656CD; Sat, 8 Jan 2011 18:30:08 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53E878FC13; Sat, 8 Jan 2011 18:30:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08IU6qe000508; Sat, 8 Jan 2011 18:30:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08IU6es000501; Sat, 8 Jan 2011 18:30:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101081830.p08IU6es000501@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 8 Jan 2011 18:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217158 - in user/nwhitehorn/bsdinstall: . distextract distfetch libexec partedit scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 18:30:08 -0000 Author: nwhitehorn Date: Sat Jan 8 18:30:06 2011 New Revision: 217158 URL: http://svn.freebsd.org/changeset/base/217158 Log: Provide a real build system that installs this software into real places. Subscripts go in /usr/libexec/bsdinstall, and the main bsdinstall binary goes in /usr/sbin. Also modify bsdinstall to run the "auto" verb by default if no other command is given. Added: user/nwhitehorn/bsdinstall/Makefile user/nwhitehorn/bsdinstall/scripts/Makefile Deleted: user/nwhitehorn/bsdinstall/libexec/ Modified: user/nwhitehorn/bsdinstall/NOTES user/nwhitehorn/bsdinstall/bsdinstall user/nwhitehorn/bsdinstall/distextract/Makefile user/nwhitehorn/bsdinstall/distfetch/Makefile user/nwhitehorn/bsdinstall/partedit/Makefile Added: user/nwhitehorn/bsdinstall/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/Makefile Sat Jan 8 18:30:06 2011 (r217158) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +BINDIR= /usr/sbin +SUBDIR= distextract distfetch partedit scripts +SCRIPTS= bsdinstall + +.include Modified: user/nwhitehorn/bsdinstall/NOTES ============================================================================== --- user/nwhitehorn/bsdinstall/NOTES Sat Jan 8 18:09:48 2011 (r217157) +++ user/nwhitehorn/bsdinstall/NOTES Sat Jan 8 18:30:06 2011 (r217158) @@ -13,3 +13,9 @@ Environment variables affecting modules: - BSDINSTALL_CHROOT: Destination location for the installation. File systems are mounted here and files installed to this path. +Install CD environment: +- Distfiles in /var/dist +- tmpmfs and varmfs turn on automatically due to read-only media +- /etc/resolv.conf symlink to /tmp/etc/resolv.conf (propagates to new system) +- /boot/loader.conf set to run installer + Modified: user/nwhitehorn/bsdinstall/bsdinstall ============================================================================== --- user/nwhitehorn/bsdinstall/bsdinstall Sat Jan 8 18:09:48 2011 (r217157) +++ user/nwhitehorn/bsdinstall/bsdinstall Sat Jan 8 18:30:06 2011 (r217158) @@ -7,7 +7,11 @@ PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"; e BSDINSTALL_DISTDIR="/var/dist"; export BSDINSTALL_DISTDIR BSDINSTALL_CHROOT="/mnt"; export BSDINSTALL_CHROOT -VERB=$1 +VERB=$1; shift -exec $(dirname $0)/libexec/$VERB +if [ -z $VERB ]; then + VERB=auto +fi + +exec /usr/libexec/bsdinstall/$VERB $@ Modified: user/nwhitehorn/bsdinstall/distextract/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/distextract/Makefile Sat Jan 8 18:09:48 2011 (r217157) +++ user/nwhitehorn/bsdinstall/distextract/Makefile Sat Jan 8 18:30:06 2011 (r217158) @@ -1,5 +1,6 @@ # $FreeBSD $ +BINDIR= /usr/libexec/bsdinstall PROG= distextract LDADD= -larchive -lncursesw -L/usr/local/lib -lcdialog -lm CFLAGS= -I/usr/local/include Modified: user/nwhitehorn/bsdinstall/distfetch/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/distfetch/Makefile Sat Jan 8 18:09:48 2011 (r217157) +++ user/nwhitehorn/bsdinstall/distfetch/Makefile Sat Jan 8 18:30:06 2011 (r217158) @@ -1,5 +1,6 @@ # $FreeBSD $ +BINDIR= /usr/libexec/bsdinstall PROG= distfetch LDADD= -lfetch -lncursesw -L/usr/local/lib -lcdialog -lm CFLAGS= -I/usr/local/include Modified: user/nwhitehorn/bsdinstall/partedit/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/Makefile Sat Jan 8 18:09:48 2011 (r217157) +++ user/nwhitehorn/bsdinstall/partedit/Makefile Sat Jan 8 18:30:06 2011 (r217158) @@ -1,5 +1,6 @@ # $FreeBSD $ +BINDIR= /usr/libexec/bsdinstall PROG= partedit LDADD= -lgeom -lncursesw -lutil -L/usr/local/lib -lcdialog -lm CFLAGS= -I/usr/local/include Added: user/nwhitehorn/bsdinstall/scripts/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/scripts/Makefile Sat Jan 8 18:30:06 2011 (r217158) @@ -0,0 +1,8 @@ +# $FreeBSD $ + +SCRIPTS= auto adduser config hostname mount netconfig rootpass services time +BINDIR= /usr/libexec/bsdinstall + +NO_MAN= true + +.include From owner-svn-src-user@FreeBSD.ORG Sat Jan 8 18:31:23 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E103B10656BB; Sat, 8 Jan 2011 18:31:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0D198FC12; Sat, 8 Jan 2011 18:31:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08IVN8r000582; Sat, 8 Jan 2011 18:31:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08IVNjK000580; Sat, 8 Jan 2011 18:31:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101081831.p08IVNjK000580@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 8 Jan 2011 18:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217159 - user/nwhitehorn/bsdinstall X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 18:31:24 -0000 Author: nwhitehorn Date: Sat Jan 8 18:31:23 2011 New Revision: 217159 URL: http://svn.freebsd.org/changeset/base/217159 Log: Update README to reflect current status. Modified: user/nwhitehorn/bsdinstall/README Modified: user/nwhitehorn/bsdinstall/README ============================================================================== --- user/nwhitehorn/bsdinstall/README Sat Jan 8 18:30:06 2011 (r217158) +++ user/nwhitehorn/bsdinstall/README Sat Jan 8 18:31:23 2011 (r217159) @@ -1,7 +1,7 @@ FreeBSD Stopgap Installer ========================= Nathan Whitehorn -December 30, 2010 +January 8, 2010 This is designed to be a lightweight replacement for sysinstall until future installers show up, but more modular and easily extended. It is scriptable @@ -11,13 +11,10 @@ bsdinstall must be in PATH. In addition dialog must be installed (devel/cdialog). Status: -- Installs working, bootable systems on powerpc, amd64, and i386 +- Installs working, bootable systems on powerpc, amd64, i386, and sparc64 Missing features: - Distfile fetching not entirely hooked up -- Root password configuration and user adding not yet added -- Network configuration sets up networking for the new system, but not (yet) - the current one Goals: - Reinvent as few wheels as possible From owner-svn-src-user@FreeBSD.ORG Sat Jan 8 20:25:13 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D49B11065670; Sat, 8 Jan 2011 20:25:13 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3F678FC16; Sat, 8 Jan 2011 20:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08KPD1a003322; Sat, 8 Jan 2011 20:25:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08KPD1U003317; Sat, 8 Jan 2011 20:25:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101082025.p08KPD1U003317@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 8 Jan 2011 20:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217165 - in user/nwhitehorn/bsdinstall: . scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 20:25:14 -0000 Author: nwhitehorn Date: Sat Jan 8 20:25:13 2011 New Revision: 217165 URL: http://svn.freebsd.org/changeset/base/217165 Log: Various improvements for running from read-only media (e.g. install CDs). Added: user/nwhitehorn/bsdinstall/rc.local (contents, props changed) user/nwhitehorn/bsdinstall/testsystem.sh (contents, props changed) Modified: user/nwhitehorn/bsdinstall/bsdinstall user/nwhitehorn/bsdinstall/scripts/hostname Modified: user/nwhitehorn/bsdinstall/bsdinstall ============================================================================== --- user/nwhitehorn/bsdinstall/bsdinstall Sat Jan 8 20:25:00 2011 (r217164) +++ user/nwhitehorn/bsdinstall/bsdinstall Sat Jan 8 20:25:13 2011 (r217165) @@ -4,7 +4,7 @@ DISTRIBUTIONS="kernel.tgz world.tgz dist BSDINSTALL_LOG="/tmp/bsdinstall_log"; export BSDINSTALL_LOG BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"; export BSDINSTALL_TMPETC PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"; export PATH_FSTAB -BSDINSTALL_DISTDIR="/var/dist"; export BSDINSTALL_DISTDIR +BSDINSTALL_DISTDIR="/usr/bsdinstall-dist"; export BSDINSTALL_DISTDIR BSDINSTALL_CHROOT="/mnt"; export BSDINSTALL_CHROOT VERB=$1; shift Added: user/nwhitehorn/bsdinstall/rc.local ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/rc.local Sat Jan 8 20:25:13 2011 (r217165) @@ -0,0 +1,28 @@ +#!/bin/sh + +: ${DIALOG_OK=0} +: ${DIALOG_CANCEL=1} +: ${DIALOG_HELP=2} +: ${DIALOG_EXTRA=3} +: ${DIALOG_ITEM_HELP=4} +: ${DIALOG_ESC=255} + +TERM=xterm; export TERM # XXX: serial consoles + +cdialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Installer" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0 + +case $? in +$DIALOG_OK) # Installer + BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT + bsdinstall + reboot + ;; +$DIALOG_CANCEL) # Live CD + exit 0 + ;; +$DIALOG_EXTRA) # Shell + /bin/sh + . /etc/rc.local + ;; +esac + Modified: user/nwhitehorn/bsdinstall/scripts/hostname ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/hostname Sat Jan 8 20:25:00 2011 (r217164) +++ user/nwhitehorn/bsdinstall/scripts/hostname Sat Jan 8 20:25:13 2011 (r217165) @@ -13,7 +13,10 @@ HOSTNAME=`cdialog --backtitle 'FreeBSD I If you are running on a managed network, please ask your network administrator for an appropriate name.' \ 0 0 $(hostname) 2>&1 1>&3` -if [ $? -eq $DIALOG_CANCEL ]; then exec $0; fi +if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi exec 3>&- echo "hostname=\"$HOSTNAME\"" >> $BSDINSTALL_TMPETC/rc.conf +if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then + hostname -s "$HOSTNAME" +fi Added: user/nwhitehorn/bsdinstall/testsystem.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/testsystem.sh Sat Jan 8 20:25:13 2011 (r217165) @@ -0,0 +1,47 @@ +#!/bin/sh + +# testsystem.sh + +mkdir $2 + +# Kernel package +cd /usr/src +mkdir $1 +make installkernel DESTDIR=$1 +cd $1 +tar cvzf $2/kernel.tgz . +chflags -R noschg . +rm -rf $1 + +# Distribution +cd /usr/src +mkdir $1 +make distrib-dirs distribution DESTDIR=$1 +cd $1 +tar cvzf $2/distribution.tgz . +chflags -R noschg . +rm -rf $1 + +# World +cd /usr/src +mkdir $1 +make installworld DESTDIR=$1 +cd $1 +tar cvzf $2/world.tgz . +# Keep world around + +# Make system +cd /usr/src +make installkernel distribution DESTDIR=$1 +mkdir $1/var/dist +cp $2/kernel.tgz $2/world.tgz $2/distribution.tgz $1/var/dist + +# Things for the CD environment +ln -s /tmp/bsdinstall_etc/resolv.conf $1/etc/resolv.conf +echo kernel_options=\"-C\" > $1/boot/loader.conf +echo sendmail_enable=\"NONE\" > $1/etc/rc.conf + +# cdialog is not called dialog yet, except here +ln -s /usr/bin/dialog $1/usr/bin/cdialog + +#mkisoimages.sh -b FreeBSD_Install $3 $1