Fix to allow 32-Bit base releases to be updated

This commit is contained in:
JRGTH
2022-01-13 20:39:07 -04:00
parent 548ab2e250
commit e11ed392f6

View File

@@ -73,6 +73,13 @@ if freebsd-version | grep -qi HBSD; then
error_exit "Not yet supported on HardenedBSD." error_exit "Not yet supported on HardenedBSD."
fi fi
# Check for alternate/unsupported archs
arch_check() {
if echo "${TARGET}" | grep -w "[0-9]\{1,2\}\.[0-9]\-RELEASE\-i386"; then
ARCH_I386="1"
fi
}
jail_check() { jail_check() {
# Check if the jail is thick and is running # Check if the jail is thick and is running
if [ ! "$(/usr/sbin/jls name | awk "/^${TARGET}$/")" ]; then if [ ! "$(/usr/sbin/jls name | awk "/^${TARGET}$/")" ]; then
@@ -103,8 +110,13 @@ jail_update() {
release_update() { release_update() {
# Update a release base(affects child containers) # Update a release base(affects child containers)
if [ -d "${bastille_releasesdir}/${TARGET}" ]; then if [ -d "${bastille_releasesdir}/${TARGET}" ]; then
TARGET_TRIM="${TARGET}"
if [ -n "${ARCH_I386}" ]; then
TARGET_TRIM=$(echo "${TARGET}" | sed 's/-i386//')
fi
env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \ env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" \
fetch install --currently-running "${TARGET}" fetch install --currently-running "${TARGET_TRIM}"
else else
error_exit "${TARGET} not found. See 'bastille bootstrap'." error_exit "${TARGET} not found. See 'bastille bootstrap'."
fi fi
@@ -152,6 +164,7 @@ elif echo "${TARGET}" | grep -Eq '^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$'; then
BASTILLE_TEMPLATE="${TARGET}" BASTILLE_TEMPLATE="${TARGET}"
template_update template_update
elif echo "${TARGET}" | grep -q "[0-9]\{2\}.[0-9]-RELEASE"; then elif echo "${TARGET}" | grep -q "[0-9]\{2\}.[0-9]-RELEASE"; then
arch_check
release_update release_update
else else
jail_update jail_update