From 19c8c021c4359a917683a74828427cfab5fa4047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eva=20Wintersch=C3=B6n?= Date: Mon, 25 Dec 2023 11:39:02 -0800 Subject: [PATCH] diff patches applied to resolve errors on setup.sh and bootstrap.sh --- usr/local/share/bastille/bootstrap.sh | 7 ++++++- usr/local/share/bastille/setup.sh | 15 ++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/usr/local/share/bastille/bootstrap.sh b/usr/local/share/bastille/bootstrap.sh index 58a027cd..f87d5cf8 100644 --- a/usr/local/share/bastille/bootstrap.sh +++ b/usr/local/share/bastille/bootstrap.sh @@ -212,6 +212,11 @@ bootstrap_directories() { } 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 [ -f "${bastille_releasesdir}/${RELEASE}/COPYRIGHT" ]; then ## check distfiles list and skip existing cached files @@ -346,7 +351,7 @@ debootstrap_release() { ;; esac 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 info "Loading kernel module: ${_req_kmod}" kldload -v ${_req_kmod} diff --git a/usr/local/share/bastille/setup.sh b/usr/local/share/bastille/setup.sh index 80ea7a95..02c12985 100644 --- a/usr/local/share/bastille/setup.sh +++ b/usr/local/share/bastille/setup.sh @@ -28,8 +28,9 @@ # 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. +bastille_config="/usr/local/etc/bastille/bastille.conf" . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +. ${bastille_config} usage() { error_exit "Usage: bastille setup [pf|bastille0|zfs|vnet]" @@ -78,8 +79,8 @@ if [ ! -f "${bastille_pf_conf}" ]; then local ext_if ext_if=$(netstat -rn | awk '/default/ {print $4}' | head -n1) 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 cat << EOF > ${bastille_pf_conf} ## generated by bastille setup @@ -111,8 +112,12 @@ configure_zfs() { else ## attempt to determine bastille_zroot from `zpool list` bastille_zroot=$(zpool list | grep -v NAME | awk '{print $1}') - sysrc -f "${bastille_prefix}/bastille.conf" bastille_zfs_enable=YES - sysrc -f "${bastille_prefix}/bastille.conf" bastille_zfs_zpool="${bastille_zroot}" + zfs create ${bastille_zfs_options} -o mountpoint=${bastille_prefix} ${bastille_zroot}/bastille || \ + 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 }