Compare commits

...

3 Commits

Author SHA1 Message Date
JRGTH
fcfe6b47b4 Minor code changes/improvements 2025-10-05 02:54:23 -04:00
JRGTH
4b0745ce64 Make sure bastille-prefix ends with bastille 2025-10-05 02:26:29 -04:00
JRGTH
fb036a29da Fallback for custom bastille prefix name
Fallback for custom bastille prefix name, for example capitalized "Bastille" prefix.
2025-10-05 01:06:40 -04:00
4 changed files with 21 additions and 10 deletions

View File

@@ -3,6 +3,9 @@
======================
Version Description
1.2.15......Minor code changes/improvements.
1.2.14......Make sure bastille-prefix ends with bastille.
1.2.13... ..Fallback for custom bastille prefix name.
1.2.12......Minor code improvements, clean stale pkg files on error.
1.2.11......Add all bastille Linux flavors bootstrap options.
1.2.10......Minor code improvements and cleanup.

26
bastille-init Normal file → Executable file
View File

@@ -103,6 +103,11 @@ BASTILLE_ZFS_ZPOOL_MOUNTPOINT_TRIM=
# Get extension ZFS config info.
if [ "${bastille_zfs_enable}" = "YES" ] || [ "${bastille_zfs_enable}" = "yes" ]; then
if [ -n "${bastille_zfs_prefix}" ] && [ -n "${bastille_zfs_zpool}" ]; then
DAFAULT_BASTILLE_PREFIX="${APPNAME}"
if [ "${CWDIR##*/}" != "${APPNAME}" ]; then
# Assume custom bastille prefix.
DAFAULT_BASTILLE_PREFIX="${CWDIR##*/}"
fi
# Always enforce ZFS activation below "/mnt/" from the extension.
if echo "${CWDIR}" | grep -q '/mnt/'; then
CWDIR_TRIM=$(echo "${CWDIR}" | sed "s|/mnt/||;s|/${bastille_zfs_prefix}||")
@@ -111,7 +116,7 @@ if [ "${bastille_zfs_enable}" = "YES" ] || [ "${bastille_zfs_enable}" = "yes" ];
if echo "${BASTILLE_ZFS_ZPOOL_MOUNTPOINT}" | grep -q '/mnt/'; then
BASTILLE_ZFS_ZPOOL_MOUNTPOINT_TRIM=$(echo "${BASTILLE_ZFS_ZPOOL_MOUNTPOINT}" | sed "s|/mnt/||;s|/${bastille_zfs_prefix}||")
fi
BASTILLE_ZFS_PREFIX_TRIM=$(echo "${bastille_zfs_prefix}" | sed "s|/${APPNAME}||")
BASTILLE_ZFS_PREFIX_TRIM=$(echo "${bastille_zfs_prefix}" | sed "s|/${DAFAULT_BASTILLE_PREFIX}||")
fi
# Check bastille ZFS config match on disk ZFS config.
BASTILLE_CONFIG_DISK=$(zfs list -H "${bastille_prefix}" 2>/dev/null | awk '{print $1}')
@@ -1215,8 +1220,8 @@ post_upgrade()
if sysrc -f ${CWDIR}${EXTCONF} -qc EXTENSION_UPGRADED=1; then
if [ -f "${CWDIR}/post_upgrade.sh" ]; then
echo "Executing post_upgrade.sh file..."
${CWDIR}/post_upgrade.sh
sleep 5
chmod +x ${CWDIR}/post_upgrade.sh && ${CWDIR}/post_upgrade.sh
sleep 3
else
echo "No post upgrade changes pending."
fi
@@ -1341,7 +1346,10 @@ rc_params()
fi
# Check and make sure bastille_zfs_prefix end with "bastille".
if ! echo "${bastille_zfs_prefix}" | grep -qw "${APPNAME}"; then
if echo "${DAFAULT_BASTILLE_PREFIX}" | ! grep -iq "${APPNAME}"; then
zfs_support_error
exit 1
elif ! echo "${bastille_zfs_prefix}" | grep -qw "${DAFAULT_BASTILLE_PREFIX}"; then
zfs_support_error
exit 1
fi
@@ -1355,20 +1363,20 @@ rc_params()
fi
# Perform some checks against on-disk and file configurations.
if zfs list "${bastille_zfs_zpool}/${BASTILLE_ZFS_PREFIX_TRIM}/${APPNAME}" >/dev/null 2>&1; then
if zfs list "${bastille_zfs_zpool}/${BASTILLE_ZFS_PREFIX_TRIM}/${DAFAULT_BASTILLE_PREFIX}" >/dev/null 2>&1; then
# Looks like ZFS support is already configured, then set parameters.
zfs_support_enabled
elif zfs list "${bastille_zfs_zpool}" >/dev/null 2>&1 && \
[ "${bastille_zfs_prefix}" = "${BASTILLE_ZFS_PREFIX_TRIM}/${APPNAME}" ]; then
[ "${bastille_zfs_prefix}" = "${BASTILLE_ZFS_PREFIX_TRIM}/${DAFAULT_BASTILLE_PREFIX}" ]; then
# Looks like ZFS support is available for activation.
zfs_support_avail
elif zfs list "${bastille_zfs_zpool}/${APPNAME}" >/dev/null 2>&1; then
elif zfs list "${bastille_zfs_zpool}/${DAFAULT_BASTILLE_PREFIX}" >/dev/null 2>&1; then
zfs_support_enabled
elif zfs list "${bastille_zfs_zpool}" >/dev/null 2>&1 && \
[ "${BASTILLE_ZFS_PREFIX_TRIM}" = "${APPNAME}" ]; then
[ "${BASTILLE_ZFS_PREFIX_TRIM}" = "${DAFAULT_BASTILLE_PREFIX}" ]; then
# Looks like ZFS support is available for activation.
zfs_support_avail
elif zfs list "${bastille_zfs_zpool}/${APPNAME}" >/dev/null 2>&1; then
elif zfs list "${bastille_zfs_zpool}/${DAFAULT_BASTILLE_PREFIX}" >/dev/null 2>&1; then
zfs_support_enabled
else
zfs_support_error

0
unionfs.sh Normal file → Executable file
View File

View File

@@ -1 +1 @@
1.2.12
1.2.15