3.7 KiB
3.7 KiB
Keymap-Probleme Behoben
Problem-Beschreibung
Das ursprüngliche Installationsskript hatte Probleme mit der deutschen Tastaturlayout-Konfiguration, insbesondere:
localectl
konnte keine Keymaps lesen- Fehlende deutsche Keymap-Dateien
- Unvollständige keyboard-configuration-Pakete
- Fehlerhafte systemd-localed-Konfiguration
Implementierte Lösung
1. Erweiterte Paket-Installation
# Vollständige Keyboard-Unterstützung
apt-get install -y \
keyboard-configuration \
console-setup \
console-data \
kbd \
console-common \
xkb-data \
locales
2. Debconf-Vorkonfiguration
# Automatische Konfiguration ohne Benutzerinteraktion
echo "keyboard-configuration keyboard-configuration/layout select German" | debconf-set-selections
echo "keyboard-configuration keyboard-configuration/layoutcode string de" | debconf-set-selections
echo "keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC" | debconf-set-selections
3. Keymap-Verzeichnis-Reparatur
- Erstellt fehlende Keymap-Verzeichnisse
- Prüft auf vorhandene deutsche Keymaps
- Erstellt Fallback-Keymap falls nötig
4. localectl-Reparatur
# Startet systemd-localed Service
systemctl start systemd-localed
systemctl enable systemd-localed
# Testet und repariert localectl-Funktionalität
if localectl status &> /dev/null; then
localectl set-keymap de
localectl set-x11-keymap de
fi
5. Multiple Fallback-Methoden
- Primär: localectl (systemd)
- Sekundär: /etc/default/keyboard
- Tertiär: /etc/vconsole.conf
- Fallback: Manuelle Keymap-Erstellung
6. Console-Setup-Integration
# Console-Setup konfigurieren
cat > "/etc/default/console-setup" << EOF
ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="UTF-8"
CODESET="guess"
FONTFACE="Fixed"
FONTSIZE="8x16"
EOF
# Setupcon ausführen
setupcon --force --save
Neue Funktion: fix_keymap_issues()
Diese Funktion wird in Phase 0.3 der Installation ausgeführt und:
- ✅ Installiert alle keyboard-bezogenen Pakete
- ✅ Generiert deutsche Locales
- ✅ Prüft und repariert Keymap-Verzeichnisse
- ✅ Erstellt Fallback-Keymap falls nötig
- ✅ Testet Keymap-Funktionalität
- ✅ Repariert localectl-Konfiguration
- ✅ Konfiguriert vconsole.conf
- ✅ Aktualisiert initramfs
Fehlerbehandlung
- Graceful Degradation: Bei Fehlern wird auf alternative Methoden zurückgegriffen
- Umfassende Logging: Alle Schritte werden protokolliert
- Fallback-Keymaps: Manuelle Erstellung wenn Pakete fehlen
- Service-Recovery: Automatischer Neustart von systemd-localed
Getestete Systeme
- ✅ Raspberry Pi OS (Debian-basiert)
- ✅ Ubuntu Server 20.04+
- ✅ Debian 11+ (Bullseye)
- ✅ Systeme ohne vorinstallierte Desktop-Umgebung
Referenzen
Wartung
Das Skript erstellt automatisch:
/etc/vconsole.conf
für systemd-Systeme/etc/default/keyboard
für X11/Console/etc/default/console-setup
für Console-Setup- Fallback-Keymap in
/usr/share/keymaps/i386/qwertz/de.kmap.gz
Bei Problemen nach der Installation:
# Keymap manuell laden
sudo loadkeys de
# localectl-Status prüfen
sudo localectl status
# Console-Setup neu konfigurieren
sudo dpkg-reconfigure keyboard-configuration
Status: ✅ Behoben
Datum: $(date +%Y-%m-%d)
Version: 2.0 (Erweiterte Keymap-Unterstützung)