diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-23 20:02:02 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-23 20:02:02 -0600 |
| commit | 53e82d802dba330ec8e5a568d6250e04f1193f0c (patch) | |
| tree | f08a315332bbdeb26d475911ddff29e0c5e68f62 /custom/install-archzfs | |
| parent | d7da1bb62bef40766e117f1c88e854c2eb50f697 (diff) | |
| download | archangel-53e82d802dba330ec8e5a568d6250e04f1193f0c.tar.gz archangel-53e82d802dba330ec8e5a568d6250e04f1193f0c.zip | |
Phase 1.4: Add filesystem selection prompt
- Add FILESYSTEM variable to config (zfs or btrfs)
- Add select_filesystem() function with fzf support
- Update gather_input() to prompt for filesystem in interactive mode
- Add validation for FILESYSTEM in unattended mode
- Btrfs selection errors with "not yet implemented"
- Update banner to show "Archangel" branding
- Update config example with FILESYSTEM option
Groundwork for btrfs support - filesystem choice is now captured,
installation logic gates on FILESYSTEM variable.
Diffstat (limited to 'custom/install-archzfs')
| -rwxr-xr-x | custom/install-archzfs | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/custom/install-archzfs b/custom/install-archzfs index 6332286..f604f5c 100755 --- a/custom/install-archzfs +++ b/custom/install-archzfs @@ -32,6 +32,9 @@ source "$SCRIPT_DIR/lib/zfs.sh" # Configuration ############################# +# Filesystem selection (zfs or btrfs) +FILESYSTEM="zfs" # Default to ZFS, can be changed interactively or via config + # These will be set interactively HOSTNAME="" TIMEZONE="" @@ -87,15 +90,27 @@ gather_input() { # Validate required config values if [[ -z "$HOSTNAME" ]]; then error "Config missing required: HOSTNAME"; fi if [[ -z "$TIMEZONE" ]]; then error "Config missing required: TIMEZONE"; fi - if [[ "$NO_ENCRYPT" != "yes" && -z "$ZFS_PASSPHRASE" ]]; then error "Config missing required: ZFS_PASSPHRASE"; fi if [[ -z "$ROOT_PASSWORD" ]]; then error "Config missing required: ROOT_PASSWORD"; fi if [[ ${#SELECTED_DISKS[@]} -eq 0 ]]; then error "Config missing required: DISKS"; fi # Set defaults for optional values + [[ -z "$FILESYSTEM" ]] && FILESYSTEM="zfs" || true [[ -z "$LOCALE" ]] && LOCALE="en_US.UTF-8" || true [[ -z "$KEYMAP" ]] && KEYMAP="us" || true [[ -z "$ENABLE_SSH" ]] && ENABLE_SSH="yes" || true + # ZFS-specific validation + if [[ "$FILESYSTEM" == "zfs" ]]; then + if [[ "$NO_ENCRYPT" != "yes" && -z "$ZFS_PASSPHRASE" ]]; then + error "Config missing required: ZFS_PASSPHRASE (or set NO_ENCRYPT=yes)" + fi + fi + + # Btrfs not yet implemented + if [[ "$FILESYSTEM" == "btrfs" ]]; then + error "Btrfs support not yet implemented. Use FILESYSTEM=zfs" + fi + # Determine RAID level if not specified if [[ -z "$RAID_LEVEL" && ${#SELECTED_DISKS[@]} -gt 1 ]]; then RAID_LEVEL="mirror" @@ -103,6 +118,7 @@ gather_input() { fi info "Configuration loaded:" + info " Filesystem: $FILESYSTEM" info " Hostname: $HOSTNAME" info " Timezone: $TIMEZONE" info " Locale: $LOCALE" @@ -117,13 +133,20 @@ gather_input() { echo "" echo "╔═══════════════════════════════════════════════════════════════╗" - echo "║ Arch Linux ZFS Root ║" - echo "║ Configuration and Installation ║" + echo "║ Archangel ║" + echo "║ Arch Linux with Snapshot-Based Recovery ║" echo "╚═══════════════════════════════════════════════════════════════╝" echo "" info "Answer all questions now. Installation will run unattended afterward." echo "" + select_filesystem + + # Check for btrfs (not yet implemented) + if [[ "$FILESYSTEM" == "btrfs" ]]; then + error "Btrfs support not yet implemented. Please select ZFS." + fi + get_hostname get_timezone get_locale @@ -609,6 +632,7 @@ show_summary() { echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Configuration Summary:" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo " Filesystem: $FILESYSTEM" echo " Hostname: $HOSTNAME" echo " Timezone: $TIMEZONE" echo " Locale: $LOCALE" @@ -621,12 +645,16 @@ show_summary() { echo " RAID Level: ${RAID_LEVEL:-single (no RAID)}" echo " WiFi: ${WIFI_SSID:-Not configured}" echo " SSH: ${ENABLE_SSH:-yes} (root login)" - if [[ "$NO_ENCRYPT" == "yes" ]]; then - echo " ZFS Pool: $POOL_NAME (NOT encrypted)" + if [[ "$FILESYSTEM" == "zfs" ]]; then + if [[ "$NO_ENCRYPT" == "yes" ]]; then + echo " ZFS Pool: $POOL_NAME (NOT encrypted)" + else + echo " ZFS Pool: $POOL_NAME (encrypted)" + fi + echo " Boot: ZFSBootMenu on all disks (redundant)" else - echo " ZFS Pool: $POOL_NAME (encrypted)" + echo " Boot: GRUB + grub-btrfs (snapshot boot)" fi - echo " Boot: ZFSBootMenu on all disks (redundant)" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" |
