A comprehensive, modular Arch Linux installation system that automates the setup of an encrypted system with flexible filesystem options and extensive package management capabilities.
Archstrap provides a fully automated Arch Linux installation experience with LUKS encryption and comprehensive package management. The system supports both ext4 and btrfs filesystems with optional LVM, and uses the rEFInd bootloader for secure boot management.
Boot from an Arch Linux ISO and run:
# Connect to internet (if not already connected)
iwctl # for wireless, or use ethernet
# Clone the repository
git clone https://github.com/ih8d8/archstrap.git
cd archstrap
# Make the installer executable
chmod +x install.sh
# Run the installation
./install.shIf you choose to use my public dotfiles during installation, run the following commands after your first login:
cd ~/.dotfiles/extra/init-scripts/; ./first-login.shThe installer will guide you through:
- System prerequisites validation
- Timezone detection
- Disk and filesystem configuration
- User account setup
- Package selection confirmation
- Automated installation and configuration
- Full disk encryption with LUKS
- Dual LUKS setup for primary and secondary storage
- Automated key management secondary storage (if exists) is automatically unlocked after the primary storage is unlocked
- Firewall configuration with UFW
- Separation of concerns - Each component handles specific functionality
- Error handling - Comprehensive error checking and recovery
- Progress tracking - Visual task progress with detailed status
- Logging system - Complete operation logging for debugging
- ext4 - Traditional, stable filesystem with LVM
- btrfs - Advanced filesystem with snapshots and compression
- Automatic subvolume creation (@, @var, @tmp, @swap, @home)
- Integration with Snapper for automated snapshots
- rEFInd bootloader - Modern UEFI boot manager with multiple kernel options
- refind-btrfs-snapshots - Adds BTRFS snapshots to rEFInd boot menu (when using btrfs)
- System services - Automated service configuration
- User environment - Complete user setup with directories and permissions
- Dotfiles integration - Automatic dotfiles deployment (see configuration section)
- BTRFS snapshots - Automated system snapshots with Snapper (when using btrfs)
- Cron jobs - System maintenance automation
The installation follows these phases:
- ✅ Prerequisites validation (UEFI, internet)
- ✅ System clock synchronization
- ✅ Automatic timezone detection
- 🔧 Filesystem selection (ext4 or btrfs)
- 🔧 Partition creation (2GB EFI + remaining for LUKS)
- 🔐 LUKS encryption setup with password
- 💾 LVM configuration (for ext4) or direct formatting (optional for btrfs)
- 📁 Filesystem formatting with subvolumes (btrfs) or logical volumes (ext4)
- 📦 Base system installation with pacstrap
- ⚙️ System configuration (locale, timezone, hostname)
- 🥾 rEFInd bootloader installation and configuration
- 👤 User account creation with sudo access
- 📚 Official repository packages
- 🔧 AUR packages (development and specialized tools)
- 🎯 Development tools (Rust, Go, Python, etc.)
- 🔧 System service configuration
- 🔐 Secondary LUKS storage setup (if configured)
- 📸 Initial BTRFS snapshots (if using btrfs)
- 🏠 User directory structure creation
- 📋 Cron job configuration
Private Repository Support: Configure PRIVATE_DOTFILES_REPO in settings/env-private.sh to use your personal dotfiles repository. During installation, you'll choose between your private repo and the default public repository. The system looks for an initialization script at:
config/dotfiles/extra/init-scripts/init-user.sh
This script will be automatically executed during post-installation with the following parameters:
$1- Mount point (/mnt)$2- Username$3- Secondary language (if any)
Example dotfiles structure:
config/dotfiles/
├── extra/
│ └── init-scripts/
│ └── init-user.sh # Your dotfiles setup script
├── .bashrc
└── ... (your dotfiles)
The init-user.sh script should handle:
- Dotfiles symlinking or copying
- Shell configuration
- Application-specific setup
- User-specific service initialization
- Uses LVM for flexible volume management
- Separate
/and/homelogical volumes - Traditional, well-tested filesystem
- Easy recovery and resizing
- Can be used with or without LVM
- Automatic subvolume creation:
@- Root filesystem@var- Variable data@tmp- Temporary files@swap- Swap area@home- User home directories
- Built-in snapshot support with Snapper integration
Edit packages/programs.csv to add packages:
official,package-name
aur,aur-package-name
- Add scripts to
config/system/for system-level configuration - Add scripts to
config/apps/for application configuration - Modify
config/post-install.shto include new configuration steps
Services are automatically configured in:
config/system/systemd-services.sh- Enable/disable services- Individual app configuration files handle service-specific setup
The system includes comprehensive error handling:
- Task-level error tracking with detailed reporting
- Automatic cleanup on failure
- Safe unmounting of filesystems
- LUKS device closure on errors
- Detailed logging for troubleshooting
All operations are logged to /var/log/arch-install-$(date +%Y%m%d-%H%M%S).log with:
- Task-specific sections for easy debugging
- Error context with full command output
- Progress tracking with visual feedback
This project is designed for personal use and educational purposes. While the scripts are provided as-is, the modular design makes debugging and customization straightforward.
For issues:
- Check the installation log at
/var/log/arch-install-$(date +%Y%m%d-%H%M%S).log - Review the specific module that failed
- Verify system requirements are met
- Test individual components in isolation
Warning: This installer will completely wipe the target disk and create a new encrypted installation. Ensure you have backups of any important data before running.