12118f387SNathan Whitehorn#!/bin/sh
22118f387SNathan Whitehorn#-
32118f387SNathan Whitehorn# Copyright (c) 2011 Nathan Whitehorn
4fef95330SDevin Teske# Copyright (c) 2013-2015 Devin Teske
52118f387SNathan Whitehorn# All rights reserved.
62118f387SNathan Whitehorn#
72118f387SNathan Whitehorn# Redistribution and use in source and binary forms, with or without
82118f387SNathan Whitehorn# modification, are permitted provided that the following conditions
92118f387SNathan Whitehorn# are met:
102118f387SNathan Whitehorn# 1. Redistributions of source code must retain the above copyright
112118f387SNathan Whitehorn#    notice, this list of conditions and the following disclaimer.
122118f387SNathan Whitehorn# 2. Redistributions in binary form must reproduce the above copyright
132118f387SNathan Whitehorn#    notice, this list of conditions and the following disclaimer in the
142118f387SNathan Whitehorn#    documentation and/or other materials provided with the distribution.
152118f387SNathan Whitehorn#
162118f387SNathan Whitehorn# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
172118f387SNathan Whitehorn# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
182118f387SNathan Whitehorn# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
192118f387SNathan Whitehorn# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
202118f387SNathan Whitehorn# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
212118f387SNathan Whitehorn# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
222118f387SNathan Whitehorn# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
232118f387SNathan Whitehorn# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
242118f387SNathan Whitehorn# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
252118f387SNathan Whitehorn# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
262118f387SNathan Whitehorn# SUCH DAMAGE.
272118f387SNathan Whitehorn#
28bc4a673fSDevin Teske#
29bc4a673fSDevin Teske############################################################ MAIN
302118f387SNathan Whitehorn
312118f387SNathan Whitehorncat $BSDINSTALL_TMPETC/rc.conf.* >> $BSDINSTALL_TMPETC/rc.conf
322118f387SNathan Whitehornrm $BSDINSTALL_TMPETC/rc.conf.*
332118f387SNathan Whitehorn
3498b9d384SSteven Hartlandcat $BSDINSTALL_CHROOT/etc/sysctl.conf $BSDINSTALL_TMPETC/sysctl.conf.* >> $BSDINSTALL_TMPETC/sysctl.conf
350e3f233fSBartek Rutkowskirm $BSDINSTALL_TMPETC/sysctl.conf.*
360e3f233fSBartek Rutkowski
3733a5ef35SMark Johnstonif [ -f $BSDINSTALL_TMPETC/ttys.hardening ]; then
3833a5ef35SMark Johnston	cat $BSDINSTALL_TMPETC/ttys.hardening > $BSDINSTALL_TMPETC/ttys
3933a5ef35SMark Johnston	rm $BSDINSTALL_TMPETC/ttys.hardening
4082ec242fSBartek Rutkowskifi
4182ec242fSBartek Rutkowski
422118f387SNathan Whitehorncp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc
43d71e85ceSNathan Whitehorn
44cd88b886SDevin Teskecat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf
45cd88b886SDevin Teskerm $BSDINSTALL_TMPBOOT/loader.conf.*
46*60403b98SRyan Moeller# The 'cryptodev_load' line is a workaround for arm64, which does not
47*60403b98SRyan Moeller# automatically load cryptodev.ko with zfs.ko.
48*60403b98SRyan Moellerdf -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "cryptodev_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf
496e15678aSNathan Whitehorndf -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf
50cd88b886SDevin Teske
51cd88b886SDevin Teskecp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
52cd88b886SDevin Teske
53cd28e9c5SDevin Teske[ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/
5466fd3214SDevin Teske
55d71e85ceSNathan Whitehorn# Set up other things from installed config
56a7fb3c62SDevin Teskechroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
57d71e85ceSNathan Whitehorn
58c12530caSEd Masteexit 0
59ff7b134cSDevin Teske
60bc4a673fSDevin Teske################################################################################
61bc4a673fSDevin Teske# END
62bc4a673fSDevin Teske################################################################################
63