Add comprehensive documentation for literate programming approach: - Phase 1 guidelines focusing on why/what without implementation - General literate programming principles for code documentation - Project notes explaining wrapper script concept and strategy Decision: Follow literate programming to make the wrapper maintainable and educational. Comments tell the story, code implements it. This foundation enables better collaboration and knowledge transfer. The notes.md establishes the core concept: a reproducible wrapper around the Void installer that automates error-prone LUKS encryption setup while keeping user control over system configuration choices.
122 lines
2.7 KiB
Markdown
122 lines
2.7 KiB
Markdown
Hier ist eine **kurze, kompakte Übersicht** zu einem **eigenen Wrapper-Skript für eine verschlüsselte Void-Linux-Installation**.
|
||
|
||
---
|
||
|
||
## Was ist ein Wrapper-Skript?
|
||
|
||
Ein Wrapper-Skript ist ein **eigenes Bash-Skript**, das **vor und um den Void-Installer herum** läuft.
|
||
Es übernimmt die **kritischen Schritte**, die der offizielle Installer nicht automatisiert kann, vor allem:
|
||
|
||
* Partitionierung
|
||
* LUKS-Verschlüsselung (`cryptsetup`)
|
||
* Anlegen von Dateisystemen
|
||
* Vorbereitung der Mountpoints (`/dev/mapper/...`)
|
||
* Optional: LVM, Swap, btrfs
|
||
|
||
Der **Void-Installer selbst** wird danach weiterhin benutzt – aber auf bereits vorbereiteten Devices.
|
||
|
||
---
|
||
|
||
## Warum ein Wrapper-Skript nutzen?
|
||
|
||
**Vorteile:**
|
||
|
||
* 🔐 **Reproduzierbare, sichere Installation**
|
||
* 🧠 Weniger manuelle Fehler bei LUKS / crypttab / dracut
|
||
* ⚙️ Anpassbar an **UEFI vs. BIOS**, **LUKS1 vs. LUKS2**, **ext4 vs. btrfs**
|
||
* 🧪 Ideal für Tests, VMs oder mehrere Maschinen
|
||
* 📜 Dokumentiert dein Setup besser als Klicks im Installer
|
||
|
||
Kurz:
|
||
|
||
> Du automatisierst das **Fehleranfällige**, nicht das **Flexible**.
|
||
|
||
---
|
||
|
||
## Wie ist die Grundidee?
|
||
|
||
### Ablauf (High-Level)
|
||
|
||
1. **Sanity Checks**
|
||
|
||
* Root-Rechte
|
||
* Richtige Disk (`/dev/sda`, `/dev/nvme0n1`)
|
||
* Warnung: *Alle Daten werden gelöscht*
|
||
|
||
2. **Partitionierung**
|
||
|
||
* EFI (unverschlüsselt)
|
||
* Root-Partition (für LUKS)
|
||
* Optional: separate `/boot`
|
||
|
||
3. **Verschlüsselung**
|
||
|
||
* `cryptsetup luksFormat`
|
||
* `cryptsetup open → /dev/mapper/cryptroot`
|
||
* Optional: LUKS1 erzwingen
|
||
|
||
4. **Dateisysteme**
|
||
|
||
* `mkfs.ext4` oder `mkfs.btrfs`
|
||
* EFI: `mkfs.vfat`
|
||
|
||
5. **Mounten**
|
||
|
||
* Root nach `/mnt`
|
||
* EFI nach `/mnt/boot/efi`
|
||
|
||
6. **Void-Installer starten**
|
||
|
||
* Manuelle Partitionierung
|
||
* Nur Mountpoints setzen, **nicht formatieren**
|
||
|
||
7. **Post-Install (chroot)**
|
||
|
||
* `/etc/crypttab`
|
||
* `dracut` konfigurieren
|
||
* `xbps-reconfigure -fa`
|
||
* `grub-mkconfig`
|
||
|
||
---
|
||
|
||
## Worauf sollte man beim „Wie“ achten?
|
||
|
||
### 🔴 Sicherheit & Zuverlässigkeit
|
||
|
||
* **Disk-Variable hart prüfen** (`lsblk`!)
|
||
* Kein automatisches Überschreiben ohne Bestätigung
|
||
* Passphrase **nicht im Skript speichern**
|
||
|
||
### 🟡 Kompatibilität
|
||
|
||
* GRUB ist am stabilsten mit **LUKS1**
|
||
* EFI immer **unverschlüsselt**
|
||
* Initramfs muss **crypt-Modul** enthalten
|
||
|
||
### 🟢 Wartbarkeit
|
||
|
||
* Variablen am Anfang (`DISK=`, `FS=`, `HOSTNAME=`)
|
||
* Keine „magischen“ Werte
|
||
* Kommentare zu jedem destruktiven Schritt
|
||
|
||
### 🧪 Testbarkeit
|
||
|
||
* Erst in einer **VM**
|
||
* Skript **idempotent** halten, wo möglich
|
||
* Klare Exit-Points bei Fehlern (`set -e`)
|
||
|
||
---
|
||
|
||
## Fazit
|
||
|
||
Ein eigenes Wrapper-Skript ist der **beste Kompromiss** zwischen:
|
||
|
||
* kompletter Handarbeit ❌
|
||
* fragilen „One-Click-Installern“ ❌
|
||
|
||
und bietet:
|
||
|
||
* Kontrolle ✅
|
||
* Wiederholbarkeit ✅
|
||
* Sicherheit ✅
|