Skip to content

Commit

Permalink
Merge pull request #484 from JRGTH/bootstrap_fixes
Browse files Browse the repository at this point in the history
Bugfix to prevent double directory creation when bootstrapping Linux …
  • Loading branch information
cedwards authored Jan 15, 2022
2 parents 548ab2e + 91bb955 commit 268d00b
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions usr/local/share/bastille/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ bootstrap_release() {
debootstrap_release() {

# Make sure to check/bootstrap directories first.
RELEASE="${DIR_BOOTSTRAP}"
bootstrap_directories

#check and install OS dependencies @hackacad
Expand All @@ -313,7 +314,8 @@ debootstrap_release() {
required_mods="fdescfs linprocfs linsysfs tmpfs"
linuxarc_mods="linux linux64"
for _req_kmod in ${required_mods}; do
if [ ! "$(sysrc -f /boot/loader.conf -qn ${_req_kmod}_load)" = "YES" ]; then
if [ ! "$(sysrc -f /boot/loader.conf -qn ${_req_kmod}_load)" = "YES" ] && \
[ ! "$(sysrc -f /boot/loader.conf.local -qn ${_req_kmod}_load)" = "YES" ]; then
warn "${_req_kmod} not enabled in /boot/loader.conf, Should I do that for you? (N|y)"
read answer
case "${answer}" in
Expand Down Expand Up @@ -346,7 +348,8 @@ debootstrap_release() {
kldload -v ${_lin_kmod}
fi
done
if [ ! "$(sysrc -qn linux_enable)" = "YES" ]; then
if [ ! "$(sysrc -qn linux_enable)" = "YES" ] && \
[ ! "$(sysrc -f /etc/rc.conf.local -qn linux_enable)" = "YES" ]; then
sysrc linux_enable=YES
fi

Expand All @@ -363,17 +366,6 @@ debootstrap_release() {
esac
fi

# Create subsequent Linux releases datasets
if [ ! -d "${bastille_releasesdir}/${DIR_BOOTSTRAP}" ]; then
if [ "${bastille_zfs_enable}" = "YES" ]; then
if [ -n "${bastille_zfs_zpool}" ]; then
zfs create ${bastille_zfs_options} -o mountpoint="${bastille_releasesdir}/${DIR_BOOTSTRAP}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/releases/${DIR_BOOTSTRAP}"
fi
else
mkdir -p "${bastille_releasesdir}/${DIR_BOOTSTRAP}"
fi
fi

# Fetch the Linux flavor
info "Bootstrapping ${PLATFORM_OS} distfiles..."
if ! debootstrap --foreign --arch=${ARCH_BOOTSTRAP} --no-check-gpg ${LINUX_FLAVOR} "${bastille_releasesdir}"/${DIR_BOOTSTRAP}; then
Expand Down

0 comments on commit 268d00b

Please sign in to comment.