Normalize feature flag handling in build.func

Updated feature flag normalization to support both yes/no and 0/1 formats for ENABLE_NESTING, ENABLE_KEYCTL, and ENABLE_MKNOD. ENABLE_FUSE remains as yes/no for backward compatibility.
This commit is contained in:
CanbiZ 2025-11-24 14:59:26 +01:00
parent 99ac1ac908
commit 3fdb2d79c6

View File

@ -542,18 +542,19 @@ base_settings() {
PROTECT_CT=${var_protection:-"${1:-no}"} PROTECT_CT=${var_protection:-"${1:-no}"}
CT_TIMEZONE=${var_timezone:-""} CT_TIMEZONE=${var_timezone:-""}
# Normalize numeric feature flags (keep ENABLE_FUSE as yes/no for compatibility) # Normalize numeric feature flags (handle both yes/no and 0/1 formats)
# Keep ENABLE_FUSE as yes/no for backward compatibility
case "${ENABLE_NESTING,,}" in case "${ENABLE_NESTING,,}" in
yes | true) ENABLE_NESTING="1" ;; yes | true | 1) ENABLE_NESTING="1" ;;
no | false) ENABLE_NESTING="0" ;; no | false | 0) ENABLE_NESTING="0" ;;
esac esac
case "${ENABLE_KEYCTL,,}" in case "${ENABLE_KEYCTL,,}" in
yes | true) ENABLE_KEYCTL="1" ;; yes | true | 1) ENABLE_KEYCTL="1" ;;
no | false) ENABLE_KEYCTL="0" ;; no | false | 0) ENABLE_KEYCTL="0" ;;
esac esac
case "${ENABLE_MKNOD,,}" in case "${ENABLE_MKNOD,,}" in
yes | true) ENABLE_MKNOD="1" ;; yes | true | 1) ENABLE_MKNOD="1" ;;
no | false) ENABLE_MKNOD="0" ;; no | false | 0) ENABLE_MKNOD="0" ;;
esac esac
# Since these 2 are only defined outside of default_settings function, we add a temporary fallback. TODO: To align everything, we should add these as constant variables (e.g. OSTYPE and OSVERSION), but that would currently require updating the default_settings function for all existing scripts # Since these 2 are only defined outside of default_settings function, we add a temporary fallback. TODO: To align everything, we should add these as constant variables (e.g. OSTYPE and OSVERSION), but that would currently require updating the default_settings function for all existing scripts