head	1.5;
access;
symbols
	RELENG_9_1_0_RELEASE:1.4.2.1.4.2
	RELENG_9_1:1.4.2.1.0.4
	RELENG_9_1_BP:1.4.2.1
	RELENG_9_0_0_RELEASE:1.4.2.1.2.1
	RELENG_9_0:1.4.2.1.0.2
	RELENG_9_0_BP:1.4.2.1
	RELENG_9:1.4.0.2
	RELENG_9_BP:1.4;
locks; strict;
comment	@# @;


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

1.4
date	2011.04.19.13.54.51;	author nwhitehorn;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2011.04.17.20.42.40;	author nwhitehorn;	state Exp;
branches;
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.4.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.4.2.1.2.1
	1.4.2.1.4.1;
next	1.4.2.2;

1.4.2.2
date	2012.11.17.11.37.43;	author svnexp;	state Exp;
branches;
next	1.4.2.3;

1.4.2.3
date	2014.03.31.02.01.46;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.4.2.1.2.2;

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

1.4.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.4.2.1.4.2;

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


desc
@@


1.5
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/scripts/jail 220834 2011-04-19 13:54:51Z nwhitehorn $

echo "Begun Installation at $(date)" > $BSDINSTALL_LOG
export BSDINSTALL_CHROOT=$1

error() {
	dialog --backtitle "FreeBSD Installer" --title "Abort" \
	    --no-label "Exit" --yes-label "Restart" --yesno \
	    "An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0
	if [ $? -ne 0 ]; then
		exit
	else
		exec $0 $BSDINSTALL_CHROOT
	fi
}


rm -rf $BSDINSTALL_TMPETC
mkdir $BSDINSTALL_TMPETC
mkdir -p $1 || error

test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR

if [ ! -f $BSDINSTALL_DISTDIR/MANIFEST -a -z "$BSDINSTALL_DISTSITE" ]; then
	exec 3>&1
	BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3)
	MIRROR_BUTTON=$?
	exec 3>&-
	test $MIRROR_BUTTON -eq 0 || error
	export BSDINSTALL_DISTSITE
	fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error
fi

export DISTRIBUTIONS="base.txz"
if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
	DISTMENU=`cut -f 4,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base`

	exec 3>&1
	EXTRA_DISTS=$(echo $DISTMENU | xargs dialog \
	    --backtitle "FreeBSD Installer" \
	    --title "Distribution Select" --nocancel --separate-output \
	    --checklist "Choose optional system components to install:" \
	    0 0 0 \
	2>&1 1>&3)
	for dist in $EXTRA_DISTS; do
		export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz"
	done
fi

FETCH_DISTRIBUTIONS=""
for dist in $DISTRIBUTIONS; do
	if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then
		FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist"
	fi
done
FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS`	# Trim white space

if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$BSDINSTALL_DISTSITE" ]; then
	exec 3>&1
	BSDINSTALL_DISTSITE=`bsdinstall mirrorselect 2>&1 1>&3`
	MIRROR_BUTTON=$?
	exec 3>&-
	test $MIRROR_BUTTON -eq 0 || error
	export BSDINSTALL_DISTSITE
fi

if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then
	bsdinstall distfetch || error
fi

bsdinstall checksum || error
bsdinstall distextract || error
bsdinstall rootpass || error

trap true SIGINT	# This section is optional
bsdinstall services

dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \
    "Would you like to add users to the installed system now?" 0 0 && \
    bsdinstall adduser

trap error SIGINT	# SIGINT is bad again
bsdinstall config  || error
cp /etc/resolv.conf $1/etc
cp /etc/localtime $1/etc

echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG

@


1.4
log
@SVN rev 220834 on 2011-04-19 13:54:51Z by nwhitehorn

Fix mirror selection, which was broken by stderr redirection.

Reported by:	Garrett Cooper
@
text
@d27 1
a27 1
# $FreeBSD$
@


1.4.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.4.2.2
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/scripts/jail 220834 2011-04-19 13:54:51Z nwhitehorn $
@


1.4.2.3
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 6
# $FreeBSD: stable/9/usr.sbin/bsdinstall/scripts/jail 263956 2014-03-31 01:04:40Z dteske $
#
############################################################ INCLUDES

BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
d29 1
a29 3
############################################################ MAIN

f_dprintf "Began Installation at %s" "$( date )"
d113 1
a113 3
bsdinstall entropy

f_dprintf "Installation Completed at %s" "$(date)"
a114 3
################################################################################
# END
################################################################################
@


1.4.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.4.2.1.4.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.1/usr.sbin/bsdinstall/scripts/jail 220834 2011-04-19 13:54:51Z nwhitehorn $
@


1.4.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.4.2.1.2.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.0/usr.sbin/bsdinstall/scripts/jail 220834 2011-04-19 13:54:51Z nwhitehorn $
@


1.3
log
@SVN rev 220753 on 2011-04-17 20:42:40Z by nwhitehorn

Update to reflect net install changes.
@
text
@d52 1
a52 1
	BSDINSTALL_DISTSITE=`bsdinstall mirrorselect 2>&1 1>&3`
@


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
@a29 1

a30 2
export DISTRIBUTIONS="kernel.txz base.txz doc.txz games.txz"
[ `uname -p` = amd64 -o `uname -p` = powerpc64 ] && export DISTRIBUTIONS="$DISTRIBUTIONS lib32.txz"
d35 1
a35 1
	    "You have canceled an installation step. Would you like to restart the installation or exit the installer?" 0 0
d39 1
a39 2
		test -f $PATH_FSTAB && bsdinstall umount
		exec $0
d46 3
d50 25
a74 1
trap error SIGINT	# SIGINT is bad
d82 10
d93 1
a93 3
if [ ! -z $FETCH_DISTRIBUTIONS ]; then
	ALL_DISTRIBUTIONS=$DISTRIBUTIONS
	DISTRIBUTIONS=$FETCH_DISTRIBUTIONS
a94 1
	DISTRIBUTIONS=$ALL_DISTRIBUTIONS
d97 1
a101 1
bsdinstall time
d110 2
@


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
@d32 2
a33 1
export DISTRIBUTIONS="`echo $DISTRIBUTIONS | sed 's/kernel\.[^ ]* //g'`"
@

