mirror of
https://github.com/JRGTH/xigmanas-bastille-extension.git
synced 2025-12-10 17:00:18 +01:00
Fallback for custom bastille prefix name
Fallback for custom bastille prefix name, for example capitalized "Bastille" prefix.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
======================
|
||||
Version Description
|
||||
|
||||
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.
|
||||
|
||||
19
bastille-init
Normal file → Executable file
19
bastille-init
Normal file → Executable 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}')
|
||||
@@ -1341,7 +1346,7 @@ rc_params()
|
||||
fi
|
||||
|
||||
# Check and make sure bastille_zfs_prefix end with "bastille".
|
||||
if ! echo "${bastille_zfs_prefix}" | grep -qw "${APPNAME}"; then
|
||||
if ! echo "${bastille_zfs_prefix}" | grep -qw "${DAFAULT_BASTILLE_PREFIX}"; then
|
||||
zfs_support_error
|
||||
exit 1
|
||||
fi
|
||||
@@ -1355,20 +1360,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
0
unionfs.sh
Normal file → Executable file
Reference in New Issue
Block a user