head	1.6;
access;
symbols
	RELENG_9_1_0_RELEASE:1.3.2.1.4.2
	RELENG_9_1:1.3.2.1.0.4
	RELENG_9_1_BP:1.3.2.1
	RELENG_9_0_0_RELEASE:1.3.2.1.2.1
	RELENG_9_0:1.3.2.1.0.2
	RELENG_9_0_BP:1.3.2.1
	RELENG_9:1.3.0.2
	RELENG_9_BP:1.3;
locks; strict;
comment	@# @;


1.6
date	2012.11.17.01.54.40;	author svnexp;	state Exp;
branches;
next	1.5;

1.5
date	2012.10.22.18.14.27;	author dteske;	state Exp;
branches;
next	1.4;

1.4
date	2012.08.21.13.46.46;	author dteske;	state Exp;
branches;
next	1.3;

1.3
date	2011.04.05.03.09.44;	author nwhitehorn;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2011.02.22.13.56.59;	author nwhitehorn;	state Exp;
branches;
next	1.1;

1.1
date	2011.02.18.14.54.34;	author nwhitehorn;	state Exp;
branches;
next	;

1.3.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.3.2.1.2.1
	1.3.2.1.4.1;
next	1.3.2.2;

1.3.2.2
date	2012.08.28.15.45.37;	author dteske;	state Exp;
branches;
next	1.3.2.3;

1.3.2.3
date	2012.11.17.11.37.43;	author svnexp;	state Exp;
branches;
next	1.3.2.4;

1.3.2.4
date	2013.03.13.14.04.34;	author svnexp;	state Exp;
branches;
next	1.3.2.5;

1.3.2.5
date	2014.03.31.02.01.45;	author svnexp;	state Exp;
branches;
next	1.3.2.6;

1.3.2.6
date	2014.04.14.02.01.43;	author svnexp;	state Exp;
branches;
next	;

1.3.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.3.2.1.2.2;

1.3.2.1.2.2
date	2012.11.17.08.37.39;	author svnexp;	state Exp;
branches;
next	;

1.3.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.3.2.1.4.2;

1.3.2.1.4.2
date	2012.11.17.08.48.31;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Switching exporter and resync
@
text
@#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: head/usr.sbin/bsdinstall/bsdinstall 241902 2012-10-22 18:14:27Z dteske $

: ${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="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR
: ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT

VERB=${1:-auto}; shift

[ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC"
echo "Running installation step: $VERB $@@" >> "$BSDINSTALL_LOG"
exec "/usr/libexec/bsdinstall/$VERB" "$@@" 2>> "$BSDINSTALL_LOG"
@


1.5
log
@SVN rev 241902 on 2012-10-22 18:14:27Z by dteske

Optimize syntax to use builtins and reduce unnecessary forking where possible.

Reviewed by:	nwhitehorn
Approved by:	adrian (co-mentor)
@
text
@d27 1
a27 1
# $FreeBSD$
@


1.4
log
@SVN rev 239500 on 2012-08-21 13:46:46Z by dteske

Fix "unexpected operator" error when passed multi-word first-argument
containing whitespace. Also make other changes to support multi-word
arguments.

PR:		bin/170759
Submitted by:	dteske
Reviewed by:	emaste (mentor)
Approved by:	emaste (mentor)
MFC after:	3 days
@
text
@d35 1
a35 1
VERB=$1; shift
d37 1
a37 5
if [ -z "$VERB" ]; then
	VERB=auto
fi

test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC"
d39 1
a39 1
exec "/usr/libexec/bsdinstall/$VERB" "$@@" 2>>"$BSDINSTALL_LOG"
@


1.3
log
@SVN rev 220350 on 2011-04-05 03:09:44Z by nwhitehorn

Improve logging by always sending stderr to the installation log file.
Reduce warnings by making sure the temporary etc directory exists.
@
text
@d37 1
a37 1
if [ -z $VERB ]; then
d42 2
a43 3
echo Running installation step: $VERB $@@ >> "$BSDINSTALL_LOG"
exec /usr/libexec/bsdinstall/$VERB $@@ 2>>"$BSDINSTALL_LOG"

@


1.3.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.3.2.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.3.2.1.4.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.1/usr.sbin/bsdinstall/bsdinstall 220350 2011-04-05 03:09:44Z nwhitehorn $
@


1.3.2.2
log
@SVN rev 239782 on 2012-08-28 15:45:37Z by dteske

MFC r239500:
Fix "unexpected operator" error when passed multi-word first-argument
containing whitespace. Also make other changes to support multi-word
arguments.

PR:		bin/170759
Submitted by:	dteske
Reviewed by:	emaste (mentor)
Approved by:	emaste (mentor)
@
text
@d37 1
a37 1
if [ -z "$VERB" ]; then
d42 3
a44 2
echo "Running installation step: $VERB $@@" >> "$BSDINSTALL_LOG"
exec "/usr/libexec/bsdinstall/$VERB" "$@@" 2>>"$BSDINSTALL_LOG"
@


1.3.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d27 1
a27 1
# $FreeBSD: stable/9/usr.sbin/bsdinstall/bsdinstall 239782 2012-08-28 15:45:37Z dteske $
@


1.3.2.4
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248237
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d27 1
a27 1
# $FreeBSD: stable/9/usr.sbin/bsdinstall/bsdinstall 248237 2013-03-13 13:41:28Z nwhitehorn $
d35 1
a35 1
VERB=${1:-auto}; shift
d37 5
a41 1
[ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC"
d43 1
a43 1
exec "/usr/libexec/bsdinstall/$VERB" "$@@" 2>> "$BSDINSTALL_LOG"
@


1.3.2.5
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/263956
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a3 1
# Copyright (c) 2013 Devin Teske
d27 1
a27 14
# $FreeBSD: stable/9/usr.sbin/bsdinstall/bsdinstall 263956 2014-03-31 01:04:40Z dteske $
#
############################################################ INCLUDES

# Delay processing of debug flags as the parent until MAIN. export'd to disable
# re-processing of flags (all children log to the parent's log file).
#
export DEBUG_SELF_INITIALIZE=
export DEBUG_INITIALIZE_FILE=

BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1

############################################################ GLOBALS
d29 1
d35 1
a35 14
export debugFile="${debugFile-${BSDINSTALL_LOG-/tmp/bsdinstall_log}}"

############################################################ MAIN

#
# Process command-line arguments
#
while getopts $GETOPTS_STDARGS ignored; do
	: just skipping known flags
done
shift $(( $OPTIND - 1 ))

# What are we here to do?
VERB="${1:-auto}"; shift
d38 2
a39 23

# Only enable debugging if debugFile is non-NULL and can be initialized
f_quietly f_debug_init
f_isset debugFile || debug=

f_dprintf "Running installation step: %s %s" "$VERB" "$*"
if [ "$debug" ]; then
	case "$debugFile" in
	# If NULL, send errors to the bit-bucket
	"") exec "/usr/libexec/bsdinstall/$VERB" "$@@" 2> /dev/null ;;
	# If begins with `+', send errors to both terminal and file (no `+')
	+*) exec "/usr/libexec/bsdinstall/$VERB" "$@@" \
		2>&1 >&$TERMINAL_STDOUT_PASSTHRU | tee "${debugFile#+}" ;;
	# Otherwise, just send errors to the file specified
	*) exec "/usr/libexec/bsdinstall/$VERB" "$@@" 2>> "$debugFile"
	esac
else
	exec "/usr/libexec/bsdinstall/$VERB" "$@@" 2> /dev/null
fi

################################################################################
# END
################################################################################
@


1.3.2.6
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/264437
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: stable/9/usr.sbin/bsdinstall/bsdinstall 264437 2014-04-14 01:18:02Z dteske $
a43 1
: ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT
a63 1
[ -d "$BSDINSTALL_TMPBOOT" ] || mkdir -p "$BSDINSTALL_TMPBOOT"
@


1.3.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.3.2.1.2.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.0/usr.sbin/bsdinstall/bsdinstall 220350 2011-04-05 03:09:44Z nwhitehorn $
@


1.2
log
@SVN rev 218947 on 2011-02-22 13:56:59Z by nwhitehorn

Add support for optional distributions, installation of the ports tree and
src. Fitting all of this on a single CD along with a full system requires
changing the default compression algorithm from gzip to xz.
@
text
@d41 3
a43 1
exec /usr/libexec/bsdinstall/$VERB $@@
@


1.1
log
@SVN rev 218799 on 2011-02-18 14:54:34Z by nwhitehorn

Import bsdinstall. This is meant to be (eventually in conjunction with
pc-sysinstall) a replacement for sysinstall in the 9.0 release and beyond.
Currently supported platforms are sparc64, pc98, i386, amd64, powerpc, and
powerpc64. Integration into the build system will occur in the coming
weeks.

Merging with pc-sysinstall will use this code as a frontend, while
temporarily retaining the interactive partition editor here. This work
will be done in parallel with improvements on this code and release
integration.

Thanks to all who have provided testing and comments!
@
text
@a28 1
: ${DISTRIBUTIONS="kernel.tgz world.tgz"}; export DISTRIBUTIONS
@

