[Midnightbsd-cvs] src [11308] trunk/usr.sbin/bsdinstall/scripts/script: add zfs
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed Jul 4 10:08:13 EDT 2018
Revision: 11308
http://svnweb.midnightbsd.org/src/?rev=11308
Author: laffer1
Date: 2018-07-04 10:08:13 -0400 (Wed, 04 Jul 2018)
Log Message:
-----------
add zfs
Modified Paths:
--------------
trunk/usr.sbin/bsdinstall/scripts/script
Property Changed:
----------------
trunk/usr.sbin/bsdinstall/scripts/script
Modified: trunk/usr.sbin/bsdinstall/scripts/script
===================================================================
--- trunk/usr.sbin/bsdinstall/scripts/script 2018-07-04 14:06:21 UTC (rev 11307)
+++ trunk/usr.sbin/bsdinstall/scripts/script 2018-07-04 14:08:13 UTC (rev 11308)
@@ -1,6 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2013 Nathan Whitehorn
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -24,21 +25,50 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
+# $FreeBSD: stable/10/usr.sbin/bsdinstall/scripts/script 290286 2015-11-02 22:03:24Z dteske $
# $MidnightBSD$
+#
+############################################################ INCLUDES
+BSDCFG_SHARE="/usr/share/bsdconfig"
+. $BSDCFG_SHARE/common.subr || exit 1
+f_dprintf "%s: loading includes..." "$0"
+f_include $BSDCFG_SHARE/dialog.subr
+f_include $BSDCFG_SHARE/variable.subr
+
+############################################################ CONFIGURATION
+
# VARIABLES:
# PARTITIONS
# DISTRIBUTIONS
# BSDINSTALL_DISTDIR
-error() {
- test -f $PATH_FSTAB && bsdinstall umount
- echo "Installation Error!"
- cat $BSDINSTALL_LOG
- echo "Installation Error!"
+############################################################ GLOBALS
+
+#
+# Strings that should be moved to an i18n file and loaded with f_include_lang()
+#
+msg_installation_error="Installation Error!"
+
+############################################################ FUNCTIONS
+
+error()
+{
+ [ -f "$PATH_FSTAB" ] && bsdinstall umount
+
+ local file
+ f_getvar "$VAR_DEBUG_FILE#+" file
+ if [ "$file" ]; then
+ f_dialog_title "$msg_installation_error"
+ f_dialog_textbox "$file"
+ # No need to restore title, pining for the fjords
+ fi
+
exit 1
}
+############################################################ MAIN
+
set -e
trap error EXIT
@@ -45,7 +75,7 @@
SCRIPT="$1"
shift
-echo "Begun Installation at $(date)" > $BSDINSTALL_LOG
+f_dprintf "Began Installation at %s" "$( date )"
rm -rf $BSDINSTALL_TMPETC
mkdir $BSDINSTALL_TMPETC
@@ -55,10 +85,22 @@
: ${DISTRIBUTIONS="kernel.txz base.txz"}; export DISTRIBUTIONS
export BSDINSTALL_DISTDIR
+# Re-initialize a new log if preamble changed BSDINSTALL_LOG
+if [ "$BSDINSTALL_LOG" != "${debugFile#+}" ]; then
+ export debugFile="$BSDINSTALL_LOG"
+ f_quietly f_debug_init
+ # NB: Being scripted, let debug go to terminal for invalid debugFile
+ f_dprintf "Began Instalation at %s" "$( date )"
+fi
+
# Make partitions
rm -f $PATH_FSTAB
touch $PATH_FSTAB
-bsdinstall scriptedpart "$PARTITIONS"
+if [ "$ZFSBOOT_DISKS" ]; then
+ bsdinstall zfsboot
+else
+ bsdinstall scriptedpart "$PARTITIONS"
+fi
bsdinstall mount
# Unpack distributions
@@ -83,8 +125,14 @@
rm $BSDINSTALL_CHROOT/tmp/installscript
fi
+bsdinstall entropy
bsdinstall umount
-echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG
+f_dprintf "Installation Completed at %s" "$( date )"
-trap true EXIT
+trap - EXIT
+exit $SUCCESS
+
+################################################################################
+# END
+################################################################################
Property changes on: trunk/usr.sbin/bsdinstall/scripts/script
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list