From d50a2ae6369ab1316fd1da3bd17cf8c93b4d85f8 Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Wed, 26 Mar 2025 16:28:40 +0100 Subject: [PATCH] Fix: Passt Konfigurationsdatei suchen an. --- 6_Plymouth.sh | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/6_Plymouth.sh b/6_Plymouth.sh index 067df09..afe18e7 100755 --- a/6_Plymouth.sh +++ b/6_Plymouth.sh @@ -37,22 +37,29 @@ mkinitcpio -P echo "🎨 Setze Plymouth-Theme auf 'arch'..." plymouth-set-default-theme -R archlinux -# Kernel-Boot-Parameter in systemd-boot anpassen -BOOT_LOADER_CONF="/boot/loader/entries/arch.conf" +# Korrekte Konfigurationsdatei suchen +BOOT_ENTRY_DIR="/boot/loader/entries" +BOOT_ENTRY_FILE=$(find "$BOOT_ENTRY_DIR" -name "*.conf" | head -n 1) -if [[ -f "$BOOT_LOADER_CONF" ]]; then - echo "🔍 Überprüfe systemd-boot-Konfiguration..." - NEW_CMDLINE="quiet splash vt.global_cursor_default=0 loglevel=3 rd.luks.options=discard plymouth.ignore-serial-consoles" - - # Kernel-Parameter anpassen - if grep -q "options=" "$BOOT_LOADER_CONF"; then - sed -i "s|^options=.*|options=\"$NEW_CMDLINE\"|" "$BOOT_LOADER_CONF" - else - echo "options=\"$NEW_CMDLINE\"" >>"$BOOT_LOADER_CONF" - fi -else - echo "❌ systemd-boot Konfigurationsdatei nicht gefunden!" +if [[ -z "$BOOT_ENTRY_FILE" ]]; then + echo "❌ Keine systemd-boot Eintragsdatei gefunden!" exit 1 fi +echo "🔍 Gefundene Konfigurationsdatei: $BOOT_ENTRY_FILE" + +# Backup erstellen +BACKUP_FILE="${BOOT_ENTRY_FILE}.backup_$(date +%Y%m%d%H%M%S)" +cp "$BOOT_ENTRY_FILE" "$BACKUP_FILE" +echo "🛑 Backup gespeichert unter: $BACKUP_FILE" + +NEW_CMDLINE="quiet splash vt.global_cursor_default=0 loglevel=3 rd.luks.options=discard plymouth.ignore-serial-consoles" + +# Kernel-Parameter anpassen +if grep -q "^options=" "$BOOT_ENTRY_FILE"; then + sed -i "s|^options=.*|options=$NEW_CMDLINE|" "$BOOT_ENTRY_FILE" +else + echo "options=$NEW_CMDLINE" >> "$BOOT_ENTRY_FILE" +fi + echo "✅ Einrichtung abgeschlossen. Bitte starte das System neu, um die Änderungen zu übernehmen."