diff options
Diffstat (limited to 'installer/lib')
| -rw-r--r-- | installer/lib/config.sh | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/installer/lib/config.sh b/installer/lib/config.sh index fefc838..65703d0 100644 --- a/installer/lib/config.sh +++ b/installer/lib/config.sh @@ -9,12 +9,18 @@ CONFIG_FILE="" UNATTENDED=false -# These get populated by config file or interactive prompts -FILESYSTEM="" # "zfs" or "btrfs" +# These get populated by config file or interactive prompts. +# Optional fields carry their default value here so config.sh is the +# single source of truth — gather_input trusts what's loaded. +FILESYSTEM="zfs" # "zfs" or "btrfs" +LOCALE="en_US.UTF-8" +KEYMAP="us" +ENABLE_SSH="yes" # SSH with root login (default yes for headless) +NO_ENCRYPT="no" # Skip filesystem encryption (testing only) + +# Required fields — installer errors out if any are still empty at install time. HOSTNAME="" TIMEZONE="" -LOCALE="" -KEYMAP="" SELECTED_DISKS=() RAID_LEVEL="" WIFI_SSID="" @@ -134,3 +140,12 @@ validate_config() { fi info "Config validation passed" } + +# Catches a typo in FILESYSTEM= from a config file before the install +# starts. Called from main() after check_config so a bad value never +# reaches gather_input or filesystem_preflight. +validate_filesystem() { + if [[ "$FILESYSTEM" != "zfs" && "$FILESYSTEM" != "btrfs" ]]; then + error "Invalid FILESYSTEM: $FILESYSTEM (must be 'zfs' or 'btrfs')" + fi +} |
