Merge pull request #650 from em-winterschon/fbsd-140R-setup-bootstrap-fixes
diff patches applied to resolve errors on setup.sh and bootstrap.sh
This commit is contained in:
@@ -212,6 +212,11 @@ bootstrap_directories() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bootstrap_release() {
|
bootstrap_release() {
|
||||||
|
# Make sure to check/bootstrap directories first.¬
|
||||||
|
NOCACHEDIR=1
|
||||||
|
RELEASE="${DIR_BOOTSTRAP}"
|
||||||
|
bootstrap_directories
|
||||||
|
|
||||||
## if release exists quit, else bootstrap additional distfiles
|
## if release exists quit, else bootstrap additional distfiles
|
||||||
if [ -f "${bastille_releasesdir}/${RELEASE}/COPYRIGHT" ]; then
|
if [ -f "${bastille_releasesdir}/${RELEASE}/COPYRIGHT" ]; then
|
||||||
## check distfiles list and skip existing cached files
|
## check distfiles list and skip existing cached files
|
||||||
@@ -346,7 +351,7 @@ debootstrap_release() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
# If already set in /boot/loader.conf, check and try to load the module.
|
# If already set in /boot/loader.conf, check and try to load the module.
|
||||||
if ! kldstat -m ${_req_kmod} >/dev/null 2>&1; then
|
if ! kldstat -m ${_req_kmod} >/dev/null 2>&1; then
|
||||||
info "Loading kernel module: ${_req_kmod}"
|
info "Loading kernel module: ${_req_kmod}"
|
||||||
kldload -v ${_req_kmod}
|
kldload -v ${_req_kmod}
|
||||||
|
|||||||
@@ -28,8 +28,9 @@
|
|||||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# 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.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
bastille_config="/usr/local/etc/bastille/bastille.conf"
|
||||||
. /usr/local/share/bastille/common.sh
|
. /usr/local/share/bastille/common.sh
|
||||||
. /usr/local/etc/bastille/bastille.conf
|
. ${bastille_config}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
error_exit "Usage: bastille setup [pf|bastille0|zfs|vnet]"
|
error_exit "Usage: bastille setup [pf|bastille0|zfs|vnet]"
|
||||||
@@ -78,8 +79,8 @@ if [ ! -f "${bastille_pf_conf}" ]; then
|
|||||||
local ext_if
|
local ext_if
|
||||||
ext_if=$(netstat -rn | awk '/default/ {print $4}' | head -n1)
|
ext_if=$(netstat -rn | awk '/default/ {print $4}' | head -n1)
|
||||||
info "Determined default network interface: ($ext_if)"
|
info "Determined default network interface: ($ext_if)"
|
||||||
info "${bastille_pf_conf} does not exist: creating..."
|
info "${bastille_pf_conf} does not exist: creating..."
|
||||||
|
|
||||||
## creating pf.conf
|
## creating pf.conf
|
||||||
cat << EOF > ${bastille_pf_conf}
|
cat << EOF > ${bastille_pf_conf}
|
||||||
## generated by bastille setup
|
## generated by bastille setup
|
||||||
@@ -111,8 +112,12 @@ configure_zfs() {
|
|||||||
else
|
else
|
||||||
## attempt to determine bastille_zroot from `zpool list`
|
## attempt to determine bastille_zroot from `zpool list`
|
||||||
bastille_zroot=$(zpool list | grep -v NAME | awk '{print $1}')
|
bastille_zroot=$(zpool list | grep -v NAME | awk '{print $1}')
|
||||||
sysrc -f "${bastille_prefix}/bastille.conf" bastille_zfs_enable=YES
|
zfs create ${bastille_zfs_options} -o mountpoint=${bastille_prefix} ${bastille_zroot}/bastille || \
|
||||||
sysrc -f "${bastille_prefix}/bastille.conf" bastille_zfs_zpool="${bastille_zroot}"
|
error_exit "Failed to create zfs dataset 'bastille' in pool '${bastille_zroot}'"
|
||||||
|
chown root:root ${bastille_prefix}
|
||||||
|
chmod 0750 ${bastille_prefix}
|
||||||
|
sysrc -f "${bastille_config}" bastille_zfs_enable=YES
|
||||||
|
sysrc -f "${bastille_config}" bastille_zfs_zpool="${bastille_zroot}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user