[Midnightbsd-cvs] src [11335] trunk/usr.sbin/bsdinstall/scripts/jail: update jail script

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jul 4 21:33:19 EDT 2018


Revision: 11335
          http://svnweb.midnightbsd.org/src/?rev=11335
Author:   laffer1
Date:     2018-07-04 21:33:19 -0400 (Wed, 04 Jul 2018)
Log Message:
-----------
update jail script

Modified Paths:
--------------
    trunk/usr.sbin/bsdinstall/scripts/jail

Property Changed:
----------------
    trunk/usr.sbin/bsdinstall/scripts/jail

Modified: trunk/usr.sbin/bsdinstall/scripts/jail
===================================================================
--- trunk/usr.sbin/bsdinstall/scripts/jail	2018-07-05 01:32:00 UTC (rev 11334)
+++ trunk/usr.sbin/bsdinstall/scripts/jail	2018-07-05 01:33:19 UTC (rev 11335)
@@ -1,6 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2011 Nathan Whitehorn
+# Copyright (c) 2013-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -24,15 +25,26 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/usr.sbin/bsdinstall/scripts/jail,v 1.4 2011/04/19 13:54:51 nwhitehorn Exp $
+# $FreeBSD: stable/10/usr.sbin/bsdinstall/scripts/jail 290292 2015-11-02 22:08:11Z dteske $
+# $MidnightBSD$
+############################################################ INCLUDES
 
-echo "Begun Installation at $(date)" > $BSDINSTALL_LOG
+BSDCFG_SHARE="/usr/share/bsdconfig"
+. $BSDCFG_SHARE/common.subr || exit 1
+
+############################################################ MAIN
+
+f_dprintf "Began Installation at %s" "$( date )"
 export BSDINSTALL_CHROOT=$1
 
 error() {
+	local msg
+	if [ -n "$1" ]; then
+		msg="$1\n\n"
+	fi
 	dialog --backtitle "MidnightBSD 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
+	    "${msg}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
@@ -43,7 +55,7 @@
 
 rm -rf $BSDINSTALL_TMPETC
 mkdir $BSDINSTALL_TMPETC
-mkdir -p $1 || error
+mkdir -p $1 || error "mkdir failed for $1"
 
 test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR
 
@@ -52,9 +64,9 @@
 	BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3)
 	MIRROR_BUTTON=$?
 	exec 3>&-
-	test $MIRROR_BUTTON -eq 0 || error
+	test $MIRROR_BUTTON -eq 0 || error "No mirror selected"
 	export BSDINSTALL_DISTSITE
-	fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error
+	fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error "Could not download $BSDINSTALL_DISTSITE/MANIFEST"
 fi
 
 export DISTRIBUTIONS="base.txz"
@@ -86,17 +98,17 @@
 	BSDINSTALL_DISTSITE=`bsdinstall mirrorselect 2>&1 1>&3`
 	MIRROR_BUTTON=$?
 	exec 3>&-
-	test $MIRROR_BUTTON -eq 0 || error
+	test $MIRROR_BUTTON -eq 0 || error "No mirror selected"
 	export BSDINSTALL_DISTSITE
 fi
 
 if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then
-	bsdinstall distfetch || error
+	bsdinstall distfetch || error "Failed to fetch distribution"
 fi
 
-bsdinstall checksum || error
-bsdinstall distextract || error
-bsdinstall rootpass || error
+bsdinstall checksum || error "Distribution checksum failed"
+bsdinstall distextract || error "Distribution extract failed"
+bsdinstall rootpass || error "Could not set root password"
 
 trap true SIGINT	# This section is optional
 bsdinstall services
@@ -106,9 +118,15 @@
     bsdinstall adduser
 
 trap error SIGINT	# SIGINT is bad again
-bsdinstall config  || error
+bsdinstall config  || error "Failed to save config"
 cp /etc/resolv.conf $1/etc
 cp /etc/localtime $1/etc
 
-echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG
+bsdinstall entropy
 
+f_dprintf "Installation Completed at %s" "$(date)"
+exit $SUCCESS
+
+################################################################################
+# END
+################################################################################


Property changes on: trunk/usr.sbin/bsdinstall/scripts/jail
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list