From 2d932f9924cd99c6d42458ece77b91ec2bcd4cb6 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 15:27:48 +0100 Subject: [PATCH 001/122] =?UTF-8?q?Initial=20commit:=20Linux-Setup=20f?= =?UTF-8?q?=C3=BCr=20MacBook=20Pro=2013"=20und=2016"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vollautomatisches Post-Install-Setup für Ubuntu 24.04 auf MacBook Pro Late 2013 (13") und Mid 2014 (16" mit Nvidia Optimus). Enthält: - setup.sh: Komplettes Post-Install-Skript (Pakete, Xubuntu, Brave, PrusaSlicer, oh-my-zsh, Claude Code, Dotfiles via Forgejo/Stow, mbpfan, thermald, TLP, WireGuard, Lokalisierung DE) - build-iso.sh: Ubuntu Autoinstall ISO für Ventoy erstellen - user-data/meta-data: cloud-init Autoinstall-Konfiguration - mbpfan-13.conf / mbpfan-16.conf: Modellspezifische Lüftersteuerung - hid_apple.conf / keyboard: Deutsche Mac-Tastaturbelegung + Fn-Tasten - blacklist-nvidia.conf: Optionaler Nvidia/nouveau-Blacklist - temp-watch.sh: CPU-Temperaturüberwachung mit Desktop-Notification Infrastruktur-Abhängigkeiten: - Dotfiles: git.motocamp.de/rene/dotfiles.git (via GNU Stow) - DiskStation 10.47.11.10 (SMTP, IMAP, Synology Drive) - WireGuard-VPN 10.13.13.x ins Heimnetz 10.47.11.0/24 Co-Authored-By: Claude Opus 4.6 --- .claude/settings.local.json | 7 ++ README.md | 56 +++++++++ blacklist-nvidia.conf | 9 ++ build-iso.sh | 92 +++++++++++++++ hid_apple.conf | 3 + keyboard | 4 + mbpfan-13.conf | 9 ++ mbpfan-16.conf | 9 ++ meta-data | 2 + setup.sh | 223 ++++++++++++++++++++++++++++++++++++ temp-watch.sh | 27 +++++ user-data | 53 +++++++++ 12 files changed, 494 insertions(+) create mode 100644 .claude/settings.local.json create mode 100644 README.md create mode 100644 blacklist-nvidia.conf create mode 100644 build-iso.sh create mode 100644 hid_apple.conf create mode 100644 keyboard create mode 100644 mbpfan-13.conf create mode 100644 mbpfan-16.conf create mode 100644 meta-data create mode 100644 setup.sh create mode 100644 temp-watch.sh create mode 100644 user-data diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..ded820a --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "Bash(git:*)" + ] + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..947c999 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# macbook-setup + +Automatisiertes Linux-Setup für MacBook Pro 13" Late 2013 und 16" Mid 2014. + +## Inhalt + +| Datei | Beschreibung | +|-------|-------------| +| `setup.sh` | Vollautomatisches Post-Install-Skript | +| `user-data` | Ubuntu Autoinstall (cloud-init) für ISO-Erstellung | +| `meta-data` | cloud-init Metadaten (erforderlich) | +| `mbpfan-13.conf` | mbpfan-Konfiguration für MBP 13" Late 2013 | +| `mbpfan-16.conf` | mbpfan-Konfiguration für MBP 16" Mid 2014 (Nvidia, aggressiver) | +| `hid_apple.conf` | Fn-Tasten als Standard (fnmode=2) | +| `keyboard` | Tastaturbelegung Deutsch (Macintosh) | +| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten (optional, für Intel-only Betrieb) | +| `temp-watch.sh` | Temperatur-Überwachung mit Desktop-Notification | +| `build-iso.sh` | ISO-Erstellungs-Skript für Ventoy | + +## Schnellstart + +### Option A: Automatisches Setup nach Minimalinstallation +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +``` + +### Option B: Vollautomatische ISO erstellen +```bash +git clone https://git.motocamp.de/rene/macbook-setup.git +cd macbook-setup +./build-iso.sh +# → ubuntu-macbook-autoinstall.iso (für Ventoy) +``` + +## Voraussetzungen + +- WireGuard-Config für das jeweilige MacBook (separat aufbewahren) +- Forgejo-Zugang für Dot-Files-Clone +- Thunderbird-Profil-Backup in Synology Drive + +## Hardware-Besonderheiten + +### MBP 16" Mid 2014 (Intel + Nvidia GT 750M) +- Nvidia Optimus: `prime-select intel` als Standard +- Aggressivere Lüfter-Konfiguration via `mbpfan-16.conf` +- Bei Problemen: `blacklist-nvidia.conf` aktivieren + +### MBP 13" Late 2013 +- Robuster, keine Dual-GPU-Probleme +- Standard `mbpfan-13.conf` reicht aus + +## Abhängigkeiten + +- Netzwerk: `10.47.11.0/24` (via WireGuard `10.13.13.x`) +- DiskStation: `10.47.11.10` (SMTP, IMAP, Synology Drive) +- Dot-Files: `https://git.motocamp.de/rene/dotfiles.git` diff --git a/blacklist-nvidia.conf b/blacklist-nvidia.conf new file mode 100644 index 0000000..aa26801 --- /dev/null +++ b/blacklist-nvidia.conf @@ -0,0 +1,9 @@ +# blacklist-nvidia.conf +# Nur aktivieren wenn Nvidia komplett deaktiviert werden soll (Intel-only Betrieb) +# Kopieren nach /etc/modprobe.d/blacklist-nvidia.conf +# Danach: sudo update-initramfs -u && sudo reboot +blacklist nouveau +blacklist nvidia +blacklist nvidia_drm +blacklist nvidia_modeset +options nouveau modeset=0 diff --git a/build-iso.sh b/build-iso.sh new file mode 100644 index 0000000..32d9c9d --- /dev/null +++ b/build-iso.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# build-iso.sh — Ubuntu 24.04 Autoinstall ISO für Ventoy bauen +# Ausführen auf einem Ubuntu/Debian-System mit Internetzugang +# Ergebnis: ubuntu-macbook-autoinstall.iso (~4-5 GB) + +set -e +UBUNTU_ISO_URL="https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso" +UBUNTU_ISO="ubuntu-24.04-live-server-amd64.iso" +OUTPUT_ISO="ubuntu-macbook-autoinstall.iso" +WORKDIR="/tmp/iso-build" + +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } + +echo "════════════════════════════════════════════" +echo " macbook-setup ISO Builder" +echo "════════════════════════════════════════════" + +# Abhängigkeiten +echo -e "\n=== Abhängigkeiten prüfen ===" +sudo apt install -y xorriso squashfs-tools genisoimage +ok "Werkzeuge verfügbar" + +# Ubuntu ISO herunterladen (falls nicht vorhanden) +if [[ ! -f "$UBUNTU_ISO" ]]; then + echo -e "\n=== Ubuntu 24.04 ISO herunterladen ===" + wget --show-progress -O "$UBUNTU_ISO" "$UBUNTU_ISO_URL" + ok "ISO heruntergeladen" +else + ok "ISO bereits vorhanden: $UBUNTU_ISO" +fi + +# Arbeitsverzeichnis vorbereiten +echo -e "\n=== ISO entpacken ===" +rm -rf "$WORKDIR" +mkdir -p "$WORKDIR/source" +sudo mount -o loop "$UBUNTU_ISO" /mnt +cp -rT /mnt "$WORKDIR/source" +sudo umount /mnt +chmod -R u+w "$WORKDIR/source" +ok "ISO entpackt nach $WORKDIR/source" + +# autoinstall-Dateien einfügen +echo -e "\n=== Autoinstall-Dateien einbetten ===" +mkdir -p "$WORKDIR/source/autoinstall" +cp user-data "$WORKDIR/source/autoinstall/" +cp meta-data "$WORKDIR/source/autoinstall/" +ok "user-data und meta-data eingefügt" + +# GRUB-Konfiguration: autoinstall-Parameter hinzufügen +echo -e "\n=== GRUB konfigurieren ===" +GRUB_CFG="$WORKDIR/source/boot/grub/grub.cfg" +# Autoinstall-Eintrag am Anfang einfügen +cat > /tmp/grub-autoinstall.cfg <<'EOF' +set default=0 +set timeout=10 + +menuentry "Ubuntu MacBook AutoInstall" { + set gfxpayload=keep + linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/autoinstall/ --- + initrd /casper/initrd +} + +EOF +cat /tmp/grub-autoinstall.cfg "$GRUB_CFG" > /tmp/grub-merged.cfg +mv /tmp/grub-merged.cfg "$GRUB_CFG" +ok "GRUB konfiguriert (autoinstall als Standard)" + +# ISO neu bauen +echo -e "\n=== ISO bauen ===" +xorriso -as mkisofs \ + -r -V "Ubuntu-24.04-MacBook" \ + -J -joliet-long \ + -b boot/grub/i386-pc/eltorito.img \ + -c boot.catalog \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + --efi-boot boot/grub/efi.img \ + -efi-boot-part --efi-startup-part --protective-msdos-label \ + "$WORKDIR/source" \ + -o "$OUTPUT_ISO" + +ok "ISO erstellt: $OUTPUT_ISO" +echo "" +echo "Größe: $(du -sh "$OUTPUT_ISO" | cut -f1)" +echo "" +warn "Nächster Schritt: ISO auf Ventoy-Stick kopieren" +echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" +echo "" +warn "Vor der Installation: user-data anpassen!" +echo " - Passwort-Hash: mkpasswd -m sha-512 DEINPASSWORT" +echo " - Modell: 'setup.sh -- 13' oder 'setup.sh -- 16' in user-data" diff --git a/hid_apple.conf b/hid_apple.conf new file mode 100644 index 0000000..b9fed99 --- /dev/null +++ b/hid_apple.conf @@ -0,0 +1,3 @@ +# Fn-Tasten als Standard (F1-F12 direkt, ohne Fn-Taste) +# Beschriftung auf MacBook-Tastatur stimmt damit überein +options hid_apple fnmode=2 diff --git a/keyboard b/keyboard new file mode 100644 index 0000000..6f02b2c --- /dev/null +++ b/keyboard @@ -0,0 +1,4 @@ +XKBMODEL="macbook79" +XKBLAYOUT="de" +XKBVARIANT="mac" +XKBOPTIONS="lv3:lalt_switch,terminate:ctrl_alt_bksp" diff --git a/mbpfan-13.conf b/mbpfan-13.conf new file mode 100644 index 0000000..9b6257c --- /dev/null +++ b/mbpfan-13.conf @@ -0,0 +1,9 @@ +# mbpfan.conf für MacBook Pro 13" Late 2013 +# Konservativere Einstellungen (kein Nvidia, weniger Hitzeproblem) +[general] +min_fan1_speed = 2000 +max_fan1_speed = 6200 +low_temp = 55 +high_temp = 65 +max_temp = 80 +polling_interval = 3 diff --git a/mbpfan-16.conf b/mbpfan-16.conf new file mode 100644 index 0000000..42ee9b0 --- /dev/null +++ b/mbpfan-16.conf @@ -0,0 +1,9 @@ +# mbpfan.conf für MacBook Pro 16" Mid 2014 +# Aggressivere Einstellungen wegen Intel + Nvidia GT 750M (Optimus) +[general] +min_fan1_speed = 2500 +max_fan1_speed = 6200 +low_temp = 50 +high_temp = 60 +max_temp = 75 +polling_interval = 3 diff --git a/meta-data b/meta-data new file mode 100644 index 0000000..e1ba485 --- /dev/null +++ b/meta-data @@ -0,0 +1,2 @@ +instance-id: macbook-autoinstall +local-hostname: macbook diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..e732f29 --- /dev/null +++ b/setup.sh @@ -0,0 +1,223 @@ +#!/bin/bash +# macbook-setup/setup.sh +# Vollautomatisches Post-Install-Skript für Linux auf MacBook Pro +# Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +# Oder: bash setup.sh [13|16] (Modell optional, wird sonst abgefragt) + +set -e +FORGEJO="https://git.motocamp.de" +DOTFILES_REPO="$FORGEJO/rene/dotfiles.git" +SETUP_REPO="$FORGEJO/rene/macbook-setup.git" +SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" + +# ── Farben ────────────────────────────────────────────────────────────── +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } + +# ── Modell ermitteln ───────────────────────────────────────────────────── +if [[ "$1" == "13" || "$1" == "16" ]]; then + MODEL="$1" +else + echo "" + echo "Welches MacBook Pro?" + echo " 13 = MBP 13\" Late 2013" + echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + read -rp "Modell [13/16]: " MODEL + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" +fi +ok "Modell: MacBook Pro $MODEL\"" + +# ── Root-Check ─────────────────────────────────────────────────────────── +[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." + +echo "" +echo "════════════════════════════════════════════" +echo " macbook-setup für MBP $MODEL\" startet" +echo "════════════════════════════════════════════" + +# ── 1. System aktualisieren ────────────────────────────────────────────── +echo -e "\n=== 1/12 System aktualisieren ===" +sudo apt update && sudo apt upgrade -y +ok "System aktuell" + +# ── 2. Pakete installieren ─────────────────────────────────────────────── +echo -e "\n=== 2/12 Pakete installieren ===" +sudo apt install -y \ + xubuntu-desktop \ + bcmwl-kernel-source \ + mbpfan thermald \ + lm-sensors xfce4-sensors-plugin \ + tlp tlp-rdw \ + git curl wget stow \ + zsh neovim \ + build-essential \ + python3 python3-pip python3-venv \ + nodejs npm \ + wireguard wireguard-tools \ + libreoffice libreoffice-l10n-de \ + thunderbird thunderbird-locale-de \ + freecad \ + keepassxc \ + htop btop \ + timeshift \ + vlc \ + language-pack-de \ + wngerman \ + bc \ + xfce4-terminal +ok "Pakete installiert" + +# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── +if [[ "$MODEL" == "16" ]]; then + echo -e "\n=== 3/12 Nvidia Optimus (MBP 16\") ===" + sudo apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms + sudo prime-select intel + ok "Nvidia installiert, Intel als Standard-GPU gesetzt" +else + echo -e "\n=== 3/12 Nvidia (MBP 13\") — übersprungen ===" + ok "Kein Nvidia auf MBP 13\"" +fi + +# ── 4. Brave Browser ───────────────────────────────────────────────────── +echo -e "\n=== 4/12 Brave Browser ===" +sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg +echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ +https://brave-releases.s3.brave.com/ stable main" \ + | sudo tee /etc/apt/sources.list.d/brave-browser-release.list +sudo apt update && sudo apt install -y brave-browser +ok "Brave installiert" + +# ── 5. PrusaSlicer ─────────────────────────────────────────────────────── +echo -e "\n=== 5/12 PrusaSlicer AppImage ===" +mkdir -p ~/Applications +PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" +wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" +chmod +x ~/Applications/PrusaSlicer.AppImage +# Desktop-Eintrag +cat > ~/.local/share/applications/prusaslicer.desktop < /dev/null < /dev/null + +# mbpfan (modellabhängig) +wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" +sudo cp /tmp/mbpfan.conf /etc/mbpfan.conf + +# Temperatur-Watch-Skript +wget -q -O /tmp/temp-watch.sh "$SETUP_RAW/temp-watch.sh" +sudo cp /tmp/temp-watch.sh /usr/local/bin/temp-watch.sh +sudo chmod +x /usr/local/bin/temp-watch.sh + +# Nvidia blacklist (nur MBP 16", optional) +if [[ "$MODEL" == "16" ]]; then + wget -q -O /tmp/blacklist-nvidia.conf "$SETUP_RAW/blacklist-nvidia.conf" + warn "MBP 16\": blacklist-nvidia.conf liegt in /tmp — nur aktivieren wenn Nvidia nicht gebraucht wird" +fi + +sudo update-initramfs -u +ok "Systemkonfigurationen gesetzt" + +# ── 10. Energieeinstellungen ───────────────────────────────────────────── +echo -e "\n=== 10/12 Energieeinstellungen ===" + +# XFCE Power Manager (Akku) +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int + +# systemd sleep + logind +sudo tee /etc/systemd/sleep.conf > /dev/null < /dev/null </dev/null || true +sudo systemctl enable --now mbpfan +sudo systemctl enable --now thermald +sudo systemctl enable tlp +ok "mbpfan, thermald, tlp aktiv" + +# ── Zusammenfassung ────────────────────────────────────────────────────── +echo "" +echo "════════════════════════════════════════════" +echo -e " ${GREEN}Setup abgeschlossen!${NC}" +echo "════════════════════════════════════════════" +echo "" +warn "Noch manuell erledigen:" +echo " 1. WireGuard-Config einspielen:" +echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" +echo " 2. Synology Drive Client installieren (.deb von synology.com)" +echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" +echo " 4. Brave starten → Synchronisation einrichten" +echo "" +warn "Neustart empfohlen!" +echo " sudo reboot" diff --git a/temp-watch.sh b/temp-watch.sh new file mode 100644 index 0000000..983ff4f --- /dev/null +++ b/temp-watch.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# temp-watch.sh — Temperaturüberwachung mit Desktop-Notification +# Systemd-Service oder XFCE Autostart +# Warnt bei CPU-Temperatur > THRESHOLD Grad Celsius + +THRESHOLD=85 +INTERVAL=30 + +while true; do + TEMP=$(sensors 2>/dev/null | grep -E "Core 0|Package id" | grep -oP '\+\K[0-9.]+' | sort -n | tail -1) + + if [[ -n "$TEMP" ]] && (( $(echo "$TEMP > $THRESHOLD" | bc -l) )); then + # Aktuellen Desktop-User ermitteln + DESK_USER=$(who | grep -m1 '(:0)' | awk '{print $1}') + if [[ -n "$DESK_USER" ]]; then + USER_ID=$(id -u "$DESK_USER") + DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${USER_ID}/bus" \ + sudo -u "$DESK_USER" notify-send \ + -u critical \ + -i dialog-warning \ + "🌡 CPU-Temperatur kritisch" \ + "${TEMP}°C — Lüfter prüfen!\nmbpfan: $(systemctl is-active mbpfan)" + fi + fi + + sleep "$INTERVAL" +done diff --git a/user-data b/user-data new file mode 100644 index 0000000..a9d1d2a --- /dev/null +++ b/user-data @@ -0,0 +1,53 @@ +#cloud-config +autoinstall: + version: 1 + locale: de_DE.UTF-8 + keyboard: + layout: de + variant: mac + identity: + hostname: macbook + username: rene + # Passwort mit `mkpasswd -m sha-512 PASSWORT` generieren und hier ersetzen: + password: "$6$CHANGEME$CHANGEME" + ssh: + install-server: false + storage: + layout: + name: lvm + packages: + - bcmwl-kernel-source + - mbpfan + - thermald + - lm-sensors + - git + - curl + - wget + - zsh + - neovim + - stow + - build-essential + - python3 + - python3-pip + - nodejs + - npm + - wireguard + - wireguard-tools + - libreoffice + - libreoffice-l10n-de + - thunderbird + - thunderbird-locale-de + - language-pack-de + - wngerman + - tlp + - tlp-rdw + - keepassxc + - htop + - btop + - timeshift + - vlc + - bc + late-commands: + # setup.sh aus Forgejo ausführen — Modell als Argument übergeben (13 oder 16) + - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -s -- 13' + # Für MBP 16": oben "13" durch "16" ersetzen From 722bd849f9fc262cbc12139132cc1883cadaf320 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 15:27:48 +0100 Subject: [PATCH 002/122] =?UTF-8?q?Initial=20commit:=20Linux-Setup=20f?= =?UTF-8?q?=C3=BCr=20MacBook=20Pro=2013"=20und=2016"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vollautomatisches Post-Install-Setup für Ubuntu 24.04 auf MacBook Pro Late 2013 (13") und Mid 2014 (16" mit Nvidia Optimus). Enthält: - setup.sh: Komplettes Post-Install-Skript (Pakete, Xubuntu, Brave, PrusaSlicer, oh-my-zsh, Claude Code, Dotfiles via Forgejo/Stow, mbpfan, thermald, TLP, WireGuard, Lokalisierung DE) - build-iso.sh: Ubuntu Autoinstall ISO für Ventoy erstellen - user-data/meta-data: cloud-init Autoinstall-Konfiguration - mbpfan-13.conf / mbpfan-16.conf: Modellspezifische Lüftersteuerung - hid_apple.conf / keyboard: Deutsche Mac-Tastaturbelegung + Fn-Tasten - blacklist-nvidia.conf: Optionaler Nvidia/nouveau-Blacklist - temp-watch.sh: CPU-Temperaturüberwachung mit Desktop-Notification Infrastruktur-Abhängigkeiten: - Dotfiles: git.motocamp.de/rene/dotfiles.git (via GNU Stow) - DiskStation 10.47.11.10 (SMTP, IMAP, Synology Drive) - WireGuard-VPN 10.13.13.x ins Heimnetz 10.47.11.0/24 --- .claude/settings.local.json | 7 ++ README.md | 56 +++++++++ blacklist-nvidia.conf | 9 ++ build-iso.sh | 92 +++++++++++++++ hid_apple.conf | 3 + keyboard | 4 + mbpfan-13.conf | 9 ++ mbpfan-16.conf | 9 ++ meta-data | 2 + setup.sh | 223 ++++++++++++++++++++++++++++++++++++ temp-watch.sh | 27 +++++ user-data | 53 +++++++++ 12 files changed, 494 insertions(+) create mode 100644 .claude/settings.local.json create mode 100644 README.md create mode 100644 blacklist-nvidia.conf create mode 100644 build-iso.sh create mode 100644 hid_apple.conf create mode 100644 keyboard create mode 100644 mbpfan-13.conf create mode 100644 mbpfan-16.conf create mode 100644 meta-data create mode 100644 setup.sh create mode 100644 temp-watch.sh create mode 100644 user-data diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..ded820a --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "Bash(git:*)" + ] + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..947c999 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# macbook-setup + +Automatisiertes Linux-Setup für MacBook Pro 13" Late 2013 und 16" Mid 2014. + +## Inhalt + +| Datei | Beschreibung | +|-------|-------------| +| `setup.sh` | Vollautomatisches Post-Install-Skript | +| `user-data` | Ubuntu Autoinstall (cloud-init) für ISO-Erstellung | +| `meta-data` | cloud-init Metadaten (erforderlich) | +| `mbpfan-13.conf` | mbpfan-Konfiguration für MBP 13" Late 2013 | +| `mbpfan-16.conf` | mbpfan-Konfiguration für MBP 16" Mid 2014 (Nvidia, aggressiver) | +| `hid_apple.conf` | Fn-Tasten als Standard (fnmode=2) | +| `keyboard` | Tastaturbelegung Deutsch (Macintosh) | +| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten (optional, für Intel-only Betrieb) | +| `temp-watch.sh` | Temperatur-Überwachung mit Desktop-Notification | +| `build-iso.sh` | ISO-Erstellungs-Skript für Ventoy | + +## Schnellstart + +### Option A: Automatisches Setup nach Minimalinstallation +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +``` + +### Option B: Vollautomatische ISO erstellen +```bash +git clone https://git.motocamp.de/rene/macbook-setup.git +cd macbook-setup +./build-iso.sh +# → ubuntu-macbook-autoinstall.iso (für Ventoy) +``` + +## Voraussetzungen + +- WireGuard-Config für das jeweilige MacBook (separat aufbewahren) +- Forgejo-Zugang für Dot-Files-Clone +- Thunderbird-Profil-Backup in Synology Drive + +## Hardware-Besonderheiten + +### MBP 16" Mid 2014 (Intel + Nvidia GT 750M) +- Nvidia Optimus: `prime-select intel` als Standard +- Aggressivere Lüfter-Konfiguration via `mbpfan-16.conf` +- Bei Problemen: `blacklist-nvidia.conf` aktivieren + +### MBP 13" Late 2013 +- Robuster, keine Dual-GPU-Probleme +- Standard `mbpfan-13.conf` reicht aus + +## Abhängigkeiten + +- Netzwerk: `10.47.11.0/24` (via WireGuard `10.13.13.x`) +- DiskStation: `10.47.11.10` (SMTP, IMAP, Synology Drive) +- Dot-Files: `https://git.motocamp.de/rene/dotfiles.git` diff --git a/blacklist-nvidia.conf b/blacklist-nvidia.conf new file mode 100644 index 0000000..aa26801 --- /dev/null +++ b/blacklist-nvidia.conf @@ -0,0 +1,9 @@ +# blacklist-nvidia.conf +# Nur aktivieren wenn Nvidia komplett deaktiviert werden soll (Intel-only Betrieb) +# Kopieren nach /etc/modprobe.d/blacklist-nvidia.conf +# Danach: sudo update-initramfs -u && sudo reboot +blacklist nouveau +blacklist nvidia +blacklist nvidia_drm +blacklist nvidia_modeset +options nouveau modeset=0 diff --git a/build-iso.sh b/build-iso.sh new file mode 100644 index 0000000..32d9c9d --- /dev/null +++ b/build-iso.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# build-iso.sh — Ubuntu 24.04 Autoinstall ISO für Ventoy bauen +# Ausführen auf einem Ubuntu/Debian-System mit Internetzugang +# Ergebnis: ubuntu-macbook-autoinstall.iso (~4-5 GB) + +set -e +UBUNTU_ISO_URL="https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso" +UBUNTU_ISO="ubuntu-24.04-live-server-amd64.iso" +OUTPUT_ISO="ubuntu-macbook-autoinstall.iso" +WORKDIR="/tmp/iso-build" + +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } + +echo "════════════════════════════════════════════" +echo " macbook-setup ISO Builder" +echo "════════════════════════════════════════════" + +# Abhängigkeiten +echo -e "\n=== Abhängigkeiten prüfen ===" +sudo apt install -y xorriso squashfs-tools genisoimage +ok "Werkzeuge verfügbar" + +# Ubuntu ISO herunterladen (falls nicht vorhanden) +if [[ ! -f "$UBUNTU_ISO" ]]; then + echo -e "\n=== Ubuntu 24.04 ISO herunterladen ===" + wget --show-progress -O "$UBUNTU_ISO" "$UBUNTU_ISO_URL" + ok "ISO heruntergeladen" +else + ok "ISO bereits vorhanden: $UBUNTU_ISO" +fi + +# Arbeitsverzeichnis vorbereiten +echo -e "\n=== ISO entpacken ===" +rm -rf "$WORKDIR" +mkdir -p "$WORKDIR/source" +sudo mount -o loop "$UBUNTU_ISO" /mnt +cp -rT /mnt "$WORKDIR/source" +sudo umount /mnt +chmod -R u+w "$WORKDIR/source" +ok "ISO entpackt nach $WORKDIR/source" + +# autoinstall-Dateien einfügen +echo -e "\n=== Autoinstall-Dateien einbetten ===" +mkdir -p "$WORKDIR/source/autoinstall" +cp user-data "$WORKDIR/source/autoinstall/" +cp meta-data "$WORKDIR/source/autoinstall/" +ok "user-data und meta-data eingefügt" + +# GRUB-Konfiguration: autoinstall-Parameter hinzufügen +echo -e "\n=== GRUB konfigurieren ===" +GRUB_CFG="$WORKDIR/source/boot/grub/grub.cfg" +# Autoinstall-Eintrag am Anfang einfügen +cat > /tmp/grub-autoinstall.cfg <<'EOF' +set default=0 +set timeout=10 + +menuentry "Ubuntu MacBook AutoInstall" { + set gfxpayload=keep + linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/autoinstall/ --- + initrd /casper/initrd +} + +EOF +cat /tmp/grub-autoinstall.cfg "$GRUB_CFG" > /tmp/grub-merged.cfg +mv /tmp/grub-merged.cfg "$GRUB_CFG" +ok "GRUB konfiguriert (autoinstall als Standard)" + +# ISO neu bauen +echo -e "\n=== ISO bauen ===" +xorriso -as mkisofs \ + -r -V "Ubuntu-24.04-MacBook" \ + -J -joliet-long \ + -b boot/grub/i386-pc/eltorito.img \ + -c boot.catalog \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + --efi-boot boot/grub/efi.img \ + -efi-boot-part --efi-startup-part --protective-msdos-label \ + "$WORKDIR/source" \ + -o "$OUTPUT_ISO" + +ok "ISO erstellt: $OUTPUT_ISO" +echo "" +echo "Größe: $(du -sh "$OUTPUT_ISO" | cut -f1)" +echo "" +warn "Nächster Schritt: ISO auf Ventoy-Stick kopieren" +echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" +echo "" +warn "Vor der Installation: user-data anpassen!" +echo " - Passwort-Hash: mkpasswd -m sha-512 DEINPASSWORT" +echo " - Modell: 'setup.sh -- 13' oder 'setup.sh -- 16' in user-data" diff --git a/hid_apple.conf b/hid_apple.conf new file mode 100644 index 0000000..b9fed99 --- /dev/null +++ b/hid_apple.conf @@ -0,0 +1,3 @@ +# Fn-Tasten als Standard (F1-F12 direkt, ohne Fn-Taste) +# Beschriftung auf MacBook-Tastatur stimmt damit überein +options hid_apple fnmode=2 diff --git a/keyboard b/keyboard new file mode 100644 index 0000000..6f02b2c --- /dev/null +++ b/keyboard @@ -0,0 +1,4 @@ +XKBMODEL="macbook79" +XKBLAYOUT="de" +XKBVARIANT="mac" +XKBOPTIONS="lv3:lalt_switch,terminate:ctrl_alt_bksp" diff --git a/mbpfan-13.conf b/mbpfan-13.conf new file mode 100644 index 0000000..9b6257c --- /dev/null +++ b/mbpfan-13.conf @@ -0,0 +1,9 @@ +# mbpfan.conf für MacBook Pro 13" Late 2013 +# Konservativere Einstellungen (kein Nvidia, weniger Hitzeproblem) +[general] +min_fan1_speed = 2000 +max_fan1_speed = 6200 +low_temp = 55 +high_temp = 65 +max_temp = 80 +polling_interval = 3 diff --git a/mbpfan-16.conf b/mbpfan-16.conf new file mode 100644 index 0000000..42ee9b0 --- /dev/null +++ b/mbpfan-16.conf @@ -0,0 +1,9 @@ +# mbpfan.conf für MacBook Pro 16" Mid 2014 +# Aggressivere Einstellungen wegen Intel + Nvidia GT 750M (Optimus) +[general] +min_fan1_speed = 2500 +max_fan1_speed = 6200 +low_temp = 50 +high_temp = 60 +max_temp = 75 +polling_interval = 3 diff --git a/meta-data b/meta-data new file mode 100644 index 0000000..e1ba485 --- /dev/null +++ b/meta-data @@ -0,0 +1,2 @@ +instance-id: macbook-autoinstall +local-hostname: macbook diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..e732f29 --- /dev/null +++ b/setup.sh @@ -0,0 +1,223 @@ +#!/bin/bash +# macbook-setup/setup.sh +# Vollautomatisches Post-Install-Skript für Linux auf MacBook Pro +# Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +# Oder: bash setup.sh [13|16] (Modell optional, wird sonst abgefragt) + +set -e +FORGEJO="https://git.motocamp.de" +DOTFILES_REPO="$FORGEJO/rene/dotfiles.git" +SETUP_REPO="$FORGEJO/rene/macbook-setup.git" +SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" + +# ── Farben ────────────────────────────────────────────────────────────── +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } + +# ── Modell ermitteln ───────────────────────────────────────────────────── +if [[ "$1" == "13" || "$1" == "16" ]]; then + MODEL="$1" +else + echo "" + echo "Welches MacBook Pro?" + echo " 13 = MBP 13\" Late 2013" + echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + read -rp "Modell [13/16]: " MODEL + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" +fi +ok "Modell: MacBook Pro $MODEL\"" + +# ── Root-Check ─────────────────────────────────────────────────────────── +[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." + +echo "" +echo "════════════════════════════════════════════" +echo " macbook-setup für MBP $MODEL\" startet" +echo "════════════════════════════════════════════" + +# ── 1. System aktualisieren ────────────────────────────────────────────── +echo -e "\n=== 1/12 System aktualisieren ===" +sudo apt update && sudo apt upgrade -y +ok "System aktuell" + +# ── 2. Pakete installieren ─────────────────────────────────────────────── +echo -e "\n=== 2/12 Pakete installieren ===" +sudo apt install -y \ + xubuntu-desktop \ + bcmwl-kernel-source \ + mbpfan thermald \ + lm-sensors xfce4-sensors-plugin \ + tlp tlp-rdw \ + git curl wget stow \ + zsh neovim \ + build-essential \ + python3 python3-pip python3-venv \ + nodejs npm \ + wireguard wireguard-tools \ + libreoffice libreoffice-l10n-de \ + thunderbird thunderbird-locale-de \ + freecad \ + keepassxc \ + htop btop \ + timeshift \ + vlc \ + language-pack-de \ + wngerman \ + bc \ + xfce4-terminal +ok "Pakete installiert" + +# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── +if [[ "$MODEL" == "16" ]]; then + echo -e "\n=== 3/12 Nvidia Optimus (MBP 16\") ===" + sudo apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms + sudo prime-select intel + ok "Nvidia installiert, Intel als Standard-GPU gesetzt" +else + echo -e "\n=== 3/12 Nvidia (MBP 13\") — übersprungen ===" + ok "Kein Nvidia auf MBP 13\"" +fi + +# ── 4. Brave Browser ───────────────────────────────────────────────────── +echo -e "\n=== 4/12 Brave Browser ===" +sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg +echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ +https://brave-releases.s3.brave.com/ stable main" \ + | sudo tee /etc/apt/sources.list.d/brave-browser-release.list +sudo apt update && sudo apt install -y brave-browser +ok "Brave installiert" + +# ── 5. PrusaSlicer ─────────────────────────────────────────────────────── +echo -e "\n=== 5/12 PrusaSlicer AppImage ===" +mkdir -p ~/Applications +PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" +wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" +chmod +x ~/Applications/PrusaSlicer.AppImage +# Desktop-Eintrag +cat > ~/.local/share/applications/prusaslicer.desktop < /dev/null < /dev/null + +# mbpfan (modellabhängig) +wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" +sudo cp /tmp/mbpfan.conf /etc/mbpfan.conf + +# Temperatur-Watch-Skript +wget -q -O /tmp/temp-watch.sh "$SETUP_RAW/temp-watch.sh" +sudo cp /tmp/temp-watch.sh /usr/local/bin/temp-watch.sh +sudo chmod +x /usr/local/bin/temp-watch.sh + +# Nvidia blacklist (nur MBP 16", optional) +if [[ "$MODEL" == "16" ]]; then + wget -q -O /tmp/blacklist-nvidia.conf "$SETUP_RAW/blacklist-nvidia.conf" + warn "MBP 16\": blacklist-nvidia.conf liegt in /tmp — nur aktivieren wenn Nvidia nicht gebraucht wird" +fi + +sudo update-initramfs -u +ok "Systemkonfigurationen gesetzt" + +# ── 10. Energieeinstellungen ───────────────────────────────────────────── +echo -e "\n=== 10/12 Energieeinstellungen ===" + +# XFCE Power Manager (Akku) +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int +xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int + +# systemd sleep + logind +sudo tee /etc/systemd/sleep.conf > /dev/null < /dev/null </dev/null || true +sudo systemctl enable --now mbpfan +sudo systemctl enable --now thermald +sudo systemctl enable tlp +ok "mbpfan, thermald, tlp aktiv" + +# ── Zusammenfassung ────────────────────────────────────────────────────── +echo "" +echo "════════════════════════════════════════════" +echo -e " ${GREEN}Setup abgeschlossen!${NC}" +echo "════════════════════════════════════════════" +echo "" +warn "Noch manuell erledigen:" +echo " 1. WireGuard-Config einspielen:" +echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" +echo " 2. Synology Drive Client installieren (.deb von synology.com)" +echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" +echo " 4. Brave starten → Synchronisation einrichten" +echo "" +warn "Neustart empfohlen!" +echo " sudo reboot" diff --git a/temp-watch.sh b/temp-watch.sh new file mode 100644 index 0000000..983ff4f --- /dev/null +++ b/temp-watch.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# temp-watch.sh — Temperaturüberwachung mit Desktop-Notification +# Systemd-Service oder XFCE Autostart +# Warnt bei CPU-Temperatur > THRESHOLD Grad Celsius + +THRESHOLD=85 +INTERVAL=30 + +while true; do + TEMP=$(sensors 2>/dev/null | grep -E "Core 0|Package id" | grep -oP '\+\K[0-9.]+' | sort -n | tail -1) + + if [[ -n "$TEMP" ]] && (( $(echo "$TEMP > $THRESHOLD" | bc -l) )); then + # Aktuellen Desktop-User ermitteln + DESK_USER=$(who | grep -m1 '(:0)' | awk '{print $1}') + if [[ -n "$DESK_USER" ]]; then + USER_ID=$(id -u "$DESK_USER") + DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${USER_ID}/bus" \ + sudo -u "$DESK_USER" notify-send \ + -u critical \ + -i dialog-warning \ + "🌡 CPU-Temperatur kritisch" \ + "${TEMP}°C — Lüfter prüfen!\nmbpfan: $(systemctl is-active mbpfan)" + fi + fi + + sleep "$INTERVAL" +done diff --git a/user-data b/user-data new file mode 100644 index 0000000..a9d1d2a --- /dev/null +++ b/user-data @@ -0,0 +1,53 @@ +#cloud-config +autoinstall: + version: 1 + locale: de_DE.UTF-8 + keyboard: + layout: de + variant: mac + identity: + hostname: macbook + username: rene + # Passwort mit `mkpasswd -m sha-512 PASSWORT` generieren und hier ersetzen: + password: "$6$CHANGEME$CHANGEME" + ssh: + install-server: false + storage: + layout: + name: lvm + packages: + - bcmwl-kernel-source + - mbpfan + - thermald + - lm-sensors + - git + - curl + - wget + - zsh + - neovim + - stow + - build-essential + - python3 + - python3-pip + - nodejs + - npm + - wireguard + - wireguard-tools + - libreoffice + - libreoffice-l10n-de + - thunderbird + - thunderbird-locale-de + - language-pack-de + - wngerman + - tlp + - tlp-rdw + - keepassxc + - htop + - btop + - timeshift + - vlc + - bc + late-commands: + # setup.sh aus Forgejo ausführen — Modell als Argument übergeben (13 oder 16) + - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -s -- 13' + # Für MBP 16": oben "13" durch "16" ersetzen From 2db0b9b36fa72f590e353f0f3ff063135ea9811e Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 15:34:38 +0100 Subject: [PATCH 003/122] =?UTF-8?q?Fix=20dotfiles=20repo=20URL:=20dotfiles?= =?UTF-8?q?=20=E2=86=92=20dotfiles-rene?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- README.md | 2 +- setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 947c999..283d91c 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,4 @@ cd macbook-setup - Netzwerk: `10.47.11.0/24` (via WireGuard `10.13.13.x`) - DiskStation: `10.47.11.10` (SMTP, IMAP, Synology Drive) -- Dot-Files: `https://git.motocamp.de/rene/dotfiles.git` +- Dot-Files: `https://git.motocamp.de/rene/dotfiles-rene.git` diff --git a/setup.sh b/setup.sh index e732f29..6182bb8 100644 --- a/setup.sh +++ b/setup.sh @@ -6,7 +6,7 @@ set -e FORGEJO="https://git.motocamp.de" -DOTFILES_REPO="$FORGEJO/rene/dotfiles.git" +DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" SETUP_REPO="$FORGEJO/rene/macbook-setup.git" SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" From d507df61234ba7dce352d2a53c41ef9b71c1b9c7 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 15:34:38 +0100 Subject: [PATCH 004/122] =?UTF-8?q?Fix=20dotfiles=20repo=20URL:=20dotfiles?= =?UTF-8?q?=20=E2=86=92=20dotfiles-rene?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 947c999..283d91c 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,4 @@ cd macbook-setup - Netzwerk: `10.47.11.0/24` (via WireGuard `10.13.13.x`) - DiskStation: `10.47.11.10` (SMTP, IMAP, Synology Drive) -- Dot-Files: `https://git.motocamp.de/rene/dotfiles.git` +- Dot-Files: `https://git.motocamp.de/rene/dotfiles-rene.git` diff --git a/setup.sh b/setup.sh index e732f29..6182bb8 100644 --- a/setup.sh +++ b/setup.sh @@ -6,7 +6,7 @@ set -e FORGEJO="https://git.motocamp.de" -DOTFILES_REPO="$FORGEJO/rene/dotfiles.git" +DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" SETUP_REPO="$FORGEJO/rene/macbook-setup.git" SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" From 1f530674befa47efabd3910514ccacbaa74dbb5c Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:41:22 +0100 Subject: [PATCH 005/122] Split setup.sh in chroot-sicheren und Desktop-Teil setup.sh rief bisher alles in einem Skript auf, was in der Autoinstall-ISO (curtin in-target/chroot) teilweise fehlschlaegt: xfconf-query, npm, oh-my-zsh, PrusaSlicer brauchen eine laufende Desktop-Session. Neuer Aufbau: - setup-base.sh: Pakete, Configs, Locale, Services (laeuft in chroot) - setup-desktop.sh: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE-Einstellungen (laeuft beim ersten Desktop-Login) - setup.sh: Wrapper fuer Option A (manuelles curl | bash nach Install) user-data ruft jetzt setup-base.sh in late-commands auf und richtet einen XFCE-Autostart fuer setup-desktop.sh beim ersten Login ein. Co-Authored-By: Claude Opus 4.6 --- README.md | 4 +- setup-base.sh | 162 +++++++++++++++++++++++++++++++++++++ setup-desktop.sh | 103 ++++++++++++++++++++++++ setup.sh | 205 ++++------------------------------------------- user-data | 49 ++++------- 5 files changed, 299 insertions(+), 224 deletions(-) create mode 100644 setup-base.sh create mode 100644 setup-desktop.sh diff --git a/README.md b/README.md index 283d91c..779460d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ Automatisiertes Linux-Setup für MacBook Pro 13" Late 2013 und 16" Mid 2014. | Datei | Beschreibung | |-------|-------------| -| `setup.sh` | Vollautomatisches Post-Install-Skript | +| `setup.sh` | Wrapper: ruft setup-base.sh + setup-desktop.sh auf (Option A) | +| `setup-base.sh` | System-Setup: Pakete, Configs, Locale, Services (chroot-sicher) | +| `setup-desktop.sh` | Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE | | `user-data` | Ubuntu Autoinstall (cloud-init) für ISO-Erstellung | | `meta-data` | cloud-init Metadaten (erforderlich) | | `mbpfan-13.conf` | mbpfan-Konfiguration für MBP 13" Late 2013 | diff --git a/setup-base.sh b/setup-base.sh new file mode 100644 index 0000000..230550a --- /dev/null +++ b/setup-base.sh @@ -0,0 +1,162 @@ +#!/bin/bash +# macbook-setup/setup-base.sh +# System-Setup: Pakete, Konfiguration, Locale, Services +# Funktioniert in chroot (Autoinstall late-commands) UND standalone +# Verwendung: sudo bash setup-base.sh [13|16] + +set -e +FORGEJO="https://git.motocamp.de" +SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" + +# ── Farben ────────────────────────────────────────────────────────────── +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } + +# ── Modell ermitteln ───────────────────────────────────────────────────── +if [[ "$1" == "13" || "$1" == "16" ]]; then + MODEL="$1" +else + echo "" + echo "Welches MacBook Pro?" + echo " 13 = MBP 13\" Late 2013" + echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + read -rp "Modell [13/16]: " MODEL + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" +fi +ok "Modell: MacBook Pro $MODEL\"" + +echo "" +echo "════════════════════════════════════════════" +echo " setup-base.sh für MBP $MODEL\" startet" +echo "════════════════════════════════════════════" + +# ── 1. System aktualisieren ────────────────────────────────────────────── +echo -e "\n=== 1/8 System aktualisieren ===" +apt update && apt upgrade -y +ok "System aktuell" + +# ── 2. Pakete installieren ─────────────────────────────────────────────── +echo -e "\n=== 2/8 Pakete installieren ===" +apt install -y \ + xubuntu-desktop \ + bcmwl-kernel-source \ + mbpfan thermald \ + lm-sensors xfce4-sensors-plugin \ + tlp tlp-rdw \ + git curl wget stow \ + zsh neovim \ + build-essential \ + python3 python3-pip python3-venv \ + nodejs npm \ + wireguard wireguard-tools \ + libreoffice libreoffice-l10n-de \ + thunderbird thunderbird-locale-de \ + freecad \ + keepassxc \ + htop btop \ + timeshift \ + vlc \ + language-pack-de \ + wngerman \ + bc \ + xfce4-terminal +ok "Pakete installiert" + +# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── +if [[ "$MODEL" == "16" ]]; then + echo -e "\n=== 3/8 Nvidia Optimus (MBP 16\") ===" + apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms + prime-select intel + ok "Nvidia installiert, Intel als Standard-GPU gesetzt" +else + echo -e "\n=== 3/8 Nvidia (MBP 13\") — übersprungen ===" + ok "Kein Nvidia auf MBP 13\"" +fi + +# ── 4. Brave Browser ───────────────────────────────────────────────────── +echo -e "\n=== 4/8 Brave Browser ===" +curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg +echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ +https://brave-releases.s3.brave.com/ stable main" \ + | tee /etc/apt/sources.list.d/brave-browser-release.list +apt update && apt install -y brave-browser +ok "Brave installiert" + +# ── 5. Konfigurationsdateien ───────────────────────────────────────────── +echo -e "\n=== 5/8 Systemkonfigurationen ===" + +# Tastaturbelegung +tee /etc/default/keyboard > /dev/null < /dev/null + +# mbpfan (modellabhängig) +wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" +cp /tmp/mbpfan.conf /etc/mbpfan.conf + +# Temperatur-Watch-Skript +wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" +chmod +x /usr/local/bin/temp-watch.sh + +# Nvidia blacklist (nur MBP 16", optional) +if [[ "$MODEL" == "16" ]]; then + wget -q -O /tmp/blacklist-nvidia.conf "$SETUP_RAW/blacklist-nvidia.conf" + warn "MBP 16\": blacklist-nvidia.conf liegt in /tmp — nur aktivieren wenn Nvidia nicht gebraucht wird" +fi + +update-initramfs -u +ok "Systemkonfigurationen gesetzt" + +# ── 6. Energieeinstellungen (systemd) ──────────────────────────────────── +echo -e "\n=== 6/8 Energieeinstellungen ===" + +tee /etc/systemd/sleep.conf > /dev/null < /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime +ok "Lokalisierung: Deutsch / Berlin" + +# ── 8. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 8/8 Services aktivieren ===" +systemctl enable mbpfan +systemctl enable thermald +systemctl enable tlp +# --now nur wenn nicht in chroot +if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; then + systemctl start mbpfan + systemctl start thermald + sensors-detect --auto 2>/dev/null || true + ok "mbpfan, thermald, tlp aktiv (gestartet)" +else + ok "mbpfan, thermald, tlp aktiviert (Start nach Reboot)" +fi + +# ── zsh als Standard-Shell für rene ────────────────────────────────────── +chsh -s /bin/zsh rene 2>/dev/null || true + +echo "" +echo "════════════════════════════════════════════" +echo -e " ${GREEN}setup-base.sh abgeschlossen!${NC}" +echo "════════════════════════════════════════════" diff --git a/setup-desktop.sh b/setup-desktop.sh new file mode 100644 index 0000000..c05bbcd --- /dev/null +++ b/setup-desktop.sh @@ -0,0 +1,103 @@ +#!/bin/bash +# macbook-setup/setup-desktop.sh +# Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE-Einstellungen +# Braucht eine laufende Desktop-Session (XFCE) — NICHT in chroot ausführen! +# Verwendung: bash setup-desktop.sh +# Wird automatisch beim ersten Login gestartet (via Autostart) + +set -e +FORGEJO="https://git.motocamp.de" +DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" + +# ── Farben ────────────────────────────────────────────────────────────── +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } + +# ── Root-Check ─────────────────────────────────────────────────────────── +[[ $EUID -eq 0 ]] && err "Nicht als root ausführen!" + +echo "" +echo "════════════════════════════════════════════" +echo " setup-desktop.sh startet" +echo "════════════════════════════════════════════" + +# ── 1. oh-my-zsh ──────────────────────────────────────────────────────── +echo -e "\n=== 1/5 oh-my-zsh ===" +if [[ ! -d ~/.oh-my-zsh ]]; then + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +fi +ok "oh-my-zsh installiert" + +# ── 2. npm global + Claude Code ───────────────────────────────────────── +echo -e "\n=== 2/5 Claude Code ===" +mkdir -p ~/.npm-global +npm config set prefix '~/.npm-global' +export PATH="$HOME/.npm-global/bin:$PATH" +npm install -g @anthropic-ai/claude-code +ok "Claude Code installiert" + +# ── 3. PrusaSlicer ────────────────────────────────────────────────────── +echo -e "\n=== 3/5 PrusaSlicer AppImage ===" +mkdir -p ~/Applications +PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" +if [[ ! -f ~/Applications/PrusaSlicer.AppImage ]]; then + wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" + chmod +x ~/Applications/PrusaSlicer.AppImage +fi +mkdir -p ~/.local/share/applications +cat > ~/.local/share/applications/prusaslicer.desktop </dev/null; then + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int + ok "XFCE Power Manager konfiguriert" +else + warn "xfconf-query nicht gefunden — XFCE Energieeinstellungen übersprungen" +fi + +# ── Autostart entfernen ───────────────────────────────────────────────── +AUTOSTART_FILE="$HOME/.config/autostart/macbook-setup-desktop.desktop" +if [[ -f "$AUTOSTART_FILE" ]]; then + rm "$AUTOSTART_FILE" + ok "Firstboot-Autostart entfernt" +fi + +# ── Zusammenfassung ────────────────────────────────────────────────────── +echo "" +echo "════════════════════════════════════════════" +echo -e " ${GREEN}Desktop-Setup abgeschlossen!${NC}" +echo "════════════════════════════════════════════" +echo "" +warn "Noch manuell erledigen:" +echo " 1. WireGuard-Config einspielen:" +echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" +echo " 2. Synology Drive Client installieren (.deb von synology.com)" +echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" +echo " 4. Brave starten → Synchronisation einrichten" diff --git a/setup.sh b/setup.sh index 6182bb8..de86e5c 100644 --- a/setup.sh +++ b/setup.sh @@ -1,21 +1,22 @@ #!/bin/bash # macbook-setup/setup.sh # Vollautomatisches Post-Install-Skript für Linux auf MacBook Pro +# Ruft setup-base.sh (als root) und setup-desktop.sh (als User) auf +# # Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash # Oder: bash setup.sh [13|16] (Modell optional, wird sonst abgefragt) set -e -FORGEJO="https://git.motocamp.de" -DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" -SETUP_REPO="$FORGEJO/rene/macbook-setup.git" -SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" +SETUP_RAW="https://git.motocamp.de/rene/macbook-setup/raw/branch/main" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } -warn() { echo -e "${YELLOW}⚠ $*${NC}"; } err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +# ── Root-Check ─────────────────────────────────────────────────────────── +[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." + # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then MODEL="$1" @@ -27,197 +28,25 @@ else read -rp "Modell [13/16]: " MODEL [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" fi -ok "Modell: MacBook Pro $MODEL\"" - -# ── Root-Check ─────────────────────────────────────────────────────────── -[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." echo "" echo "════════════════════════════════════════════" -echo " macbook-setup für MBP $MODEL\" startet" +echo " macbook-setup für MBP $MODEL\" (komplett)" echo "════════════════════════════════════════════" -# ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/12 System aktualisieren ===" -sudo apt update && sudo apt upgrade -y -ok "System aktuell" +# ── Phase 1: System-Setup (als root) ──────────────────────────────────── +echo -e "\n>>> Phase 1: setup-base.sh (System)" +curl -fsSL "$SETUP_RAW/setup-base.sh" | sudo bash -s -- "$MODEL" +ok "Phase 1 abgeschlossen" -# ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/12 Pakete installieren ===" -sudo apt install -y \ - xubuntu-desktop \ - bcmwl-kernel-source \ - mbpfan thermald \ - lm-sensors xfce4-sensors-plugin \ - tlp tlp-rdw \ - git curl wget stow \ - zsh neovim \ - build-essential \ - python3 python3-pip python3-venv \ - nodejs npm \ - wireguard wireguard-tools \ - libreoffice libreoffice-l10n-de \ - thunderbird thunderbird-locale-de \ - freecad \ - keepassxc \ - htop btop \ - timeshift \ - vlc \ - language-pack-de \ - wngerman \ - bc \ - xfce4-terminal -ok "Pakete installiert" +# ── Phase 2: Desktop-Setup (als User) ─────────────────────────────────── +echo -e "\n>>> Phase 2: setup-desktop.sh (Desktop)" +curl -fsSL "$SETUP_RAW/setup-desktop.sh" | bash +ok "Phase 2 abgeschlossen" -# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── -if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/12 Nvidia Optimus (MBP 16\") ===" - sudo apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms - sudo prime-select intel - ok "Nvidia installiert, Intel als Standard-GPU gesetzt" -else - echo -e "\n=== 3/12 Nvidia (MBP 13\") — übersprungen ===" - ok "Kein Nvidia auf MBP 13\"" -fi - -# ── 4. Brave Browser ───────────────────────────────────────────────────── -echo -e "\n=== 4/12 Brave Browser ===" -sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ - https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg -echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ -https://brave-releases.s3.brave.com/ stable main" \ - | sudo tee /etc/apt/sources.list.d/brave-browser-release.list -sudo apt update && sudo apt install -y brave-browser -ok "Brave installiert" - -# ── 5. PrusaSlicer ─────────────────────────────────────────────────────── -echo -e "\n=== 5/12 PrusaSlicer AppImage ===" -mkdir -p ~/Applications -PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" -wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" -chmod +x ~/Applications/PrusaSlicer.AppImage -# Desktop-Eintrag -cat > ~/.local/share/applications/prusaslicer.desktop < /dev/null < /dev/null - -# mbpfan (modellabhängig) -wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" -sudo cp /tmp/mbpfan.conf /etc/mbpfan.conf - -# Temperatur-Watch-Skript -wget -q -O /tmp/temp-watch.sh "$SETUP_RAW/temp-watch.sh" -sudo cp /tmp/temp-watch.sh /usr/local/bin/temp-watch.sh -sudo chmod +x /usr/local/bin/temp-watch.sh - -# Nvidia blacklist (nur MBP 16", optional) -if [[ "$MODEL" == "16" ]]; then - wget -q -O /tmp/blacklist-nvidia.conf "$SETUP_RAW/blacklist-nvidia.conf" - warn "MBP 16\": blacklist-nvidia.conf liegt in /tmp — nur aktivieren wenn Nvidia nicht gebraucht wird" -fi - -sudo update-initramfs -u -ok "Systemkonfigurationen gesetzt" - -# ── 10. Energieeinstellungen ───────────────────────────────────────────── -echo -e "\n=== 10/12 Energieeinstellungen ===" - -# XFCE Power Manager (Akku) -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int - -# systemd sleep + logind -sudo tee /etc/systemd/sleep.conf > /dev/null < /dev/null </dev/null || true -sudo systemctl enable --now mbpfan -sudo systemctl enable --now thermald -sudo systemctl enable tlp -ok "mbpfan, thermald, tlp aktiv" - -# ── Zusammenfassung ────────────────────────────────────────────────────── echo "" echo "════════════════════════════════════════════" -echo -e " ${GREEN}Setup abgeschlossen!${NC}" +echo -e " ${GREEN}Komplett-Setup abgeschlossen!${NC}" echo "════════════════════════════════════════════" echo "" -warn "Noch manuell erledigen:" -echo " 1. WireGuard-Config einspielen:" -echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" -echo " 2. Synology Drive Client installieren (.deb von synology.com)" -echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" -echo " 4. Brave starten → Synchronisation einrichten" -echo "" -warn "Neustart empfohlen!" -echo " sudo reboot" +echo "Neustart empfohlen: sudo reboot" diff --git a/user-data b/user-data index a9d1d2a..f7c9329 100644 --- a/user-data +++ b/user-data @@ -15,39 +15,18 @@ autoinstall: storage: layout: name: lvm - packages: - - bcmwl-kernel-source - - mbpfan - - thermald - - lm-sensors - - git - - curl - - wget - - zsh - - neovim - - stow - - build-essential - - python3 - - python3-pip - - nodejs - - npm - - wireguard - - wireguard-tools - - libreoffice - - libreoffice-l10n-de - - thunderbird - - thunderbird-locale-de - - language-pack-de - - wngerman - - tlp - - tlp-rdw - - keepassxc - - htop - - btop - - timeshift - - vlc - - bc late-commands: - # setup.sh aus Forgejo ausführen — Modell als Argument übergeben (13 oder 16) - - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -s -- 13' - # Für MBP 16": oben "13" durch "16" ersetzen + # System-Setup in chroot (Pakete, Configs, Locale, Services) + - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 13' + # Desktop-Setup als Firstboot-Autostart einrichten + - curtin in-target --target=/target -- mkdir -p /home/rene/.config/autostart + - curtin in-target --target=/target -- bash -c 'cat > /home/rene/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; exec xfce4-terminal -e \"bash -c less /tmp/setup-desktop.log\"" +Hidden=false +X-GNOME-Autostart-enabled=true +AUTOSTART' + - curtin in-target --target=/target -- chown -R 1000:1000 /home/rene/.config + # Fuer MBP 16": oben "13" durch "16" ersetzen From d6af10d780aa17c1ec38c40e10c99bb6f8f8dd6f Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:41:22 +0100 Subject: [PATCH 006/122] Split setup.sh in chroot-sicheren und Desktop-Teil setup.sh rief bisher alles in einem Skript auf, was in der Autoinstall-ISO (curtin in-target/chroot) teilweise fehlschlaegt: xfconf-query, npm, oh-my-zsh, PrusaSlicer brauchen eine laufende Desktop-Session. Neuer Aufbau: - setup-base.sh: Pakete, Configs, Locale, Services (laeuft in chroot) - setup-desktop.sh: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE-Einstellungen (laeuft beim ersten Desktop-Login) - setup.sh: Wrapper fuer Option A (manuelles curl | bash nach Install) user-data ruft jetzt setup-base.sh in late-commands auf und richtet einen XFCE-Autostart fuer setup-desktop.sh beim ersten Login ein. --- README.md | 4 +- setup-base.sh | 162 +++++++++++++++++++++++++++++++++++++ setup-desktop.sh | 103 ++++++++++++++++++++++++ setup.sh | 205 ++++------------------------------------------- user-data | 49 ++++------- 5 files changed, 299 insertions(+), 224 deletions(-) create mode 100644 setup-base.sh create mode 100644 setup-desktop.sh diff --git a/README.md b/README.md index 283d91c..779460d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ Automatisiertes Linux-Setup für MacBook Pro 13" Late 2013 und 16" Mid 2014. | Datei | Beschreibung | |-------|-------------| -| `setup.sh` | Vollautomatisches Post-Install-Skript | +| `setup.sh` | Wrapper: ruft setup-base.sh + setup-desktop.sh auf (Option A) | +| `setup-base.sh` | System-Setup: Pakete, Configs, Locale, Services (chroot-sicher) | +| `setup-desktop.sh` | Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE | | `user-data` | Ubuntu Autoinstall (cloud-init) für ISO-Erstellung | | `meta-data` | cloud-init Metadaten (erforderlich) | | `mbpfan-13.conf` | mbpfan-Konfiguration für MBP 13" Late 2013 | diff --git a/setup-base.sh b/setup-base.sh new file mode 100644 index 0000000..230550a --- /dev/null +++ b/setup-base.sh @@ -0,0 +1,162 @@ +#!/bin/bash +# macbook-setup/setup-base.sh +# System-Setup: Pakete, Konfiguration, Locale, Services +# Funktioniert in chroot (Autoinstall late-commands) UND standalone +# Verwendung: sudo bash setup-base.sh [13|16] + +set -e +FORGEJO="https://git.motocamp.de" +SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" + +# ── Farben ────────────────────────────────────────────────────────────── +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } + +# ── Modell ermitteln ───────────────────────────────────────────────────── +if [[ "$1" == "13" || "$1" == "16" ]]; then + MODEL="$1" +else + echo "" + echo "Welches MacBook Pro?" + echo " 13 = MBP 13\" Late 2013" + echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + read -rp "Modell [13/16]: " MODEL + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" +fi +ok "Modell: MacBook Pro $MODEL\"" + +echo "" +echo "════════════════════════════════════════════" +echo " setup-base.sh für MBP $MODEL\" startet" +echo "════════════════════════════════════════════" + +# ── 1. System aktualisieren ────────────────────────────────────────────── +echo -e "\n=== 1/8 System aktualisieren ===" +apt update && apt upgrade -y +ok "System aktuell" + +# ── 2. Pakete installieren ─────────────────────────────────────────────── +echo -e "\n=== 2/8 Pakete installieren ===" +apt install -y \ + xubuntu-desktop \ + bcmwl-kernel-source \ + mbpfan thermald \ + lm-sensors xfce4-sensors-plugin \ + tlp tlp-rdw \ + git curl wget stow \ + zsh neovim \ + build-essential \ + python3 python3-pip python3-venv \ + nodejs npm \ + wireguard wireguard-tools \ + libreoffice libreoffice-l10n-de \ + thunderbird thunderbird-locale-de \ + freecad \ + keepassxc \ + htop btop \ + timeshift \ + vlc \ + language-pack-de \ + wngerman \ + bc \ + xfce4-terminal +ok "Pakete installiert" + +# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── +if [[ "$MODEL" == "16" ]]; then + echo -e "\n=== 3/8 Nvidia Optimus (MBP 16\") ===" + apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms + prime-select intel + ok "Nvidia installiert, Intel als Standard-GPU gesetzt" +else + echo -e "\n=== 3/8 Nvidia (MBP 13\") — übersprungen ===" + ok "Kein Nvidia auf MBP 13\"" +fi + +# ── 4. Brave Browser ───────────────────────────────────────────────────── +echo -e "\n=== 4/8 Brave Browser ===" +curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg +echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ +https://brave-releases.s3.brave.com/ stable main" \ + | tee /etc/apt/sources.list.d/brave-browser-release.list +apt update && apt install -y brave-browser +ok "Brave installiert" + +# ── 5. Konfigurationsdateien ───────────────────────────────────────────── +echo -e "\n=== 5/8 Systemkonfigurationen ===" + +# Tastaturbelegung +tee /etc/default/keyboard > /dev/null < /dev/null + +# mbpfan (modellabhängig) +wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" +cp /tmp/mbpfan.conf /etc/mbpfan.conf + +# Temperatur-Watch-Skript +wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" +chmod +x /usr/local/bin/temp-watch.sh + +# Nvidia blacklist (nur MBP 16", optional) +if [[ "$MODEL" == "16" ]]; then + wget -q -O /tmp/blacklist-nvidia.conf "$SETUP_RAW/blacklist-nvidia.conf" + warn "MBP 16\": blacklist-nvidia.conf liegt in /tmp — nur aktivieren wenn Nvidia nicht gebraucht wird" +fi + +update-initramfs -u +ok "Systemkonfigurationen gesetzt" + +# ── 6. Energieeinstellungen (systemd) ──────────────────────────────────── +echo -e "\n=== 6/8 Energieeinstellungen ===" + +tee /etc/systemd/sleep.conf > /dev/null < /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime +ok "Lokalisierung: Deutsch / Berlin" + +# ── 8. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 8/8 Services aktivieren ===" +systemctl enable mbpfan +systemctl enable thermald +systemctl enable tlp +# --now nur wenn nicht in chroot +if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; then + systemctl start mbpfan + systemctl start thermald + sensors-detect --auto 2>/dev/null || true + ok "mbpfan, thermald, tlp aktiv (gestartet)" +else + ok "mbpfan, thermald, tlp aktiviert (Start nach Reboot)" +fi + +# ── zsh als Standard-Shell für rene ────────────────────────────────────── +chsh -s /bin/zsh rene 2>/dev/null || true + +echo "" +echo "════════════════════════════════════════════" +echo -e " ${GREEN}setup-base.sh abgeschlossen!${NC}" +echo "════════════════════════════════════════════" diff --git a/setup-desktop.sh b/setup-desktop.sh new file mode 100644 index 0000000..c05bbcd --- /dev/null +++ b/setup-desktop.sh @@ -0,0 +1,103 @@ +#!/bin/bash +# macbook-setup/setup-desktop.sh +# Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE-Einstellungen +# Braucht eine laufende Desktop-Session (XFCE) — NICHT in chroot ausführen! +# Verwendung: bash setup-desktop.sh +# Wird automatisch beim ersten Login gestartet (via Autostart) + +set -e +FORGEJO="https://git.motocamp.de" +DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" + +# ── Farben ────────────────────────────────────────────────────────────── +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' +ok() { echo -e "${GREEN}✓ $*${NC}"; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } + +# ── Root-Check ─────────────────────────────────────────────────────────── +[[ $EUID -eq 0 ]] && err "Nicht als root ausführen!" + +echo "" +echo "════════════════════════════════════════════" +echo " setup-desktop.sh startet" +echo "════════════════════════════════════════════" + +# ── 1. oh-my-zsh ──────────────────────────────────────────────────────── +echo -e "\n=== 1/5 oh-my-zsh ===" +if [[ ! -d ~/.oh-my-zsh ]]; then + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +fi +ok "oh-my-zsh installiert" + +# ── 2. npm global + Claude Code ───────────────────────────────────────── +echo -e "\n=== 2/5 Claude Code ===" +mkdir -p ~/.npm-global +npm config set prefix '~/.npm-global' +export PATH="$HOME/.npm-global/bin:$PATH" +npm install -g @anthropic-ai/claude-code +ok "Claude Code installiert" + +# ── 3. PrusaSlicer ────────────────────────────────────────────────────── +echo -e "\n=== 3/5 PrusaSlicer AppImage ===" +mkdir -p ~/Applications +PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" +if [[ ! -f ~/Applications/PrusaSlicer.AppImage ]]; then + wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" + chmod +x ~/Applications/PrusaSlicer.AppImage +fi +mkdir -p ~/.local/share/applications +cat > ~/.local/share/applications/prusaslicer.desktop </dev/null; then + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int + ok "XFCE Power Manager konfiguriert" +else + warn "xfconf-query nicht gefunden — XFCE Energieeinstellungen übersprungen" +fi + +# ── Autostart entfernen ───────────────────────────────────────────────── +AUTOSTART_FILE="$HOME/.config/autostart/macbook-setup-desktop.desktop" +if [[ -f "$AUTOSTART_FILE" ]]; then + rm "$AUTOSTART_FILE" + ok "Firstboot-Autostart entfernt" +fi + +# ── Zusammenfassung ────────────────────────────────────────────────────── +echo "" +echo "════════════════════════════════════════════" +echo -e " ${GREEN}Desktop-Setup abgeschlossen!${NC}" +echo "════════════════════════════════════════════" +echo "" +warn "Noch manuell erledigen:" +echo " 1. WireGuard-Config einspielen:" +echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" +echo " 2. Synology Drive Client installieren (.deb von synology.com)" +echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" +echo " 4. Brave starten → Synchronisation einrichten" diff --git a/setup.sh b/setup.sh index 6182bb8..de86e5c 100644 --- a/setup.sh +++ b/setup.sh @@ -1,21 +1,22 @@ #!/bin/bash # macbook-setup/setup.sh # Vollautomatisches Post-Install-Skript für Linux auf MacBook Pro +# Ruft setup-base.sh (als root) und setup-desktop.sh (als User) auf +# # Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash # Oder: bash setup.sh [13|16] (Modell optional, wird sonst abgefragt) set -e -FORGEJO="https://git.motocamp.de" -DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" -SETUP_REPO="$FORGEJO/rene/macbook-setup.git" -SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" +SETUP_RAW="https://git.motocamp.de/rene/macbook-setup/raw/branch/main" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } -warn() { echo -e "${YELLOW}⚠ $*${NC}"; } err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +# ── Root-Check ─────────────────────────────────────────────────────────── +[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." + # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then MODEL="$1" @@ -27,197 +28,25 @@ else read -rp "Modell [13/16]: " MODEL [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" fi -ok "Modell: MacBook Pro $MODEL\"" - -# ── Root-Check ─────────────────────────────────────────────────────────── -[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." echo "" echo "════════════════════════════════════════════" -echo " macbook-setup für MBP $MODEL\" startet" +echo " macbook-setup für MBP $MODEL\" (komplett)" echo "════════════════════════════════════════════" -# ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/12 System aktualisieren ===" -sudo apt update && sudo apt upgrade -y -ok "System aktuell" +# ── Phase 1: System-Setup (als root) ──────────────────────────────────── +echo -e "\n>>> Phase 1: setup-base.sh (System)" +curl -fsSL "$SETUP_RAW/setup-base.sh" | sudo bash -s -- "$MODEL" +ok "Phase 1 abgeschlossen" -# ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/12 Pakete installieren ===" -sudo apt install -y \ - xubuntu-desktop \ - bcmwl-kernel-source \ - mbpfan thermald \ - lm-sensors xfce4-sensors-plugin \ - tlp tlp-rdw \ - git curl wget stow \ - zsh neovim \ - build-essential \ - python3 python3-pip python3-venv \ - nodejs npm \ - wireguard wireguard-tools \ - libreoffice libreoffice-l10n-de \ - thunderbird thunderbird-locale-de \ - freecad \ - keepassxc \ - htop btop \ - timeshift \ - vlc \ - language-pack-de \ - wngerman \ - bc \ - xfce4-terminal -ok "Pakete installiert" +# ── Phase 2: Desktop-Setup (als User) ─────────────────────────────────── +echo -e "\n>>> Phase 2: setup-desktop.sh (Desktop)" +curl -fsSL "$SETUP_RAW/setup-desktop.sh" | bash +ok "Phase 2 abgeschlossen" -# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── -if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/12 Nvidia Optimus (MBP 16\") ===" - sudo apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms - sudo prime-select intel - ok "Nvidia installiert, Intel als Standard-GPU gesetzt" -else - echo -e "\n=== 3/12 Nvidia (MBP 13\") — übersprungen ===" - ok "Kein Nvidia auf MBP 13\"" -fi - -# ── 4. Brave Browser ───────────────────────────────────────────────────── -echo -e "\n=== 4/12 Brave Browser ===" -sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ - https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg -echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ -https://brave-releases.s3.brave.com/ stable main" \ - | sudo tee /etc/apt/sources.list.d/brave-browser-release.list -sudo apt update && sudo apt install -y brave-browser -ok "Brave installiert" - -# ── 5. PrusaSlicer ─────────────────────────────────────────────────────── -echo -e "\n=== 5/12 PrusaSlicer AppImage ===" -mkdir -p ~/Applications -PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" -wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" -chmod +x ~/Applications/PrusaSlicer.AppImage -# Desktop-Eintrag -cat > ~/.local/share/applications/prusaslicer.desktop < /dev/null < /dev/null - -# mbpfan (modellabhängig) -wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" -sudo cp /tmp/mbpfan.conf /etc/mbpfan.conf - -# Temperatur-Watch-Skript -wget -q -O /tmp/temp-watch.sh "$SETUP_RAW/temp-watch.sh" -sudo cp /tmp/temp-watch.sh /usr/local/bin/temp-watch.sh -sudo chmod +x /usr/local/bin/temp-watch.sh - -# Nvidia blacklist (nur MBP 16", optional) -if [[ "$MODEL" == "16" ]]; then - wget -q -O /tmp/blacklist-nvidia.conf "$SETUP_RAW/blacklist-nvidia.conf" - warn "MBP 16\": blacklist-nvidia.conf liegt in /tmp — nur aktivieren wenn Nvidia nicht gebraucht wird" -fi - -sudo update-initramfs -u -ok "Systemkonfigurationen gesetzt" - -# ── 10. Energieeinstellungen ───────────────────────────────────────────── -echo -e "\n=== 10/12 Energieeinstellungen ===" - -# XFCE Power Manager (Akku) -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int -xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int - -# systemd sleep + logind -sudo tee /etc/systemd/sleep.conf > /dev/null < /dev/null </dev/null || true -sudo systemctl enable --now mbpfan -sudo systemctl enable --now thermald -sudo systemctl enable tlp -ok "mbpfan, thermald, tlp aktiv" - -# ── Zusammenfassung ────────────────────────────────────────────────────── echo "" echo "════════════════════════════════════════════" -echo -e " ${GREEN}Setup abgeschlossen!${NC}" +echo -e " ${GREEN}Komplett-Setup abgeschlossen!${NC}" echo "════════════════════════════════════════════" echo "" -warn "Noch manuell erledigen:" -echo " 1. WireGuard-Config einspielen:" -echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" -echo " 2. Synology Drive Client installieren (.deb von synology.com)" -echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" -echo " 4. Brave starten → Synchronisation einrichten" -echo "" -warn "Neustart empfohlen!" -echo " sudo reboot" +echo "Neustart empfohlen: sudo reboot" diff --git a/user-data b/user-data index a9d1d2a..f7c9329 100644 --- a/user-data +++ b/user-data @@ -15,39 +15,18 @@ autoinstall: storage: layout: name: lvm - packages: - - bcmwl-kernel-source - - mbpfan - - thermald - - lm-sensors - - git - - curl - - wget - - zsh - - neovim - - stow - - build-essential - - python3 - - python3-pip - - nodejs - - npm - - wireguard - - wireguard-tools - - libreoffice - - libreoffice-l10n-de - - thunderbird - - thunderbird-locale-de - - language-pack-de - - wngerman - - tlp - - tlp-rdw - - keepassxc - - htop - - btop - - timeshift - - vlc - - bc late-commands: - # setup.sh aus Forgejo ausführen — Modell als Argument übergeben (13 oder 16) - - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -s -- 13' - # Für MBP 16": oben "13" durch "16" ersetzen + # System-Setup in chroot (Pakete, Configs, Locale, Services) + - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 13' + # Desktop-Setup als Firstboot-Autostart einrichten + - curtin in-target --target=/target -- mkdir -p /home/rene/.config/autostart + - curtin in-target --target=/target -- bash -c 'cat > /home/rene/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; exec xfce4-terminal -e \"bash -c less /tmp/setup-desktop.log\"" +Hidden=false +X-GNOME-Autostart-enabled=true +AUTOSTART' + - curtin in-target --target=/target -- chown -R 1000:1000 /home/rene/.config + # Fuer MBP 16": oben "13" durch "16" ersetzen From bc1fcb296c8c6827b6c7825a7951d7d8d889a5ac Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:50:26 +0100 Subject: [PATCH 007/122] Fix Dotfiles Stow-Pakete: an dotfiles-rene Struktur anpassen nvim, oh-my-zsh, micro, bin, heic-scripts statt zsh, nvim, git, ssh Co-Authored-By: Claude Opus 4.6 --- setup-desktop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index c05bbcd..4cc323b 100644 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -63,7 +63,7 @@ if [[ ! -d ~/dotfiles ]]; then git clone "$DOTFILES_REPO" ~/dotfiles fi cd ~/dotfiles -for pkg in zsh nvim git ssh; do +for pkg in nvim oh-my-zsh micro bin heic-scripts; do [[ -d "$pkg" ]] && stow "$pkg" && ok "Dot-Files: $pkg" done cd ~ From a62a8a9781caaecb21e820edaeb4962b0fb596d5 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:50:26 +0100 Subject: [PATCH 008/122] Fix Dotfiles Stow-Pakete: an dotfiles-rene Struktur anpassen nvim, oh-my-zsh, micro, bin, heic-scripts statt zsh, nvim, git, ssh --- setup-desktop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index c05bbcd..4cc323b 100644 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -63,7 +63,7 @@ if [[ ! -d ~/dotfiles ]]; then git clone "$DOTFILES_REPO" ~/dotfiles fi cd ~/dotfiles -for pkg in zsh nvim git ssh; do +for pkg in nvim oh-my-zsh micro bin heic-scripts; do [[ -d "$pkg" ]] && stow "$pkg" && ok "Dot-Files: $pkg" done cd ~ From 8e4850278bb34dc00ecf4fc3830613f4c4174b4c Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:51:55 +0100 Subject: [PATCH 009/122] Set default password for autoinstall (pin0cchi0) Co-Authored-By: Claude Opus 4.6 --- user-data | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user-data b/user-data index f7c9329..3946073 100644 --- a/user-data +++ b/user-data @@ -8,8 +8,8 @@ autoinstall: identity: hostname: macbook username: rene - # Passwort mit `mkpasswd -m sha-512 PASSWORT` generieren und hier ersetzen: - password: "$6$CHANGEME$CHANGEME" + # Standard-Passwort: pin0cchi0 (nach Erstinstallation aendern!) + password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: install-server: false storage: From 8190c3f7223ed8840cedba22d9336c12657681c9 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:51:55 +0100 Subject: [PATCH 010/122] Set default password for autoinstall (pin0cchi0) --- user-data | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user-data b/user-data index f7c9329..3946073 100644 --- a/user-data +++ b/user-data @@ -8,8 +8,8 @@ autoinstall: identity: hostname: macbook username: rene - # Passwort mit `mkpasswd -m sha-512 PASSWORT` generieren und hier ersetzen: - password: "$6$CHANGEME$CHANGEME" + # Standard-Passwort: pin0cchi0 (nach Erstinstallation aendern!) + password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: install-server: false storage: From 026e0201c68bee8ee593ff8fe7e5bf08df50f92f Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:52:40 +0100 Subject: [PATCH 011/122] Remove plaintext password hint from user-data Co-Authored-By: Claude Opus 4.6 --- user-data | 1 - 1 file changed, 1 deletion(-) diff --git a/user-data b/user-data index 3946073..20141f5 100644 --- a/user-data +++ b/user-data @@ -8,7 +8,6 @@ autoinstall: identity: hostname: macbook username: rene - # Standard-Passwort: pin0cchi0 (nach Erstinstallation aendern!) password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: install-server: false From 0451ff5c14342bf82c9db1776b1fb087b37ae93d Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:52:40 +0100 Subject: [PATCH 012/122] Remove plaintext password hint from user-data --- user-data | 1 - 1 file changed, 1 deletion(-) diff --git a/user-data b/user-data index 3946073..20141f5 100644 --- a/user-data +++ b/user-data @@ -8,7 +8,6 @@ autoinstall: identity: hostname: macbook username: rene - # Standard-Passwort: pin0cchi0 (nach Erstinstallation aendern!) password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: install-server: false From 68705f6719b3dd471176cadc9a00716c558955f5 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:53:59 +0100 Subject: [PATCH 013/122] Make setup-base.sh and setup-desktop.sh executable Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 0 setup-desktop.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 setup-base.sh mode change 100644 => 100755 setup-desktop.sh diff --git a/setup-base.sh b/setup-base.sh old mode 100644 new mode 100755 diff --git a/setup-desktop.sh b/setup-desktop.sh old mode 100644 new mode 100755 From 0702910e1c33def806d82b1ae4369913d2750f9d Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:53:59 +0100 Subject: [PATCH 014/122] Make setup-base.sh and setup-desktop.sh executable --- setup-base.sh | 0 setup-desktop.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 setup-base.sh mode change 100644 => 100755 setup-desktop.sh diff --git a/setup-base.sh b/setup-base.sh old mode 100644 new mode 100755 diff --git a/setup-desktop.sh b/setup-desktop.sh old mode 100644 new mode 100755 From da9fa8391091f04abc61c3c8db881a8b9f785b95 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:58:06 +0100 Subject: [PATCH 015/122] Dotfiles: Install-Skripte statt Stow, Clone nach ~/git-projekte Dotfiles-rene nutzt eigene Install-Skripte (nvim, micro) und Symlinks (oh-my-zsh custom, heic-scripts) statt GNU Stow. Clone-Pfad geaendert von ~/dotfiles nach ~/git-projekte/dotfiles-rene. Co-Authored-By: Claude Opus 4.6 --- setup-desktop.sh | 54 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index 4cc323b..a45ce6c 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -59,14 +59,54 @@ ok "PrusaSlicer installiert" # ── 4. Dot-Files ──────────────────────────────────────────────────────── echo -e "\n=== 4/5 Dot-Files ===" -if [[ ! -d ~/dotfiles ]]; then - git clone "$DOTFILES_REPO" ~/dotfiles +DOTFILES_DIR="$HOME/git-projekte/dotfiles-rene" +if [[ ! -d "$DOTFILES_DIR" ]]; then + mkdir -p "$HOME/git-projekte" + git clone "$DOTFILES_REPO" "$DOTFILES_DIR" +fi + +# Neovim +if [[ -f "$DOTFILES_DIR/nvim/install-nvim-dotfiles.sh" ]]; then + bash "$DOTFILES_DIR/nvim/install-nvim-dotfiles.sh" + ok "Dot-Files: nvim" +fi + +# Micro +if [[ -f "$DOTFILES_DIR/micro/install-micro-dotfiles.sh" ]]; then + bash "$DOTFILES_DIR/micro/install-micro-dotfiles.sh" + ok "Dot-Files: micro" +fi + +# oh-my-zsh custom (Plugins, Themes, Aliase) +if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom" ]] && [[ -d ~/.oh-my-zsh/custom ]]; then + for f in "$DOTFILES_DIR/oh-my-zsh/custom"/*.zsh; do + [[ -f "$f" ]] && ln -sf "$f" ~/.oh-my-zsh/custom/ + done + # Custom Plugins + if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/plugins" ]]; then + for plugin_dir in "$DOTFILES_DIR/oh-my-zsh/custom/plugins"/*/; do + plugin_name=$(basename "$plugin_dir") + ln -sfn "$plugin_dir" ~/.oh-my-zsh/custom/plugins/"$plugin_name" + done + fi + # Custom Themes + if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/themes" ]]; then + for theme_dir in "$DOTFILES_DIR/oh-my-zsh/custom/themes"/*/; do + theme_name=$(basename "$theme_dir") + ln -sfn "$theme_dir" ~/.oh-my-zsh/custom/themes/"$theme_name" + done + fi + ok "Dot-Files: oh-my-zsh custom" +fi + +# heic-scripts nach ~/bin +if [[ -d "$DOTFILES_DIR/heic-scripts" ]]; then + mkdir -p ~/bin + for script in "$DOTFILES_DIR/heic-scripts"/*; do + [[ -f "$script" ]] && ln -sf "$script" ~/bin/ + done + ok "Dot-Files: heic-scripts → ~/bin" fi -cd ~/dotfiles -for pkg in nvim oh-my-zsh micro bin heic-scripts; do - [[ -d "$pkg" ]] && stow "$pkg" && ok "Dot-Files: $pkg" -done -cd ~ # ── 5. XFCE Energieeinstellungen ──────────────────────────────────────── echo -e "\n=== 5/5 XFCE Energieeinstellungen ===" From b08902488f276c764c72ab51b3e1b2d7a309e518 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 16:58:06 +0100 Subject: [PATCH 016/122] Dotfiles: Install-Skripte statt Stow, Clone nach ~/git-projekte Dotfiles-rene nutzt eigene Install-Skripte (nvim, micro) und Symlinks (oh-my-zsh custom, heic-scripts) statt GNU Stow. Clone-Pfad geaendert von ~/dotfiles nach ~/git-projekte/dotfiles-rene. --- setup-desktop.sh | 54 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index 4cc323b..a45ce6c 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -59,14 +59,54 @@ ok "PrusaSlicer installiert" # ── 4. Dot-Files ──────────────────────────────────────────────────────── echo -e "\n=== 4/5 Dot-Files ===" -if [[ ! -d ~/dotfiles ]]; then - git clone "$DOTFILES_REPO" ~/dotfiles +DOTFILES_DIR="$HOME/git-projekte/dotfiles-rene" +if [[ ! -d "$DOTFILES_DIR" ]]; then + mkdir -p "$HOME/git-projekte" + git clone "$DOTFILES_REPO" "$DOTFILES_DIR" +fi + +# Neovim +if [[ -f "$DOTFILES_DIR/nvim/install-nvim-dotfiles.sh" ]]; then + bash "$DOTFILES_DIR/nvim/install-nvim-dotfiles.sh" + ok "Dot-Files: nvim" +fi + +# Micro +if [[ -f "$DOTFILES_DIR/micro/install-micro-dotfiles.sh" ]]; then + bash "$DOTFILES_DIR/micro/install-micro-dotfiles.sh" + ok "Dot-Files: micro" +fi + +# oh-my-zsh custom (Plugins, Themes, Aliase) +if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom" ]] && [[ -d ~/.oh-my-zsh/custom ]]; then + for f in "$DOTFILES_DIR/oh-my-zsh/custom"/*.zsh; do + [[ -f "$f" ]] && ln -sf "$f" ~/.oh-my-zsh/custom/ + done + # Custom Plugins + if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/plugins" ]]; then + for plugin_dir in "$DOTFILES_DIR/oh-my-zsh/custom/plugins"/*/; do + plugin_name=$(basename "$plugin_dir") + ln -sfn "$plugin_dir" ~/.oh-my-zsh/custom/plugins/"$plugin_name" + done + fi + # Custom Themes + if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/themes" ]]; then + for theme_dir in "$DOTFILES_DIR/oh-my-zsh/custom/themes"/*/; do + theme_name=$(basename "$theme_dir") + ln -sfn "$theme_dir" ~/.oh-my-zsh/custom/themes/"$theme_name" + done + fi + ok "Dot-Files: oh-my-zsh custom" +fi + +# heic-scripts nach ~/bin +if [[ -d "$DOTFILES_DIR/heic-scripts" ]]; then + mkdir -p ~/bin + for script in "$DOTFILES_DIR/heic-scripts"/*; do + [[ -f "$script" ]] && ln -sf "$script" ~/bin/ + done + ok "Dot-Files: heic-scripts → ~/bin" fi -cd ~/dotfiles -for pkg in nvim oh-my-zsh micro bin heic-scripts; do - [[ -d "$pkg" ]] && stow "$pkg" && ok "Dot-Files: $pkg" -done -cd ~ # ── 5. XFCE Energieeinstellungen ──────────────────────────────────────── echo -e "\n=== 5/5 XFCE Energieeinstellungen ===" From 9cf76959c8116c50b11899c91fe85fb4aad43978 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 21:37:00 +0100 Subject: [PATCH 017/122] Rewrite build-iso.sh: macOS-Support, Ubuntu 24.04.4, xorriso in-place MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Funktioniert auf macOS (brew) und Linux (apt) - Ubuntu ISO URL aktualisiert auf 24.04.4 - xorriso modifiziert die Original-ISO direkt statt entpacken/neu bauen → Boot-Records (BIOS + EFI) bleiben korrekt erhalten - Download-Validierung (prüft auf gültige ISO) - user-data/meta-data per absolutem Pfad (SCRIPT_DIR) Co-Authored-By: Claude Opus 4.6 --- build-iso.sh | 115 +++++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 50 deletions(-) mode change 100644 => 100755 build-iso.sh diff --git a/build-iso.sh b/build-iso.sh old mode 100644 new mode 100755 index 32d9c9d..4817a29 --- a/build-iso.sh +++ b/build-iso.sh @@ -1,58 +1,73 @@ #!/bin/bash # build-iso.sh — Ubuntu 24.04 Autoinstall ISO für Ventoy bauen -# Ausführen auf einem Ubuntu/Debian-System mit Internetzugang -# Ergebnis: ubuntu-macbook-autoinstall.iso (~4-5 GB) +# Funktioniert auf macOS (xorriso via brew) und Linux (xorriso via apt) +# Ergebnis: ubuntu-macbook-autoinstall.iso (~3.2 GB) set -e -UBUNTU_ISO_URL="https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso" -UBUNTU_ISO="ubuntu-24.04-live-server-amd64.iso" +UBUNTU_ISO_URL="https://releases.ubuntu.com/24.04/ubuntu-24.04.4-live-server-amd64.iso" +UBUNTU_ISO="ubuntu-24.04.4-live-server-amd64.iso" OUTPUT_ISO="ubuntu-macbook-autoinstall.iso" -WORKDIR="/tmp/iso-build" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +OS="$(uname -s)" echo "════════════════════════════════════════════" -echo " macbook-setup ISO Builder" +echo " macbook-setup ISO Builder ($OS)" echo "════════════════════════════════════════════" -# Abhängigkeiten +# ── Abhängigkeiten ─────────────────────────────────────────────────────── echo -e "\n=== Abhängigkeiten prüfen ===" -sudo apt install -y xorriso squashfs-tools genisoimage -ok "Werkzeuge verfügbar" +if [[ "$OS" == "Darwin" ]]; then + if ! command -v xorriso &>/dev/null; then + echo "xorriso nicht gefunden, installiere via Homebrew..." + brew install xorriso + fi + ok "xorriso verfügbar (macOS)" +else + if ! command -v xorriso &>/dev/null; then + sudo apt install -y xorriso + fi + ok "xorriso verfügbar (Linux)" +fi -# Ubuntu ISO herunterladen (falls nicht vorhanden) +# ── Ubuntu ISO herunterladen ───────────────────────────────────────────── if [[ ! -f "$UBUNTU_ISO" ]]; then echo -e "\n=== Ubuntu 24.04 ISO herunterladen ===" - wget --show-progress -O "$UBUNTU_ISO" "$UBUNTU_ISO_URL" + curl -L --progress-bar -o "$UBUNTU_ISO" "$UBUNTU_ISO_URL" ok "ISO heruntergeladen" else ok "ISO bereits vorhanden: $UBUNTU_ISO" fi -# Arbeitsverzeichnis vorbereiten -echo -e "\n=== ISO entpacken ===" -rm -rf "$WORKDIR" -mkdir -p "$WORKDIR/source" -sudo mount -o loop "$UBUNTU_ISO" /mnt -cp -rT /mnt "$WORKDIR/source" -sudo umount /mnt -chmod -R u+w "$WORKDIR/source" -ok "ISO entpackt nach $WORKDIR/source" +# Prüfen ob es eine echte ISO ist +if ! file "$UBUNTU_ISO" | grep -q "ISO 9660"; then + rm -f "$UBUNTU_ISO" + err "Download fehlgeschlagen (keine gültige ISO). Bitte erneut starten." +fi -# autoinstall-Dateien einfügen -echo -e "\n=== Autoinstall-Dateien einbetten ===" -mkdir -p "$WORKDIR/source/autoinstall" -cp user-data "$WORKDIR/source/autoinstall/" -cp meta-data "$WORKDIR/source/autoinstall/" -ok "user-data und meta-data eingefügt" +# ── Autoinstall-Dateien vorbereiten ────────────────────────────────────── +echo -e "\n=== Autoinstall-Dateien vorbereiten ===" +TMPDIR=$(mktemp -d) +mkdir -p "$TMPDIR/autoinstall" +cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall/" +cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" +ok "user-data und meta-data bereit" -# GRUB-Konfiguration: autoinstall-Parameter hinzufügen -echo -e "\n=== GRUB konfigurieren ===" -GRUB_CFG="$WORKDIR/source/boot/grub/grub.cfg" -# Autoinstall-Eintrag am Anfang einfügen -cat > /tmp/grub-autoinstall.cfg <<'EOF' +# ── GRUB-Eintrag vorbereiten ──────────────────────────────────────────── +echo -e "\n=== GRUB-Eintrag vorbereiten ===" + +# Originale grub.cfg extrahieren +xorriso -osirrox on -indev "$UBUNTU_ISO" \ + -extract /boot/grub/grub.cfg "$TMPDIR/grub.cfg" 2>/dev/null +chmod u+w "$TMPDIR/grub.cfg" + +# Autoinstall-Eintrag voranstellen +TMPGRUB=$(mktemp) +cat > "$TMPGRUB" <<'GRUBEOF' set default=0 set timeout=10 @@ -62,31 +77,31 @@ menuentry "Ubuntu MacBook AutoInstall" { initrd /casper/initrd } -EOF -cat /tmp/grub-autoinstall.cfg "$GRUB_CFG" > /tmp/grub-merged.cfg -mv /tmp/grub-merged.cfg "$GRUB_CFG" +GRUBEOF +cat "$TMPGRUB" "$TMPDIR/grub.cfg" > "$TMPDIR/grub-new.cfg" +rm "$TMPGRUB" ok "GRUB konfiguriert (autoinstall als Standard)" -# ISO neu bauen +# ── ISO modifizieren (Boot-Records bleiben erhalten) ───────────────────── echo -e "\n=== ISO bauen ===" -xorriso -as mkisofs \ - -r -V "Ubuntu-24.04-MacBook" \ - -J -joliet-long \ - -b boot/grub/i386-pc/eltorito.img \ - -c boot.catalog \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - --efi-boot boot/grub/efi.img \ - -efi-boot-part --efi-startup-part --protective-msdos-label \ - "$WORKDIR/source" \ - -o "$OUTPUT_ISO" +cp "$UBUNTU_ISO" "$OUTPUT_ISO" + +xorriso -indev "$OUTPUT_ISO" \ + -outdev "$OUTPUT_ISO" \ + -map "$TMPDIR/autoinstall" /autoinstall \ + -map "$TMPDIR/grub-new.cfg" /boot/grub/grub.cfg \ + -boot_image any replay \ + -commit + +rm -rf "$TMPDIR" ok "ISO erstellt: $OUTPUT_ISO" echo "" echo "Größe: $(du -sh "$OUTPUT_ISO" | cut -f1)" echo "" warn "Nächster Schritt: ISO auf Ventoy-Stick kopieren" -echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" -echo "" -warn "Vor der Installation: user-data anpassen!" -echo " - Passwort-Hash: mkpasswd -m sha-512 DEINPASSWORT" -echo " - Modell: 'setup.sh -- 13' oder 'setup.sh -- 16' in user-data" +if [[ "$OS" == "Darwin" ]]; then + echo " cp $OUTPUT_ISO /Volumes/Ventoy/" +else + echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" +fi From 55296cd1fd881ab4d2aebff9261938aefa6406bd Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 21:37:00 +0100 Subject: [PATCH 018/122] Rewrite build-iso.sh: macOS-Support, Ubuntu 24.04.4, xorriso in-place MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Funktioniert auf macOS (brew) und Linux (apt) - Ubuntu ISO URL aktualisiert auf 24.04.4 - xorriso modifiziert die Original-ISO direkt statt entpacken/neu bauen → Boot-Records (BIOS + EFI) bleiben korrekt erhalten - Download-Validierung (prüft auf gültige ISO) - user-data/meta-data per absolutem Pfad (SCRIPT_DIR) --- build-iso.sh | 115 +++++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 50 deletions(-) mode change 100644 => 100755 build-iso.sh diff --git a/build-iso.sh b/build-iso.sh old mode 100644 new mode 100755 index 32d9c9d..4817a29 --- a/build-iso.sh +++ b/build-iso.sh @@ -1,58 +1,73 @@ #!/bin/bash # build-iso.sh — Ubuntu 24.04 Autoinstall ISO für Ventoy bauen -# Ausführen auf einem Ubuntu/Debian-System mit Internetzugang -# Ergebnis: ubuntu-macbook-autoinstall.iso (~4-5 GB) +# Funktioniert auf macOS (xorriso via brew) und Linux (xorriso via apt) +# Ergebnis: ubuntu-macbook-autoinstall.iso (~3.2 GB) set -e -UBUNTU_ISO_URL="https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso" -UBUNTU_ISO="ubuntu-24.04-live-server-amd64.iso" +UBUNTU_ISO_URL="https://releases.ubuntu.com/24.04/ubuntu-24.04.4-live-server-amd64.iso" +UBUNTU_ISO="ubuntu-24.04.4-live-server-amd64.iso" OUTPUT_ISO="ubuntu-macbook-autoinstall.iso" -WORKDIR="/tmp/iso-build" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +OS="$(uname -s)" echo "════════════════════════════════════════════" -echo " macbook-setup ISO Builder" +echo " macbook-setup ISO Builder ($OS)" echo "════════════════════════════════════════════" -# Abhängigkeiten +# ── Abhängigkeiten ─────────────────────────────────────────────────────── echo -e "\n=== Abhängigkeiten prüfen ===" -sudo apt install -y xorriso squashfs-tools genisoimage -ok "Werkzeuge verfügbar" +if [[ "$OS" == "Darwin" ]]; then + if ! command -v xorriso &>/dev/null; then + echo "xorriso nicht gefunden, installiere via Homebrew..." + brew install xorriso + fi + ok "xorriso verfügbar (macOS)" +else + if ! command -v xorriso &>/dev/null; then + sudo apt install -y xorriso + fi + ok "xorriso verfügbar (Linux)" +fi -# Ubuntu ISO herunterladen (falls nicht vorhanden) +# ── Ubuntu ISO herunterladen ───────────────────────────────────────────── if [[ ! -f "$UBUNTU_ISO" ]]; then echo -e "\n=== Ubuntu 24.04 ISO herunterladen ===" - wget --show-progress -O "$UBUNTU_ISO" "$UBUNTU_ISO_URL" + curl -L --progress-bar -o "$UBUNTU_ISO" "$UBUNTU_ISO_URL" ok "ISO heruntergeladen" else ok "ISO bereits vorhanden: $UBUNTU_ISO" fi -# Arbeitsverzeichnis vorbereiten -echo -e "\n=== ISO entpacken ===" -rm -rf "$WORKDIR" -mkdir -p "$WORKDIR/source" -sudo mount -o loop "$UBUNTU_ISO" /mnt -cp -rT /mnt "$WORKDIR/source" -sudo umount /mnt -chmod -R u+w "$WORKDIR/source" -ok "ISO entpackt nach $WORKDIR/source" +# Prüfen ob es eine echte ISO ist +if ! file "$UBUNTU_ISO" | grep -q "ISO 9660"; then + rm -f "$UBUNTU_ISO" + err "Download fehlgeschlagen (keine gültige ISO). Bitte erneut starten." +fi -# autoinstall-Dateien einfügen -echo -e "\n=== Autoinstall-Dateien einbetten ===" -mkdir -p "$WORKDIR/source/autoinstall" -cp user-data "$WORKDIR/source/autoinstall/" -cp meta-data "$WORKDIR/source/autoinstall/" -ok "user-data und meta-data eingefügt" +# ── Autoinstall-Dateien vorbereiten ────────────────────────────────────── +echo -e "\n=== Autoinstall-Dateien vorbereiten ===" +TMPDIR=$(mktemp -d) +mkdir -p "$TMPDIR/autoinstall" +cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall/" +cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" +ok "user-data und meta-data bereit" -# GRUB-Konfiguration: autoinstall-Parameter hinzufügen -echo -e "\n=== GRUB konfigurieren ===" -GRUB_CFG="$WORKDIR/source/boot/grub/grub.cfg" -# Autoinstall-Eintrag am Anfang einfügen -cat > /tmp/grub-autoinstall.cfg <<'EOF' +# ── GRUB-Eintrag vorbereiten ──────────────────────────────────────────── +echo -e "\n=== GRUB-Eintrag vorbereiten ===" + +# Originale grub.cfg extrahieren +xorriso -osirrox on -indev "$UBUNTU_ISO" \ + -extract /boot/grub/grub.cfg "$TMPDIR/grub.cfg" 2>/dev/null +chmod u+w "$TMPDIR/grub.cfg" + +# Autoinstall-Eintrag voranstellen +TMPGRUB=$(mktemp) +cat > "$TMPGRUB" <<'GRUBEOF' set default=0 set timeout=10 @@ -62,31 +77,31 @@ menuentry "Ubuntu MacBook AutoInstall" { initrd /casper/initrd } -EOF -cat /tmp/grub-autoinstall.cfg "$GRUB_CFG" > /tmp/grub-merged.cfg -mv /tmp/grub-merged.cfg "$GRUB_CFG" +GRUBEOF +cat "$TMPGRUB" "$TMPDIR/grub.cfg" > "$TMPDIR/grub-new.cfg" +rm "$TMPGRUB" ok "GRUB konfiguriert (autoinstall als Standard)" -# ISO neu bauen +# ── ISO modifizieren (Boot-Records bleiben erhalten) ───────────────────── echo -e "\n=== ISO bauen ===" -xorriso -as mkisofs \ - -r -V "Ubuntu-24.04-MacBook" \ - -J -joliet-long \ - -b boot/grub/i386-pc/eltorito.img \ - -c boot.catalog \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - --efi-boot boot/grub/efi.img \ - -efi-boot-part --efi-startup-part --protective-msdos-label \ - "$WORKDIR/source" \ - -o "$OUTPUT_ISO" +cp "$UBUNTU_ISO" "$OUTPUT_ISO" + +xorriso -indev "$OUTPUT_ISO" \ + -outdev "$OUTPUT_ISO" \ + -map "$TMPDIR/autoinstall" /autoinstall \ + -map "$TMPDIR/grub-new.cfg" /boot/grub/grub.cfg \ + -boot_image any replay \ + -commit + +rm -rf "$TMPDIR" ok "ISO erstellt: $OUTPUT_ISO" echo "" echo "Größe: $(du -sh "$OUTPUT_ISO" | cut -f1)" echo "" warn "Nächster Schritt: ISO auf Ventoy-Stick kopieren" -echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" -echo "" -warn "Vor der Installation: user-data anpassen!" -echo " - Passwort-Hash: mkpasswd -m sha-512 DEINPASSWORT" -echo " - Modell: 'setup.sh -- 13' oder 'setup.sh -- 16' in user-data" +if [[ "$OS" == "Darwin" ]]; then + echo " cp $OUTPUT_ISO /Volumes/Ventoy/" +else + echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" +fi From 6f8ae5263d1ec70dfe073a10403343f8c790f17f Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 21:44:42 +0100 Subject: [PATCH 019/122] =?UTF-8?q?Add=20INSTALL.md:=20Schritt-f=C3=BCr-Sc?= =?UTF-8?q?hritt=20von=20ISO=20bis=20fertiges=20System?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abdeckt: Ventoy, Booten, automatische Installation, erster Login, manuelle Post-Install-Schritte (WireGuard, Synology Drive, Thunderbird, Brave Sync), MBP 13/16 Unterschiede, Troubleshooting. Co-Authored-By: Claude Opus 4.6 --- INSTALL.md | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..54ddac5 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,149 @@ +# Installation + +## 1. ISO auf Ventoy-Stick kopieren + +```bash +cp ubuntu-macbook-autoinstall.iso /Volumes/Ventoy/ +``` + +Falls kein Ventoy-Stick vorhanden: [ventoy.net](https://www.ventoy.net/) — beliebigen USB-Stick mit Ventoy formatieren, dann ISO einfach draufkopieren. + +## 2. MacBook booten + +1. USB-Stick einstecken +2. MacBook einschalten, **Alt-Taste (⌥)** gedrückt halten +3. "EFI Boot" auswählen +4. Im Ventoy-Menü die `ubuntu-macbook-autoinstall.iso` wählen +5. GRUB zeigt "Ubuntu MacBook AutoInstall" — startet nach 10 Sekunden automatisch + +## 3. Automatische Installation + +Ab hier läuft alles ohne Eingreifen: + +- Ubuntu 24.04 Server wird installiert (LVM, User `rene`) +- Pakete werden installiert (Xubuntu-Desktop, Brave, Treiber, Tools) +- `setup-base.sh` konfiguriert Tastatur, Lüfter, Nvidia, Locale, Services +- Ein Autostart-Eintrag für `setup-desktop.sh` wird angelegt + +**Dauer:** ca. 30-60 Minuten je nach Internetgeschwindigkeit. + +Nach Abschluss startet das MacBook automatisch neu. + +## 4. Erster Desktop-Login + +Anmelden als `rene` — `setup-desktop.sh` startet automatisch und installiert: + +| Was | Details | +|-----|---------| +| oh-my-zsh | Inkl. zsh als Standard-Shell | +| Claude Code | via npm global | +| PrusaSlicer | AppImage nach ~/Applications | +| Dotfiles | nvim, micro, oh-my-zsh custom, heic-scripts | +| XFCE Energie | AC: Bildschirm bleibt an / Akku: aus nach 10 Min | + +Der Autostart-Eintrag entfernt sich nach erfolgreichem Durchlauf selbst. + +**Log prüfen:** Falls etwas fehlschlägt: +```bash +cat /tmp/setup-desktop.log +``` + +**Manuell erneut starten:** +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash +``` + +## 5. Manuelle Schritte + +### WireGuard + +Config-Datei muss separat vorliegen (nicht im Repo). + +```bash +sudo cp wg0.conf /etc/wireguard/ +sudo systemctl enable --now wg-quick@wg0 +``` + +Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). + +### Synology Drive Client + +1. `.deb` von [synology.com](https://www.synology.com/de-de/dsm/feature/drive) herunterladen +2. `sudo dpkg -i synology-drive-client-*.deb` +3. Starten, mit DiskStation verbinden (10.47.11.10 oder dsm.motocamp.de) + +### Thunderbird + +1. Thunderbird starten +2. Profil aus Synology Drive einbinden (vorheriges Backup) +3. IMAP: 10.47.11.10 (nach WireGuard-Verbindung) + +### Brave Browser + +1. Brave starten +2. Einstellungen → Brave Sync → Sync-Kette beitreten + +## 6. Modell: MBP 13" vs 16" + +Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"** vor dem ISO-Bau in `user-data` ändern: + +```yaml +# Zeile in late-commands: +- curtin in-target --target=/target -- bash -c '... setup-base.sh | bash -s -- 16' +# hier: 13 → 16 ^^^ +``` + +MBP 16" bekommt zusätzlich: +- `nvidia-driver-535` + `prime-select intel` +- Aggressivere Lüftersteuerung (`mbpfan-16.conf`) +- `blacklist-nvidia.conf` in `/tmp` (optional aktivieren) + +## Troubleshooting + +### WLAN geht nicht nach Installation + +Broadcom BCM4360 braucht den proprietären Treiber. Falls er nicht installiert wurde: +```bash +sudo apt install bcmwl-kernel-source +sudo modprobe wl +``` + +### Bildschirm flackert / kein Bild (MBP 16") + +Nvidia Optimus-Problem. Intel als GPU erzwingen: +```bash +sudo prime-select intel +sudo reboot +``` + +Falls das nicht hilft, Nvidia komplett blacklisten: +```bash +sudo cp /tmp/blacklist-nvidia.conf /etc/modprobe.d/ +sudo update-initramfs -u +sudo reboot +``` + +### Lüfter drehen nicht hoch / MacBook wird zu heiß + +```bash +# mbpfan läuft? +sudo systemctl status mbpfan + +# Temperaturen prüfen +sensors + +# temp-watch.sh manuell starten +sudo /usr/local/bin/temp-watch.sh +``` + +### setup-desktop.sh startet nicht beim Login + +Autostart-Eintrag manuell prüfen/anlegen: +```bash +cat ~/.config/autostart/macbook-setup-desktop.desktop +``` + +Oder direkt ausführen: +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash +``` From e6b1365422622163aef86c64aed4ece33b99da0c Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 21:44:42 +0100 Subject: [PATCH 020/122] =?UTF-8?q?Add=20INSTALL.md:=20Schritt-f=C3=BCr-Sc?= =?UTF-8?q?hritt=20von=20ISO=20bis=20fertiges=20System?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abdeckt: Ventoy, Booten, automatische Installation, erster Login, manuelle Post-Install-Schritte (WireGuard, Synology Drive, Thunderbird, Brave Sync), MBP 13/16 Unterschiede, Troubleshooting. --- INSTALL.md | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..54ddac5 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,149 @@ +# Installation + +## 1. ISO auf Ventoy-Stick kopieren + +```bash +cp ubuntu-macbook-autoinstall.iso /Volumes/Ventoy/ +``` + +Falls kein Ventoy-Stick vorhanden: [ventoy.net](https://www.ventoy.net/) — beliebigen USB-Stick mit Ventoy formatieren, dann ISO einfach draufkopieren. + +## 2. MacBook booten + +1. USB-Stick einstecken +2. MacBook einschalten, **Alt-Taste (⌥)** gedrückt halten +3. "EFI Boot" auswählen +4. Im Ventoy-Menü die `ubuntu-macbook-autoinstall.iso` wählen +5. GRUB zeigt "Ubuntu MacBook AutoInstall" — startet nach 10 Sekunden automatisch + +## 3. Automatische Installation + +Ab hier läuft alles ohne Eingreifen: + +- Ubuntu 24.04 Server wird installiert (LVM, User `rene`) +- Pakete werden installiert (Xubuntu-Desktop, Brave, Treiber, Tools) +- `setup-base.sh` konfiguriert Tastatur, Lüfter, Nvidia, Locale, Services +- Ein Autostart-Eintrag für `setup-desktop.sh` wird angelegt + +**Dauer:** ca. 30-60 Minuten je nach Internetgeschwindigkeit. + +Nach Abschluss startet das MacBook automatisch neu. + +## 4. Erster Desktop-Login + +Anmelden als `rene` — `setup-desktop.sh` startet automatisch und installiert: + +| Was | Details | +|-----|---------| +| oh-my-zsh | Inkl. zsh als Standard-Shell | +| Claude Code | via npm global | +| PrusaSlicer | AppImage nach ~/Applications | +| Dotfiles | nvim, micro, oh-my-zsh custom, heic-scripts | +| XFCE Energie | AC: Bildschirm bleibt an / Akku: aus nach 10 Min | + +Der Autostart-Eintrag entfernt sich nach erfolgreichem Durchlauf selbst. + +**Log prüfen:** Falls etwas fehlschlägt: +```bash +cat /tmp/setup-desktop.log +``` + +**Manuell erneut starten:** +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash +``` + +## 5. Manuelle Schritte + +### WireGuard + +Config-Datei muss separat vorliegen (nicht im Repo). + +```bash +sudo cp wg0.conf /etc/wireguard/ +sudo systemctl enable --now wg-quick@wg0 +``` + +Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). + +### Synology Drive Client + +1. `.deb` von [synology.com](https://www.synology.com/de-de/dsm/feature/drive) herunterladen +2. `sudo dpkg -i synology-drive-client-*.deb` +3. Starten, mit DiskStation verbinden (10.47.11.10 oder dsm.motocamp.de) + +### Thunderbird + +1. Thunderbird starten +2. Profil aus Synology Drive einbinden (vorheriges Backup) +3. IMAP: 10.47.11.10 (nach WireGuard-Verbindung) + +### Brave Browser + +1. Brave starten +2. Einstellungen → Brave Sync → Sync-Kette beitreten + +## 6. Modell: MBP 13" vs 16" + +Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"** vor dem ISO-Bau in `user-data` ändern: + +```yaml +# Zeile in late-commands: +- curtin in-target --target=/target -- bash -c '... setup-base.sh | bash -s -- 16' +# hier: 13 → 16 ^^^ +``` + +MBP 16" bekommt zusätzlich: +- `nvidia-driver-535` + `prime-select intel` +- Aggressivere Lüftersteuerung (`mbpfan-16.conf`) +- `blacklist-nvidia.conf` in `/tmp` (optional aktivieren) + +## Troubleshooting + +### WLAN geht nicht nach Installation + +Broadcom BCM4360 braucht den proprietären Treiber. Falls er nicht installiert wurde: +```bash +sudo apt install bcmwl-kernel-source +sudo modprobe wl +``` + +### Bildschirm flackert / kein Bild (MBP 16") + +Nvidia Optimus-Problem. Intel als GPU erzwingen: +```bash +sudo prime-select intel +sudo reboot +``` + +Falls das nicht hilft, Nvidia komplett blacklisten: +```bash +sudo cp /tmp/blacklist-nvidia.conf /etc/modprobe.d/ +sudo update-initramfs -u +sudo reboot +``` + +### Lüfter drehen nicht hoch / MacBook wird zu heiß + +```bash +# mbpfan läuft? +sudo systemctl status mbpfan + +# Temperaturen prüfen +sensors + +# temp-watch.sh manuell starten +sudo /usr/local/bin/temp-watch.sh +``` + +### setup-desktop.sh startet nicht beim Login + +Autostart-Eintrag manuell prüfen/anlegen: +```bash +cat ~/.config/autostart/macbook-setup-desktop.desktop +``` + +Oder direkt ausführen: +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash +``` From d8f765ffd614026906dcf9396c20eb289cfcc85a Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 21:45:58 +0100 Subject: [PATCH 021/122] Add .gitignore: exclude ISOs and .DS_Store Co-Authored-By: Claude Opus 4.6 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..153f1f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.iso +.DS_Store From 78431a1c3321e169c150928c859890bdd7432c2c Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 7 Mar 2026 21:45:58 +0100 Subject: [PATCH 022/122] Add .gitignore: exclude ISOs and .DS_Store --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..153f1f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.iso +.DS_Store From 32b49f81a519a509ef27f19b9215470dfd3ec9f9 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 08:20:59 +0100 Subject: [PATCH 023/122] Fix setup-base.sh: freecad via snap statt apt (nicht in Ubuntu 24.04 Repos) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aktualisiert auch INSTALL.md mit realistischem Installationsablauf (TTY-Login nach Autoinstall, Prüfung ob setup-base.sh gelaufen ist). Co-Authored-By: Claude Opus 4.6 --- INSTALL.md | 64 +++++++++++++++++++++++++++++++++++++-------------- setup-base.sh | 7 ++++-- 2 files changed, 52 insertions(+), 19 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 54ddac5..e2e8f77 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -18,20 +18,50 @@ Falls kein Ventoy-Stick vorhanden: [ventoy.net](https://www.ventoy.net/) — bel ## 3. Automatische Installation -Ab hier läuft alles ohne Eingreifen: +Die Autoinstall installiert Ubuntu 24.04 Server (LVM, User `rene`). Je nach Netzwerk und Mirrors dauert das 10-30 Minuten. -- Ubuntu 24.04 Server wird installiert (LVM, User `rene`) -- Pakete werden installiert (Xubuntu-Desktop, Brave, Treiber, Tools) -- `setup-base.sh` konfiguriert Tastatur, Lüfter, Nvidia, Locale, Services -- Ein Autostart-Eintrag für `setup-desktop.sh` wird angelegt +Nach Abschluss erscheint cloud-init-Output mit SSH Host Key Fingerprints und der Login-Prompt: +``` +Cloud-init v. ... finished ... Datasource DataSourceNone. +m16 login: +``` -**Dauer:** ca. 30-60 Minuten je nach Internetgeschwindigkeit. +**Enter drücken**, dann als `rene` anmelden. -Nach Abschluss startet das MacBook automatisch neu. +## 4. Prüfen ob setup-base.sh gelaufen ist -## 4. Erster Desktop-Login +`setup-base.sh` sollte in den Autoinstall `late-commands` gelaufen sein. Prüfen: -Anmelden als `rene` — `setup-desktop.sh` startet automatisch und installiert: +```bash +dpkg -l | grep xubuntu-desktop +``` + +### Fall A: xubuntu-desktop ist installiert + +Desktop starten: +```bash +sudo systemctl start lightdm +``` +Weiter mit **Schritt 5**. + +### Fall B: xubuntu-desktop fehlt + +`setup-base.sh` manuell ausführen (MBP 13" oder 16"): +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16 +``` +**Dauer:** ca. 20-40 Minuten (Xubuntu-Desktop, Brave, Treiber, etc.) + +Danach neu starten: +```bash +sudo reboot +``` + +## 5. Erster Desktop-Login + +Nach Reboot erscheint LightDM. Anmelden als `rene`. + +`setup-desktop.sh` startet automatisch via Autostart und installiert: | Was | Details | |-----|---------| @@ -43,17 +73,17 @@ Anmelden als `rene` — `setup-desktop.sh` startet automatisch und installiert: Der Autostart-Eintrag entfernt sich nach erfolgreichem Durchlauf selbst. -**Log prüfen:** Falls etwas fehlschlägt: -```bash -cat /tmp/setup-desktop.log -``` - -**Manuell erneut starten:** +**Falls setup-desktop.sh nicht automatisch startet**, manuell ausführen: ```bash curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash ``` -## 5. Manuelle Schritte +**Log prüfen:** +```bash +cat /tmp/setup-desktop.log +``` + +## 6. Manuelle Schritte ### WireGuard @@ -83,7 +113,7 @@ Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). 1. Brave starten 2. Einstellungen → Brave Sync → Sync-Kette beitreten -## 6. Modell: MBP 13" vs 16" +## 7. Modell: MBP 13" vs 16" Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"** vor dem ISO-Bau in `user-data` ändern: diff --git a/setup-base.sh b/setup-base.sh index 230550a..1b30795 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -53,7 +53,6 @@ apt install -y \ wireguard wireguard-tools \ libreoffice libreoffice-l10n-de \ thunderbird thunderbird-locale-de \ - freecad \ keepassxc \ htop btop \ timeshift \ @@ -62,7 +61,11 @@ apt install -y \ wngerman \ bc \ xfce4-terminal -ok "Pakete installiert" +ok "Pakete installiert (apt)" + +# FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) +snap install freecad +ok "FreeCAD installiert (snap)" # ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── if [[ "$MODEL" == "16" ]]; then From d6049e69417c9a497919e5ffcfdca5fe774daec2 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 08:20:59 +0100 Subject: [PATCH 024/122] Fix setup-base.sh: freecad via snap statt apt (nicht in Ubuntu 24.04 Repos) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aktualisiert auch INSTALL.md mit realistischem Installationsablauf (TTY-Login nach Autoinstall, Prüfung ob setup-base.sh gelaufen ist). --- INSTALL.md | 64 +++++++++++++++++++++++++++++++++++++-------------- setup-base.sh | 7 ++++-- 2 files changed, 52 insertions(+), 19 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 54ddac5..e2e8f77 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -18,20 +18,50 @@ Falls kein Ventoy-Stick vorhanden: [ventoy.net](https://www.ventoy.net/) — bel ## 3. Automatische Installation -Ab hier läuft alles ohne Eingreifen: +Die Autoinstall installiert Ubuntu 24.04 Server (LVM, User `rene`). Je nach Netzwerk und Mirrors dauert das 10-30 Minuten. -- Ubuntu 24.04 Server wird installiert (LVM, User `rene`) -- Pakete werden installiert (Xubuntu-Desktop, Brave, Treiber, Tools) -- `setup-base.sh` konfiguriert Tastatur, Lüfter, Nvidia, Locale, Services -- Ein Autostart-Eintrag für `setup-desktop.sh` wird angelegt +Nach Abschluss erscheint cloud-init-Output mit SSH Host Key Fingerprints und der Login-Prompt: +``` +Cloud-init v. ... finished ... Datasource DataSourceNone. +m16 login: +``` -**Dauer:** ca. 30-60 Minuten je nach Internetgeschwindigkeit. +**Enter drücken**, dann als `rene` anmelden. -Nach Abschluss startet das MacBook automatisch neu. +## 4. Prüfen ob setup-base.sh gelaufen ist -## 4. Erster Desktop-Login +`setup-base.sh` sollte in den Autoinstall `late-commands` gelaufen sein. Prüfen: -Anmelden als `rene` — `setup-desktop.sh` startet automatisch und installiert: +```bash +dpkg -l | grep xubuntu-desktop +``` + +### Fall A: xubuntu-desktop ist installiert + +Desktop starten: +```bash +sudo systemctl start lightdm +``` +Weiter mit **Schritt 5**. + +### Fall B: xubuntu-desktop fehlt + +`setup-base.sh` manuell ausführen (MBP 13" oder 16"): +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16 +``` +**Dauer:** ca. 20-40 Minuten (Xubuntu-Desktop, Brave, Treiber, etc.) + +Danach neu starten: +```bash +sudo reboot +``` + +## 5. Erster Desktop-Login + +Nach Reboot erscheint LightDM. Anmelden als `rene`. + +`setup-desktop.sh` startet automatisch via Autostart und installiert: | Was | Details | |-----|---------| @@ -43,17 +73,17 @@ Anmelden als `rene` — `setup-desktop.sh` startet automatisch und installiert: Der Autostart-Eintrag entfernt sich nach erfolgreichem Durchlauf selbst. -**Log prüfen:** Falls etwas fehlschlägt: -```bash -cat /tmp/setup-desktop.log -``` - -**Manuell erneut starten:** +**Falls setup-desktop.sh nicht automatisch startet**, manuell ausführen: ```bash curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash ``` -## 5. Manuelle Schritte +**Log prüfen:** +```bash +cat /tmp/setup-desktop.log +``` + +## 6. Manuelle Schritte ### WireGuard @@ -83,7 +113,7 @@ Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). 1. Brave starten 2. Einstellungen → Brave Sync → Sync-Kette beitreten -## 6. Modell: MBP 13" vs 16" +## 7. Modell: MBP 13" vs 16" Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"** vor dem ISO-Bau in `user-data` ändern: diff --git a/setup-base.sh b/setup-base.sh index 230550a..1b30795 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -53,7 +53,6 @@ apt install -y \ wireguard wireguard-tools \ libreoffice libreoffice-l10n-de \ thunderbird thunderbird-locale-de \ - freecad \ keepassxc \ htop btop \ timeshift \ @@ -62,7 +61,11 @@ apt install -y \ wngerman \ bc \ xfce4-terminal -ok "Pakete installiert" +ok "Pakete installiert (apt)" + +# FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) +snap install freecad +ok "FreeCAD installiert (snap)" # ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── if [[ "$MODEL" == "16" ]]; then From de67fff30c5d0b5a25782b838278cff613ceeecd Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 09:22:19 +0100 Subject: [PATCH 025/122] Fix MBP 16": Nvidia blacklisten, nomodeset, Compositor aus, SSH, sudo Probleme beim ersten MBP 16" Setup behoben: - Nvidia-Treiber werden NICHT mehr installiert, stattdessen alle Nvidia-Module komplett geblockt (blacklist-nvidia.conf) - GRUB: nomodeset fuer MBP 16" (verhindert GPU-Artefakte) - XFCE Compositor deaktiviert fuer MBP 16" - Sleep/Suspend waehrend Installation verhindert - openssh-server in Paketliste (SSH-Zugriff ab erstem Boot) - user-data: rene zur sudo-Gruppe, install-server: true - FreeCAD Snap: Fehler in chroot abfangen Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 79 +++++++++++++++++++++++++++++++++++++-------------- user-data | 4 ++- 2 files changed, 60 insertions(+), 23 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 1b30795..99e10f0 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -32,13 +32,18 @@ echo "════════════════════════ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" +# ── 0. Sleep/Suspend verhindern während Installation ───────────────────── +echo -e "\n=== 0/9 Sleep verhindern ===" +systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true +ok "Sleep/Suspend deaktiviert (für Installation)" + # ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/8 System aktualisieren ===" +echo -e "\n=== 1/9 System aktualisieren ===" apt update && apt upgrade -y ok "System aktuell" # ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/8 Pakete installieren ===" +echo -e "\n=== 2/9 Pakete installieren ===" apt install -y \ xubuntu-desktop \ bcmwl-kernel-source \ @@ -51,6 +56,7 @@ apt install -y \ python3 python3-pip python3-venv \ nodejs npm \ wireguard wireguard-tools \ + openssh-server \ libreoffice libreoffice-l10n-de \ thunderbird thunderbird-locale-de \ keepassxc \ @@ -64,22 +70,26 @@ apt install -y \ ok "Pakete installiert (apt)" # FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) -snap install freecad +snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen (chroot)" ok "FreeCAD installiert (snap)" -# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── +# ── 3. Nvidia blacklisten (MBP 16") ───────────────────────────────────── if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/8 Nvidia Optimus (MBP 16\") ===" - apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms - prime-select intel - ok "Nvidia installiert, Intel als Standard-GPU gesetzt" + echo -e "\n=== 3/9 Nvidia blacklisten (MBP 16\") ===" + cat > /etc/modprobe.d/blacklist-nvidia.conf < /dev/null </dev/null || true + ok "GRUB: nomodeset gesetzt (MBP 16\")" fi update-initramfs -u ok "Systemkonfigurationen gesetzt" -# ── 6. Energieeinstellungen (systemd) ──────────────────────────────────── -echo -e "\n=== 6/8 Energieeinstellungen ===" +# ── 6. XFCE Compositor deaktivieren (MBP 16") ──────────────────────────── +if [[ "$MODEL" == "16" ]]; then + echo -e "\n=== 6/9 XFCE Compositor deaktivieren ===" + XFWM4_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" + mkdir -p "$XFWM4_DIR" + cat > "$XFWM4_DIR/xfwm4.xml" < + + + + + +XFEOF + chown -R 1000:1000 /home/rene/.config/xfce4 + ok "XFCE Compositor deaktiviert (MBP 16\")" +else + echo -e "\n=== 6/9 XFCE Compositor — beibehalten (MBP 13\") ===" +fi + +# ── 7. Energieeinstellungen (systemd) ──────────────────────────────────── +echo -e "\n=== 7/9 Energieeinstellungen ===" tee /etc/systemd/sleep.conf > /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime ok "Lokalisierung: Deutsch / Berlin" -# ── 8. Services aktivieren ────────────────────────────────────────────── -echo -e "\n=== 8/8 Services aktivieren ===" +# ── 9. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 9/9 Services aktivieren ===" systemctl enable mbpfan systemctl enable thermald systemctl enable tlp +systemctl enable ssh # --now nur wenn nicht in chroot if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; then systemctl start mbpfan systemctl start thermald + systemctl start ssh sensors-detect --auto 2>/dev/null || true - ok "mbpfan, thermald, tlp aktiv (gestartet)" + ok "mbpfan, thermald, tlp, ssh aktiv (gestartet)" else - ok "mbpfan, thermald, tlp aktiviert (Start nach Reboot)" + ok "mbpfan, thermald, tlp, ssh aktiviert (Start nach Reboot)" fi # ── zsh als Standard-Shell für rene ────────────────────────────────────── chsh -s /bin/zsh rene 2>/dev/null || true +# ── Sleep wieder erlauben ──────────────────────────────────────────────── +systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true + echo "" echo "════════════════════════════════════════════" echo -e " ${GREEN}setup-base.sh abgeschlossen!${NC}" diff --git a/user-data b/user-data index 20141f5..95f135e 100644 --- a/user-data +++ b/user-data @@ -10,11 +10,13 @@ autoinstall: username: rene password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: - install-server: false + install-server: true storage: layout: name: lvm late-commands: + # User rene zur sudo-Gruppe hinzufuegen + - curtin in-target --target=/target -- usermod -aG sudo rene # System-Setup in chroot (Pakete, Configs, Locale, Services) - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 13' # Desktop-Setup als Firstboot-Autostart einrichten From 4f75cd598ced027a4e6d971d5da413b31fcfcc71 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 09:22:19 +0100 Subject: [PATCH 026/122] Fix MBP 16": Nvidia blacklisten, nomodeset, Compositor aus, SSH, sudo Probleme beim ersten MBP 16" Setup behoben: - Nvidia-Treiber werden NICHT mehr installiert, stattdessen alle Nvidia-Module komplett geblockt (blacklist-nvidia.conf) - GRUB: nomodeset fuer MBP 16" (verhindert GPU-Artefakte) - XFCE Compositor deaktiviert fuer MBP 16" - Sleep/Suspend waehrend Installation verhindert - openssh-server in Paketliste (SSH-Zugriff ab erstem Boot) - user-data: rene zur sudo-Gruppe, install-server: true - FreeCAD Snap: Fehler in chroot abfangen --- setup-base.sh | 79 +++++++++++++++++++++++++++++++++++++-------------- user-data | 4 ++- 2 files changed, 60 insertions(+), 23 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 1b30795..99e10f0 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -32,13 +32,18 @@ echo "════════════════════════ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" +# ── 0. Sleep/Suspend verhindern während Installation ───────────────────── +echo -e "\n=== 0/9 Sleep verhindern ===" +systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true +ok "Sleep/Suspend deaktiviert (für Installation)" + # ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/8 System aktualisieren ===" +echo -e "\n=== 1/9 System aktualisieren ===" apt update && apt upgrade -y ok "System aktuell" # ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/8 Pakete installieren ===" +echo -e "\n=== 2/9 Pakete installieren ===" apt install -y \ xubuntu-desktop \ bcmwl-kernel-source \ @@ -51,6 +56,7 @@ apt install -y \ python3 python3-pip python3-venv \ nodejs npm \ wireguard wireguard-tools \ + openssh-server \ libreoffice libreoffice-l10n-de \ thunderbird thunderbird-locale-de \ keepassxc \ @@ -64,22 +70,26 @@ apt install -y \ ok "Pakete installiert (apt)" # FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) -snap install freecad +snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen (chroot)" ok "FreeCAD installiert (snap)" -# ── 3. Nvidia (nur MBP 16") ────────────────────────────────────────────── +# ── 3. Nvidia blacklisten (MBP 16") ───────────────────────────────────── if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/8 Nvidia Optimus (MBP 16\") ===" - apt install -y nvidia-driver-535 nvidia-prime bbswitch-dkms - prime-select intel - ok "Nvidia installiert, Intel als Standard-GPU gesetzt" + echo -e "\n=== 3/9 Nvidia blacklisten (MBP 16\") ===" + cat > /etc/modprobe.d/blacklist-nvidia.conf < /dev/null </dev/null || true + ok "GRUB: nomodeset gesetzt (MBP 16\")" fi update-initramfs -u ok "Systemkonfigurationen gesetzt" -# ── 6. Energieeinstellungen (systemd) ──────────────────────────────────── -echo -e "\n=== 6/8 Energieeinstellungen ===" +# ── 6. XFCE Compositor deaktivieren (MBP 16") ──────────────────────────── +if [[ "$MODEL" == "16" ]]; then + echo -e "\n=== 6/9 XFCE Compositor deaktivieren ===" + XFWM4_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" + mkdir -p "$XFWM4_DIR" + cat > "$XFWM4_DIR/xfwm4.xml" < + + + + + +XFEOF + chown -R 1000:1000 /home/rene/.config/xfce4 + ok "XFCE Compositor deaktiviert (MBP 16\")" +else + echo -e "\n=== 6/9 XFCE Compositor — beibehalten (MBP 13\") ===" +fi + +# ── 7. Energieeinstellungen (systemd) ──────────────────────────────────── +echo -e "\n=== 7/9 Energieeinstellungen ===" tee /etc/systemd/sleep.conf > /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime ok "Lokalisierung: Deutsch / Berlin" -# ── 8. Services aktivieren ────────────────────────────────────────────── -echo -e "\n=== 8/8 Services aktivieren ===" +# ── 9. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 9/9 Services aktivieren ===" systemctl enable mbpfan systemctl enable thermald systemctl enable tlp +systemctl enable ssh # --now nur wenn nicht in chroot if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; then systemctl start mbpfan systemctl start thermald + systemctl start ssh sensors-detect --auto 2>/dev/null || true - ok "mbpfan, thermald, tlp aktiv (gestartet)" + ok "mbpfan, thermald, tlp, ssh aktiv (gestartet)" else - ok "mbpfan, thermald, tlp aktiviert (Start nach Reboot)" + ok "mbpfan, thermald, tlp, ssh aktiviert (Start nach Reboot)" fi # ── zsh als Standard-Shell für rene ────────────────────────────────────── chsh -s /bin/zsh rene 2>/dev/null || true +# ── Sleep wieder erlauben ──────────────────────────────────────────────── +systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true + echo "" echo "════════════════════════════════════════════" echo -e " ${GREEN}setup-base.sh abgeschlossen!${NC}" diff --git a/user-data b/user-data index 20141f5..95f135e 100644 --- a/user-data +++ b/user-data @@ -10,11 +10,13 @@ autoinstall: username: rene password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: - install-server: false + install-server: true storage: layout: name: lvm late-commands: + # User rene zur sudo-Gruppe hinzufuegen + - curtin in-target --target=/target -- usermod -aG sudo rene # System-Setup in chroot (Pakete, Configs, Locale, Services) - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 13' # Desktop-Setup als Firstboot-Autostart einrichten From 7719026c36b77be59e1b48ea64b89a62f36b632f Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 11:39:26 +0100 Subject: [PATCH 027/122] Rewrite MBP 16": AMD Radeon statt Nvidia, NetworkManager, Retina-Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Erkenntnisse vom MBP 15" Mid 2014 Setup: - GPU ist AMD Radeon R9 M370X (nicht Nvidia!) - Radeon/amdgpu blacklisten statt Nvidia-Module - Kein nomodeset noetig — i915 laeuft ohne - xfce4-display-settings per dpkg-divert deaktivieren (oeffnet sich sonst in Endlosschleife bei fehlender dGPU) - Display-Skalierung 2x / DPI 168 fuer Retina - NetworkManager statt netplan fuer WLAN - systemd-networkd-wait-online deaktivieren (Boot haengt sonst) - INSTALL.md komplett aktualisiert mit neuen Troubleshooting-Eintraegen Co-Authored-By: Claude Opus 4.6 --- INSTALL.md | 44 +++++++++++++++------- setup-base.sh | 102 +++++++++++++++++++++++++++++++------------------- 2 files changed, 94 insertions(+), 52 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index e2e8f77..e865fda 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -123,10 +123,12 @@ Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"* # hier: 13 → 16 ^^^ ``` -MBP 16" bekommt zusätzlich: -- `nvidia-driver-535` + `prime-select intel` +MBP 16" (Mid 2014, Intel + AMD Radeon R9 M370X) bekommt zusätzlich: +- AMD Radeon geblockt (`blacklist-radeon.conf`) — nur Intel i915 nutzen +- XFCE Compositor deaktiviert (keine GPU-Beschleunigung) +- Display-Skalierung 2x / DPI 168 (Retina) +- `xfce4-display-settings` deaktiviert (öffnet sich sonst in Endlosschleife) - Aggressivere Lüftersteuerung (`mbpfan-16.conf`) -- `blacklist-nvidia.conf` in `/tmp` (optional aktivieren) ## Troubleshooting @@ -138,19 +140,32 @@ sudo apt install bcmwl-kernel-source sudo modprobe wl ``` -### Bildschirm flackert / kein Bild (MBP 16") +### WLAN "Device not managed" -Nvidia Optimus-Problem. Intel als GPU erzwingen: +NetworkManager verwaltet das WLAN nicht, weil netplan/cloud-init es konfiguriert: ```bash -sudo prime-select intel +# Prüfen +cat /etc/netplan/*.yaml +cat /etc/NetworkManager/NetworkManager.conf + +# Fix: NetworkManager als Renderer setzen +echo -e "network:\n version: 2\n renderer: NetworkManager" | sudo tee /etc/netplan/01-network-manager.yaml +sudo rm -f /etc/netplan/50-cloud-init.yaml +sudo netplan apply +``` + +### Bildschirm flackert / Grafikartefakte (MBP 16") + +Das MBP 16" hat eine AMD Radeon R9 M370X die Probleme macht. AMD-GPU komplett blacklisten: +```bash +echo -e "blacklist radeon\nblacklist amdgpu" | sudo tee /etc/modprobe.d/blacklist-radeon.conf +sudo update-initramfs -u sudo reboot ``` -Falls das nicht hilft, Nvidia komplett blacklisten: +Falls `xfce4-display-settings` sich in Endlosschleife öffnet: ```bash -sudo cp /tmp/blacklist-nvidia.conf /etc/modprobe.d/ -sudo update-initramfs -u -sudo reboot +sudo mv /usr/bin/xfce4-display-settings /usr/bin/xfce4-display-settings.bak ``` ### Lüfter drehen nicht hoch / MacBook wird zu heiß @@ -166,14 +181,15 @@ sensors sudo /usr/local/bin/temp-watch.sh ``` -### setup-desktop.sh startet nicht beim Login +### Boot hängt (wartet auf Netzwerk) -Autostart-Eintrag manuell prüfen/anlegen: ```bash -cat ~/.config/autostart/macbook-setup-desktop.desktop +sudo systemctl disable systemd-networkd-wait-online.service +sudo reboot ``` -Oder direkt ausführen: +### setup-desktop.sh manuell ausführen + ```bash curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash ``` diff --git a/setup-base.sh b/setup-base.sh index 99e10f0..adb5296 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -21,7 +21,7 @@ else echo "" echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" - echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" read -rp "Modell [13/16]: " MODEL [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" fi @@ -33,17 +33,17 @@ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" # ── 0. Sleep/Suspend verhindern während Installation ───────────────────── -echo -e "\n=== 0/9 Sleep verhindern ===" +echo -e "\n=== 0/10 Sleep verhindern ===" systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true ok "Sleep/Suspend deaktiviert (für Installation)" # ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/9 System aktualisieren ===" +echo -e "\n=== 1/10 System aktualisieren ===" apt update && apt upgrade -y ok "System aktuell" # ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/9 Pakete installieren ===" +echo -e "\n=== 2/10 Pakete installieren ===" apt install -y \ xubuntu-desktop \ bcmwl-kernel-source \ @@ -71,25 +71,24 @@ ok "Pakete installiert (apt)" # FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen (chroot)" -ok "FreeCAD installiert (snap)" -# ── 3. Nvidia blacklisten (MBP 16") ───────────────────────────────────── +# ── 3. GPU-Konfiguration ──────────────────────────────────────────────── if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/9 Nvidia blacklisten (MBP 16\") ===" - cat > /etc/modprobe.d/blacklist-nvidia.conf < /etc/modprobe.d/blacklist-radeon.conf < /dev/null </dev/null || true - ok "GRUB: nomodeset gesetzt (MBP 16\")" -fi - update-initramfs -u ok "Systemkonfigurationen gesetzt" -# ── 6. XFCE Compositor deaktivieren (MBP 16") ──────────────────────────── +# ── 6. XFCE-Konfiguration (MBP 16": Compositor aus, Display-Skalierung) ─ if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 6/9 XFCE Compositor deaktivieren ===" - XFWM4_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" - mkdir -p "$XFWM4_DIR" - cat > "$XFWM4_DIR/xfwm4.xml" < "$XFCE_XML_DIR/xfwm4.xml" < @@ -143,14 +137,46 @@ if [[ "$MODEL" == "16" ]]; then XFEOF + + # Display-Skalierung für Retina (2x, DPI 168) + cat > "$XFCE_XML_DIR/xsettings.xml" < + + + + + + + + +XSEOF + + # xfce4-display-settings deaktivieren (öffnet sich sonst in Endlosschleife) + dpkg-divert --local --rename --divert /usr/bin/xfce4-display-settings.real /usr/bin/xfce4-display-settings + ln -sf /usr/bin/true /usr/bin/xfce4-display-settings + chown -R 1000:1000 /home/rene/.config/xfce4 - ok "XFCE Compositor deaktiviert (MBP 16\")" + ok "XFCE: Compositor aus, Retina-Skalierung, Display-Settings deaktiviert" else - echo -e "\n=== 6/9 XFCE Compositor — beibehalten (MBP 13\") ===" + echo -e "\n=== 6/10 XFCE-Konfiguration — Standard (MBP 13\") ===" fi -# ── 7. Energieeinstellungen (systemd) ──────────────────────────────────── -echo -e "\n=== 7/9 Energieeinstellungen ===" +# ── 7. Netzwerk: NetworkManager statt netplan ───────────────────────────── +echo -e "\n=== 7/10 Netzwerk ===" +cat > /etc/netplan/01-network-manager.yaml </dev/null || true +systemctl enable NetworkManager-wait-online.service 2>/dev/null || true +ok "NetworkManager als Netzwerk-Renderer" + +# ── 8. Energieeinstellungen (systemd) ──────────────────────────────────── +echo -e "\n=== 8/10 Energieeinstellungen ===" tee /etc/systemd/sleep.conf > /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime ok "Lokalisierung: Deutsch / Berlin" -# ── 9. Services aktivieren ────────────────────────────────────────────── -echo -e "\n=== 9/9 Services aktivieren ===" +# ── 10. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 10/10 Services aktivieren ===" systemctl enable mbpfan systemctl enable thermald systemctl enable tlp From 484a1f02623c23f4aea408a3bdcf379bccf7d610 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 11:39:26 +0100 Subject: [PATCH 028/122] Rewrite MBP 16": AMD Radeon statt Nvidia, NetworkManager, Retina-Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Erkenntnisse vom MBP 15" Mid 2014 Setup: - GPU ist AMD Radeon R9 M370X (nicht Nvidia!) - Radeon/amdgpu blacklisten statt Nvidia-Module - Kein nomodeset noetig — i915 laeuft ohne - xfce4-display-settings per dpkg-divert deaktivieren (oeffnet sich sonst in Endlosschleife bei fehlender dGPU) - Display-Skalierung 2x / DPI 168 fuer Retina - NetworkManager statt netplan fuer WLAN - systemd-networkd-wait-online deaktivieren (Boot haengt sonst) - INSTALL.md komplett aktualisiert mit neuen Troubleshooting-Eintraegen --- INSTALL.md | 44 +++++++++++++++------- setup-base.sh | 102 +++++++++++++++++++++++++++++++------------------- 2 files changed, 94 insertions(+), 52 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index e2e8f77..e865fda 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -123,10 +123,12 @@ Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"* # hier: 13 → 16 ^^^ ``` -MBP 16" bekommt zusätzlich: -- `nvidia-driver-535` + `prime-select intel` +MBP 16" (Mid 2014, Intel + AMD Radeon R9 M370X) bekommt zusätzlich: +- AMD Radeon geblockt (`blacklist-radeon.conf`) — nur Intel i915 nutzen +- XFCE Compositor deaktiviert (keine GPU-Beschleunigung) +- Display-Skalierung 2x / DPI 168 (Retina) +- `xfce4-display-settings` deaktiviert (öffnet sich sonst in Endlosschleife) - Aggressivere Lüftersteuerung (`mbpfan-16.conf`) -- `blacklist-nvidia.conf` in `/tmp` (optional aktivieren) ## Troubleshooting @@ -138,19 +140,32 @@ sudo apt install bcmwl-kernel-source sudo modprobe wl ``` -### Bildschirm flackert / kein Bild (MBP 16") +### WLAN "Device not managed" -Nvidia Optimus-Problem. Intel als GPU erzwingen: +NetworkManager verwaltet das WLAN nicht, weil netplan/cloud-init es konfiguriert: ```bash -sudo prime-select intel +# Prüfen +cat /etc/netplan/*.yaml +cat /etc/NetworkManager/NetworkManager.conf + +# Fix: NetworkManager als Renderer setzen +echo -e "network:\n version: 2\n renderer: NetworkManager" | sudo tee /etc/netplan/01-network-manager.yaml +sudo rm -f /etc/netplan/50-cloud-init.yaml +sudo netplan apply +``` + +### Bildschirm flackert / Grafikartefakte (MBP 16") + +Das MBP 16" hat eine AMD Radeon R9 M370X die Probleme macht. AMD-GPU komplett blacklisten: +```bash +echo -e "blacklist radeon\nblacklist amdgpu" | sudo tee /etc/modprobe.d/blacklist-radeon.conf +sudo update-initramfs -u sudo reboot ``` -Falls das nicht hilft, Nvidia komplett blacklisten: +Falls `xfce4-display-settings` sich in Endlosschleife öffnet: ```bash -sudo cp /tmp/blacklist-nvidia.conf /etc/modprobe.d/ -sudo update-initramfs -u -sudo reboot +sudo mv /usr/bin/xfce4-display-settings /usr/bin/xfce4-display-settings.bak ``` ### Lüfter drehen nicht hoch / MacBook wird zu heiß @@ -166,14 +181,15 @@ sensors sudo /usr/local/bin/temp-watch.sh ``` -### setup-desktop.sh startet nicht beim Login +### Boot hängt (wartet auf Netzwerk) -Autostart-Eintrag manuell prüfen/anlegen: ```bash -cat ~/.config/autostart/macbook-setup-desktop.desktop +sudo systemctl disable systemd-networkd-wait-online.service +sudo reboot ``` -Oder direkt ausführen: +### setup-desktop.sh manuell ausführen + ```bash curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash ``` diff --git a/setup-base.sh b/setup-base.sh index 99e10f0..adb5296 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -21,7 +21,7 @@ else echo "" echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" - echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" read -rp "Modell [13/16]: " MODEL [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" fi @@ -33,17 +33,17 @@ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" # ── 0. Sleep/Suspend verhindern während Installation ───────────────────── -echo -e "\n=== 0/9 Sleep verhindern ===" +echo -e "\n=== 0/10 Sleep verhindern ===" systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true ok "Sleep/Suspend deaktiviert (für Installation)" # ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/9 System aktualisieren ===" +echo -e "\n=== 1/10 System aktualisieren ===" apt update && apt upgrade -y ok "System aktuell" # ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/9 Pakete installieren ===" +echo -e "\n=== 2/10 Pakete installieren ===" apt install -y \ xubuntu-desktop \ bcmwl-kernel-source \ @@ -71,25 +71,24 @@ ok "Pakete installiert (apt)" # FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen (chroot)" -ok "FreeCAD installiert (snap)" -# ── 3. Nvidia blacklisten (MBP 16") ───────────────────────────────────── +# ── 3. GPU-Konfiguration ──────────────────────────────────────────────── if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/9 Nvidia blacklisten (MBP 16\") ===" - cat > /etc/modprobe.d/blacklist-nvidia.conf < /etc/modprobe.d/blacklist-radeon.conf < /dev/null </dev/null || true - ok "GRUB: nomodeset gesetzt (MBP 16\")" -fi - update-initramfs -u ok "Systemkonfigurationen gesetzt" -# ── 6. XFCE Compositor deaktivieren (MBP 16") ──────────────────────────── +# ── 6. XFCE-Konfiguration (MBP 16": Compositor aus, Display-Skalierung) ─ if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 6/9 XFCE Compositor deaktivieren ===" - XFWM4_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" - mkdir -p "$XFWM4_DIR" - cat > "$XFWM4_DIR/xfwm4.xml" < "$XFCE_XML_DIR/xfwm4.xml" < @@ -143,14 +137,46 @@ if [[ "$MODEL" == "16" ]]; then XFEOF + + # Display-Skalierung für Retina (2x, DPI 168) + cat > "$XFCE_XML_DIR/xsettings.xml" < + + + + + + + + +XSEOF + + # xfce4-display-settings deaktivieren (öffnet sich sonst in Endlosschleife) + dpkg-divert --local --rename --divert /usr/bin/xfce4-display-settings.real /usr/bin/xfce4-display-settings + ln -sf /usr/bin/true /usr/bin/xfce4-display-settings + chown -R 1000:1000 /home/rene/.config/xfce4 - ok "XFCE Compositor deaktiviert (MBP 16\")" + ok "XFCE: Compositor aus, Retina-Skalierung, Display-Settings deaktiviert" else - echo -e "\n=== 6/9 XFCE Compositor — beibehalten (MBP 13\") ===" + echo -e "\n=== 6/10 XFCE-Konfiguration — Standard (MBP 13\") ===" fi -# ── 7. Energieeinstellungen (systemd) ──────────────────────────────────── -echo -e "\n=== 7/9 Energieeinstellungen ===" +# ── 7. Netzwerk: NetworkManager statt netplan ───────────────────────────── +echo -e "\n=== 7/10 Netzwerk ===" +cat > /etc/netplan/01-network-manager.yaml </dev/null || true +systemctl enable NetworkManager-wait-online.service 2>/dev/null || true +ok "NetworkManager als Netzwerk-Renderer" + +# ── 8. Energieeinstellungen (systemd) ──────────────────────────────────── +echo -e "\n=== 8/10 Energieeinstellungen ===" tee /etc/systemd/sleep.conf > /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime ok "Lokalisierung: Deutsch / Berlin" -# ── 9. Services aktivieren ────────────────────────────────────────────── -echo -e "\n=== 9/9 Services aktivieren ===" +# ── 10. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 10/10 Services aktivieren ===" systemctl enable mbpfan systemctl enable thermald systemctl enable tlp From fc2374e268afe63236723db9992c3ea618bf1d2a Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 11:44:54 +0100 Subject: [PATCH 029/122] Set DPI to 128 for MBP 16" Retina (Scale 2x + 128 DPI) Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-base.sh b/setup-base.sh index adb5296..8682b37 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -146,7 +146,7 @@ XFEOF - + XSEOF From 27ecda8d4eb4d368780ac26c9ac3646a7393903c Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 11:44:54 +0100 Subject: [PATCH 030/122] Set DPI to 128 for MBP 16" Retina (Scale 2x + 128 DPI) --- setup-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-base.sh b/setup-base.sh index adb5296..8682b37 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -146,7 +146,7 @@ XFEOF - + XSEOF From 5e4e2eb82567f5b26e99c86b9e06b8fe0d2e9f83 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 11:46:21 +0100 Subject: [PATCH 031/122] PrusaSlicer: AppImage durch Flatpak ersetzen (kein Linux-AppImage mehr ab 2.9.x) Co-Authored-By: Claude Opus 4.6 --- setup-desktop.sh | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index a45ce6c..3b2efba 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -38,24 +38,14 @@ export PATH="$HOME/.npm-global/bin:$PATH" npm install -g @anthropic-ai/claude-code ok "Claude Code installiert" -# ── 3. PrusaSlicer ────────────────────────────────────────────────────── -echo -e "\n=== 3/5 PrusaSlicer AppImage ===" -mkdir -p ~/Applications -PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" -if [[ ! -f ~/Applications/PrusaSlicer.AppImage ]]; then - wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" - chmod +x ~/Applications/PrusaSlicer.AppImage +# ── 3. PrusaSlicer (Flatpak) ────────────────────────────────────────────── +echo -e "\n=== 3/5 PrusaSlicer ===" +if ! command -v flatpak &>/dev/null; then + sudo apt install -y flatpak fi -mkdir -p ~/.local/share/applications -cat > ~/.local/share/applications/prusaslicer.desktop < Date: Sun, 8 Mar 2026 11:46:21 +0100 Subject: [PATCH 032/122] PrusaSlicer: AppImage durch Flatpak ersetzen (kein Linux-AppImage mehr ab 2.9.x) --- setup-desktop.sh | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index a45ce6c..3b2efba 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -38,24 +38,14 @@ export PATH="$HOME/.npm-global/bin:$PATH" npm install -g @anthropic-ai/claude-code ok "Claude Code installiert" -# ── 3. PrusaSlicer ────────────────────────────────────────────────────── -echo -e "\n=== 3/5 PrusaSlicer AppImage ===" -mkdir -p ~/Applications -PRUSA_URL="https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.8.1/PrusaSlicer-2.8.1+linux-x64-GTK3-202410181354.AppImage" -if [[ ! -f ~/Applications/PrusaSlicer.AppImage ]]; then - wget -q --show-progress -O ~/Applications/PrusaSlicer.AppImage "$PRUSA_URL" - chmod +x ~/Applications/PrusaSlicer.AppImage +# ── 3. PrusaSlicer (Flatpak) ────────────────────────────────────────────── +echo -e "\n=== 3/5 PrusaSlicer ===" +if ! command -v flatpak &>/dev/null; then + sudo apt install -y flatpak fi -mkdir -p ~/.local/share/applications -cat > ~/.local/share/applications/prusaslicer.desktop < Date: Sun, 8 Mar 2026 16:47:01 +0100 Subject: [PATCH 033/122] Fix Brave Browser: neue offizielle APT-Repository-URL Alte URL brave-releases.s3.brave.com existiert nicht mehr, neue URL ist brave-browser-apt-release.s3.brave.com mit .sources-Format. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 8682b37..18a92d3 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -90,10 +90,9 @@ fi # ── 4. Brave Browser ───────────────────────────────────────────────────── echo -e "\n=== 4/10 Brave Browser ===" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ - https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg -echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ -https://brave-releases.s3.brave.com/ stable main" \ - | tee /etc/apt/sources.list.d/brave-browser-release.list + https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg +curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ + https://brave-browser-apt-release.s3.brave.com/brave-browser.sources apt update && apt install -y brave-browser ok "Brave installiert" From 0c784c7aedd51433adc4fa5836c10f464f666cc8 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 16:47:01 +0100 Subject: [PATCH 034/122] Fix Brave Browser: neue offizielle APT-Repository-URL Alte URL brave-releases.s3.brave.com existiert nicht mehr, neue URL ist brave-browser-apt-release.s3.brave.com mit .sources-Format. --- setup-base.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 8682b37..18a92d3 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -90,10 +90,9 @@ fi # ── 4. Brave Browser ───────────────────────────────────────────────────── echo -e "\n=== 4/10 Brave Browser ===" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ - https://brave-keyring.s3.brave.com/brave-browser-archive-keyring.gpg -echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] \ -https://brave-releases.s3.brave.com/ stable main" \ - | tee /etc/apt/sources.list.d/brave-browser-release.list + https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg +curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ + https://brave-browser-apt-release.s3.brave.com/brave-browser.sources apt update && apt install -y brave-browser ok "Brave installiert" From ef7c660c824c83a9ee3904b98677d7d75f540e4b Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 8 Mar 2026 19:29:59 +0100 Subject: [PATCH 035/122] WireGuard-Config ins ISO einbetten (wireguard/ Ordner, .gitignore) - build-iso.sh erkennt Modell/Hostname aus user-data und sucht passende Config in wireguard/{hostname}.conf oder wireguard/m{model}.conf - user-data: late-commands kopieren wg0.conf vom Installationsmedium nach /etc/wireguard/ und aktivieren wg-quick@wg0 - wireguard/ in .gitignore (keine Secrets im Repo) Co-Authored-By: Claude Opus 4.6 --- .gitignore | 1 + build-iso.sh | 36 +++++++++++++++++++++++++++++++++--- user-data | 8 ++++++-- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 153f1f7..3880bdb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.iso .DS_Store +wireguard/ diff --git a/build-iso.sh b/build-iso.sh index 4817a29..85b3a94 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -19,6 +19,14 @@ echo "════════════════════════ echo " macbook-setup ISO Builder ($OS)" echo "════════════════════════════════════════════" +# ── Modell aus user-data erkennen ────────────────────────────────────────── +MODEL=$(grep -o 'setup-base.sh | bash -s -- [0-9]*' "$SCRIPT_DIR/user-data" | grep -o '[0-9]*$') +HOSTNAME=$(grep 'hostname:' "$SCRIPT_DIR/user-data" | awk '{print $2}') +if [[ -z "$MODEL" ]]; then + err "Konnte Modell nicht aus user-data ermitteln" +fi +ok "Modell: MBP $MODEL\" (Hostname: $HOSTNAME)" + # ── Abhängigkeiten ─────────────────────────────────────────────────────── echo -e "\n=== Abhängigkeiten prüfen ===" if [[ "$OS" == "Darwin" ]]; then @@ -57,6 +65,25 @@ cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall/" cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" ok "user-data und meta-data bereit" +# ── WireGuard-Config einbetten ──────────────────────────────────────────── +echo -e "\n=== WireGuard-Config ===" +WG_CONF="" +# Suche nach passender Config: wireguard/m16.conf, wireguard/m13.conf, etc. +for candidate in "$SCRIPT_DIR/wireguard/${HOSTNAME}.conf" "$SCRIPT_DIR/wireguard/m${MODEL}.conf"; do + if [[ -f "$candidate" ]]; then + WG_CONF="$candidate" + break + fi +done + +if [[ -n "$WG_CONF" ]]; then + cp "$WG_CONF" "$TMPDIR/autoinstall/wg0.conf" + ok "WireGuard-Config eingebettet: $(basename "$WG_CONF")" +else + warn "Keine WireGuard-Config gefunden in wireguard/ — übersprungen" + warn "Erwartet: wireguard/${HOSTNAME}.conf oder wireguard/m${MODEL}.conf" +fi + # ── GRUB-Eintrag vorbereiten ──────────────────────────────────────────── echo -e "\n=== GRUB-Eintrag vorbereiten ===" @@ -98,10 +125,13 @@ rm -rf "$TMPDIR" ok "ISO erstellt: $OUTPUT_ISO" echo "" echo "Größe: $(du -sh "$OUTPUT_ISO" | cut -f1)" +echo "Modell: MBP $MODEL\" | Hostname: $HOSTNAME" +[[ -n "$WG_CONF" ]] && echo "WireGuard: $(basename "$WG_CONF")" || echo "WireGuard: nicht eingebettet" echo "" -warn "Nächster Schritt: ISO auf Ventoy-Stick kopieren" +warn "Nächster Schritt: ISO auf USB-Stick schreiben" if [[ "$OS" == "Darwin" ]]; then - echo " cp $OUTPUT_ISO /Volumes/Ventoy/" + echo " diskutil unmountDisk /dev/diskX" + echo " sudo dd if=$OUTPUT_ISO of=/dev/rdiskX bs=4m" else - echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" + echo " sudo dd if=$OUTPUT_ISO of=/dev/sdX bs=4M status=progress" fi diff --git a/user-data b/user-data index 95f135e..4b23e6c 100644 --- a/user-data +++ b/user-data @@ -6,7 +6,7 @@ autoinstall: layout: de variant: mac identity: - hostname: macbook + hostname: m16 username: rene password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: @@ -17,8 +17,12 @@ autoinstall: late-commands: # User rene zur sudo-Gruppe hinzufuegen - curtin in-target --target=/target -- usermod -aG sudo rene + # WireGuard-Config vom Installationsmedium kopieren (falls vorhanden) + - bash -c 'if [ -f /cdrom/autoinstall/wg0.conf ]; then mkdir -p /target/etc/wireguard && cp /cdrom/autoinstall/wg0.conf /target/etc/wireguard/wg0.conf && chmod 600 /target/etc/wireguard/wg0.conf; fi' + # WireGuard beim Boot aktivieren + - curtin in-target --target=/target -- bash -c 'if [ -f /etc/wireguard/wg0.conf ]; then systemctl enable wg-quick@wg0; fi' # System-Setup in chroot (Pakete, Configs, Locale, Services) - - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 13' + - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 16' # Desktop-Setup als Firstboot-Autostart einrichten - curtin in-target --target=/target -- mkdir -p /home/rene/.config/autostart - curtin in-target --target=/target -- bash -c 'cat > /home/rene/.config/autostart/macbook-setup-desktop.desktop < Date: Sun, 8 Mar 2026 19:29:59 +0100 Subject: [PATCH 036/122] WireGuard-Config ins ISO einbetten (wireguard/ Ordner, .gitignore) - build-iso.sh erkennt Modell/Hostname aus user-data und sucht passende Config in wireguard/{hostname}.conf oder wireguard/m{model}.conf - user-data: late-commands kopieren wg0.conf vom Installationsmedium nach /etc/wireguard/ und aktivieren wg-quick@wg0 - wireguard/ in .gitignore (keine Secrets im Repo) --- .gitignore | 1 + build-iso.sh | 36 +++++++++++++++++++++++++++++++++--- user-data | 8 ++++++-- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 153f1f7..3880bdb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.iso .DS_Store +wireguard/ diff --git a/build-iso.sh b/build-iso.sh index 4817a29..85b3a94 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -19,6 +19,14 @@ echo "════════════════════════ echo " macbook-setup ISO Builder ($OS)" echo "════════════════════════════════════════════" +# ── Modell aus user-data erkennen ────────────────────────────────────────── +MODEL=$(grep -o 'setup-base.sh | bash -s -- [0-9]*' "$SCRIPT_DIR/user-data" | grep -o '[0-9]*$') +HOSTNAME=$(grep 'hostname:' "$SCRIPT_DIR/user-data" | awk '{print $2}') +if [[ -z "$MODEL" ]]; then + err "Konnte Modell nicht aus user-data ermitteln" +fi +ok "Modell: MBP $MODEL\" (Hostname: $HOSTNAME)" + # ── Abhängigkeiten ─────────────────────────────────────────────────────── echo -e "\n=== Abhängigkeiten prüfen ===" if [[ "$OS" == "Darwin" ]]; then @@ -57,6 +65,25 @@ cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall/" cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" ok "user-data und meta-data bereit" +# ── WireGuard-Config einbetten ──────────────────────────────────────────── +echo -e "\n=== WireGuard-Config ===" +WG_CONF="" +# Suche nach passender Config: wireguard/m16.conf, wireguard/m13.conf, etc. +for candidate in "$SCRIPT_DIR/wireguard/${HOSTNAME}.conf" "$SCRIPT_DIR/wireguard/m${MODEL}.conf"; do + if [[ -f "$candidate" ]]; then + WG_CONF="$candidate" + break + fi +done + +if [[ -n "$WG_CONF" ]]; then + cp "$WG_CONF" "$TMPDIR/autoinstall/wg0.conf" + ok "WireGuard-Config eingebettet: $(basename "$WG_CONF")" +else + warn "Keine WireGuard-Config gefunden in wireguard/ — übersprungen" + warn "Erwartet: wireguard/${HOSTNAME}.conf oder wireguard/m${MODEL}.conf" +fi + # ── GRUB-Eintrag vorbereiten ──────────────────────────────────────────── echo -e "\n=== GRUB-Eintrag vorbereiten ===" @@ -98,10 +125,13 @@ rm -rf "$TMPDIR" ok "ISO erstellt: $OUTPUT_ISO" echo "" echo "Größe: $(du -sh "$OUTPUT_ISO" | cut -f1)" +echo "Modell: MBP $MODEL\" | Hostname: $HOSTNAME" +[[ -n "$WG_CONF" ]] && echo "WireGuard: $(basename "$WG_CONF")" || echo "WireGuard: nicht eingebettet" echo "" -warn "Nächster Schritt: ISO auf Ventoy-Stick kopieren" +warn "Nächster Schritt: ISO auf USB-Stick schreiben" if [[ "$OS" == "Darwin" ]]; then - echo " cp $OUTPUT_ISO /Volumes/Ventoy/" + echo " diskutil unmountDisk /dev/diskX" + echo " sudo dd if=$OUTPUT_ISO of=/dev/rdiskX bs=4m" else - echo " cp $OUTPUT_ISO /media/\$USER/Ventoy/" + echo " sudo dd if=$OUTPUT_ISO of=/dev/sdX bs=4M status=progress" fi diff --git a/user-data b/user-data index 95f135e..4b23e6c 100644 --- a/user-data +++ b/user-data @@ -6,7 +6,7 @@ autoinstall: layout: de variant: mac identity: - hostname: macbook + hostname: m16 username: rene password: "$6$lXt4c5wub9FgGOj2$rjwW.UjraH2yYwxabXH.diOu86KSfW.AZvIVRmScbH7Nmh.zLbeMbNITGtRKfpGhe01nqgw4fL8QK67B1oWaq." ssh: @@ -17,8 +17,12 @@ autoinstall: late-commands: # User rene zur sudo-Gruppe hinzufuegen - curtin in-target --target=/target -- usermod -aG sudo rene + # WireGuard-Config vom Installationsmedium kopieren (falls vorhanden) + - bash -c 'if [ -f /cdrom/autoinstall/wg0.conf ]; then mkdir -p /target/etc/wireguard && cp /cdrom/autoinstall/wg0.conf /target/etc/wireguard/wg0.conf && chmod 600 /target/etc/wireguard/wg0.conf; fi' + # WireGuard beim Boot aktivieren + - curtin in-target --target=/target -- bash -c 'if [ -f /etc/wireguard/wg0.conf ]; then systemctl enable wg-quick@wg0; fi' # System-Setup in chroot (Pakete, Configs, Locale, Services) - - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 13' + - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 16' # Desktop-Setup als Firstboot-Autostart einrichten - curtin in-target --target=/target -- mkdir -p /home/rene/.config/autostart - curtin in-target --target=/target -- bash -c 'cat > /home/rene/.config/autostart/macbook-setup-desktop.desktop < Date: Mon, 9 Mar 2026 19:55:58 +0100 Subject: [PATCH 037/122] Tastatur-Fix, Zsh-Tooling, cloud-init, Autoinstall-Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup-base.sh: - Tastatur: mac_nodeadkeys + iso_layout=0 (fixt ^/< Swap, @ auf Alt+L) - Neue Pakete: libheif-examples, imagemagick, pipx, zoxide, micro - cloud-init deaktivieren (blockiert Boot ohne Cloud-Provider) - dpkg-reconfigure nach Keyboard-Änderung setup-desktop.sh: - Powerlevel10k + zsh-syntax-highlighting von GitHub klonen - MesloLGS NF Fonts installieren - PlatformIO via pipx - .zshrc deployen (Linux-Version mit allen Aliases) - .p10k.zsh aus dotfiles-rene deployen - git-check-all.sh + git-update-all.sh verlinken - XFCE Keyboard-Override deaktivieren (XkbDisable) - XFCE Terminal auf MesloLGS NF setzen - DPMS-Werte gestaffelt (5/6/7 Min statt alle 10) build-iso.sh: - cloud-config-url=/dev/null (Fix für Ubuntu 24.04 Autoinstall) user-data: - Keyboard-Variante mac_nodeadkeys Co-Authored-By: Claude Opus 4.6 --- build-iso.sh | 2 +- setup-base.sh | 19 ++++- setup-desktop.sh | 209 ++++++++++++++++++++++++++++++++++++++++------- user-data | 2 +- 4 files changed, 196 insertions(+), 36 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index 85b3a94..b0a9c53 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -100,7 +100,7 @@ set timeout=10 menuentry "Ubuntu MacBook AutoInstall" { set gfxpayload=keep - linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/autoinstall/ --- + linux /casper/vmlinuz quiet autoinstall cloud-config-url=/dev/null ds=nocloud\;s=/cdrom/autoinstall/ --- initrd /casper/initrd } diff --git a/setup-base.sh b/setup-base.sh index 18a92d3..32edbbf 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -57,6 +57,10 @@ apt install -y \ nodejs npm \ wireguard wireguard-tools \ openssh-server \ + libheif-examples imagemagick \ + pipx \ + zoxide \ + micro \ libreoffice libreoffice-l10n-de \ thunderbird thunderbird-locale-de \ keepassxc \ @@ -99,16 +103,17 @@ ok "Brave installiert" # ── 5. Konfigurationsdateien ───────────────────────────────────────────── echo -e "\n=== 5/10 Systemkonfigurationen ===" -# Tastaturbelegung +# Tastaturbelegung (mac_nodeadkeys: @=Alt+L, |=Alt+7, wie auf dem Mac) tee /etc/default/keyboard > /dev/null </dev/null || true -# Fn-Tasten -echo 'options hid_apple fnmode=2' | tee /etc/modprobe.d/hid_apple.conf > /dev/null +# Fn-Tasten + ISO-Layout-Fix (iso_layout=0 verhindert ^/< Vertauschung) +echo 'options hid_apple fnmode=2 iso_layout=0' | tee /etc/modprobe.d/hid_apple.conf > /dev/null # mbpfan (modellabhängig) wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" @@ -213,6 +218,12 @@ else ok "mbpfan, thermald, tlp, ssh aktiviert (Start nach Reboot)" fi +# ── cloud-init deaktivieren (kein Cloud-Provider, blockiert sonst den Boot) ── +if command -v cloud-init &>/dev/null; then + touch /etc/cloud/cloud-init.disabled + ok "cloud-init deaktiviert" +fi + # ── zsh als Standard-Shell für rene ────────────────────────────────────── chsh -s /bin/zsh rene 2>/dev/null || true diff --git a/setup-desktop.sh b/setup-desktop.sh index 3b2efba..b23efd8 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -1,6 +1,6 @@ #!/bin/bash # macbook-setup/setup-desktop.sh -# Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE-Einstellungen +# Desktop-Setup: oh-my-zsh, Zsh-Tooling, Claude Code, PrusaSlicer, Dotfiles, XFCE # Braucht eine laufende Desktop-Session (XFCE) — NICHT in chroot ausführen! # Verwendung: bash setup-desktop.sh # Wird automatisch beim ersten Login gestartet (via Autostart) @@ -24,22 +24,55 @@ echo " setup-desktop.sh startet" echo "════════════════════════════════════════════" # ── 1. oh-my-zsh ──────────────────────────────────────────────────────── -echo -e "\n=== 1/5 oh-my-zsh ===" +echo -e "\n=== 1/8 oh-my-zsh ===" if [[ ! -d ~/.oh-my-zsh ]]; then sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended fi ok "oh-my-zsh installiert" -# ── 2. npm global + Claude Code ───────────────────────────────────────── -echo -e "\n=== 2/5 Claude Code ===" +# ── 2. Zsh-Plugins & Powerlevel10k ────────────────────────────────────── +echo -e "\n=== 2/8 Zsh-Plugins & Powerlevel10k ===" + +# zsh-syntax-highlighting (Submodule im Dotfiles-Repo ist leer) +ZSH_SHL_DIR="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" +if [[ ! -d "$ZSH_SHL_DIR/.git" ]]; then + rm -rf "$ZSH_SHL_DIR" + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_SHL_DIR" +fi +ok "zsh-syntax-highlighting" + +# Powerlevel10k (Submodule im Dotfiles-Repo ist leer) +P10K_DIR="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" +if [[ ! -d "$P10K_DIR/.git" ]]; then + rm -rf "$P10K_DIR" + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$P10K_DIR" +fi +ok "Powerlevel10k" + +# ── 3. MesloLGS NF Font (Powerlevel10k-Icons) ─────────────────────────── +echo -e "\n=== 3/8 MesloLGS NF Font ===" +FONT_DIR="$HOME/.local/share/fonts" +mkdir -p "$FONT_DIR" +FONT_BASE="https://github.com/romkatv/powerlevel10k-media/raw/master" +for font in "MesloLGS NF Regular.ttf" "MesloLGS NF Bold.ttf" \ + "MesloLGS NF Italic.ttf" "MesloLGS NF Bold Italic.ttf"; do + if [[ ! -f "$FONT_DIR/$font" ]]; then + curl -fsSL -o "$FONT_DIR/$font" "$FONT_BASE/${font// /%20}" + fi +done +fc-cache -f "$FONT_DIR" 2>/dev/null || true +ok "MesloLGS NF Fonts installiert" + +# ── 4. npm global + Claude Code ───────────────────────────────────────── +echo -e "\n=== 4/8 Claude Code ===" mkdir -p ~/.npm-global npm config set prefix '~/.npm-global' export PATH="$HOME/.npm-global/bin:$PATH" npm install -g @anthropic-ai/claude-code ok "Claude Code installiert" -# ── 3. PrusaSlicer (Flatpak) ────────────────────────────────────────────── -echo -e "\n=== 3/5 PrusaSlicer ===" +# ── 5. PrusaSlicer (Flatpak) ──────────────────────────────────────────── +echo -e "\n=== 5/8 PrusaSlicer ===" if ! command -v flatpak &>/dev/null; then sudo apt install -y flatpak fi @@ -47,8 +80,16 @@ flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flath flatpak install --user -y flathub com.prusa3d.PrusaSlicer ok "PrusaSlicer installiert (Flatpak)" -# ── 4. Dot-Files ──────────────────────────────────────────────────────── -echo -e "\n=== 4/5 Dot-Files ===" +# ── 6. PlatformIO (pipx) ──────────────────────────────────────────────── +echo -e "\n=== 6/8 PlatformIO ===" +if ! command -v pio &>/dev/null; then + pipx install platformio + pipx ensurepath +fi +ok "PlatformIO installiert (pipx)" + +# ── 7. Dot-Files ──────────────────────────────────────────────────────── +echo -e "\n=== 7/8 Dot-Files ===" DOTFILES_DIR="$HOME/git-projekte/dotfiles-rene" if [[ ! -d "$DOTFILES_DIR" ]]; then mkdir -p "$HOME/git-projekte" @@ -67,51 +108,158 @@ if [[ -f "$DOTFILES_DIR/micro/install-micro-dotfiles.sh" ]]; then ok "Dot-Files: micro" fi -# oh-my-zsh custom (Plugins, Themes, Aliase) +# oh-my-zsh custom (platformio.zsh etc.) if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom" ]] && [[ -d ~/.oh-my-zsh/custom ]]; then for f in "$DOTFILES_DIR/oh-my-zsh/custom"/*.zsh; do [[ -f "$f" ]] && ln -sf "$f" ~/.oh-my-zsh/custom/ done - # Custom Plugins - if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/plugins" ]]; then - for plugin_dir in "$DOTFILES_DIR/oh-my-zsh/custom/plugins"/*/; do - plugin_name=$(basename "$plugin_dir") - ln -sfn "$plugin_dir" ~/.oh-my-zsh/custom/plugins/"$plugin_name" - done - fi - # Custom Themes - if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/themes" ]]; then - for theme_dir in "$DOTFILES_DIR/oh-my-zsh/custom/themes"/*/; do - theme_name=$(basename "$theme_dir") - ln -sfn "$theme_dir" ~/.oh-my-zsh/custom/themes/"$theme_name" - done - fi ok "Dot-Files: oh-my-zsh custom" fi # heic-scripts nach ~/bin +mkdir -p ~/bin if [[ -d "$DOTFILES_DIR/heic-scripts" ]]; then - mkdir -p ~/bin for script in "$DOTFILES_DIR/heic-scripts"/*; do - [[ -f "$script" ]] && ln -sf "$script" ~/bin/ + [[ -f "$script" ]] && chmod +x "$script" && ln -sf "$script" ~/bin/ done ok "Dot-Files: heic-scripts → ~/bin" fi -# ── 5. XFCE Energieeinstellungen ──────────────────────────────────────── -echo -e "\n=== 5/5 XFCE Energieeinstellungen ===" +# git-check-all.sh + git-update-all.sh nach ~/ +if [[ -d "$DOTFILES_DIR/bin" ]]; then + for script in "$DOTFILES_DIR/bin"/*; do + [[ -f "$script" ]] && chmod +x "$script" && ln -sf "$script" ~/ + done + ok "Dot-Files: git-check-all.sh, git-update-all.sh → ~/" +fi + +# .zshrc (Linux-Version, ohne Conda/LM Studio/iTerm2) +cat > ~/.zshrc <<'ZSHEOF' +# ---------------------------------------------------------- +# Zsh-Konfiguration fuer Rene (Linux / MacBook Pro) +# Oh My Zsh + Powerlevel10k + Micro +# ---------------------------------------------------------- + +# 1) Powerlevel10k Instant Prompt (muss sehr weit oben stehen) +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# 2) Oh My Zsh Basis +export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="powerlevel10k/powerlevel10k" + +plugins=( + git + zsh-syntax-highlighting + zoxide +) + +source "$ZSH/oh-my-zsh.sh" + +# 3) Powerlevel10k-Konfiguration +[[ -f "$HOME/.p10k.zsh" ]] && source "$HOME/.p10k.zsh" + +# 4) Standard-Editor (lokal: micro, SSH: nicht erzwingen) +if [[ -z "$SSH_CONNECTION" ]]; then + export EDITOR="micro" + export VISUAL="micro" +fi + +# 5) Pfade +export PATH="$HOME/bin:$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" + +# 6) Aliases + +# ls-Varianten +alias ll='ls -lha' +alias la='ls -A' +alias l='ls -lh' + +# Verzeichnisse +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' + +# Konfigdateien +alias zshconfig='micro ~/.zshrc' +alias p10kconfig='micro ~/.p10k.zsh' + +# Git-Kurzbefehle +alias gs='git status' +alias ga='git add' +alias gc='git commit' +alias gp='git push' +alias gl='git log --oneline --graph --decorate' +alias gitcheck="~/git-check-all.sh --short" +alias gitupdate="~/git-update-all.sh" + +# 7) History +HISTFILE="$HOME/.zsh_history" +HISTSIZE=5000 +SAVEHIST=5000 +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_SPACE +setopt SHARE_HISTORY + +# 8) Zsh-Optionen +setopt AUTO_CD + +# 9) Fenster-/Tab-Titel +precmd() { print -Pn "\e]0;%n@%m: %~\a" } +export COLORTERM=truecolor +ZSHEOF +ok "Dot-Files: .zshrc" + +# .p10k.zsh (vom Mac kopieren, falls im Repo vorhanden, sonst Wizard beim ersten Start) +if [[ -f "$DOTFILES_DIR/.p10k.zsh" ]]; then + cp "$DOTFILES_DIR/.p10k.zsh" ~/.p10k.zsh + ok "Dot-Files: .p10k.zsh" +else + warn ".p10k.zsh nicht im Dotfiles-Repo — beim ersten zsh-Start 'p10k configure' ausfuehren" +fi + +# ── 8. XFCE-Einstellungen ─────────────────────────────────────────────── +echo -e "\n=== 8/8 XFCE-Einstellungen ===" + +# Keyboard: XFCE soll /etc/default/keyboard respektieren (nicht eigenes Layout erzwingen) +if command -v xfconf-query &>/dev/null; then + xfconf-query -c keyboard-layout -p /Default/XkbDisable -n -t bool -s true 2>/dev/null || true + ok "XFCE Keyboard: System-Layout wird verwendet" +fi + +# Energieeinstellungen if command -v xfconf-query &>/dev/null; then xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int - xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int - xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int - xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 5 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 6 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 7 --create -t int ok "XFCE Power Manager konfiguriert" else warn "xfconf-query nicht gefunden — XFCE Energieeinstellungen übersprungen" fi +# XFCE Terminal: MesloLGS NF als Schriftart setzen +XFCE_TERM_RC="$HOME/.config/xfce4/terminal/terminalrc" +if [[ -d "$HOME/.config/xfce4" ]]; then + mkdir -p "$(dirname "$XFCE_TERM_RC")" + if [[ -f "$XFCE_TERM_RC" ]]; then + sed -i 's/^FontName=.*/FontName=MesloLGS NF 11/' "$XFCE_TERM_RC" 2>/dev/null || true + else + cat > "$XFCE_TERM_RC" <<'TERMEOF' +[Configuration] +FontName=MesloLGS NF 11 +MiscAlwaysShowTabs=FALSE +MiscBell=FALSE +MiscDefaultGeometry=120x35 +ScrollingBar=TERMINAL_SCROLLBAR_NONE +TERMEOF + fi + ok "XFCE Terminal: MesloLGS NF Schriftart" +fi + # ── Autostart entfernen ───────────────────────────────────────────────── AUTOSTART_FILE="$HOME/.config/autostart/macbook-setup-desktop.desktop" if [[ -f "$AUTOSTART_FILE" ]]; then @@ -131,3 +279,4 @@ echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-qu echo " 2. Synology Drive Client installieren (.deb von synology.com)" echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" echo " 4. Brave starten → Synchronisation einrichten" +echo " 5. Falls p10k-Icons fehlen: Terminal-Schriftart auf 'MesloLGS NF' setzen" diff --git a/user-data b/user-data index 4b23e6c..08668d0 100644 --- a/user-data +++ b/user-data @@ -4,7 +4,7 @@ autoinstall: locale: de_DE.UTF-8 keyboard: layout: de - variant: mac + variant: mac_nodeadkeys identity: hostname: m16 username: rene From 0b908ba3bf4def881371f21317fd195431be4525 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 19:55:58 +0100 Subject: [PATCH 038/122] Tastatur-Fix, Zsh-Tooling, cloud-init, Autoinstall-Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup-base.sh: - Tastatur: mac_nodeadkeys + iso_layout=0 (fixt ^/< Swap, @ auf Alt+L) - Neue Pakete: libheif-examples, imagemagick, pipx, zoxide, micro - cloud-init deaktivieren (blockiert Boot ohne Cloud-Provider) - dpkg-reconfigure nach Keyboard-Änderung setup-desktop.sh: - Powerlevel10k + zsh-syntax-highlighting von GitHub klonen - MesloLGS NF Fonts installieren - PlatformIO via pipx - .zshrc deployen (Linux-Version mit allen Aliases) - .p10k.zsh aus dotfiles-rene deployen - git-check-all.sh + git-update-all.sh verlinken - XFCE Keyboard-Override deaktivieren (XkbDisable) - XFCE Terminal auf MesloLGS NF setzen - DPMS-Werte gestaffelt (5/6/7 Min statt alle 10) build-iso.sh: - cloud-config-url=/dev/null (Fix für Ubuntu 24.04 Autoinstall) user-data: - Keyboard-Variante mac_nodeadkeys --- build-iso.sh | 2 +- setup-base.sh | 19 ++++- setup-desktop.sh | 209 ++++++++++++++++++++++++++++++++++++++++------- user-data | 2 +- 4 files changed, 196 insertions(+), 36 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index 85b3a94..b0a9c53 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -100,7 +100,7 @@ set timeout=10 menuentry "Ubuntu MacBook AutoInstall" { set gfxpayload=keep - linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/autoinstall/ --- + linux /casper/vmlinuz quiet autoinstall cloud-config-url=/dev/null ds=nocloud\;s=/cdrom/autoinstall/ --- initrd /casper/initrd } diff --git a/setup-base.sh b/setup-base.sh index 18a92d3..32edbbf 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -57,6 +57,10 @@ apt install -y \ nodejs npm \ wireguard wireguard-tools \ openssh-server \ + libheif-examples imagemagick \ + pipx \ + zoxide \ + micro \ libreoffice libreoffice-l10n-de \ thunderbird thunderbird-locale-de \ keepassxc \ @@ -99,16 +103,17 @@ ok "Brave installiert" # ── 5. Konfigurationsdateien ───────────────────────────────────────────── echo -e "\n=== 5/10 Systemkonfigurationen ===" -# Tastaturbelegung +# Tastaturbelegung (mac_nodeadkeys: @=Alt+L, |=Alt+7, wie auf dem Mac) tee /etc/default/keyboard > /dev/null </dev/null || true -# Fn-Tasten -echo 'options hid_apple fnmode=2' | tee /etc/modprobe.d/hid_apple.conf > /dev/null +# Fn-Tasten + ISO-Layout-Fix (iso_layout=0 verhindert ^/< Vertauschung) +echo 'options hid_apple fnmode=2 iso_layout=0' | tee /etc/modprobe.d/hid_apple.conf > /dev/null # mbpfan (modellabhängig) wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" @@ -213,6 +218,12 @@ else ok "mbpfan, thermald, tlp, ssh aktiviert (Start nach Reboot)" fi +# ── cloud-init deaktivieren (kein Cloud-Provider, blockiert sonst den Boot) ── +if command -v cloud-init &>/dev/null; then + touch /etc/cloud/cloud-init.disabled + ok "cloud-init deaktiviert" +fi + # ── zsh als Standard-Shell für rene ────────────────────────────────────── chsh -s /bin/zsh rene 2>/dev/null || true diff --git a/setup-desktop.sh b/setup-desktop.sh index 3b2efba..b23efd8 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -1,6 +1,6 @@ #!/bin/bash # macbook-setup/setup-desktop.sh -# Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE-Einstellungen +# Desktop-Setup: oh-my-zsh, Zsh-Tooling, Claude Code, PrusaSlicer, Dotfiles, XFCE # Braucht eine laufende Desktop-Session (XFCE) — NICHT in chroot ausführen! # Verwendung: bash setup-desktop.sh # Wird automatisch beim ersten Login gestartet (via Autostart) @@ -24,22 +24,55 @@ echo " setup-desktop.sh startet" echo "════════════════════════════════════════════" # ── 1. oh-my-zsh ──────────────────────────────────────────────────────── -echo -e "\n=== 1/5 oh-my-zsh ===" +echo -e "\n=== 1/8 oh-my-zsh ===" if [[ ! -d ~/.oh-my-zsh ]]; then sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended fi ok "oh-my-zsh installiert" -# ── 2. npm global + Claude Code ───────────────────────────────────────── -echo -e "\n=== 2/5 Claude Code ===" +# ── 2. Zsh-Plugins & Powerlevel10k ────────────────────────────────────── +echo -e "\n=== 2/8 Zsh-Plugins & Powerlevel10k ===" + +# zsh-syntax-highlighting (Submodule im Dotfiles-Repo ist leer) +ZSH_SHL_DIR="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" +if [[ ! -d "$ZSH_SHL_DIR/.git" ]]; then + rm -rf "$ZSH_SHL_DIR" + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_SHL_DIR" +fi +ok "zsh-syntax-highlighting" + +# Powerlevel10k (Submodule im Dotfiles-Repo ist leer) +P10K_DIR="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" +if [[ ! -d "$P10K_DIR/.git" ]]; then + rm -rf "$P10K_DIR" + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$P10K_DIR" +fi +ok "Powerlevel10k" + +# ── 3. MesloLGS NF Font (Powerlevel10k-Icons) ─────────────────────────── +echo -e "\n=== 3/8 MesloLGS NF Font ===" +FONT_DIR="$HOME/.local/share/fonts" +mkdir -p "$FONT_DIR" +FONT_BASE="https://github.com/romkatv/powerlevel10k-media/raw/master" +for font in "MesloLGS NF Regular.ttf" "MesloLGS NF Bold.ttf" \ + "MesloLGS NF Italic.ttf" "MesloLGS NF Bold Italic.ttf"; do + if [[ ! -f "$FONT_DIR/$font" ]]; then + curl -fsSL -o "$FONT_DIR/$font" "$FONT_BASE/${font// /%20}" + fi +done +fc-cache -f "$FONT_DIR" 2>/dev/null || true +ok "MesloLGS NF Fonts installiert" + +# ── 4. npm global + Claude Code ───────────────────────────────────────── +echo -e "\n=== 4/8 Claude Code ===" mkdir -p ~/.npm-global npm config set prefix '~/.npm-global' export PATH="$HOME/.npm-global/bin:$PATH" npm install -g @anthropic-ai/claude-code ok "Claude Code installiert" -# ── 3. PrusaSlicer (Flatpak) ────────────────────────────────────────────── -echo -e "\n=== 3/5 PrusaSlicer ===" +# ── 5. PrusaSlicer (Flatpak) ──────────────────────────────────────────── +echo -e "\n=== 5/8 PrusaSlicer ===" if ! command -v flatpak &>/dev/null; then sudo apt install -y flatpak fi @@ -47,8 +80,16 @@ flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flath flatpak install --user -y flathub com.prusa3d.PrusaSlicer ok "PrusaSlicer installiert (Flatpak)" -# ── 4. Dot-Files ──────────────────────────────────────────────────────── -echo -e "\n=== 4/5 Dot-Files ===" +# ── 6. PlatformIO (pipx) ──────────────────────────────────────────────── +echo -e "\n=== 6/8 PlatformIO ===" +if ! command -v pio &>/dev/null; then + pipx install platformio + pipx ensurepath +fi +ok "PlatformIO installiert (pipx)" + +# ── 7. Dot-Files ──────────────────────────────────────────────────────── +echo -e "\n=== 7/8 Dot-Files ===" DOTFILES_DIR="$HOME/git-projekte/dotfiles-rene" if [[ ! -d "$DOTFILES_DIR" ]]; then mkdir -p "$HOME/git-projekte" @@ -67,51 +108,158 @@ if [[ -f "$DOTFILES_DIR/micro/install-micro-dotfiles.sh" ]]; then ok "Dot-Files: micro" fi -# oh-my-zsh custom (Plugins, Themes, Aliase) +# oh-my-zsh custom (platformio.zsh etc.) if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom" ]] && [[ -d ~/.oh-my-zsh/custom ]]; then for f in "$DOTFILES_DIR/oh-my-zsh/custom"/*.zsh; do [[ -f "$f" ]] && ln -sf "$f" ~/.oh-my-zsh/custom/ done - # Custom Plugins - if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/plugins" ]]; then - for plugin_dir in "$DOTFILES_DIR/oh-my-zsh/custom/plugins"/*/; do - plugin_name=$(basename "$plugin_dir") - ln -sfn "$plugin_dir" ~/.oh-my-zsh/custom/plugins/"$plugin_name" - done - fi - # Custom Themes - if [[ -d "$DOTFILES_DIR/oh-my-zsh/custom/themes" ]]; then - for theme_dir in "$DOTFILES_DIR/oh-my-zsh/custom/themes"/*/; do - theme_name=$(basename "$theme_dir") - ln -sfn "$theme_dir" ~/.oh-my-zsh/custom/themes/"$theme_name" - done - fi ok "Dot-Files: oh-my-zsh custom" fi # heic-scripts nach ~/bin +mkdir -p ~/bin if [[ -d "$DOTFILES_DIR/heic-scripts" ]]; then - mkdir -p ~/bin for script in "$DOTFILES_DIR/heic-scripts"/*; do - [[ -f "$script" ]] && ln -sf "$script" ~/bin/ + [[ -f "$script" ]] && chmod +x "$script" && ln -sf "$script" ~/bin/ done ok "Dot-Files: heic-scripts → ~/bin" fi -# ── 5. XFCE Energieeinstellungen ──────────────────────────────────────── -echo -e "\n=== 5/5 XFCE Energieeinstellungen ===" +# git-check-all.sh + git-update-all.sh nach ~/ +if [[ -d "$DOTFILES_DIR/bin" ]]; then + for script in "$DOTFILES_DIR/bin"/*; do + [[ -f "$script" ]] && chmod +x "$script" && ln -sf "$script" ~/ + done + ok "Dot-Files: git-check-all.sh, git-update-all.sh → ~/" +fi + +# .zshrc (Linux-Version, ohne Conda/LM Studio/iTerm2) +cat > ~/.zshrc <<'ZSHEOF' +# ---------------------------------------------------------- +# Zsh-Konfiguration fuer Rene (Linux / MacBook Pro) +# Oh My Zsh + Powerlevel10k + Micro +# ---------------------------------------------------------- + +# 1) Powerlevel10k Instant Prompt (muss sehr weit oben stehen) +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# 2) Oh My Zsh Basis +export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="powerlevel10k/powerlevel10k" + +plugins=( + git + zsh-syntax-highlighting + zoxide +) + +source "$ZSH/oh-my-zsh.sh" + +# 3) Powerlevel10k-Konfiguration +[[ -f "$HOME/.p10k.zsh" ]] && source "$HOME/.p10k.zsh" + +# 4) Standard-Editor (lokal: micro, SSH: nicht erzwingen) +if [[ -z "$SSH_CONNECTION" ]]; then + export EDITOR="micro" + export VISUAL="micro" +fi + +# 5) Pfade +export PATH="$HOME/bin:$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" + +# 6) Aliases + +# ls-Varianten +alias ll='ls -lha' +alias la='ls -A' +alias l='ls -lh' + +# Verzeichnisse +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' + +# Konfigdateien +alias zshconfig='micro ~/.zshrc' +alias p10kconfig='micro ~/.p10k.zsh' + +# Git-Kurzbefehle +alias gs='git status' +alias ga='git add' +alias gc='git commit' +alias gp='git push' +alias gl='git log --oneline --graph --decorate' +alias gitcheck="~/git-check-all.sh --short" +alias gitupdate="~/git-update-all.sh" + +# 7) History +HISTFILE="$HOME/.zsh_history" +HISTSIZE=5000 +SAVEHIST=5000 +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_SPACE +setopt SHARE_HISTORY + +# 8) Zsh-Optionen +setopt AUTO_CD + +# 9) Fenster-/Tab-Titel +precmd() { print -Pn "\e]0;%n@%m: %~\a" } +export COLORTERM=truecolor +ZSHEOF +ok "Dot-Files: .zshrc" + +# .p10k.zsh (vom Mac kopieren, falls im Repo vorhanden, sonst Wizard beim ersten Start) +if [[ -f "$DOTFILES_DIR/.p10k.zsh" ]]; then + cp "$DOTFILES_DIR/.p10k.zsh" ~/.p10k.zsh + ok "Dot-Files: .p10k.zsh" +else + warn ".p10k.zsh nicht im Dotfiles-Repo — beim ersten zsh-Start 'p10k configure' ausfuehren" +fi + +# ── 8. XFCE-Einstellungen ─────────────────────────────────────────────── +echo -e "\n=== 8/8 XFCE-Einstellungen ===" + +# Keyboard: XFCE soll /etc/default/keyboard respektieren (nicht eigenes Layout erzwingen) +if command -v xfconf-query &>/dev/null; then + xfconf-query -c keyboard-layout -p /Default/XkbDisable -n -t bool -s true 2>/dev/null || true + ok "XFCE Keyboard: System-Layout wird verwendet" +fi + +# Energieeinstellungen if command -v xfconf-query &>/dev/null; then xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off -s 0 --create -t int xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep -s 0 --create -t int xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create -t int - xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 10 --create -t int - xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 10 --create -t int - xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 10 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 5 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 6 --create -t int + xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 7 --create -t int ok "XFCE Power Manager konfiguriert" else warn "xfconf-query nicht gefunden — XFCE Energieeinstellungen übersprungen" fi +# XFCE Terminal: MesloLGS NF als Schriftart setzen +XFCE_TERM_RC="$HOME/.config/xfce4/terminal/terminalrc" +if [[ -d "$HOME/.config/xfce4" ]]; then + mkdir -p "$(dirname "$XFCE_TERM_RC")" + if [[ -f "$XFCE_TERM_RC" ]]; then + sed -i 's/^FontName=.*/FontName=MesloLGS NF 11/' "$XFCE_TERM_RC" 2>/dev/null || true + else + cat > "$XFCE_TERM_RC" <<'TERMEOF' +[Configuration] +FontName=MesloLGS NF 11 +MiscAlwaysShowTabs=FALSE +MiscBell=FALSE +MiscDefaultGeometry=120x35 +ScrollingBar=TERMINAL_SCROLLBAR_NONE +TERMEOF + fi + ok "XFCE Terminal: MesloLGS NF Schriftart" +fi + # ── Autostart entfernen ───────────────────────────────────────────────── AUTOSTART_FILE="$HOME/.config/autostart/macbook-setup-desktop.desktop" if [[ -f "$AUTOSTART_FILE" ]]; then @@ -131,3 +279,4 @@ echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-qu echo " 2. Synology Drive Client installieren (.deb von synology.com)" echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" echo " 4. Brave starten → Synchronisation einrichten" +echo " 5. Falls p10k-Icons fehlen: Terminal-Schriftart auf 'MesloLGS NF' setzen" diff --git a/user-data b/user-data index 4b23e6c..08668d0 100644 --- a/user-data +++ b/user-data @@ -4,7 +4,7 @@ autoinstall: locale: de_DE.UTF-8 keyboard: layout: de - variant: mac + variant: mac_nodeadkeys identity: hostname: m16 username: rene From 8475f329d41e2cf57ef19e28e98a9b82535f5dd5 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 20:06:03 +0100 Subject: [PATCH 039/122] Fix Autoinstall: Subiquity-Weg statt nur cloud-init NoCloud - autoinstall.yaml im ISO-Root (direkter Subiquity-Weg, Ubuntu 24.04+) - Kernel-Parameter subiquity.autoinstallpath als Backup - NoCloud ds=nocloud + cloud-config-url=/dev/null als Fallback Ubuntu 24.04 Subiquity sucht in dieser Reihenfolge: 1. subiquity.autoinstallpath= (Kernel-Parameter) 2. Root des Installationssystems 3. cloud-config (cloud-init) 4. Root des Installationsmediums (autoinstall.yaml) Co-Authored-By: Claude Opus 4.6 --- build-iso.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index b0a9c53..4747423 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -60,10 +60,17 @@ fi # ── Autoinstall-Dateien vorbereiten ────────────────────────────────────── echo -e "\n=== Autoinstall-Dateien vorbereiten ===" TMPDIR=$(mktemp -d) + +# NoCloud-Verzeichnis (Fallback für cloud-init) mkdir -p "$TMPDIR/autoinstall" cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall/" cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" -ok "user-data und meta-data bereit" + +# autoinstall.yaml im ISO-Root (direkter Subiquity-Weg, Ubuntu 24.04+) +# Subiquity sucht im Root des Installationsmediums nach autoinstall.yaml +grep -v '^#cloud-config' "$SCRIPT_DIR/user-data" | \ + sed 's/^autoinstall://' | sed 's/^ //' > "$TMPDIR/autoinstall.yaml" +ok "user-data und autoinstall.yaml bereit" # ── WireGuard-Config einbetten ──────────────────────────────────────────── echo -e "\n=== WireGuard-Config ===" @@ -100,7 +107,7 @@ set timeout=10 menuentry "Ubuntu MacBook AutoInstall" { set gfxpayload=keep - linux /casper/vmlinuz quiet autoinstall cloud-config-url=/dev/null ds=nocloud\;s=/cdrom/autoinstall/ --- + linux /casper/vmlinuz quiet autoinstall subiquity.autoinstallpath=/cdrom/autoinstall.yaml cloud-config-url=/dev/null ds=nocloud\;s=/cdrom/autoinstall/ --- initrd /casper/initrd } @@ -116,6 +123,7 @@ cp "$UBUNTU_ISO" "$OUTPUT_ISO" xorriso -indev "$OUTPUT_ISO" \ -outdev "$OUTPUT_ISO" \ -map "$TMPDIR/autoinstall" /autoinstall \ + -map "$TMPDIR/autoinstall.yaml" /autoinstall.yaml \ -map "$TMPDIR/grub-new.cfg" /boot/grub/grub.cfg \ -boot_image any replay \ -commit From 35ed5e2bd29a69e074f886f9dc4ea6e1020ee152 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 20:06:03 +0100 Subject: [PATCH 040/122] Fix Autoinstall: Subiquity-Weg statt nur cloud-init NoCloud - autoinstall.yaml im ISO-Root (direkter Subiquity-Weg, Ubuntu 24.04+) - Kernel-Parameter subiquity.autoinstallpath als Backup - NoCloud ds=nocloud + cloud-config-url=/dev/null als Fallback Ubuntu 24.04 Subiquity sucht in dieser Reihenfolge: 1. subiquity.autoinstallpath= (Kernel-Parameter) 2. Root des Installationssystems 3. cloud-config (cloud-init) 4. Root des Installationsmediums (autoinstall.yaml) --- build-iso.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index b0a9c53..4747423 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -60,10 +60,17 @@ fi # ── Autoinstall-Dateien vorbereiten ────────────────────────────────────── echo -e "\n=== Autoinstall-Dateien vorbereiten ===" TMPDIR=$(mktemp -d) + +# NoCloud-Verzeichnis (Fallback für cloud-init) mkdir -p "$TMPDIR/autoinstall" cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall/" cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" -ok "user-data und meta-data bereit" + +# autoinstall.yaml im ISO-Root (direkter Subiquity-Weg, Ubuntu 24.04+) +# Subiquity sucht im Root des Installationsmediums nach autoinstall.yaml +grep -v '^#cloud-config' "$SCRIPT_DIR/user-data" | \ + sed 's/^autoinstall://' | sed 's/^ //' > "$TMPDIR/autoinstall.yaml" +ok "user-data und autoinstall.yaml bereit" # ── WireGuard-Config einbetten ──────────────────────────────────────────── echo -e "\n=== WireGuard-Config ===" @@ -100,7 +107,7 @@ set timeout=10 menuentry "Ubuntu MacBook AutoInstall" { set gfxpayload=keep - linux /casper/vmlinuz quiet autoinstall cloud-config-url=/dev/null ds=nocloud\;s=/cdrom/autoinstall/ --- + linux /casper/vmlinuz quiet autoinstall subiquity.autoinstallpath=/cdrom/autoinstall.yaml cloud-config-url=/dev/null ds=nocloud\;s=/cdrom/autoinstall/ --- initrd /casper/initrd } @@ -116,6 +123,7 @@ cp "$UBUNTU_ISO" "$OUTPUT_ISO" xorriso -indev "$OUTPUT_ISO" \ -outdev "$OUTPUT_ISO" \ -map "$TMPDIR/autoinstall" /autoinstall \ + -map "$TMPDIR/autoinstall.yaml" /autoinstall.yaml \ -map "$TMPDIR/grub-new.cfg" /boot/grub/grub.cfg \ -boot_image any replay \ -commit From c0e934f8e7e1aca376b87118809b0bc6740b8e60 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 20:28:05 +0100 Subject: [PATCH 041/122] Fix autoinstall.yaml: user-data 1:1 kopieren statt sed-Transformation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die sed-Transformation hat die YAML-Struktur zerstört — Heredoc-Zeilen im late-commands Block ([Desktop Entry] etc.) landeten auf Spalte 0 und brachen den YAML-Parser. user-data direkt als autoinstall.yaml verwenden, #cloud-config ist ein YAML-Kommentar und autoinstall: als Top-Level-Key wird von Subiquity 24.04 unterstützt. Co-Authored-By: Claude Opus 4.6 --- build-iso.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index 4747423..d8a42ab 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -68,8 +68,8 @@ cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" # autoinstall.yaml im ISO-Root (direkter Subiquity-Weg, Ubuntu 24.04+) # Subiquity sucht im Root des Installationsmediums nach autoinstall.yaml -grep -v '^#cloud-config' "$SCRIPT_DIR/user-data" | \ - sed 's/^autoinstall://' | sed 's/^ //' > "$TMPDIR/autoinstall.yaml" +# Datei 1:1 kopieren — #cloud-config ist ein YAML-Kommentar, autoinstall: Top-Level-Key wird unterstützt +cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall.yaml" ok "user-data und autoinstall.yaml bereit" # ── WireGuard-Config einbetten ──────────────────────────────────────────── From 4e955bea7eaacdea4b9fa7e8914243530b3cd402 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 20:28:05 +0100 Subject: [PATCH 042/122] Fix autoinstall.yaml: user-data 1:1 kopieren statt sed-Transformation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die sed-Transformation hat die YAML-Struktur zerstört — Heredoc-Zeilen im late-commands Block ([Desktop Entry] etc.) landeten auf Spalte 0 und brachen den YAML-Parser. user-data direkt als autoinstall.yaml verwenden, #cloud-config ist ein YAML-Kommentar und autoinstall: als Top-Level-Key wird von Subiquity 24.04 unterstützt. --- build-iso.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index 4747423..d8a42ab 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -68,8 +68,8 @@ cp "$SCRIPT_DIR/meta-data" "$TMPDIR/autoinstall/" # autoinstall.yaml im ISO-Root (direkter Subiquity-Weg, Ubuntu 24.04+) # Subiquity sucht im Root des Installationsmediums nach autoinstall.yaml -grep -v '^#cloud-config' "$SCRIPT_DIR/user-data" | \ - sed 's/^autoinstall://' | sed 's/^ //' > "$TMPDIR/autoinstall.yaml" +# Datei 1:1 kopieren — #cloud-config ist ein YAML-Kommentar, autoinstall: Top-Level-Key wird unterstützt +cp "$SCRIPT_DIR/user-data" "$TMPDIR/autoinstall.yaml" ok "user-data und autoinstall.yaml bereit" # ── WireGuard-Config einbetten ──────────────────────────────────────────── From 193d2bc496fa9826f553546ef2283eb3adcc2d6f Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 20:39:59 +0100 Subject: [PATCH 043/122] Fix user-data YAML: Heredoc durch printf ersetzen Der Bash-Heredoc < --- user-data | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/user-data b/user-data index 08668d0..162d78b 100644 --- a/user-data +++ b/user-data @@ -25,13 +25,6 @@ autoinstall: - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 16' # Desktop-Setup als Firstboot-Autostart einrichten - curtin in-target --target=/target -- mkdir -p /home/rene/.config/autostart - - curtin in-target --target=/target -- bash -c 'cat > /home/rene/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; exec xfce4-terminal -e \"bash -c less /tmp/setup-desktop.log\"" -Hidden=false -X-GNOME-Autostart-enabled=true -AUTOSTART' + - curtin in-target --target=/target -- bash -c 'printf "[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c \"curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log\"\nHidden=false\nX-GNOME-Autostart-enabled=true\n" > /home/rene/.config/autostart/macbook-setup-desktop.desktop' - curtin in-target --target=/target -- chown -R 1000:1000 /home/rene/.config # Fuer MBP 16": oben "13" durch "16" ersetzen From a511ff48d7c7b03a260522923947610826f425e1 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 20:39:59 +0100 Subject: [PATCH 044/122] Fix user-data YAML: Heredoc durch printf ersetzen Der Bash-Heredoc < /home/rene/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; exec xfce4-terminal -e \"bash -c less /tmp/setup-desktop.log\"" -Hidden=false -X-GNOME-Autostart-enabled=true -AUTOSTART' + - curtin in-target --target=/target -- bash -c 'printf "[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c \"curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log\"\nHidden=false\nX-GNOME-Autostart-enabled=true\n" > /home/rene/.config/autostart/macbook-setup-desktop.desktop' - curtin in-target --target=/target -- chown -R 1000:1000 /home/rene/.config # Fuer MBP 16": oben "13" durch "16" ersetzen From 4f6320870bf2387c1d8eac2a780fa69aefa0761e Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 21:08:55 +0100 Subject: [PATCH 045/122] Autoinstall: late-commands reduzieren (kein Netzwerk im Installer) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Broadcom-WLAN hat keinen Treiber in der Live-Umgebung, daher schlagen alle Netzwerk-abhängigen late-commands fehl. Nur noch usermod -aG sudo rene als late-command. setup-base.sh und setup-desktop.sh werden nach manueller WLAN-Einrichtung gestartet. Co-Authored-By: Claude Opus 4.6 --- user-data | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/user-data b/user-data index 162d78b..3932e18 100644 --- a/user-data +++ b/user-data @@ -17,14 +17,3 @@ autoinstall: late-commands: # User rene zur sudo-Gruppe hinzufuegen - curtin in-target --target=/target -- usermod -aG sudo rene - # WireGuard-Config vom Installationsmedium kopieren (falls vorhanden) - - bash -c 'if [ -f /cdrom/autoinstall/wg0.conf ]; then mkdir -p /target/etc/wireguard && cp /cdrom/autoinstall/wg0.conf /target/etc/wireguard/wg0.conf && chmod 600 /target/etc/wireguard/wg0.conf; fi' - # WireGuard beim Boot aktivieren - - curtin in-target --target=/target -- bash -c 'if [ -f /etc/wireguard/wg0.conf ]; then systemctl enable wg-quick@wg0; fi' - # System-Setup in chroot (Pakete, Configs, Locale, Services) - - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 16' - # Desktop-Setup als Firstboot-Autostart einrichten - - curtin in-target --target=/target -- mkdir -p /home/rene/.config/autostart - - curtin in-target --target=/target -- bash -c 'printf "[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c \"curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log\"\nHidden=false\nX-GNOME-Autostart-enabled=true\n" > /home/rene/.config/autostart/macbook-setup-desktop.desktop' - - curtin in-target --target=/target -- chown -R 1000:1000 /home/rene/.config - # Fuer MBP 16": oben "13" durch "16" ersetzen From fffed907353c90e2e455c918e8f207f207958b57 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 21:08:55 +0100 Subject: [PATCH 046/122] Autoinstall: late-commands reduzieren (kein Netzwerk im Installer) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Broadcom-WLAN hat keinen Treiber in der Live-Umgebung, daher schlagen alle Netzwerk-abhängigen late-commands fehl. Nur noch usermod -aG sudo rene als late-command. setup-base.sh und setup-desktop.sh werden nach manueller WLAN-Einrichtung gestartet. --- user-data | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/user-data b/user-data index 162d78b..3932e18 100644 --- a/user-data +++ b/user-data @@ -17,14 +17,3 @@ autoinstall: late-commands: # User rene zur sudo-Gruppe hinzufuegen - curtin in-target --target=/target -- usermod -aG sudo rene - # WireGuard-Config vom Installationsmedium kopieren (falls vorhanden) - - bash -c 'if [ -f /cdrom/autoinstall/wg0.conf ]; then mkdir -p /target/etc/wireguard && cp /cdrom/autoinstall/wg0.conf /target/etc/wireguard/wg0.conf && chmod 600 /target/etc/wireguard/wg0.conf; fi' - # WireGuard beim Boot aktivieren - - curtin in-target --target=/target -- bash -c 'if [ -f /etc/wireguard/wg0.conf ]; then systemctl enable wg-quick@wg0; fi' - # System-Setup in chroot (Pakete, Configs, Locale, Services) - - curtin in-target --target=/target -- bash -c 'curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | bash -s -- 16' - # Desktop-Setup als Firstboot-Autostart einrichten - - curtin in-target --target=/target -- mkdir -p /home/rene/.config/autostart - - curtin in-target --target=/target -- bash -c 'printf "[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c \"curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log\"\nHidden=false\nX-GNOME-Autostart-enabled=true\n" > /home/rene/.config/autostart/macbook-setup-desktop.desktop' - - curtin in-target --target=/target -- chown -R 1000:1000 /home/rene/.config - # Fuer MBP 16": oben "13" durch "16" ersetzen From c6ba3d92120376d90e88fe0c0a7591dc76eee508 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 21:09:35 +0100 Subject: [PATCH 047/122] Fix build-iso.sh: Modell aus Hostname ableiten statt aus late-commands Co-Authored-By: Claude Opus 4.6 --- build-iso.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index d8a42ab..2bca40f 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -20,10 +20,11 @@ echo " macbook-setup ISO Builder ($OS)" echo "════════════════════════════════════════════" # ── Modell aus user-data erkennen ────────────────────────────────────────── -MODEL=$(grep -o 'setup-base.sh | bash -s -- [0-9]*' "$SCRIPT_DIR/user-data" | grep -o '[0-9]*$') HOSTNAME=$(grep 'hostname:' "$SCRIPT_DIR/user-data" | awk '{print $2}') -if [[ -z "$MODEL" ]]; then - err "Konnte Modell nicht aus user-data ermitteln" +# Modell aus Hostname ableiten: m13 → 13, m16 → 16 +MODEL=$(echo "$HOSTNAME" | grep -o '[0-9]*') +if [[ -z "$MODEL" || -z "$HOSTNAME" ]]; then + err "Konnte Modell/Hostname nicht aus user-data ermitteln (hostname: m13 oder m16)" fi ok "Modell: MBP $MODEL\" (Hostname: $HOSTNAME)" From 6f48c7fc3b3da10ac2574c44cbd82c1a8e48b928 Mon Sep 17 00:00:00 2001 From: rene Date: Mon, 9 Mar 2026 21:09:35 +0100 Subject: [PATCH 048/122] Fix build-iso.sh: Modell aus Hostname ableiten statt aus late-commands --- build-iso.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-iso.sh b/build-iso.sh index d8a42ab..2bca40f 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -20,10 +20,11 @@ echo " macbook-setup ISO Builder ($OS)" echo "════════════════════════════════════════════" # ── Modell aus user-data erkennen ────────────────────────────────────────── -MODEL=$(grep -o 'setup-base.sh | bash -s -- [0-9]*' "$SCRIPT_DIR/user-data" | grep -o '[0-9]*$') HOSTNAME=$(grep 'hostname:' "$SCRIPT_DIR/user-data" | awk '{print $2}') -if [[ -z "$MODEL" ]]; then - err "Konnte Modell nicht aus user-data ermitteln" +# Modell aus Hostname ableiten: m13 → 13, m16 → 16 +MODEL=$(echo "$HOSTNAME" | grep -o '[0-9]*') +if [[ -z "$MODEL" || -z "$HOSTNAME" ]]; then + err "Konnte Modell/Hostname nicht aus user-data ermitteln (hostname: m13 oder m16)" fi ok "Modell: MBP $MODEL\" (Hostname: $HOSTNAME)" From 7078299ac6ac1760c63bb1ede50016faa00c28e5 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 06:06:01 +0100 Subject: [PATCH 049/122] Robusteres setup-base.sh: GPU-Fix zuerst, kein set -e, idempotent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set -e entfernt (Script bricht nicht mehr bei einzelnen Fehlern ab) - GPU-Blacklist + hid_apple + Keyboard als SCHRITT 1 (vor apt install) - dpkg --configure -a VOR Paketinstallation (repariert unterbrochene Installs) - update-initramfs direkt nach Hardware-Fixes - cloud-init früh deaktivieren - Fehlerbehandlung mit || warn/fail statt Abbruch - Zusammenfassung am Ende mit nächsten Schritten Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 191 +++++++++++++++++++++++++++----------------------- 1 file changed, 102 insertions(+), 89 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 32edbbf..3bdf594 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -1,10 +1,9 @@ #!/bin/bash # macbook-setup/setup-base.sh # System-Setup: Pakete, Konfiguration, Locale, Services -# Funktioniert in chroot (Autoinstall late-commands) UND standalone -# Verwendung: sudo bash setup-base.sh [13|16] +# Verwendung: curl ... | sudo bash -s -- 16 +# Kann mehrfach ausgeführt werden (idempotent) -set -e FORGEJO="https://git.motocamp.de" SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" @@ -12,7 +11,7 @@ SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } warn() { echo -e "${YELLOW}⚠ $*${NC}"; } -err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +fail() { echo -e "${RED}✗ $*${NC}"; } # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then @@ -23,7 +22,7 @@ else echo " 13 = MBP 13\" Late 2013" echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" read -rp "Modell [13/16]: " MODEL - [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && { fail "Ungültiges Modell: $MODEL"; exit 1; } fi ok "Modell: MacBook Pro $MODEL\"" @@ -32,18 +31,62 @@ echo "════════════════════════ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" -# ── 0. Sleep/Suspend verhindern während Installation ───────────────────── -echo -e "\n=== 0/10 Sleep verhindern ===" +# ── 1. Kritische Hardware-Fixes ZUERST (vor allem anderen) ─────────────── +echo -e "\n=== 1/11 Hardware-Fixes ===" + +# GPU: AMD Radeon blacklisten (MBP 16") +if [[ "$MODEL" == "16" ]]; then + cat > /etc/modprobe.d/blacklist-radeon.conf < /etc/modprobe.d/hid_apple.conf +ok "hid_apple: fnmode=2, iso_layout=0" + +# Tastaturbelegung (mac_nodeadkeys: @=Alt+L, |=Alt+7, wie auf dem Mac) +cat > /etc/default/keyboard </dev/null || true +ok "Tastatur: mac_nodeadkeys" + +# cloud-init deaktivieren (blockiert Boot ohne Cloud-Provider) +if command -v cloud-init &>/dev/null; then + touch /etc/cloud/cloud-init.disabled + ok "cloud-init deaktiviert" +fi + +# initramfs aktualisieren (GPU-Blacklist + hid_apple wirksam machen) +update-initramfs -u 2>/dev/null || true +ok "initramfs aktualisiert" + +# ── 2. Sleep/Suspend verhindern während Installation ───────────────────── +echo -e "\n=== 2/11 Sleep verhindern ===" systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true ok "Sleep/Suspend deaktiviert (für Installation)" -# ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/10 System aktualisieren ===" -apt update && apt upgrade -y +# ── 3. Eventuelle unterbrochene Installationen reparieren ──────────────── +echo -e "\n=== 3/11 dpkg reparieren ===" +dpkg --configure -a 2>/dev/null || true +apt install -f -y 2>/dev/null || true +ok "dpkg/apt repariert" + +# ── 4. System aktualisieren ────────────────────────────────────────────── +echo -e "\n=== 4/11 System aktualisieren ===" +apt update && apt upgrade -y || warn "apt upgrade hatte Probleme" ok "System aktuell" -# ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/10 Pakete installieren ===" +# ── 5. Pakete installieren ─────────────────────────────────────────────── +echo -e "\n=== 5/11 Pakete installieren ===" apt install -y \ xubuntu-desktop \ bcmwl-kernel-source \ @@ -70,69 +113,42 @@ apt install -y \ language-pack-de \ wngerman \ bc \ - xfce4-terminal + xfce4-terminal \ +|| { fail "apt install fehlgeschlagen"; dpkg --configure -a; apt install -f -y; } ok "Pakete installiert (apt)" -# FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) -snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen (chroot)" +# FreeCAD via Snap +snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen" -# ── 3. GPU-Konfiguration ──────────────────────────────────────────────── -if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/10 AMD Radeon blacklisten (MBP 16\") ===" - # MBP 15" Mid 2014 hat Intel HD 5200 + AMD Radeon R9 M370X - # Radeon verursacht Grafikartefakte — nur Intel-GPU nutzen - cat > /etc/modprobe.d/blacklist-radeon.conf < /dev/null </dev/null || true - -# Fn-Tasten + ISO-Layout-Fix (iso_layout=0 verhindert ^/< Vertauschung) -echo 'options hid_apple fnmode=2 iso_layout=0' | tee /etc/modprobe.d/hid_apple.conf > /dev/null +# ── 7. Systemkonfigurationen ───────────────────────────────────────────── +echo -e "\n=== 7/11 Systemkonfigurationen ===" # mbpfan (modellabhängig) -wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" -cp /tmp/mbpfan.conf /etc/mbpfan.conf +wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" && \ + cp /tmp/mbpfan.conf /etc/mbpfan.conf || warn "mbpfan.conf Download fehlgeschlagen" # Temperatur-Watch-Skript -wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" -chmod +x /usr/local/bin/temp-watch.sh +wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" && \ + chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" -update-initramfs -u ok "Systemkonfigurationen gesetzt" -# ── 6. XFCE-Konfiguration (MBP 16": Compositor aus, Display-Skalierung) ─ +# ── 8. XFCE-Konfiguration (MBP 16": Compositor aus, Display-Skalierung) ─ if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 6/10 XFCE-Konfiguration (MBP 16\") ===" + echo -e "\n=== 8/11 XFCE-Konfiguration (MBP 16\") ===" XFCE_XML_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" mkdir -p "$XFCE_XML_DIR" - # Compositor deaktivieren (verursacht Probleme ohne GPU-Beschleunigung) + # Compositor deaktivieren cat > "$XFCE_XML_DIR/xfwm4.xml" < @@ -142,7 +158,7 @@ if [[ "$MODEL" == "16" ]]; then XFEOF - # Display-Skalierung für Retina (2x, DPI 168) + # Display-Skalierung für Retina (2x, DPI 128) cat > "$XFCE_XML_DIR/xsettings.xml" < @@ -155,18 +171,18 @@ XFEOF XSEOF - # xfce4-display-settings deaktivieren (öffnet sich sonst in Endlosschleife) - dpkg-divert --local --rename --divert /usr/bin/xfce4-display-settings.real /usr/bin/xfce4-display-settings + # xfce4-display-settings deaktivieren (Endlosschleife) + dpkg-divert --local --rename --divert /usr/bin/xfce4-display-settings.real /usr/bin/xfce4-display-settings 2>/dev/null || true ln -sf /usr/bin/true /usr/bin/xfce4-display-settings chown -R 1000:1000 /home/rene/.config/xfce4 ok "XFCE: Compositor aus, Retina-Skalierung, Display-Settings deaktiviert" else - echo -e "\n=== 6/10 XFCE-Konfiguration — Standard (MBP 13\") ===" + echo -e "\n=== 8/11 XFCE-Konfiguration — Standard (MBP 13\") ===" fi -# ── 7. Netzwerk: NetworkManager statt netplan ───────────────────────────── -echo -e "\n=== 7/10 Netzwerk ===" +# ── 9. Netzwerk: NetworkManager statt netplan ───────────────────────────── +echo -e "\n=== 9/11 Netzwerk ===" cat > /etc/netplan/01-network-manager.yaml </dev/null || true systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" -# ── 8. Energieeinstellungen (systemd) ──────────────────────────────────── -echo -e "\n=== 8/10 Energieeinstellungen ===" +# ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── +echo -e "\n=== 10/11 Energie & Lokalisierung ===" tee /etc/systemd/sleep.conf > /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime -ok "Lokalisierung: Deutsch / Berlin" +ok "Energie & Lokalisierung gesetzt" -# ── 10. Services aktivieren ────────────────────────────────────────────── -echo -e "\n=== 10/10 Services aktivieren ===" -systemctl enable mbpfan -systemctl enable thermald -systemctl enable tlp -systemctl enable ssh -# --now nur wenn nicht in chroot +# ── 11. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 11/11 Services & Shell ===" +systemctl enable mbpfan 2>/dev/null || true +systemctl enable thermald 2>/dev/null || true +systemctl enable tlp 2>/dev/null || true +systemctl enable ssh 2>/dev/null || true + +# Services starten (nur wenn nicht in chroot) if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; then - systemctl start mbpfan - systemctl start thermald - systemctl start ssh + systemctl start mbpfan 2>/dev/null || true + systemctl start thermald 2>/dev/null || true + systemctl start ssh 2>/dev/null || true sensors-detect --auto 2>/dev/null || true - ok "mbpfan, thermald, tlp, ssh aktiv (gestartet)" -else - ok "mbpfan, thermald, tlp, ssh aktiviert (Start nach Reboot)" fi -# ── cloud-init deaktivieren (kein Cloud-Provider, blockiert sonst den Boot) ── -if command -v cloud-init &>/dev/null; then - touch /etc/cloud/cloud-init.disabled - ok "cloud-init deaktiviert" -fi - -# ── zsh als Standard-Shell für rene ────────────────────────────────────── +# zsh als Standard-Shell chsh -s /bin/zsh rene 2>/dev/null || true -# ── Sleep wieder erlauben ──────────────────────────────────────────────── +# Sleep wieder erlauben systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true +ok "Services aktiviert, zsh als Standard-Shell" + +# ── Zusammenfassung ────────────────────────────────────────────────────── echo "" echo "════════════════════════════════════════════" echo -e " ${GREEN}setup-base.sh abgeschlossen!${NC}" echo "════════════════════════════════════════════" +echo "" +echo "Nächste Schritte:" +echo " 1. sudo reboot" +echo " 2. In XFCE einloggen" +echo " 3. Terminal öffnen und setup-desktop.sh starten:" +echo " curl -fsSL $SETUP_RAW/setup-desktop.sh | bash" From b0202cb28589481c43fe26b429459001ade18875 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 06:06:01 +0100 Subject: [PATCH 050/122] Robusteres setup-base.sh: GPU-Fix zuerst, kein set -e, idempotent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set -e entfernt (Script bricht nicht mehr bei einzelnen Fehlern ab) - GPU-Blacklist + hid_apple + Keyboard als SCHRITT 1 (vor apt install) - dpkg --configure -a VOR Paketinstallation (repariert unterbrochene Installs) - update-initramfs direkt nach Hardware-Fixes - cloud-init früh deaktivieren - Fehlerbehandlung mit || warn/fail statt Abbruch - Zusammenfassung am Ende mit nächsten Schritten --- setup-base.sh | 191 +++++++++++++++++++++++++++----------------------- 1 file changed, 102 insertions(+), 89 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 32edbbf..3bdf594 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -1,10 +1,9 @@ #!/bin/bash # macbook-setup/setup-base.sh # System-Setup: Pakete, Konfiguration, Locale, Services -# Funktioniert in chroot (Autoinstall late-commands) UND standalone -# Verwendung: sudo bash setup-base.sh [13|16] +# Verwendung: curl ... | sudo bash -s -- 16 +# Kann mehrfach ausgeführt werden (idempotent) -set -e FORGEJO="https://git.motocamp.de" SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" @@ -12,7 +11,7 @@ SETUP_RAW="$FORGEJO/rene/macbook-setup/raw/branch/main" RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } warn() { echo -e "${YELLOW}⚠ $*${NC}"; } -err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +fail() { echo -e "${RED}✗ $*${NC}"; } # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then @@ -23,7 +22,7 @@ else echo " 13 = MBP 13\" Late 2013" echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" read -rp "Modell [13/16]: " MODEL - [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && { fail "Ungültiges Modell: $MODEL"; exit 1; } fi ok "Modell: MacBook Pro $MODEL\"" @@ -32,18 +31,62 @@ echo "════════════════════════ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" -# ── 0. Sleep/Suspend verhindern während Installation ───────────────────── -echo -e "\n=== 0/10 Sleep verhindern ===" +# ── 1. Kritische Hardware-Fixes ZUERST (vor allem anderen) ─────────────── +echo -e "\n=== 1/11 Hardware-Fixes ===" + +# GPU: AMD Radeon blacklisten (MBP 16") +if [[ "$MODEL" == "16" ]]; then + cat > /etc/modprobe.d/blacklist-radeon.conf < /etc/modprobe.d/hid_apple.conf +ok "hid_apple: fnmode=2, iso_layout=0" + +# Tastaturbelegung (mac_nodeadkeys: @=Alt+L, |=Alt+7, wie auf dem Mac) +cat > /etc/default/keyboard </dev/null || true +ok "Tastatur: mac_nodeadkeys" + +# cloud-init deaktivieren (blockiert Boot ohne Cloud-Provider) +if command -v cloud-init &>/dev/null; then + touch /etc/cloud/cloud-init.disabled + ok "cloud-init deaktiviert" +fi + +# initramfs aktualisieren (GPU-Blacklist + hid_apple wirksam machen) +update-initramfs -u 2>/dev/null || true +ok "initramfs aktualisiert" + +# ── 2. Sleep/Suspend verhindern während Installation ───────────────────── +echo -e "\n=== 2/11 Sleep verhindern ===" systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true ok "Sleep/Suspend deaktiviert (für Installation)" -# ── 1. System aktualisieren ────────────────────────────────────────────── -echo -e "\n=== 1/10 System aktualisieren ===" -apt update && apt upgrade -y +# ── 3. Eventuelle unterbrochene Installationen reparieren ──────────────── +echo -e "\n=== 3/11 dpkg reparieren ===" +dpkg --configure -a 2>/dev/null || true +apt install -f -y 2>/dev/null || true +ok "dpkg/apt repariert" + +# ── 4. System aktualisieren ────────────────────────────────────────────── +echo -e "\n=== 4/11 System aktualisieren ===" +apt update && apt upgrade -y || warn "apt upgrade hatte Probleme" ok "System aktuell" -# ── 2. Pakete installieren ─────────────────────────────────────────────── -echo -e "\n=== 2/10 Pakete installieren ===" +# ── 5. Pakete installieren ─────────────────────────────────────────────── +echo -e "\n=== 5/11 Pakete installieren ===" apt install -y \ xubuntu-desktop \ bcmwl-kernel-source \ @@ -70,69 +113,42 @@ apt install -y \ language-pack-de \ wngerman \ bc \ - xfce4-terminal + xfce4-terminal \ +|| { fail "apt install fehlgeschlagen"; dpkg --configure -a; apt install -f -y; } ok "Pakete installiert (apt)" -# FreeCAD via Snap (nicht in Ubuntu 24.04 Repos verfügbar) -snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen (chroot)" +# FreeCAD via Snap +snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen" -# ── 3. GPU-Konfiguration ──────────────────────────────────────────────── -if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 3/10 AMD Radeon blacklisten (MBP 16\") ===" - # MBP 15" Mid 2014 hat Intel HD 5200 + AMD Radeon R9 M370X - # Radeon verursacht Grafikartefakte — nur Intel-GPU nutzen - cat > /etc/modprobe.d/blacklist-radeon.conf < /dev/null </dev/null || true - -# Fn-Tasten + ISO-Layout-Fix (iso_layout=0 verhindert ^/< Vertauschung) -echo 'options hid_apple fnmode=2 iso_layout=0' | tee /etc/modprobe.d/hid_apple.conf > /dev/null +# ── 7. Systemkonfigurationen ───────────────────────────────────────────── +echo -e "\n=== 7/11 Systemkonfigurationen ===" # mbpfan (modellabhängig) -wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" -cp /tmp/mbpfan.conf /etc/mbpfan.conf +wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" && \ + cp /tmp/mbpfan.conf /etc/mbpfan.conf || warn "mbpfan.conf Download fehlgeschlagen" # Temperatur-Watch-Skript -wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" -chmod +x /usr/local/bin/temp-watch.sh +wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" && \ + chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" -update-initramfs -u ok "Systemkonfigurationen gesetzt" -# ── 6. XFCE-Konfiguration (MBP 16": Compositor aus, Display-Skalierung) ─ +# ── 8. XFCE-Konfiguration (MBP 16": Compositor aus, Display-Skalierung) ─ if [[ "$MODEL" == "16" ]]; then - echo -e "\n=== 6/10 XFCE-Konfiguration (MBP 16\") ===" + echo -e "\n=== 8/11 XFCE-Konfiguration (MBP 16\") ===" XFCE_XML_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" mkdir -p "$XFCE_XML_DIR" - # Compositor deaktivieren (verursacht Probleme ohne GPU-Beschleunigung) + # Compositor deaktivieren cat > "$XFCE_XML_DIR/xfwm4.xml" < @@ -142,7 +158,7 @@ if [[ "$MODEL" == "16" ]]; then XFEOF - # Display-Skalierung für Retina (2x, DPI 168) + # Display-Skalierung für Retina (2x, DPI 128) cat > "$XFCE_XML_DIR/xsettings.xml" < @@ -155,18 +171,18 @@ XFEOF XSEOF - # xfce4-display-settings deaktivieren (öffnet sich sonst in Endlosschleife) - dpkg-divert --local --rename --divert /usr/bin/xfce4-display-settings.real /usr/bin/xfce4-display-settings + # xfce4-display-settings deaktivieren (Endlosschleife) + dpkg-divert --local --rename --divert /usr/bin/xfce4-display-settings.real /usr/bin/xfce4-display-settings 2>/dev/null || true ln -sf /usr/bin/true /usr/bin/xfce4-display-settings chown -R 1000:1000 /home/rene/.config/xfce4 ok "XFCE: Compositor aus, Retina-Skalierung, Display-Settings deaktiviert" else - echo -e "\n=== 6/10 XFCE-Konfiguration — Standard (MBP 13\") ===" + echo -e "\n=== 8/11 XFCE-Konfiguration — Standard (MBP 13\") ===" fi -# ── 7. Netzwerk: NetworkManager statt netplan ───────────────────────────── -echo -e "\n=== 7/10 Netzwerk ===" +# ── 9. Netzwerk: NetworkManager statt netplan ───────────────────────────── +echo -e "\n=== 9/11 Netzwerk ===" cat > /etc/netplan/01-network-manager.yaml </dev/null || true systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" -# ── 8. Energieeinstellungen (systemd) ──────────────────────────────────── -echo -e "\n=== 8/10 Energieeinstellungen ===" +# ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── +echo -e "\n=== 10/11 Energie & Lokalisierung ===" tee /etc/systemd/sleep.conf > /dev/null </dev/null || ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime -ok "Lokalisierung: Deutsch / Berlin" +ok "Energie & Lokalisierung gesetzt" -# ── 10. Services aktivieren ────────────────────────────────────────────── -echo -e "\n=== 10/10 Services aktivieren ===" -systemctl enable mbpfan -systemctl enable thermald -systemctl enable tlp -systemctl enable ssh -# --now nur wenn nicht in chroot +# ── 11. Services aktivieren ────────────────────────────────────────────── +echo -e "\n=== 11/11 Services & Shell ===" +systemctl enable mbpfan 2>/dev/null || true +systemctl enable thermald 2>/dev/null || true +systemctl enable tlp 2>/dev/null || true +systemctl enable ssh 2>/dev/null || true + +# Services starten (nur wenn nicht in chroot) if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; then - systemctl start mbpfan - systemctl start thermald - systemctl start ssh + systemctl start mbpfan 2>/dev/null || true + systemctl start thermald 2>/dev/null || true + systemctl start ssh 2>/dev/null || true sensors-detect --auto 2>/dev/null || true - ok "mbpfan, thermald, tlp, ssh aktiv (gestartet)" -else - ok "mbpfan, thermald, tlp, ssh aktiviert (Start nach Reboot)" fi -# ── cloud-init deaktivieren (kein Cloud-Provider, blockiert sonst den Boot) ── -if command -v cloud-init &>/dev/null; then - touch /etc/cloud/cloud-init.disabled - ok "cloud-init deaktiviert" -fi - -# ── zsh als Standard-Shell für rene ────────────────────────────────────── +# zsh als Standard-Shell chsh -s /bin/zsh rene 2>/dev/null || true -# ── Sleep wieder erlauben ──────────────────────────────────────────────── +# Sleep wieder erlauben systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true +ok "Services aktiviert, zsh als Standard-Shell" + +# ── Zusammenfassung ────────────────────────────────────────────────────── echo "" echo "════════════════════════════════════════════" echo -e " ${GREEN}setup-base.sh abgeschlossen!${NC}" echo "════════════════════════════════════════════" +echo "" +echo "Nächste Schritte:" +echo " 1. sudo reboot" +echo " 2. In XFCE einloggen" +echo " 3. Terminal öffnen und setup-desktop.sh starten:" +echo " curl -fsSL $SETUP_RAW/setup-desktop.sh | bash" From f9199a3f31dec539ca855608b3b37a8efe875b64 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 06:07:28 +0100 Subject: [PATCH 051/122] =?UTF-8?q?setup.sh:=20Reboot=20zwischen=20Phase?= =?UTF-8?q?=201=20und=202,=20Autostart=20f=C3=BCr=20Desktop-Setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup-desktop.sh braucht laufende XFCE-Session und die Hardware-Fixes aus setup-base.sh (GPU-Blacklist, Treiber) erfordern einen Reboot. Daher: setup-base.sh sofort ausführen, setup-desktop.sh als XFCE- Autostart einrichten, Reboot dazwischen. Co-Authored-By: Claude Opus 4.6 --- setup.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/setup.sh b/setup.sh index de86e5c..f082137 100644 --- a/setup.sh +++ b/setup.sh @@ -1,21 +1,20 @@ #!/bin/bash # macbook-setup/setup.sh -# Vollautomatisches Post-Install-Skript für Linux auf MacBook Pro -# Ruft setup-base.sh (als root) und setup-desktop.sh (als User) auf +# Post-Install-Skript für Linux auf MacBook Pro +# Startet setup-base.sh und richtet setup-desktop.sh als Autostart ein # # Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -# Oder: bash setup.sh [13|16] (Modell optional, wird sonst abgefragt) -set -e SETUP_RAW="https://git.motocamp.de/rene/macbook-setup/raw/branch/main" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } -err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +fail() { echo -e "${RED}✗ $*${NC}"; exit 1; } # ── Root-Check ─────────────────────────────────────────────────────────── -[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." +[[ $EUID -eq 0 ]] && fail "Nicht als root ausführen. sudo wird intern verwendet." # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then @@ -24,14 +23,14 @@ else echo "" echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" - echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" read -rp "Modell [13/16]: " MODEL - [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && fail "Ungültiges Modell: $MODEL" fi echo "" echo "════════════════════════════════════════════" -echo " macbook-setup für MBP $MODEL\" (komplett)" +echo " macbook-setup für MBP $MODEL\"" echo "════════════════════════════════════════════" # ── Phase 1: System-Setup (als root) ──────────────────────────────────── @@ -39,14 +38,20 @@ echo -e "\n>>> Phase 1: setup-base.sh (System)" curl -fsSL "$SETUP_RAW/setup-base.sh" | sudo bash -s -- "$MODEL" ok "Phase 1 abgeschlossen" -# ── Phase 2: Desktop-Setup (als User) ─────────────────────────────────── -echo -e "\n>>> Phase 2: setup-desktop.sh (Desktop)" -curl -fsSL "$SETUP_RAW/setup-desktop.sh" | bash -ok "Phase 2 abgeschlossen" +# ── Phase 2: Desktop-Setup als Autostart einrichten ────────────────────── +echo -e "\n>>> Phase 2: setup-desktop.sh wird als Autostart eingerichtet" +mkdir -p ~/.config/autostart +printf '[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c "curl -fsSL %s/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log"\nHidden=false\nX-GNOME-Autostart-enabled=true\n' "$SETUP_RAW" \ + > ~/.config/autostart/macbook-setup-desktop.desktop +ok "Autostart für setup-desktop.sh eingerichtet" echo "" echo "════════════════════════════════════════════" -echo -e " ${GREEN}Komplett-Setup abgeschlossen!${NC}" +echo -e " ${GREEN}Phase 1 abgeschlossen!${NC}" echo "════════════════════════════════════════════" echo "" -echo "Neustart empfohlen: sudo reboot" +echo "Nächster Schritt:" +echo " sudo reboot" +echo "" +echo "Nach dem Reboot in XFCE einloggen —" +echo "setup-desktop.sh startet automatisch." From 14d6ed084c162c36a2b5de1329e8f9a8f8ba4f60 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 06:07:28 +0100 Subject: [PATCH 052/122] =?UTF-8?q?setup.sh:=20Reboot=20zwischen=20Phase?= =?UTF-8?q?=201=20und=202,=20Autostart=20f=C3=BCr=20Desktop-Setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup-desktop.sh braucht laufende XFCE-Session und die Hardware-Fixes aus setup-base.sh (GPU-Blacklist, Treiber) erfordern einen Reboot. Daher: setup-base.sh sofort ausführen, setup-desktop.sh als XFCE- Autostart einrichten, Reboot dazwischen. --- setup.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/setup.sh b/setup.sh index de86e5c..f082137 100644 --- a/setup.sh +++ b/setup.sh @@ -1,21 +1,20 @@ #!/bin/bash # macbook-setup/setup.sh -# Vollautomatisches Post-Install-Skript für Linux auf MacBook Pro -# Ruft setup-base.sh (als root) und setup-desktop.sh (als User) auf +# Post-Install-Skript für Linux auf MacBook Pro +# Startet setup-base.sh und richtet setup-desktop.sh als Autostart ein # # Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -# Oder: bash setup.sh [13|16] (Modell optional, wird sonst abgefragt) -set -e SETUP_RAW="https://git.motocamp.de/rene/macbook-setup/raw/branch/main" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' ok() { echo -e "${GREEN}✓ $*${NC}"; } -err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +warn() { echo -e "${YELLOW}⚠ $*${NC}"; } +fail() { echo -e "${RED}✗ $*${NC}"; exit 1; } # ── Root-Check ─────────────────────────────────────────────────────────── -[[ $EUID -eq 0 ]] && err "Nicht als root ausführen. sudo wird intern verwendet." +[[ $EUID -eq 0 ]] && fail "Nicht als root ausführen. sudo wird intern verwendet." # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then @@ -24,14 +23,14 @@ else echo "" echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" - echo " 16 = MBP 16\" Mid 2014 (Intel + Nvidia)" + echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" read -rp "Modell [13/16]: " MODEL - [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && err "Ungültiges Modell: $MODEL" + [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && fail "Ungültiges Modell: $MODEL" fi echo "" echo "════════════════════════════════════════════" -echo " macbook-setup für MBP $MODEL\" (komplett)" +echo " macbook-setup für MBP $MODEL\"" echo "════════════════════════════════════════════" # ── Phase 1: System-Setup (als root) ──────────────────────────────────── @@ -39,14 +38,20 @@ echo -e "\n>>> Phase 1: setup-base.sh (System)" curl -fsSL "$SETUP_RAW/setup-base.sh" | sudo bash -s -- "$MODEL" ok "Phase 1 abgeschlossen" -# ── Phase 2: Desktop-Setup (als User) ─────────────────────────────────── -echo -e "\n>>> Phase 2: setup-desktop.sh (Desktop)" -curl -fsSL "$SETUP_RAW/setup-desktop.sh" | bash -ok "Phase 2 abgeschlossen" +# ── Phase 2: Desktop-Setup als Autostart einrichten ────────────────────── +echo -e "\n>>> Phase 2: setup-desktop.sh wird als Autostart eingerichtet" +mkdir -p ~/.config/autostart +printf '[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c "curl -fsSL %s/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log"\nHidden=false\nX-GNOME-Autostart-enabled=true\n' "$SETUP_RAW" \ + > ~/.config/autostart/macbook-setup-desktop.desktop +ok "Autostart für setup-desktop.sh eingerichtet" echo "" echo "════════════════════════════════════════════" -echo -e " ${GREEN}Komplett-Setup abgeschlossen!${NC}" +echo -e " ${GREEN}Phase 1 abgeschlossen!${NC}" echo "════════════════════════════════════════════" echo "" -echo "Neustart empfohlen: sudo reboot" +echo "Nächster Schritt:" +echo " sudo reboot" +echo "" +echo "Nach dem Reboot in XFCE einloggen —" +echo "setup-desktop.sh startet automatisch." From 5553e0e744732ca05355485dfee73fc9552ae231 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 06:27:27 +0100 Subject: [PATCH 053/122] Fix read bei curl|bash: stdin von /dev/tty lesen Bei curl|bash ist stdin die Pipe, nicht das Terminal. read < /dev/tty liest direkt vom Terminal. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 2 +- setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 3bdf594..5013736 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -21,7 +21,7 @@ else echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" - read -rp "Modell [13/16]: " MODEL + read -rp "Modell [13/16]: " MODEL < /dev/tty [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && { fail "Ungültiges Modell: $MODEL"; exit 1; } fi ok "Modell: MacBook Pro $MODEL\"" diff --git a/setup.sh b/setup.sh index f082137..ba42cda 100644 --- a/setup.sh +++ b/setup.sh @@ -24,7 +24,7 @@ else echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" - read -rp "Modell [13/16]: " MODEL + read -rp "Modell [13/16]: " MODEL < /dev/tty [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && fail "Ungültiges Modell: $MODEL" fi From e505649140a7a2f8001ddd524a6f201744211d21 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 06:27:27 +0100 Subject: [PATCH 054/122] Fix read bei curl|bash: stdin von /dev/tty lesen Bei curl|bash ist stdin die Pipe, nicht das Terminal. read < /dev/tty liest direkt vom Terminal. --- setup-base.sh | 2 +- setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 3bdf594..5013736 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -21,7 +21,7 @@ else echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" - read -rp "Modell [13/16]: " MODEL + read -rp "Modell [13/16]: " MODEL < /dev/tty [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && { fail "Ungültiges Modell: $MODEL"; exit 1; } fi ok "Modell: MacBook Pro $MODEL\"" diff --git a/setup.sh b/setup.sh index f082137..ba42cda 100644 --- a/setup.sh +++ b/setup.sh @@ -24,7 +24,7 @@ else echo "Welches MacBook Pro?" echo " 13 = MBP 13\" Late 2013" echo " 16 = MBP 16\" Mid 2014 (Intel + AMD Radeon)" - read -rp "Modell [13/16]: " MODEL + read -rp "Modell [13/16]: " MODEL < /dev/tty [[ "$MODEL" != "13" && "$MODEL" != "16" ]] && fail "Ungültiges Modell: $MODEL" fi From 61066a43ed41a91d69b6446d451acec137ce2965 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 18:32:50 +0100 Subject: [PATCH 055/122] Fix Tastatur: iso_layout=1 + de nodeadkeys (nicht mac_nodeadkeys) Apple ISO-Keyboards senden ^/< Keycodes vertauscht. iso_layout=1 korrigiert das auf Kernel-Ebene. de(mac_nodeadkeys) hat eigene TLDE-Zuordnung die mit iso_layout kollidiert. de(nodeadkeys) + lv3:lalt_switch ist die richtige Kombi: - ^/< korrekt, @=Alt+Q, |=Alt+<, {}[]=Alt+7890 Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 5013736..fb04df5 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -45,15 +45,15 @@ else ok "MBP 13\": nur Intel-GPU, kein Blacklisting nötig" fi -# Fn-Tasten + ISO-Layout-Fix (iso_layout=0 verhindert ^/< Vertauschung) -echo 'options hid_apple fnmode=2 iso_layout=0' > /etc/modprobe.d/hid_apple.conf -ok "hid_apple: fnmode=2, iso_layout=0" +# Fn-Tasten + ISO-Layout-Fix (iso_layout=1 korrigiert ^/< auf Apple ISO-Keyboards) +echo 'options hid_apple fnmode=2 iso_layout=1' > /etc/modprobe.d/hid_apple.conf +ok "hid_apple: fnmode=2, iso_layout=1" -# Tastaturbelegung (mac_nodeadkeys: @=Alt+L, |=Alt+7, wie auf dem Mac) +# Tastaturbelegung (nodeadkeys + lv3:lalt_switch: @=Alt+Q, |=Alt+<) cat > /etc/default/keyboard </dev/null || true From 10b85845d2ed79467b1a61d878dc399cba23fe04 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 18:32:50 +0100 Subject: [PATCH 056/122] Fix Tastatur: iso_layout=1 + de nodeadkeys (nicht mac_nodeadkeys) Apple ISO-Keyboards senden ^/< Keycodes vertauscht. iso_layout=1 korrigiert das auf Kernel-Ebene. de(mac_nodeadkeys) hat eigene TLDE-Zuordnung die mit iso_layout kollidiert. de(nodeadkeys) + lv3:lalt_switch ist die richtige Kombi: - ^/< korrekt, @=Alt+Q, |=Alt+<, {}[]=Alt+7890 --- setup-base.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 5013736..fb04df5 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -45,15 +45,15 @@ else ok "MBP 13\": nur Intel-GPU, kein Blacklisting nötig" fi -# Fn-Tasten + ISO-Layout-Fix (iso_layout=0 verhindert ^/< Vertauschung) -echo 'options hid_apple fnmode=2 iso_layout=0' > /etc/modprobe.d/hid_apple.conf -ok "hid_apple: fnmode=2, iso_layout=0" +# Fn-Tasten + ISO-Layout-Fix (iso_layout=1 korrigiert ^/< auf Apple ISO-Keyboards) +echo 'options hid_apple fnmode=2 iso_layout=1' > /etc/modprobe.d/hid_apple.conf +ok "hid_apple: fnmode=2, iso_layout=1" -# Tastaturbelegung (mac_nodeadkeys: @=Alt+L, |=Alt+7, wie auf dem Mac) +# Tastaturbelegung (nodeadkeys + lv3:lalt_switch: @=Alt+Q, |=Alt+<) cat > /etc/default/keyboard </dev/null || true From b78ea2252966a9410649d8e0991fb11a9fced321 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 19:26:20 +0100 Subject: [PATCH 057/122] WLAN-Config beim Umstieg auf NetworkManager erhalten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vor dem Löschen der netplan-Config werden SSID und Passwort extrahiert und nach dem Wechsel zu NetworkManager als neue Verbindung eingerichtet. Verhindert WLAN-Verlust nach Reboot. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index fb04df5..c536084 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -183,6 +183,18 @@ fi # ── 9. Netzwerk: NetworkManager statt netplan ───────────────────────────── echo -e "\n=== 9/11 Netzwerk ===" + +# WLAN-Zugangsdaten aus bestehender netplan-Config übernehmen (falls vorhanden) +WLAN_SSID="" +WLAN_PASS="" +for npfile in /etc/netplan/*.yaml; do + if [[ -f "$npfile" ]] && grep -q "wifis:" "$npfile" 2>/dev/null; then + WLAN_SSID=$(grep -A5 'wifis:' "$npfile" | grep -oP '"\K[^"]+' | head -1) + WLAN_PASS=$(grep -oP 'password:\s*"\K[^"]+' "$npfile" | head -1) + [[ -n "$WLAN_SSID" ]] && ok "WLAN-Config gefunden: $WLAN_SSID" + fi +done + cat > /etc/netplan/01-network-manager.yaml </dev/null; sensors-detect --auto 2>/dev/null || true fi +# WLAN-Verbindung in NetworkManager einrichten (aus gesicherter netplan-Config) +if [[ -n "$WLAN_SSID" && -n "$WLAN_PASS" ]]; then + nmcli device wifi connect "$WLAN_SSID" password "$WLAN_PASS" 2>/dev/null || true + ok "WLAN wiederhergestellt: $WLAN_SSID" +fi + # zsh als Standard-Shell chsh -s /bin/zsh rene 2>/dev/null || true From 4ff2dd88e42f7bd7b4c892d3c68ada64843d886f Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 19:26:20 +0100 Subject: [PATCH 058/122] WLAN-Config beim Umstieg auf NetworkManager erhalten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vor dem Löschen der netplan-Config werden SSID und Passwort extrahiert und nach dem Wechsel zu NetworkManager als neue Verbindung eingerichtet. Verhindert WLAN-Verlust nach Reboot. --- setup-base.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index fb04df5..c536084 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -183,6 +183,18 @@ fi # ── 9. Netzwerk: NetworkManager statt netplan ───────────────────────────── echo -e "\n=== 9/11 Netzwerk ===" + +# WLAN-Zugangsdaten aus bestehender netplan-Config übernehmen (falls vorhanden) +WLAN_SSID="" +WLAN_PASS="" +for npfile in /etc/netplan/*.yaml; do + if [[ -f "$npfile" ]] && grep -q "wifis:" "$npfile" 2>/dev/null; then + WLAN_SSID=$(grep -A5 'wifis:' "$npfile" | grep -oP '"\K[^"]+' | head -1) + WLAN_PASS=$(grep -oP 'password:\s*"\K[^"]+' "$npfile" | head -1) + [[ -n "$WLAN_SSID" ]] && ok "WLAN-Config gefunden: $WLAN_SSID" + fi +done + cat > /etc/netplan/01-network-manager.yaml </dev/null; sensors-detect --auto 2>/dev/null || true fi +# WLAN-Verbindung in NetworkManager einrichten (aus gesicherter netplan-Config) +if [[ -n "$WLAN_SSID" && -n "$WLAN_PASS" ]]; then + nmcli device wifi connect "$WLAN_SSID" password "$WLAN_PASS" 2>/dev/null || true + ok "WLAN wiederhergestellt: $WLAN_SSID" +fi + # zsh als Standard-Shell chsh -s /bin/zsh rene 2>/dev/null || true From fe0978c72ed9cbbb57e4d8b6721a883e14ff9ed2 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 19:28:16 +0100 Subject: [PATCH 059/122] Fix setup-desktop.sh: set -e entfernt, Unicode durch ASCII ersetzt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set -e entfernt (bricht bei jedem Fehler ab) - Unicode-Zeichen (✓ ⚠ ✗ ═) durch ASCII ersetzt ([OK] [!!] [FAIL] =) verhindert Encoding-Fehler bei curl|bash - LANG=en_US.UTF-8 gesetzt Co-Authored-By: Claude Opus 4.6 --- setup-desktop.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index b23efd8..e167f31 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -5,23 +5,23 @@ # Verwendung: bash setup-desktop.sh # Wird automatisch beim ersten Login gestartet (via Autostart) -set -e +export LANG=en_US.UTF-8 FORGEJO="https://git.motocamp.de" DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' -ok() { echo -e "${GREEN}✓ $*${NC}"; } -warn() { echo -e "${YELLOW}⚠ $*${NC}"; } -err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +ok() { echo -e "${GREEN}[OK] $*${NC}"; } +warn() { echo -e "${YELLOW}[!!] $*${NC}"; } +fail() { echo -e "${RED}[FAIL] $*${NC}"; } # ── Root-Check ─────────────────────────────────────────────────────────── -[[ $EUID -eq 0 ]] && err "Nicht als root ausführen!" +[[ $EUID -eq 0 ]] && { fail "Nicht als root ausführen!"; exit 1; } echo "" -echo "════════════════════════════════════════════" +echo "============================================" echo " setup-desktop.sh startet" -echo "════════════════════════════════════════════" +echo "============================================" # ── 1. oh-my-zsh ──────────────────────────────────────────────────────── echo -e "\n=== 1/8 oh-my-zsh ===" @@ -269,9 +269,9 @@ fi # ── Zusammenfassung ────────────────────────────────────────────────────── echo "" -echo "════════════════════════════════════════════" +echo "============================================" echo -e " ${GREEN}Desktop-Setup abgeschlossen!${NC}" -echo "════════════════════════════════════════════" +echo "============================================" echo "" warn "Noch manuell erledigen:" echo " 1. WireGuard-Config einspielen:" From 01bbd7fd1425542a63ab568c5428347c4d1b4934 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 19:28:16 +0100 Subject: [PATCH 060/122] Fix setup-desktop.sh: set -e entfernt, Unicode durch ASCII ersetzt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set -e entfernt (bricht bei jedem Fehler ab) - Unicode-Zeichen (✓ ⚠ ✗ ═) durch ASCII ersetzt ([OK] [!!] [FAIL] =) verhindert Encoding-Fehler bei curl|bash - LANG=en_US.UTF-8 gesetzt --- setup-desktop.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index b23efd8..e167f31 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -5,23 +5,23 @@ # Verwendung: bash setup-desktop.sh # Wird automatisch beim ersten Login gestartet (via Autostart) -set -e +export LANG=en_US.UTF-8 FORGEJO="https://git.motocamp.de" DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' -ok() { echo -e "${GREEN}✓ $*${NC}"; } -warn() { echo -e "${YELLOW}⚠ $*${NC}"; } -err() { echo -e "${RED}✗ $*${NC}"; exit 1; } +ok() { echo -e "${GREEN}[OK] $*${NC}"; } +warn() { echo -e "${YELLOW}[!!] $*${NC}"; } +fail() { echo -e "${RED}[FAIL] $*${NC}"; } # ── Root-Check ─────────────────────────────────────────────────────────── -[[ $EUID -eq 0 ]] && err "Nicht als root ausführen!" +[[ $EUID -eq 0 ]] && { fail "Nicht als root ausführen!"; exit 1; } echo "" -echo "════════════════════════════════════════════" +echo "============================================" echo " setup-desktop.sh startet" -echo "════════════════════════════════════════════" +echo "============================================" # ── 1. oh-my-zsh ──────────────────────────────────────────────────────── echo -e "\n=== 1/8 oh-my-zsh ===" @@ -269,9 +269,9 @@ fi # ── Zusammenfassung ────────────────────────────────────────────────────── echo "" -echo "════════════════════════════════════════════" +echo "============================================" echo -e " ${GREEN}Desktop-Setup abgeschlossen!${NC}" -echo "════════════════════════════════════════════" +echo "============================================" echo "" warn "Noch manuell erledigen:" echo " 1. WireGuard-Config einspielen:" From 48e8acea925561483e31c1b4873d96b02150be71 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 19:47:54 +0100 Subject: [PATCH 061/122] Fix LibreOffice (default-jre) und Brave (--disable-gpu) auf MBP 16" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - default-jre Paket hinzugefügt: behebt "javaldx failed" in LibreOffice - Brave Browser: --disable-gpu in .desktop für MBP 16" (AMD geblockt, Intel i915 allein verursacht Crash mit "Trace/Breakpoint") Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index c536084..67089e4 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -110,6 +110,7 @@ apt install -y \ htop btop \ timeshift \ vlc \ + default-jre \ language-pack-de \ wngerman \ bc \ @@ -127,6 +128,17 @@ curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ https://brave-browser-apt-release.s3.brave.com/brave-browser.sources apt update && apt install -y brave-browser || warn "Brave Browser fehlgeschlagen" + +# Brave: --disable-gpu Flag setzen (AMD geblockt, Intel i915 allein reicht nicht für GPU-Accel) +if [[ "$MODEL" == "16" ]]; then + mkdir -p /etc/brave-browser + echo '{"hardware_acceleration_mode_previous": false}' > /etc/brave-browser/initial_preferences 2>/dev/null || true + # Override .desktop Datei mit --disable-gpu + BRAVE_DESKTOP="/usr/share/applications/brave-browser.desktop" + if [[ -f "$BRAVE_DESKTOP" ]]; then + sed -i 's|Exec=/usr/bin/brave-browser-stable|Exec=/usr/bin/brave-browser-stable --disable-gpu|g' "$BRAVE_DESKTOP" + fi +fi ok "Brave installiert" # ── 7. Systemkonfigurationen ───────────────────────────────────────────── From b2459b5c05ed93df6c43299bd45115c510f66a8b Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 10 Mar 2026 19:47:54 +0100 Subject: [PATCH 062/122] Fix LibreOffice (default-jre) und Brave (--disable-gpu) auf MBP 16" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - default-jre Paket hinzugefügt: behebt "javaldx failed" in LibreOffice - Brave Browser: --disable-gpu in .desktop für MBP 16" (AMD geblockt, Intel i915 allein verursacht Crash mit "Trace/Breakpoint") --- setup-base.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index c536084..67089e4 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -110,6 +110,7 @@ apt install -y \ htop btop \ timeshift \ vlc \ + default-jre \ language-pack-de \ wngerman \ bc \ @@ -127,6 +128,17 @@ curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ https://brave-browser-apt-release.s3.brave.com/brave-browser.sources apt update && apt install -y brave-browser || warn "Brave Browser fehlgeschlagen" + +# Brave: --disable-gpu Flag setzen (AMD geblockt, Intel i915 allein reicht nicht für GPU-Accel) +if [[ "$MODEL" == "16" ]]; then + mkdir -p /etc/brave-browser + echo '{"hardware_acceleration_mode_previous": false}' > /etc/brave-browser/initial_preferences 2>/dev/null || true + # Override .desktop Datei mit --disable-gpu + BRAVE_DESKTOP="/usr/share/applications/brave-browser.desktop" + if [[ -f "$BRAVE_DESKTOP" ]]; then + sed -i 's|Exec=/usr/bin/brave-browser-stable|Exec=/usr/bin/brave-browser-stable --disable-gpu|g' "$BRAVE_DESKTOP" + fi +fi ok "Brave installiert" # ── 7. Systemkonfigurationen ───────────────────────────────────────────── From 042f650e34466625de5cd2261ed2f35da41aad3b Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 11 Mar 2026 18:29:20 +0100 Subject: [PATCH 063/122] Brave/LibreOffice auf Flatpak/Snap, HiDPI-Fix, Autostart mit Terminal - Brave: .deb entfernt (crasht mit SIGTRAP auf aelterer HW), Flatpak statt dessen - LibreOffice: apt entfernt (Installationsfehler), Snap statt dessen - default-jre entfernt (nur fuer LibreOffice .deb noetig) - flatpak Paket in setup-base.sh (kein sudo in setup-desktop.sh noetig) - HiDPI: DPI 96 statt 128, Cursor 48, xfwm4 Default-xhdpi Theme - Autostart oeffnet Terminal-Fenster fuer interaktive Eingaben Co-Authored-By: Claude Opus 4.6 --- README.md | 9 +++++++++ setup-base.sh | 39 ++++++++++++++------------------------- setup-desktop.sh | 9 ++++----- setup.sh | 10 ++++++++-- 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 779460d..2522032 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,15 @@ cd macbook-setup - Forgejo-Zugang für Dot-Files-Clone - Thunderbird-Profil-Backup in Synology Drive +## Paketquellen + +| App | Quelle | Grund | +|-----|--------|-------| +| LibreOffice | Snap | .deb-Version hat Installationsfehler auf MBP | +| FreeCAD | Snap | Standard | +| Brave Browser | Flatpak | .deb crasht (int3/SIGTRAP) auf aelterer Hardware | +| PrusaSlicer | Flatpak | Standard | + ## Hardware-Besonderheiten ### MBP 16" Mid 2014 (Intel + Nvidia GT 750M) diff --git a/setup-base.sh b/setup-base.sh index 67089e4..3fd70f8 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -104,13 +104,12 @@ apt install -y \ pipx \ zoxide \ micro \ - libreoffice libreoffice-l10n-de \ + flatpak \ thunderbird thunderbird-locale-de \ keepassxc \ htop btop \ timeshift \ vlc \ - default-jre \ language-pack-de \ wngerman \ bc \ @@ -118,28 +117,13 @@ apt install -y \ || { fail "apt install fehlgeschlagen"; dpkg --configure -a; apt install -f -y; } ok "Pakete installiert (apt)" -# FreeCAD via Snap -snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen" +# FreeCAD + LibreOffice via Snap +snap install freecad 2>/dev/null || warn "FreeCAD Snap uebersprungen" +snap install libreoffice 2>/dev/null || warn "LibreOffice Snap uebersprungen" -# ── 6. Brave Browser ───────────────────────────────────────────────────── +# ── 6. Brave Browser (wird in setup-desktop.sh als Flatpak installiert) ── echo -e "\n=== 6/11 Brave Browser ===" -curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ - https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg -curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ - https://brave-browser-apt-release.s3.brave.com/brave-browser.sources -apt update && apt install -y brave-browser || warn "Brave Browser fehlgeschlagen" - -# Brave: --disable-gpu Flag setzen (AMD geblockt, Intel i915 allein reicht nicht für GPU-Accel) -if [[ "$MODEL" == "16" ]]; then - mkdir -p /etc/brave-browser - echo '{"hardware_acceleration_mode_previous": false}' > /etc/brave-browser/initial_preferences 2>/dev/null || true - # Override .desktop Datei mit --disable-gpu - BRAVE_DESKTOP="/usr/share/applications/brave-browser.desktop" - if [[ -f "$BRAVE_DESKTOP" ]]; then - sed -i 's|Exec=/usr/bin/brave-browser-stable|Exec=/usr/bin/brave-browser-stable --disable-gpu|g' "$BRAVE_DESKTOP" - fi -fi -ok "Brave installiert" +ok "Brave wird als Flatpak in setup-desktop.sh installiert" # ── 7. Systemkonfigurationen ───────────────────────────────────────────── echo -e "\n=== 7/11 Systemkonfigurationen ===" @@ -160,17 +144,19 @@ if [[ "$MODEL" == "16" ]]; then XFCE_XML_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" mkdir -p "$XFCE_XML_DIR" - # Compositor deaktivieren + # Compositor deaktivieren + HiDPI-Theme + Titelschrift cat > "$XFCE_XML_DIR/xfwm4.xml" < + + XFEOF - # Display-Skalierung für Retina (2x, DPI 128) + # Display-Skalierung für Retina (2x) cat > "$XFCE_XML_DIR/xsettings.xml" < @@ -178,7 +164,10 @@ XFEOF - + + + + XSEOF diff --git a/setup-desktop.sh b/setup-desktop.sh index e167f31..589105a 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -71,14 +71,13 @@ export PATH="$HOME/.npm-global/bin:$PATH" npm install -g @anthropic-ai/claude-code ok "Claude Code installiert" -# ── 5. PrusaSlicer (Flatpak) ──────────────────────────────────────────── -echo -e "\n=== 5/8 PrusaSlicer ===" -if ! command -v flatpak &>/dev/null; then - sudo apt install -y flatpak -fi +# ── 5. Flatpak-Apps (PrusaSlicer + Brave) ────────────────────────────── +echo -e "\n=== 5/8 Flatpak-Apps ===" flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install --user -y flathub com.prusa3d.PrusaSlicer ok "PrusaSlicer installiert (Flatpak)" +flatpak install --user -y flathub com.brave.Browser +ok "Brave Browser installiert (Flatpak)" # ── 6. PlatformIO (pipx) ──────────────────────────────────────────────── echo -e "\n=== 6/8 PlatformIO ===" diff --git a/setup.sh b/setup.sh index ba42cda..9f6cad4 100644 --- a/setup.sh +++ b/setup.sh @@ -41,8 +41,14 @@ ok "Phase 1 abgeschlossen" # ── Phase 2: Desktop-Setup als Autostart einrichten ────────────────────── echo -e "\n>>> Phase 2: setup-desktop.sh wird als Autostart eingerichtet" mkdir -p ~/.config/autostart -printf '[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c "curl -fsSL %s/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log"\nHidden=false\nX-GNOME-Autostart-enabled=true\n' "$SETUP_RAW" \ - > ~/.config/autostart/macbook-setup-desktop.desktop +cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Hidden=false +X-GNOME-Autostart-enabled=true +DTEOF ok "Autostart für setup-desktop.sh eingerichtet" echo "" From adc5367a8c1590efcf11ffd4a1bcb704598f187a Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 11 Mar 2026 18:29:20 +0100 Subject: [PATCH 064/122] Brave/LibreOffice auf Flatpak/Snap, HiDPI-Fix, Autostart mit Terminal - Brave: .deb entfernt (crasht mit SIGTRAP auf aelterer HW), Flatpak statt dessen - LibreOffice: apt entfernt (Installationsfehler), Snap statt dessen - default-jre entfernt (nur fuer LibreOffice .deb noetig) - flatpak Paket in setup-base.sh (kein sudo in setup-desktop.sh noetig) - HiDPI: DPI 96 statt 128, Cursor 48, xfwm4 Default-xhdpi Theme - Autostart oeffnet Terminal-Fenster fuer interaktive Eingaben --- README.md | 9 +++++++++ setup-base.sh | 39 ++++++++++++++------------------------- setup-desktop.sh | 9 ++++----- setup.sh | 10 ++++++++-- 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 779460d..2522032 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,15 @@ cd macbook-setup - Forgejo-Zugang für Dot-Files-Clone - Thunderbird-Profil-Backup in Synology Drive +## Paketquellen + +| App | Quelle | Grund | +|-----|--------|-------| +| LibreOffice | Snap | .deb-Version hat Installationsfehler auf MBP | +| FreeCAD | Snap | Standard | +| Brave Browser | Flatpak | .deb crasht (int3/SIGTRAP) auf aelterer Hardware | +| PrusaSlicer | Flatpak | Standard | + ## Hardware-Besonderheiten ### MBP 16" Mid 2014 (Intel + Nvidia GT 750M) diff --git a/setup-base.sh b/setup-base.sh index 67089e4..3fd70f8 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -104,13 +104,12 @@ apt install -y \ pipx \ zoxide \ micro \ - libreoffice libreoffice-l10n-de \ + flatpak \ thunderbird thunderbird-locale-de \ keepassxc \ htop btop \ timeshift \ vlc \ - default-jre \ language-pack-de \ wngerman \ bc \ @@ -118,28 +117,13 @@ apt install -y \ || { fail "apt install fehlgeschlagen"; dpkg --configure -a; apt install -f -y; } ok "Pakete installiert (apt)" -# FreeCAD via Snap -snap install freecad 2>/dev/null || warn "FreeCAD Snap übersprungen" +# FreeCAD + LibreOffice via Snap +snap install freecad 2>/dev/null || warn "FreeCAD Snap uebersprungen" +snap install libreoffice 2>/dev/null || warn "LibreOffice Snap uebersprungen" -# ── 6. Brave Browser ───────────────────────────────────────────────────── +# ── 6. Brave Browser (wird in setup-desktop.sh als Flatpak installiert) ── echo -e "\n=== 6/11 Brave Browser ===" -curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ - https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg -curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ - https://brave-browser-apt-release.s3.brave.com/brave-browser.sources -apt update && apt install -y brave-browser || warn "Brave Browser fehlgeschlagen" - -# Brave: --disable-gpu Flag setzen (AMD geblockt, Intel i915 allein reicht nicht für GPU-Accel) -if [[ "$MODEL" == "16" ]]; then - mkdir -p /etc/brave-browser - echo '{"hardware_acceleration_mode_previous": false}' > /etc/brave-browser/initial_preferences 2>/dev/null || true - # Override .desktop Datei mit --disable-gpu - BRAVE_DESKTOP="/usr/share/applications/brave-browser.desktop" - if [[ -f "$BRAVE_DESKTOP" ]]; then - sed -i 's|Exec=/usr/bin/brave-browser-stable|Exec=/usr/bin/brave-browser-stable --disable-gpu|g' "$BRAVE_DESKTOP" - fi -fi -ok "Brave installiert" +ok "Brave wird als Flatpak in setup-desktop.sh installiert" # ── 7. Systemkonfigurationen ───────────────────────────────────────────── echo -e "\n=== 7/11 Systemkonfigurationen ===" @@ -160,17 +144,19 @@ if [[ "$MODEL" == "16" ]]; then XFCE_XML_DIR="/home/rene/.config/xfce4/xfconf/xfce-perchannel-xml" mkdir -p "$XFCE_XML_DIR" - # Compositor deaktivieren + # Compositor deaktivieren + HiDPI-Theme + Titelschrift cat > "$XFCE_XML_DIR/xfwm4.xml" < + + XFEOF - # Display-Skalierung für Retina (2x, DPI 128) + # Display-Skalierung für Retina (2x) cat > "$XFCE_XML_DIR/xsettings.xml" < @@ -178,7 +164,10 @@ XFEOF - + + + + XSEOF diff --git a/setup-desktop.sh b/setup-desktop.sh index e167f31..589105a 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -71,14 +71,13 @@ export PATH="$HOME/.npm-global/bin:$PATH" npm install -g @anthropic-ai/claude-code ok "Claude Code installiert" -# ── 5. PrusaSlicer (Flatpak) ──────────────────────────────────────────── -echo -e "\n=== 5/8 PrusaSlicer ===" -if ! command -v flatpak &>/dev/null; then - sudo apt install -y flatpak -fi +# ── 5. Flatpak-Apps (PrusaSlicer + Brave) ────────────────────────────── +echo -e "\n=== 5/8 Flatpak-Apps ===" flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install --user -y flathub com.prusa3d.PrusaSlicer ok "PrusaSlicer installiert (Flatpak)" +flatpak install --user -y flathub com.brave.Browser +ok "Brave Browser installiert (Flatpak)" # ── 6. PlatformIO (pipx) ──────────────────────────────────────────────── echo -e "\n=== 6/8 PlatformIO ===" diff --git a/setup.sh b/setup.sh index ba42cda..9f6cad4 100644 --- a/setup.sh +++ b/setup.sh @@ -41,8 +41,14 @@ ok "Phase 1 abgeschlossen" # ── Phase 2: Desktop-Setup als Autostart einrichten ────────────────────── echo -e "\n>>> Phase 2: setup-desktop.sh wird als Autostart eingerichtet" mkdir -p ~/.config/autostart -printf '[Desktop Entry]\nType=Application\nName=MacBook Setup Desktop\nExec=bash -c "curl -fsSL %s/setup-desktop.sh | bash 2>&1 | tee /tmp/setup-desktop.log"\nHidden=false\nX-GNOME-Autostart-enabled=true\n' "$SETUP_RAW" \ - > ~/.config/autostart/macbook-setup-desktop.desktop +cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Hidden=false +X-GNOME-Autostart-enabled=true +DTEOF ok "Autostart für setup-desktop.sh eingerichtet" echo "" From 16ef6e09fccf911d525a9604fcc4229278afe311 Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 11 Mar 2026 18:44:17 +0100 Subject: [PATCH 065/122] xubuntu-desktop durch xubuntu-core ersetzen (minimaler Desktop) Weniger vorinstallierte Apps, schnellere Installation. LibreOffice (Snap), Thunderbird (apt) und Brave (Flatpak) werden separat installiert. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-base.sh b/setup-base.sh index 3fd70f8..7220674 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -88,7 +88,7 @@ ok "System aktuell" # ── 5. Pakete installieren ─────────────────────────────────────────────── echo -e "\n=== 5/11 Pakete installieren ===" apt install -y \ - xubuntu-desktop \ + xubuntu-core \ bcmwl-kernel-source \ mbpfan thermald \ lm-sensors xfce4-sensors-plugin \ From ff8b1b7da921f14ca59e06672938012491be4bda Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 11 Mar 2026 18:44:17 +0100 Subject: [PATCH 066/122] xubuntu-desktop durch xubuntu-core ersetzen (minimaler Desktop) Weniger vorinstallierte Apps, schnellere Installation. LibreOffice (Snap), Thunderbird (apt) und Brave (Flatpak) werden separat installiert. --- setup-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-base.sh b/setup-base.sh index 3fd70f8..7220674 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -88,7 +88,7 @@ ok "System aktuell" # ── 5. Pakete installieren ─────────────────────────────────────────────── echo -e "\n=== 5/11 Pakete installieren ===" apt install -y \ - xubuntu-desktop \ + xubuntu-core \ bcmwl-kernel-source \ mbpfan thermald \ lm-sensors xfce4-sensors-plugin \ From f6e7807d19cc86073e9c2c55ec357de6be87a94a Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 11 Mar 2026 19:24:44 +0100 Subject: [PATCH 067/122] Autostart: Skript erst herunterladen, dann lokal ausfuehren curl|bash hat kein echtes stdin fuer interaktive Eingaben (Git-Credentials). Skript wird jetzt nach /tmp heruntergeladen und lokal ausgefuehrt. Co-Authored-By: Claude Opus 4.6 --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 9f6cad4..04510a8 100644 --- a/setup.sh +++ b/setup.sh @@ -45,7 +45,7 @@ cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Exec=xfce4-terminal -e "bash -c 'curl -fsSL $SETUP_RAW/setup-desktop.sh -o /tmp/setup-desktop.sh && bash /tmp/setup-desktop.sh 2>&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" Hidden=false X-GNOME-Autostart-enabled=true DTEOF From 56bf15e03a84f4d4cd0a9b33d2e7c6ab5fd2c26d Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 11 Mar 2026 19:24:44 +0100 Subject: [PATCH 068/122] Autostart: Skript erst herunterladen, dann lokal ausfuehren curl|bash hat kein echtes stdin fuer interaktive Eingaben (Git-Credentials). Skript wird jetzt nach /tmp heruntergeladen und lokal ausgefuehrt. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 9f6cad4..04510a8 100644 --- a/setup.sh +++ b/setup.sh @@ -45,7 +45,7 @@ cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Exec=xfce4-terminal -e "bash -c 'curl -fsSL $SETUP_RAW/setup-desktop.sh -o /tmp/setup-desktop.sh && bash /tmp/setup-desktop.sh 2>&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" Hidden=false X-GNOME-Autostart-enabled=true DTEOF From 4c2fa872097f9b0f94cc86fa8783f1ca008d78e1 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 16:52:48 +0100 Subject: [PATCH 069/122] Repos lokal klonen vor Setup, WireGuard automatisch deployen - setup.sh klont macbook-setup + dotfiles-rene lokal (Credentials einmalig im interaktiven Terminal statt im Autostart) - setup-base.sh nutzt lokale Dateien wenn vorhanden (wget-Fallback fuer Autoinstall bleibt erhalten), deployed WireGuard-Config - wireguard/ aus .gitignore entfernt, Configs werden getrackt - WireGuard aus manueller Checkliste entfernt Co-Authored-By: Claude Opus 4.6 --- .gitignore | 1 - INSTALL.md | 6 ++--- setup-base.sh | 38 +++++++++++++++++++++++++++---- setup-desktop.sh | 10 ++++----- setup.sh | 51 ++++++++++++++++++++++++++++++++---------- wireguard/iPadM.conf | 12 ++++++++++ wireguard/iPadR.conf | 12 ++++++++++ wireguard/iPhoneM.conf | 12 ++++++++++ wireguard/iPhoneR.conf | 12 ++++++++++ wireguard/m1.conf | 12 ++++++++++ wireguard/m13.conf | 12 ++++++++++ wireguard/m16.conf | 12 ++++++++++ 12 files changed, 164 insertions(+), 26 deletions(-) create mode 100755 wireguard/iPadM.conf create mode 100755 wireguard/iPadR.conf create mode 100755 wireguard/iPhoneM.conf create mode 100755 wireguard/iPhoneR.conf create mode 100755 wireguard/m1.conf create mode 100755 wireguard/m13.conf create mode 100755 wireguard/m16.conf diff --git a/.gitignore b/.gitignore index 3880bdb..153f1f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ *.iso .DS_Store -wireguard/ diff --git a/INSTALL.md b/INSTALL.md index e865fda..c87208c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -87,11 +87,11 @@ cat /tmp/setup-desktop.log ### WireGuard -Config-Datei muss separat vorliegen (nicht im Repo). +WireGuard wird automatisch von `setup-base.sh` konfiguriert (Config aus `wireguard/m13.conf` bzw. `wireguard/m16.conf`). Falls nötig, manuell prüfen: ```bash -sudo cp wg0.conf /etc/wireguard/ -sudo systemctl enable --now wg-quick@wg0 +sudo systemctl status wg-quick@wg0 +sudo wg show ``` Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). diff --git a/setup-base.sh b/setup-base.sh index 7220674..5f7bc58 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -13,6 +13,15 @@ ok() { echo -e "${GREEN}✓ $*${NC}"; } warn() { echo -e "${YELLOW}⚠ $*${NC}"; } fail() { echo -e "${RED}✗ $*${NC}"; } +# ── Lokales Repo erkennen (falls nicht via curl|bash) ───────────────── +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)" +if [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/mbpfan-13.conf" ]]; then + REPO_DIR="$SCRIPT_DIR" + ok "Lokales Repo erkannt: $REPO_DIR" +else + REPO_DIR="" +fi + # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then MODEL="$1" @@ -129,12 +138,33 @@ ok "Brave wird als Flatpak in setup-desktop.sh installiert" echo -e "\n=== 7/11 Systemkonfigurationen ===" # mbpfan (modellabhängig) -wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" && \ - cp /tmp/mbpfan.conf /etc/mbpfan.conf || warn "mbpfan.conf Download fehlgeschlagen" +if [[ -n "$REPO_DIR" && -f "$REPO_DIR/mbpfan-${MODEL}.conf" ]]; then + cp "$REPO_DIR/mbpfan-${MODEL}.conf" /etc/mbpfan.conf + ok "mbpfan.conf (lokal)" +else + wget -q -O /etc/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" || warn "mbpfan.conf Download fehlgeschlagen" +fi # Temperatur-Watch-Skript -wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" && \ - chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" +if [[ -n "$REPO_DIR" && -f "$REPO_DIR/temp-watch.sh" ]]; then + cp "$REPO_DIR/temp-watch.sh" /usr/local/bin/temp-watch.sh + chmod +x /usr/local/bin/temp-watch.sh + ok "temp-watch.sh (lokal)" +else + wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" && \ + chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" +fi + +# WireGuard-Config +if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then + mkdir -p /etc/wireguard + cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf + chmod 600 /etc/wireguard/wg0.conf + systemctl enable wg-quick@wg0 2>/dev/null || true + ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" +else + warn "WireGuard: keine lokale Config gefunden — manuell einrichten" +fi ok "Systemkonfigurationen gesetzt" diff --git a/setup-desktop.sh b/setup-desktop.sh index 589105a..5759371 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -273,9 +273,7 @@ echo -e " ${GREEN}Desktop-Setup abgeschlossen!${NC}" echo "============================================" echo "" warn "Noch manuell erledigen:" -echo " 1. WireGuard-Config einspielen:" -echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" -echo " 2. Synology Drive Client installieren (.deb von synology.com)" -echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" -echo " 4. Brave starten → Synchronisation einrichten" -echo " 5. Falls p10k-Icons fehlen: Terminal-Schriftart auf 'MesloLGS NF' setzen" +echo " 1. Synology Drive Client installieren (.deb von synology.com)" +echo " 2. Thunderbird starten → Profil aus Synology Drive einbinden" +echo " 3. Brave starten → Synchronisation einrichten" +echo " 4. Falls p10k-Icons fehlen: Terminal-Schriftart auf 'MesloLGS NF' setzen" diff --git a/setup.sh b/setup.sh index 04510a8..71407d4 100644 --- a/setup.sh +++ b/setup.sh @@ -1,11 +1,15 @@ #!/bin/bash # macbook-setup/setup.sh # Post-Install-Skript für Linux auf MacBook Pro -# Startet setup-base.sh und richtet setup-desktop.sh als Autostart ein +# Klont alle Repos lokal, führt setup-base.sh aus und richtet Autostart ein # -# Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +# Verwendung: +# curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +# oder: cd macbook-setup && bash setup.sh -SETUP_RAW="https://git.motocamp.de/rene/macbook-setup/raw/branch/main" +FORGEJO="https://git.motocamp.de" +MACBOOK_REPO="$FORGEJO/rene/macbook-setup.git" +DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' @@ -33,27 +37,50 @@ echo "════════════════════════ echo " macbook-setup für MBP $MODEL\"" echo "════════════════════════════════════════════" -# ── Phase 1: System-Setup (als root) ──────────────────────────────────── -echo -e "\n>>> Phase 1: setup-base.sh (System)" -curl -fsSL "$SETUP_RAW/setup-base.sh" | sudo bash -s -- "$MODEL" -ok "Phase 1 abgeschlossen" +# ── Phase 1: Repos lokal klonen ────────────────────────────────────────── +echo -e "\n>>> Phase 1: Repos lokal bereitstellen" -# ── Phase 2: Desktop-Setup als Autostart einrichten ────────────────────── -echo -e "\n>>> Phase 2: setup-desktop.sh wird als Autostart eingerichtet" +REPO_DIR="$HOME/git-projekte/macbook-setup" +if [[ -d "$REPO_DIR/.git" ]]; then + ok "macbook-setup bereits vorhanden: $REPO_DIR" +else + mkdir -p "$HOME/git-projekte" + git clone "$MACBOOK_REPO" "$REPO_DIR" + ok "macbook-setup geklont" +fi + +DOTFILES_DIR="$HOME/git-projekte/dotfiles-rene" +if [[ -d "$DOTFILES_DIR/.git" ]]; then + ok "dotfiles-rene bereits vorhanden: $DOTFILES_DIR" +else + echo "" + echo "Dotfiles-Repo wird geklont (Forgejo-Zugangsdaten erforderlich):" + mkdir -p "$HOME/git-projekte" + git clone "$DOTFILES_REPO" "$DOTFILES_DIR" + ok "dotfiles-rene geklont" +fi + +# ── Phase 2: System-Setup (als root) ──────────────────────────────────── +echo -e "\n>>> Phase 2: setup-base.sh (System)" +sudo bash "$REPO_DIR/setup-base.sh" "$MODEL" +ok "Phase 2 abgeschlossen" + +# ── Phase 3: Desktop-Setup als Autostart einrichten ────────────────────── +echo -e "\n>>> Phase 3: setup-desktop.sh wird als Autostart eingerichtet" mkdir -p ~/.config/autostart cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Exec=xfce4-terminal -e "bash -c 'bash $REPO_DIR/setup-desktop.sh 2>&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" Hidden=false X-GNOME-Autostart-enabled=true DTEOF -ok "Autostart für setup-desktop.sh eingerichtet" +ok "Autostart für setup-desktop.sh eingerichtet (lokal: $REPO_DIR)" echo "" echo "════════════════════════════════════════════" -echo -e " ${GREEN}Phase 1 abgeschlossen!${NC}" +echo -e " ${GREEN}Vorbereitung abgeschlossen!${NC}" echo "════════════════════════════════════════════" echo "" echo "Nächster Schritt:" diff --git a/wireguard/iPadM.conf b/wireguard/iPadM.conf new file mode 100755 index 0000000..bc535aa --- /dev/null +++ b/wireguard/iPadM.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = EHTtesjOBYQdhOnii54POY1XivkohZS/3VdZU8xRaUc= +ListenPort = 51820 +Address = 10.13.13.5/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = RCdpZ28dwVsRxTNIDu3C3dhj5byma+azl+Z4PIxbzYc= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/iPadR.conf b/wireguard/iPadR.conf new file mode 100755 index 0000000..1e81e5a --- /dev/null +++ b/wireguard/iPadR.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = CHIzDLQ2Sla/aH591a+OlvG9bjyGDq/toh+NYE6wPFo= +ListenPort = 51820 +Address = 10.13.13.4/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = OSjgUUR8mGAmIAmadioA4RYGluN3ROE5qxfhttyQlvg= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/iPhoneM.conf b/wireguard/iPhoneM.conf new file mode 100755 index 0000000..14072b1 --- /dev/null +++ b/wireguard/iPhoneM.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = OL+CAPy9+HaHLxxqB3+N4ABn51v6xLk8gaGhRWlbG1s= +ListenPort = 51820 +Address = 10.13.13.3/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = MorbmVdEQ79ItWbRs3RI+bh6jxqQFkxa/k06fBjHXS0= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/iPhoneR.conf b/wireguard/iPhoneR.conf new file mode 100755 index 0000000..9489a5d --- /dev/null +++ b/wireguard/iPhoneR.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = oIJYPKn7pmsRFMY5+PIDaXZxDCVug9KsR5ZMjSwdVWw= +ListenPort = 51820 +Address = 10.13.13.2/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = +lNOGDr7RjHZqGa/NtsVBUyknY4+uH8Qe3OAPGqerX8= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 \ No newline at end of file diff --git a/wireguard/m1.conf b/wireguard/m1.conf new file mode 100755 index 0000000..58f30b0 --- /dev/null +++ b/wireguard/m1.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = kEUk6gLdqXiPfOt9n639fshf0gMAhRhoRTRRXoz86Hc= +ListenPort = 51820 +Address = 10.13.13.6/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = nzxhGAJsHPETlYf/yZiZIx0G//ghg3uUDtMgzxzfahI= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/m13.conf b/wireguard/m13.conf new file mode 100755 index 0000000..f1953f9 --- /dev/null +++ b/wireguard/m13.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= +ListenPort = 51820 +Address = 10.13.13.8/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= +PresharedKey = JNq27UrO94P1eSBWfID4TsgQXNKa/PhAKquIHtsq89w= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 \ No newline at end of file diff --git a/wireguard/m16.conf b/wireguard/m16.conf new file mode 100755 index 0000000..c4e08d0 --- /dev/null +++ b/wireguard/m16.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= +ListenPort = 51820 +Address = 10.13.13.7/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= +PresharedKey = vReUFqlQoOG1eUMTje+F2OOtgisgp/vNsDyx6lq3KXE= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 \ No newline at end of file From 6a6acca19fc122f8f7718188e620521ce14e6a72 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 16:52:48 +0100 Subject: [PATCH 070/122] Repos lokal klonen vor Setup, WireGuard automatisch deployen - setup.sh klont macbook-setup + dotfiles-rene lokal (Credentials einmalig im interaktiven Terminal statt im Autostart) - setup-base.sh nutzt lokale Dateien wenn vorhanden (wget-Fallback fuer Autoinstall bleibt erhalten), deployed WireGuard-Config - wireguard/ aus .gitignore entfernt, Configs werden getrackt - WireGuard aus manueller Checkliste entfernt --- .gitignore | 1 - INSTALL.md | 6 ++--- setup-base.sh | 38 +++++++++++++++++++++++++++---- setup-desktop.sh | 10 ++++----- setup.sh | 51 ++++++++++++++++++++++++++++++++---------- wireguard/iPadM.conf | 12 ++++++++++ wireguard/iPadR.conf | 12 ++++++++++ wireguard/iPhoneM.conf | 12 ++++++++++ wireguard/iPhoneR.conf | 12 ++++++++++ wireguard/m1.conf | 12 ++++++++++ wireguard/m13.conf | 12 ++++++++++ wireguard/m16.conf | 12 ++++++++++ 12 files changed, 164 insertions(+), 26 deletions(-) create mode 100755 wireguard/iPadM.conf create mode 100755 wireguard/iPadR.conf create mode 100755 wireguard/iPhoneM.conf create mode 100755 wireguard/iPhoneR.conf create mode 100755 wireguard/m1.conf create mode 100755 wireguard/m13.conf create mode 100755 wireguard/m16.conf diff --git a/.gitignore b/.gitignore index 3880bdb..153f1f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ *.iso .DS_Store -wireguard/ diff --git a/INSTALL.md b/INSTALL.md index e865fda..c87208c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -87,11 +87,11 @@ cat /tmp/setup-desktop.log ### WireGuard -Config-Datei muss separat vorliegen (nicht im Repo). +WireGuard wird automatisch von `setup-base.sh` konfiguriert (Config aus `wireguard/m13.conf` bzw. `wireguard/m16.conf`). Falls nötig, manuell prüfen: ```bash -sudo cp wg0.conf /etc/wireguard/ -sudo systemctl enable --now wg-quick@wg0 +sudo systemctl status wg-quick@wg0 +sudo wg show ``` Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). diff --git a/setup-base.sh b/setup-base.sh index 7220674..5f7bc58 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -13,6 +13,15 @@ ok() { echo -e "${GREEN}✓ $*${NC}"; } warn() { echo -e "${YELLOW}⚠ $*${NC}"; } fail() { echo -e "${RED}✗ $*${NC}"; } +# ── Lokales Repo erkennen (falls nicht via curl|bash) ───────────────── +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)" +if [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/mbpfan-13.conf" ]]; then + REPO_DIR="$SCRIPT_DIR" + ok "Lokales Repo erkannt: $REPO_DIR" +else + REPO_DIR="" +fi + # ── Modell ermitteln ───────────────────────────────────────────────────── if [[ "$1" == "13" || "$1" == "16" ]]; then MODEL="$1" @@ -129,12 +138,33 @@ ok "Brave wird als Flatpak in setup-desktop.sh installiert" echo -e "\n=== 7/11 Systemkonfigurationen ===" # mbpfan (modellabhängig) -wget -q -O /tmp/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" && \ - cp /tmp/mbpfan.conf /etc/mbpfan.conf || warn "mbpfan.conf Download fehlgeschlagen" +if [[ -n "$REPO_DIR" && -f "$REPO_DIR/mbpfan-${MODEL}.conf" ]]; then + cp "$REPO_DIR/mbpfan-${MODEL}.conf" /etc/mbpfan.conf + ok "mbpfan.conf (lokal)" +else + wget -q -O /etc/mbpfan.conf "$SETUP_RAW/mbpfan-${MODEL}.conf" || warn "mbpfan.conf Download fehlgeschlagen" +fi # Temperatur-Watch-Skript -wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" && \ - chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" +if [[ -n "$REPO_DIR" && -f "$REPO_DIR/temp-watch.sh" ]]; then + cp "$REPO_DIR/temp-watch.sh" /usr/local/bin/temp-watch.sh + chmod +x /usr/local/bin/temp-watch.sh + ok "temp-watch.sh (lokal)" +else + wget -q -O /usr/local/bin/temp-watch.sh "$SETUP_RAW/temp-watch.sh" && \ + chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" +fi + +# WireGuard-Config +if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then + mkdir -p /etc/wireguard + cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf + chmod 600 /etc/wireguard/wg0.conf + systemctl enable wg-quick@wg0 2>/dev/null || true + ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" +else + warn "WireGuard: keine lokale Config gefunden — manuell einrichten" +fi ok "Systemkonfigurationen gesetzt" diff --git a/setup-desktop.sh b/setup-desktop.sh index 589105a..5759371 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -273,9 +273,7 @@ echo -e " ${GREEN}Desktop-Setup abgeschlossen!${NC}" echo "============================================" echo "" warn "Noch manuell erledigen:" -echo " 1. WireGuard-Config einspielen:" -echo " sudo cp wg0.conf /etc/wireguard/ && sudo systemctl enable --now wg-quick@wg0" -echo " 2. Synology Drive Client installieren (.deb von synology.com)" -echo " 3. Thunderbird starten → Profil aus Synology Drive einbinden" -echo " 4. Brave starten → Synchronisation einrichten" -echo " 5. Falls p10k-Icons fehlen: Terminal-Schriftart auf 'MesloLGS NF' setzen" +echo " 1. Synology Drive Client installieren (.deb von synology.com)" +echo " 2. Thunderbird starten → Profil aus Synology Drive einbinden" +echo " 3. Brave starten → Synchronisation einrichten" +echo " 4. Falls p10k-Icons fehlen: Terminal-Schriftart auf 'MesloLGS NF' setzen" diff --git a/setup.sh b/setup.sh index 04510a8..71407d4 100644 --- a/setup.sh +++ b/setup.sh @@ -1,11 +1,15 @@ #!/bin/bash # macbook-setup/setup.sh # Post-Install-Skript für Linux auf MacBook Pro -# Startet setup-base.sh und richtet setup-desktop.sh als Autostart ein +# Klont alle Repos lokal, führt setup-base.sh aus und richtet Autostart ein # -# Verwendung: curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +# Verwendung: +# curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash +# oder: cd macbook-setup && bash setup.sh -SETUP_RAW="https://git.motocamp.de/rene/macbook-setup/raw/branch/main" +FORGEJO="https://git.motocamp.de" +MACBOOK_REPO="$FORGEJO/rene/macbook-setup.git" +DOTFILES_REPO="$FORGEJO/rene/dotfiles-rene.git" # ── Farben ────────────────────────────────────────────────────────────── RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' @@ -33,27 +37,50 @@ echo "════════════════════════ echo " macbook-setup für MBP $MODEL\"" echo "════════════════════════════════════════════" -# ── Phase 1: System-Setup (als root) ──────────────────────────────────── -echo -e "\n>>> Phase 1: setup-base.sh (System)" -curl -fsSL "$SETUP_RAW/setup-base.sh" | sudo bash -s -- "$MODEL" -ok "Phase 1 abgeschlossen" +# ── Phase 1: Repos lokal klonen ────────────────────────────────────────── +echo -e "\n>>> Phase 1: Repos lokal bereitstellen" -# ── Phase 2: Desktop-Setup als Autostart einrichten ────────────────────── -echo -e "\n>>> Phase 2: setup-desktop.sh wird als Autostart eingerichtet" +REPO_DIR="$HOME/git-projekte/macbook-setup" +if [[ -d "$REPO_DIR/.git" ]]; then + ok "macbook-setup bereits vorhanden: $REPO_DIR" +else + mkdir -p "$HOME/git-projekte" + git clone "$MACBOOK_REPO" "$REPO_DIR" + ok "macbook-setup geklont" +fi + +DOTFILES_DIR="$HOME/git-projekte/dotfiles-rene" +if [[ -d "$DOTFILES_DIR/.git" ]]; then + ok "dotfiles-rene bereits vorhanden: $DOTFILES_DIR" +else + echo "" + echo "Dotfiles-Repo wird geklont (Forgejo-Zugangsdaten erforderlich):" + mkdir -p "$HOME/git-projekte" + git clone "$DOTFILES_REPO" "$DOTFILES_DIR" + ok "dotfiles-rene geklont" +fi + +# ── Phase 2: System-Setup (als root) ──────────────────────────────────── +echo -e "\n>>> Phase 2: setup-base.sh (System)" +sudo bash "$REPO_DIR/setup-base.sh" "$MODEL" +ok "Phase 2 abgeschlossen" + +# ── Phase 3: Desktop-Setup als Autostart einrichten ────────────────────── +echo -e "\n>>> Phase 3: setup-desktop.sh wird als Autostart eingerichtet" mkdir -p ~/.config/autostart cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Exec=xfce4-terminal -e "bash -c 'bash $REPO_DIR/setup-desktop.sh 2>&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" Hidden=false X-GNOME-Autostart-enabled=true DTEOF -ok "Autostart für setup-desktop.sh eingerichtet" +ok "Autostart für setup-desktop.sh eingerichtet (lokal: $REPO_DIR)" echo "" echo "════════════════════════════════════════════" -echo -e " ${GREEN}Phase 1 abgeschlossen!${NC}" +echo -e " ${GREEN}Vorbereitung abgeschlossen!${NC}" echo "════════════════════════════════════════════" echo "" echo "Nächster Schritt:" diff --git a/wireguard/iPadM.conf b/wireguard/iPadM.conf new file mode 100755 index 0000000..bc535aa --- /dev/null +++ b/wireguard/iPadM.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = EHTtesjOBYQdhOnii54POY1XivkohZS/3VdZU8xRaUc= +ListenPort = 51820 +Address = 10.13.13.5/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = RCdpZ28dwVsRxTNIDu3C3dhj5byma+azl+Z4PIxbzYc= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/iPadR.conf b/wireguard/iPadR.conf new file mode 100755 index 0000000..1e81e5a --- /dev/null +++ b/wireguard/iPadR.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = CHIzDLQ2Sla/aH591a+OlvG9bjyGDq/toh+NYE6wPFo= +ListenPort = 51820 +Address = 10.13.13.4/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = OSjgUUR8mGAmIAmadioA4RYGluN3ROE5qxfhttyQlvg= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/iPhoneM.conf b/wireguard/iPhoneM.conf new file mode 100755 index 0000000..14072b1 --- /dev/null +++ b/wireguard/iPhoneM.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = OL+CAPy9+HaHLxxqB3+N4ABn51v6xLk8gaGhRWlbG1s= +ListenPort = 51820 +Address = 10.13.13.3/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = MorbmVdEQ79ItWbRs3RI+bh6jxqQFkxa/k06fBjHXS0= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/iPhoneR.conf b/wireguard/iPhoneR.conf new file mode 100755 index 0000000..9489a5d --- /dev/null +++ b/wireguard/iPhoneR.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = oIJYPKn7pmsRFMY5+PIDaXZxDCVug9KsR5ZMjSwdVWw= +ListenPort = 51820 +Address = 10.13.13.2/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = +lNOGDr7RjHZqGa/NtsVBUyknY4+uH8Qe3OAPGqerX8= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 \ No newline at end of file diff --git a/wireguard/m1.conf b/wireguard/m1.conf new file mode 100755 index 0000000..58f30b0 --- /dev/null +++ b/wireguard/m1.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = kEUk6gLdqXiPfOt9n639fshf0gMAhRhoRTRRXoz86Hc= +ListenPort = 51820 +Address = 10.13.13.6/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +PresharedKey = nzxhGAJsHPETlYf/yZiZIx0G//ghg3uUDtMgzxzfahI= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 diff --git a/wireguard/m13.conf b/wireguard/m13.conf new file mode 100755 index 0000000..f1953f9 --- /dev/null +++ b/wireguard/m13.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= +ListenPort = 51820 +Address = 10.13.13.8/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= +PresharedKey = JNq27UrO94P1eSBWfID4TsgQXNKa/PhAKquIHtsq89w= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 \ No newline at end of file diff --git a/wireguard/m16.conf b/wireguard/m16.conf new file mode 100755 index 0000000..c4e08d0 --- /dev/null +++ b/wireguard/m16.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= +ListenPort = 51820 +Address = 10.13.13.7/24 +DNS = 10.47.11.21,10.47.11.20 + +[Peer] +PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= +PresharedKey = vReUFqlQoOG1eUMTje+F2OOtgisgp/vNsDyx6lq3KXE= +AllowedIPs = 10.47.11.0/24,10.13.13.0/24 +Endpoint = 24.134.39.137:443 +PersistentKeepalive = 25 \ No newline at end of file From 351a3d5ffe64b40b77f5e24fd7e062cec9d213b3 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 17:43:26 +0100 Subject: [PATCH 071/122] WireGuard DNS-Fix: PiHole primaer, Stub-Resolver umgehen - DNS in allen WireGuard-Configs: 10.47.11.20 (PiHole) + 10.47.11.1 (Fritz!Box Fallback), redundantes PiHole auf .21 entfernt - resolv.conf Symlink auf upstream statt stub (127.0.0.53), da systemd-resolved mit WireGuard DNS catch-all (~.) nicht funktioniert Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 3 +++ wireguard/iPadM.conf | 2 +- wireguard/iPadR.conf | 2 +- wireguard/iPhoneM.conf | 2 +- wireguard/iPhoneR.conf | 2 +- wireguard/m1.conf | 2 +- wireguard/m13.conf | 2 +- wireguard/m16.conf | 2 +- 8 files changed, 10 insertions(+), 7 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 5f7bc58..a441f18 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -161,6 +161,9 @@ if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf chmod 600 /etc/wireguard/wg0.conf systemctl enable wg-quick@wg0 2>/dev/null || true + # systemd-resolved Stub funktioniert nicht mit WireGuard DNS catch-all (~.) + # → resolv.conf direkt auf die upstream-Server zeigen lassen + ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" else warn "WireGuard: keine lokale Config gefunden — manuell einrichten" diff --git a/wireguard/iPadM.conf b/wireguard/iPadM.conf index bc535aa..c664d0d 100755 --- a/wireguard/iPadM.conf +++ b/wireguard/iPadM.conf @@ -2,7 +2,7 @@ PrivateKey = EHTtesjOBYQdhOnii54POY1XivkohZS/3VdZU8xRaUc= ListenPort = 51820 Address = 10.13.13.5/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/iPadR.conf b/wireguard/iPadR.conf index 1e81e5a..533619f 100755 --- a/wireguard/iPadR.conf +++ b/wireguard/iPadR.conf @@ -2,7 +2,7 @@ PrivateKey = CHIzDLQ2Sla/aH591a+OlvG9bjyGDq/toh+NYE6wPFo= ListenPort = 51820 Address = 10.13.13.4/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/iPhoneM.conf b/wireguard/iPhoneM.conf index 14072b1..0813476 100755 --- a/wireguard/iPhoneM.conf +++ b/wireguard/iPhoneM.conf @@ -2,7 +2,7 @@ PrivateKey = OL+CAPy9+HaHLxxqB3+N4ABn51v6xLk8gaGhRWlbG1s= ListenPort = 51820 Address = 10.13.13.3/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/iPhoneR.conf b/wireguard/iPhoneR.conf index 9489a5d..0c813d0 100755 --- a/wireguard/iPhoneR.conf +++ b/wireguard/iPhoneR.conf @@ -2,7 +2,7 @@ PrivateKey = oIJYPKn7pmsRFMY5+PIDaXZxDCVug9KsR5ZMjSwdVWw= ListenPort = 51820 Address = 10.13.13.2/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/m1.conf b/wireguard/m1.conf index 58f30b0..0650ba9 100755 --- a/wireguard/m1.conf +++ b/wireguard/m1.conf @@ -2,7 +2,7 @@ PrivateKey = kEUk6gLdqXiPfOt9n639fshf0gMAhRhoRTRRXoz86Hc= ListenPort = 51820 Address = 10.13.13.6/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/m13.conf b/wireguard/m13.conf index f1953f9..f2688ca 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -2,7 +2,7 @@ PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= ListenPort = 51820 Address = 10.13.13.8/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= diff --git a/wireguard/m16.conf b/wireguard/m16.conf index c4e08d0..b2a1652 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -2,7 +2,7 @@ PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= ListenPort = 51820 Address = 10.13.13.7/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= From 7b478e08e890febb6562fa8c723502cb2a802d6e Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 17:43:26 +0100 Subject: [PATCH 072/122] WireGuard DNS-Fix: PiHole primaer, Stub-Resolver umgehen - DNS in allen WireGuard-Configs: 10.47.11.20 (PiHole) + 10.47.11.1 (Fritz!Box Fallback), redundantes PiHole auf .21 entfernt - resolv.conf Symlink auf upstream statt stub (127.0.0.53), da systemd-resolved mit WireGuard DNS catch-all (~.) nicht funktioniert --- setup-base.sh | 3 +++ wireguard/iPadM.conf | 2 +- wireguard/iPadR.conf | 2 +- wireguard/iPhoneM.conf | 2 +- wireguard/iPhoneR.conf | 2 +- wireguard/m1.conf | 2 +- wireguard/m13.conf | 2 +- wireguard/m16.conf | 2 +- 8 files changed, 10 insertions(+), 7 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 5f7bc58..a441f18 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -161,6 +161,9 @@ if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf chmod 600 /etc/wireguard/wg0.conf systemctl enable wg-quick@wg0 2>/dev/null || true + # systemd-resolved Stub funktioniert nicht mit WireGuard DNS catch-all (~.) + # → resolv.conf direkt auf die upstream-Server zeigen lassen + ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" else warn "WireGuard: keine lokale Config gefunden — manuell einrichten" diff --git a/wireguard/iPadM.conf b/wireguard/iPadM.conf index bc535aa..c664d0d 100755 --- a/wireguard/iPadM.conf +++ b/wireguard/iPadM.conf @@ -2,7 +2,7 @@ PrivateKey = EHTtesjOBYQdhOnii54POY1XivkohZS/3VdZU8xRaUc= ListenPort = 51820 Address = 10.13.13.5/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/iPadR.conf b/wireguard/iPadR.conf index 1e81e5a..533619f 100755 --- a/wireguard/iPadR.conf +++ b/wireguard/iPadR.conf @@ -2,7 +2,7 @@ PrivateKey = CHIzDLQ2Sla/aH591a+OlvG9bjyGDq/toh+NYE6wPFo= ListenPort = 51820 Address = 10.13.13.4/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/iPhoneM.conf b/wireguard/iPhoneM.conf index 14072b1..0813476 100755 --- a/wireguard/iPhoneM.conf +++ b/wireguard/iPhoneM.conf @@ -2,7 +2,7 @@ PrivateKey = OL+CAPy9+HaHLxxqB3+N4ABn51v6xLk8gaGhRWlbG1s= ListenPort = 51820 Address = 10.13.13.3/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/iPhoneR.conf b/wireguard/iPhoneR.conf index 9489a5d..0c813d0 100755 --- a/wireguard/iPhoneR.conf +++ b/wireguard/iPhoneR.conf @@ -2,7 +2,7 @@ PrivateKey = oIJYPKn7pmsRFMY5+PIDaXZxDCVug9KsR5ZMjSwdVWw= ListenPort = 51820 Address = 10.13.13.2/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/m1.conf b/wireguard/m1.conf index 58f30b0..0650ba9 100755 --- a/wireguard/m1.conf +++ b/wireguard/m1.conf @@ -2,7 +2,7 @@ PrivateKey = kEUk6gLdqXiPfOt9n639fshf0gMAhRhoRTRRXoz86Hc= ListenPort = 51820 Address = 10.13.13.6/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= diff --git a/wireguard/m13.conf b/wireguard/m13.conf index f1953f9..f2688ca 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -2,7 +2,7 @@ PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= ListenPort = 51820 Address = 10.13.13.8/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= diff --git a/wireguard/m16.conf b/wireguard/m16.conf index c4e08d0..b2a1652 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -2,7 +2,7 @@ PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= ListenPort = 51820 Address = 10.13.13.7/24 -DNS = 10.47.11.21,10.47.11.20 +DNS = 10.47.11.20,10.47.11.1 [Peer] PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= From fe5a515bfe391d684a3f7bbac4c832e9051e9f66 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 17:54:06 +0100 Subject: [PATCH 073/122] Autostart-Eintrag vor setup-base.sh anlegen Autostart fuer setup-desktop.sh wird jetzt in Phase 2 erstellt (vor setup-base.sh), damit er auch bei Abbruch vorhanden ist. Co-Authored-By: Claude Opus 4.6 --- setup.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index 71407d4..2af7d83 100644 --- a/setup.sh +++ b/setup.sh @@ -60,13 +60,9 @@ else ok "dotfiles-rene geklont" fi -# ── Phase 2: System-Setup (als root) ──────────────────────────────────── -echo -e "\n>>> Phase 2: setup-base.sh (System)" -sudo bash "$REPO_DIR/setup-base.sh" "$MODEL" -ok "Phase 2 abgeschlossen" - -# ── Phase 3: Desktop-Setup als Autostart einrichten ────────────────────── -echo -e "\n>>> Phase 3: setup-desktop.sh wird als Autostart eingerichtet" +# ── Phase 2: Desktop-Setup als Autostart einrichten (VOR base, damit es ── +# ── bei Abbruch von setup-base.sh trotzdem vorhanden ist) ─────────────── +echo -e "\n>>> Phase 2: setup-desktop.sh als Autostart einrichten" mkdir -p ~/.config/autostart cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp Hidden=false X-GNOME-Autostart-enabled=true DTEOF -ok "Autostart für setup-desktop.sh eingerichtet (lokal: $REPO_DIR)" +ok "Autostart eingerichtet (lokal: $REPO_DIR)" + +# ── Phase 3: System-Setup (als root) ──────────────────────────────────── +echo -e "\n>>> Phase 3: setup-base.sh (System)" +sudo bash "$REPO_DIR/setup-base.sh" "$MODEL" +ok "Phase 3 abgeschlossen" echo "" echo "════════════════════════════════════════════" From 37fa959182b1806a22d76691a41981053609c5da Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 17:54:06 +0100 Subject: [PATCH 074/122] Autostart-Eintrag vor setup-base.sh anlegen Autostart fuer setup-desktop.sh wird jetzt in Phase 2 erstellt (vor setup-base.sh), damit er auch bei Abbruch vorhanden ist. --- setup.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index 71407d4..2af7d83 100644 --- a/setup.sh +++ b/setup.sh @@ -60,13 +60,9 @@ else ok "dotfiles-rene geklont" fi -# ── Phase 2: System-Setup (als root) ──────────────────────────────────── -echo -e "\n>>> Phase 2: setup-base.sh (System)" -sudo bash "$REPO_DIR/setup-base.sh" "$MODEL" -ok "Phase 2 abgeschlossen" - -# ── Phase 3: Desktop-Setup als Autostart einrichten ────────────────────── -echo -e "\n>>> Phase 3: setup-desktop.sh wird als Autostart eingerichtet" +# ── Phase 2: Desktop-Setup als Autostart einrichten (VOR base, damit es ── +# ── bei Abbruch von setup-base.sh trotzdem vorhanden ist) ─────────────── +echo -e "\n>>> Phase 2: setup-desktop.sh als Autostart einrichten" mkdir -p ~/.config/autostart cat > ~/.config/autostart/macbook-setup-desktop.desktop <&1 | tee /tmp Hidden=false X-GNOME-Autostart-enabled=true DTEOF -ok "Autostart für setup-desktop.sh eingerichtet (lokal: $REPO_DIR)" +ok "Autostart eingerichtet (lokal: $REPO_DIR)" + +# ── Phase 3: System-Setup (als root) ──────────────────────────────────── +echo -e "\n>>> Phase 3: setup-base.sh (System)" +sudo bash "$REPO_DIR/setup-base.sh" "$MODEL" +ok "Phase 3 abgeschlossen" echo "" echo "════════════════════════════════════════════" From 8e0c2d8e116b6eda39e709299800c464ce0bc571 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 18:06:59 +0100 Subject: [PATCH 075/122] git installieren falls nicht vorhanden (Ubuntu Minimized) Co-Authored-By: Claude Opus 4.6 --- setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.sh b/setup.sh index 2af7d83..89be28e 100644 --- a/setup.sh +++ b/setup.sh @@ -37,6 +37,12 @@ echo "════════════════════════ echo " macbook-setup für MBP $MODEL\"" echo "════════════════════════════════════════════" +# ── Voraussetzungen (git fehlt in Ubuntu Server Minimized) ──────────────── +if ! command -v git &>/dev/null; then + echo -e "\n>>> git wird installiert..." + sudo apt update && sudo apt install -y git +fi + # ── Phase 1: Repos lokal klonen ────────────────────────────────────────── echo -e "\n>>> Phase 1: Repos lokal bereitstellen" From b4220333ed33811033d9ef79c71106710f01a6bd Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 18:06:59 +0100 Subject: [PATCH 076/122] git installieren falls nicht vorhanden (Ubuntu Minimized) --- setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.sh b/setup.sh index 2af7d83..89be28e 100644 --- a/setup.sh +++ b/setup.sh @@ -37,6 +37,12 @@ echo "════════════════════════ echo " macbook-setup für MBP $MODEL\"" echo "════════════════════════════════════════════" +# ── Voraussetzungen (git fehlt in Ubuntu Server Minimized) ──────────────── +if ! command -v git &>/dev/null; then + echo -e "\n>>> git wird installiert..." + sudo apt update && sudo apt install -y git +fi + # ── Phase 1: Repos lokal klonen ────────────────────────────────────────── echo -e "\n>>> Phase 1: Repos lokal bereitstellen" From 8102d9ea40b1ba040bcc83983d1ba68bd32458a1 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 18:34:11 +0100 Subject: [PATCH 077/122] WLAN als NetworkManager-Profil anlegen statt nmcli connect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nmcli connect ist nicht persistent wenn NM noch nicht laeuft. Stattdessen .nmconnection-Datei direkt schreiben — ueberlebt Reboot und verbindet automatisch. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index a441f18..80c2233 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -274,10 +274,32 @@ if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; sensors-detect --auto 2>/dev/null || true fi -# WLAN-Verbindung in NetworkManager einrichten (aus gesicherter netplan-Config) +# WLAN-Verbindung als NetworkManager-Profil anlegen (überlebt Reboot) if [[ -n "$WLAN_SSID" && -n "$WLAN_PASS" ]]; then - nmcli device wifi connect "$WLAN_SSID" password "$WLAN_PASS" 2>/dev/null || true - ok "WLAN wiederhergestellt: $WLAN_SSID" + NM_CONN_DIR="/etc/NetworkManager/system-connections" + mkdir -p "$NM_CONN_DIR" + cat > "$NM_CONN_DIR/$WLAN_SSID.nmconnection" < Date: Thu, 12 Mar 2026 18:34:11 +0100 Subject: [PATCH 078/122] WLAN als NetworkManager-Profil anlegen statt nmcli connect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nmcli connect ist nicht persistent wenn NM noch nicht laeuft. Stattdessen .nmconnection-Datei direkt schreiben — ueberlebt Reboot und verbindet automatisch. --- setup-base.sh | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index a441f18..80c2233 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -274,10 +274,32 @@ if [[ "$(stat -c %d:%i /)" == "$(stat -c %d:%i /proc/1/root/.)" ]] 2>/dev/null; sensors-detect --auto 2>/dev/null || true fi -# WLAN-Verbindung in NetworkManager einrichten (aus gesicherter netplan-Config) +# WLAN-Verbindung als NetworkManager-Profil anlegen (überlebt Reboot) if [[ -n "$WLAN_SSID" && -n "$WLAN_PASS" ]]; then - nmcli device wifi connect "$WLAN_SSID" password "$WLAN_PASS" 2>/dev/null || true - ok "WLAN wiederhergestellt: $WLAN_SSID" + NM_CONN_DIR="/etc/NetworkManager/system-connections" + mkdir -p "$NM_CONN_DIR" + cat > "$NM_CONN_DIR/$WLAN_SSID.nmconnection" < Date: Thu, 12 Mar 2026 18:37:32 +0100 Subject: [PATCH 079/122] Autostart fuer setup-desktop.sh auch in setup-base.sh anlegen Der Autostart-Eintrag aus setup.sh ging beim ersten XFCE-Start verloren. Jetzt wird er zusaetzlich am Ende von setup-base.sh angelegt (als root), damit er zuverlaessig vorhanden ist. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index 80c2233..7eb2bbe 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -305,6 +305,24 @@ fi # zsh als Standard-Shell chsh -s /bin/zsh rene 2>/dev/null || true +# Autostart für setup-desktop.sh anlegen (als root, da setup.sh-Eintrag +# beim ersten XFCE-Start verloren gehen kann) +REPO_DIR_USER="/home/rene/git-projekte/macbook-setup" +if [[ -f "$REPO_DIR_USER/setup-desktop.sh" ]]; then + AUTOSTART_DIR="/home/rene/.config/autostart" + mkdir -p "$AUTOSTART_DIR" + cat > "$AUTOSTART_DIR/macbook-setup-desktop.desktop" <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Hidden=false +X-GNOME-Autostart-enabled=true +ASEOF + chown -R 1000:1000 "$AUTOSTART_DIR" + ok "Autostart für setup-desktop.sh eingerichtet" +fi + # Sleep wieder erlauben systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true From d98fa5530bb9d427665bb32fee1c5ac3e8967a0f Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 12 Mar 2026 18:37:32 +0100 Subject: [PATCH 080/122] Autostart fuer setup-desktop.sh auch in setup-base.sh anlegen Der Autostart-Eintrag aus setup.sh ging beim ersten XFCE-Start verloren. Jetzt wird er zusaetzlich am Ende von setup-base.sh angelegt (als root), damit er zuverlaessig vorhanden ist. --- setup-base.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index 80c2233..7eb2bbe 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -305,6 +305,24 @@ fi # zsh als Standard-Shell chsh -s /bin/zsh rene 2>/dev/null || true +# Autostart für setup-desktop.sh anlegen (als root, da setup.sh-Eintrag +# beim ersten XFCE-Start verloren gehen kann) +REPO_DIR_USER="/home/rene/git-projekte/macbook-setup" +if [[ -f "$REPO_DIR_USER/setup-desktop.sh" ]]; then + AUTOSTART_DIR="/home/rene/.config/autostart" + mkdir -p "$AUTOSTART_DIR" + cat > "$AUTOSTART_DIR/macbook-setup-desktop.desktop" <&1 | tee /tmp/setup-desktop.log; echo; echo Setup abgeschlossen - Enter zum Schliessen; read'" +Hidden=false +X-GNOME-Autostart-enabled=true +ASEOF + chown -R 1000:1000 "$AUTOSTART_DIR" + ok "Autostart für setup-desktop.sh eingerichtet" +fi + # Sleep wieder erlauben systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true From 72a177e0e5cb0ffc2bef32f95b7dc1ceeafcf0ea Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 13 Mar 2026 08:54:24 +0100 Subject: [PATCH 081/122] WireGuard DNS via resolvectl statt DNS= Direktive wg-quick DNS= setzt catch-all (~.) ueber resolvconf, was systemd-resolved Stub-Resolver blockiert. Flatpak-Apps (Brave, PrusaSlicer) koennen 127.0.0.53 nicht erreichen und haben kein DNS. Fix: PostUp/PostDown mit resolvectl fuer korrektes Interface-basiertes DNS. resolv.conf zeigt auf stub-resolv.conf. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 6 +++--- wireguard/m13.conf | 3 ++- wireguard/m16.conf | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 7eb2bbe..6c623bc 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -161,9 +161,9 @@ if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf chmod 600 /etc/wireguard/wg0.conf systemctl enable wg-quick@wg0 2>/dev/null || true - # systemd-resolved Stub funktioniert nicht mit WireGuard DNS catch-all (~.) - # → resolv.conf direkt auf die upstream-Server zeigen lassen - ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf + # Stub-Resolver noetig fuer Flatpak-Apps (Brave, PrusaSlicer) + # DNS wird per PostUp/PostDown in der wg-Config via resolvectl gesetzt + ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" else warn "WireGuard: keine lokale Config gefunden — manuell einrichten" diff --git a/wireguard/m13.conf b/wireguard/m13.conf index f2688ca..a2cfb3d 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -2,7 +2,8 @@ PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= ListenPort = 51820 Address = 10.13.13.8/24 -DNS = 10.47.11.20,10.47.11.1 +PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 +PostDown = resolvectl revert %i [Peer] PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= diff --git a/wireguard/m16.conf b/wireguard/m16.conf index b2a1652..510ccb7 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -2,7 +2,8 @@ PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= ListenPort = 51820 Address = 10.13.13.7/24 -DNS = 10.47.11.20,10.47.11.1 +PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 +PostDown = resolvectl revert %i [Peer] PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= From da87ac255e6db36c53359469b28eeb1946e4c6ce Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 13 Mar 2026 08:54:24 +0100 Subject: [PATCH 082/122] WireGuard DNS via resolvectl statt DNS= Direktive wg-quick DNS= setzt catch-all (~.) ueber resolvconf, was systemd-resolved Stub-Resolver blockiert. Flatpak-Apps (Brave, PrusaSlicer) koennen 127.0.0.53 nicht erreichen und haben kein DNS. Fix: PostUp/PostDown mit resolvectl fuer korrektes Interface-basiertes DNS. resolv.conf zeigt auf stub-resolv.conf. --- setup-base.sh | 6 +++--- wireguard/m13.conf | 3 ++- wireguard/m16.conf | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 7eb2bbe..6c623bc 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -161,9 +161,9 @@ if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf chmod 600 /etc/wireguard/wg0.conf systemctl enable wg-quick@wg0 2>/dev/null || true - # systemd-resolved Stub funktioniert nicht mit WireGuard DNS catch-all (~.) - # → resolv.conf direkt auf die upstream-Server zeigen lassen - ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf + # Stub-Resolver noetig fuer Flatpak-Apps (Brave, PrusaSlicer) + # DNS wird per PostUp/PostDown in der wg-Config via resolvectl gesetzt + ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" else warn "WireGuard: keine lokale Config gefunden — manuell einrichten" diff --git a/wireguard/m13.conf b/wireguard/m13.conf index f2688ca..a2cfb3d 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -2,7 +2,8 @@ PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= ListenPort = 51820 Address = 10.13.13.8/24 -DNS = 10.47.11.20,10.47.11.1 +PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 +PostDown = resolvectl revert %i [Peer] PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= diff --git a/wireguard/m16.conf b/wireguard/m16.conf index b2a1652..510ccb7 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -2,7 +2,8 @@ PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= ListenPort = 51820 Address = 10.13.13.7/24 -DNS = 10.47.11.20,10.47.11.1 +PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 +PostDown = resolvectl revert %i [Peer] PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= From 13177aba11b62bb08a6a89c85044b823bbf54a8d Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 13 Mar 2026 19:35:42 +0100 Subject: [PATCH 083/122] WireGuard via NM .nmconnection + sudoers-Fix fuer macOS-Installer - sudoers: macOS-Version durch Linux-Standard ersetzen (secure_path, @includedir /etc/sudoers.d), NOPASSWD fuer rene - WireGuard: statt wg-quick .nmconnection direkt schreiben mit DNS, dns-search ~., autoconnect, persistent Keys (private-key-flags=0) - m13.conf/m16.conf: PostUp/PostDown entfernt (wg-quick-spezifisch) Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 76 ++++++++++++++++++++++++++++++++++++++++------ wireguard/m13.conf | 2 -- wireguard/m16.conf | 2 -- 3 files changed, 66 insertions(+), 14 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 6c623bc..70156a7 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -40,6 +40,23 @@ echo "════════════════════════ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" +# ── 0. sudoers reparieren (macOS-Installer hinterlässt macOS-sudoers) ────── +echo -e "\n=== 0/11 sudoers ===" +cat > /etc/sudoers <<'SUDOEOF' +Defaults env_reset +Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +root ALL=(ALL:ALL) ALL +%sudo ALL=(ALL:ALL) ALL + +@includedir /etc/sudoers.d +SUDOEOF +chmod 440 /etc/sudoers +# Passwordless sudo fuer rene +echo "rene ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/rene +chmod 440 /etc/sudoers.d/rene +ok "sudoers: Linux-Standard + NOPASSWD fuer rene" + # ── 1. Kritische Hardware-Fixes ZUERST (vor allem anderen) ─────────────── echo -e "\n=== 1/11 Hardware-Fixes ===" @@ -155,16 +172,55 @@ else chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" fi -# WireGuard-Config -if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then - mkdir -p /etc/wireguard - cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf - chmod 600 /etc/wireguard/wg0.conf - systemctl enable wg-quick@wg0 2>/dev/null || true - # Stub-Resolver noetig fuer Flatpak-Apps (Brave, PrusaSlicer) - # DNS wird per PostUp/PostDown in der wg-Config via resolvectl gesetzt - ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf - ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" +# WireGuard via NetworkManager (.nmconnection direkt schreiben, kein nmcli noetig) +WG_CONF="$REPO_DIR/wireguard/m${MODEL}.conf" +if [[ -n "$REPO_DIR" && -f "$WG_CONF" ]]; then + # Alte wg-quick-Config entfernen falls vorhanden + systemctl disable --now wg-quick@wg0 2>/dev/null || true + # Werte aus der WireGuard-Conf lesen + WG_PRIVKEY=$(grep -oP 'PrivateKey\s*=\s*\K.*' "$WG_CONF") + WG_LISTEN=$(grep -oP 'ListenPort\s*=\s*\K.*' "$WG_CONF") + WG_ADDR=$(grep -oP 'Address\s*=\s*\K.*' "$WG_CONF") + WG_PUBKEY=$(grep -oP 'PublicKey\s*=\s*\K.*' "$WG_CONF") + WG_PSK=$(grep -oP 'PresharedKey\s*=\s*\K.*' "$WG_CONF") + WG_ALLOWED=$(grep -oP 'AllowedIPs\s*=\s*\K.*' "$WG_CONF" | tr -d ' ') + WG_ENDPOINT=$(grep -oP 'Endpoint\s*=\s*\K.*' "$WG_CONF") + WG_KEEPALIVE=$(grep -oP 'PersistentKeepalive\s*=\s*\K.*' "$WG_CONF") + # NM-Verbindungsdatei direkt schreiben (laeuft als root, Keys persistent) + NM_CONN_DIR="/etc/NetworkManager/system-connections" + mkdir -p "$NM_CONN_DIR" + cat > "$NM_CONN_DIR/wg0.nmconnection" </dev/null || true + nmcli connection up wg0 2>/dev/null || true + ok "WireGuard wg0.nmconnection geschrieben (DNS: 10.47.11.20, 10.47.11.1, autoconnect)" else warn "WireGuard: keine lokale Config gefunden — manuell einrichten" fi diff --git a/wireguard/m13.conf b/wireguard/m13.conf index a2cfb3d..66e7d39 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -2,8 +2,6 @@ PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= ListenPort = 51820 Address = 10.13.13.8/24 -PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 -PostDown = resolvectl revert %i [Peer] PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= diff --git a/wireguard/m16.conf b/wireguard/m16.conf index 510ccb7..d20dde8 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -2,8 +2,6 @@ PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= ListenPort = 51820 Address = 10.13.13.7/24 -PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 -PostDown = resolvectl revert %i [Peer] PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= From 384f44441bf91e157dfaa6f64dd1a35f30dcaf6e Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 13 Mar 2026 19:35:42 +0100 Subject: [PATCH 084/122] WireGuard via NM .nmconnection + sudoers-Fix fuer macOS-Installer - sudoers: macOS-Version durch Linux-Standard ersetzen (secure_path, @includedir /etc/sudoers.d), NOPASSWD fuer rene - WireGuard: statt wg-quick .nmconnection direkt schreiben mit DNS, dns-search ~., autoconnect, persistent Keys (private-key-flags=0) - m13.conf/m16.conf: PostUp/PostDown entfernt (wg-quick-spezifisch) --- setup-base.sh | 76 ++++++++++++++++++++++++++++++++++++++++------ wireguard/m13.conf | 2 -- wireguard/m16.conf | 2 -- 3 files changed, 66 insertions(+), 14 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 6c623bc..70156a7 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -40,6 +40,23 @@ echo "════════════════════════ echo " setup-base.sh für MBP $MODEL\" startet" echo "════════════════════════════════════════════" +# ── 0. sudoers reparieren (macOS-Installer hinterlässt macOS-sudoers) ────── +echo -e "\n=== 0/11 sudoers ===" +cat > /etc/sudoers <<'SUDOEOF' +Defaults env_reset +Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +root ALL=(ALL:ALL) ALL +%sudo ALL=(ALL:ALL) ALL + +@includedir /etc/sudoers.d +SUDOEOF +chmod 440 /etc/sudoers +# Passwordless sudo fuer rene +echo "rene ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/rene +chmod 440 /etc/sudoers.d/rene +ok "sudoers: Linux-Standard + NOPASSWD fuer rene" + # ── 1. Kritische Hardware-Fixes ZUERST (vor allem anderen) ─────────────── echo -e "\n=== 1/11 Hardware-Fixes ===" @@ -155,16 +172,55 @@ else chmod +x /usr/local/bin/temp-watch.sh || warn "temp-watch.sh Download fehlgeschlagen" fi -# WireGuard-Config -if [[ -n "$REPO_DIR" && -f "$REPO_DIR/wireguard/m${MODEL}.conf" ]]; then - mkdir -p /etc/wireguard - cp "$REPO_DIR/wireguard/m${MODEL}.conf" /etc/wireguard/wg0.conf - chmod 600 /etc/wireguard/wg0.conf - systemctl enable wg-quick@wg0 2>/dev/null || true - # Stub-Resolver noetig fuer Flatpak-Apps (Brave, PrusaSlicer) - # DNS wird per PostUp/PostDown in der wg-Config via resolvectl gesetzt - ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf - ok "WireGuard m${MODEL}.conf → /etc/wireguard/wg0.conf" +# WireGuard via NetworkManager (.nmconnection direkt schreiben, kein nmcli noetig) +WG_CONF="$REPO_DIR/wireguard/m${MODEL}.conf" +if [[ -n "$REPO_DIR" && -f "$WG_CONF" ]]; then + # Alte wg-quick-Config entfernen falls vorhanden + systemctl disable --now wg-quick@wg0 2>/dev/null || true + # Werte aus der WireGuard-Conf lesen + WG_PRIVKEY=$(grep -oP 'PrivateKey\s*=\s*\K.*' "$WG_CONF") + WG_LISTEN=$(grep -oP 'ListenPort\s*=\s*\K.*' "$WG_CONF") + WG_ADDR=$(grep -oP 'Address\s*=\s*\K.*' "$WG_CONF") + WG_PUBKEY=$(grep -oP 'PublicKey\s*=\s*\K.*' "$WG_CONF") + WG_PSK=$(grep -oP 'PresharedKey\s*=\s*\K.*' "$WG_CONF") + WG_ALLOWED=$(grep -oP 'AllowedIPs\s*=\s*\K.*' "$WG_CONF" | tr -d ' ') + WG_ENDPOINT=$(grep -oP 'Endpoint\s*=\s*\K.*' "$WG_CONF") + WG_KEEPALIVE=$(grep -oP 'PersistentKeepalive\s*=\s*\K.*' "$WG_CONF") + # NM-Verbindungsdatei direkt schreiben (laeuft als root, Keys persistent) + NM_CONN_DIR="/etc/NetworkManager/system-connections" + mkdir -p "$NM_CONN_DIR" + cat > "$NM_CONN_DIR/wg0.nmconnection" </dev/null || true + nmcli connection up wg0 2>/dev/null || true + ok "WireGuard wg0.nmconnection geschrieben (DNS: 10.47.11.20, 10.47.11.1, autoconnect)" else warn "WireGuard: keine lokale Config gefunden — manuell einrichten" fi diff --git a/wireguard/m13.conf b/wireguard/m13.conf index a2cfb3d..66e7d39 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -2,8 +2,6 @@ PrivateKey = sIxh2D50+9bpWe6O6ezrfybW9Iy6QKcrwr9hmFpuGn0= ListenPort = 51820 Address = 10.13.13.8/24 -PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 -PostDown = resolvectl revert %i [Peer] PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= diff --git a/wireguard/m16.conf b/wireguard/m16.conf index 510ccb7..d20dde8 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -2,8 +2,6 @@ PrivateKey = OA5IiSzPglSY8GdobOYMlaOaG+QqNjHIACBRe7MvK04= ListenPort = 51820 Address = 10.13.13.7/24 -PostUp = resolvectl dns %i 10.47.11.20 10.47.11.1 -PostDown = resolvectl revert %i [Peer] PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= From f35bed5598e46d2c4ebc4417c6f7b3b4a5b69444 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 13 Mar 2026 20:26:29 +0100 Subject: [PATCH 085/122] Falsche Peer-PublicKeys in m16/m13 WireGuard-Configs korrigiert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - m16.conf/m13.conf: Peer-PublicKey war der eigene statt der des Servers, dadurch wurde kein Peer geladen und DNS/VPN funktionierte nicht - setup-base.sh: AllowedIPs Komma→Semikolon fuer NM-Format Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 2 +- wireguard/m13.conf | 2 +- wireguard/m16.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 70156a7..ea750ae 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -183,7 +183,7 @@ if [[ -n "$REPO_DIR" && -f "$WG_CONF" ]]; then WG_ADDR=$(grep -oP 'Address\s*=\s*\K.*' "$WG_CONF") WG_PUBKEY=$(grep -oP 'PublicKey\s*=\s*\K.*' "$WG_CONF") WG_PSK=$(grep -oP 'PresharedKey\s*=\s*\K.*' "$WG_CONF") - WG_ALLOWED=$(grep -oP 'AllowedIPs\s*=\s*\K.*' "$WG_CONF" | tr -d ' ') + WG_ALLOWED=$(grep -oP 'AllowedIPs\s*=\s*\K.*' "$WG_CONF" | tr -d ' ' | tr ',' ';') WG_ENDPOINT=$(grep -oP 'Endpoint\s*=\s*\K.*' "$WG_CONF") WG_KEEPALIVE=$(grep -oP 'PersistentKeepalive\s*=\s*\K.*' "$WG_CONF") # NM-Verbindungsdatei direkt schreiben (laeuft als root, Keys persistent) diff --git a/wireguard/m13.conf b/wireguard/m13.conf index 66e7d39..177a5e1 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -4,7 +4,7 @@ ListenPort = 51820 Address = 10.13.13.8/24 [Peer] -PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= PresharedKey = JNq27UrO94P1eSBWfID4TsgQXNKa/PhAKquIHtsq89w= AllowedIPs = 10.47.11.0/24,10.13.13.0/24 Endpoint = 24.134.39.137:443 diff --git a/wireguard/m16.conf b/wireguard/m16.conf index d20dde8..5b25c10 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -4,7 +4,7 @@ ListenPort = 51820 Address = 10.13.13.7/24 [Peer] -PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= PresharedKey = vReUFqlQoOG1eUMTje+F2OOtgisgp/vNsDyx6lq3KXE= AllowedIPs = 10.47.11.0/24,10.13.13.0/24 Endpoint = 24.134.39.137:443 From 75de3c203bb1f4feddd6dbafc820dfa6f6594b14 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 13 Mar 2026 20:26:29 +0100 Subject: [PATCH 086/122] Falsche Peer-PublicKeys in m16/m13 WireGuard-Configs korrigiert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - m16.conf/m13.conf: Peer-PublicKey war der eigene statt der des Servers, dadurch wurde kein Peer geladen und DNS/VPN funktionierte nicht - setup-base.sh: AllowedIPs Komma→Semikolon fuer NM-Format --- setup-base.sh | 2 +- wireguard/m13.conf | 2 +- wireguard/m16.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index 70156a7..ea750ae 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -183,7 +183,7 @@ if [[ -n "$REPO_DIR" && -f "$WG_CONF" ]]; then WG_ADDR=$(grep -oP 'Address\s*=\s*\K.*' "$WG_CONF") WG_PUBKEY=$(grep -oP 'PublicKey\s*=\s*\K.*' "$WG_CONF") WG_PSK=$(grep -oP 'PresharedKey\s*=\s*\K.*' "$WG_CONF") - WG_ALLOWED=$(grep -oP 'AllowedIPs\s*=\s*\K.*' "$WG_CONF" | tr -d ' ') + WG_ALLOWED=$(grep -oP 'AllowedIPs\s*=\s*\K.*' "$WG_CONF" | tr -d ' ' | tr ',' ';') WG_ENDPOINT=$(grep -oP 'Endpoint\s*=\s*\K.*' "$WG_CONF") WG_KEEPALIVE=$(grep -oP 'PersistentKeepalive\s*=\s*\K.*' "$WG_CONF") # NM-Verbindungsdatei direkt schreiben (laeuft als root, Keys persistent) diff --git a/wireguard/m13.conf b/wireguard/m13.conf index 66e7d39..177a5e1 100755 --- a/wireguard/m13.conf +++ b/wireguard/m13.conf @@ -4,7 +4,7 @@ ListenPort = 51820 Address = 10.13.13.8/24 [Peer] -PublicKey = 7WrqHPof31gcCYMjLWPoP1EIxPR2896/3KL1pQ3YZGs= +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= PresharedKey = JNq27UrO94P1eSBWfID4TsgQXNKa/PhAKquIHtsq89w= AllowedIPs = 10.47.11.0/24,10.13.13.0/24 Endpoint = 24.134.39.137:443 diff --git a/wireguard/m16.conf b/wireguard/m16.conf index d20dde8..5b25c10 100755 --- a/wireguard/m16.conf +++ b/wireguard/m16.conf @@ -4,7 +4,7 @@ ListenPort = 51820 Address = 10.13.13.7/24 [Peer] -PublicKey = J/dD1t3Bo9Zbcvxg6PvGP78kgMlL4s4yYfrUMpcoS2w= +PublicKey = mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= PresharedKey = vReUFqlQoOG1eUMTje+F2OOtgisgp/vNsDyx6lq3KXE= AllowedIPs = 10.47.11.0/24,10.13.13.0/24 Endpoint = 24.134.39.137:443 From 564fd365d4fa642eac655cdf3020006bbe60aaff Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 08:15:31 +0100 Subject: [PATCH 087/122] CLAUDE.md mit allen Projekt-Erkenntnissen fuer portable Nutzung Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..fba521f --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,103 @@ +# macbook-setup - Projektkontext fuer Claude Code + +## Projekt-Uebersicht +Setup-Skripte fuer Ubuntu 24.04 auf alten MacBook Pros (Xubuntu-Desktop). +Repo liegt auf Gitea: git.motocamp.de/rene/macbook-setup + +## Hardware + +| Bezeichnung | Modell | CPU | GPU | Display | Besonderheiten | +|---|---|---|---|---|---| +| m16 | MBP 15" Mid 2014 | i7-4980HQ | Intel HD 5200 + AMD Radeon R9 M370X | Retina (2x) | AMD muss geblockt werden (amdgpu blacklist) | +| m13 | MBP 13" Late 2013 | - | nur Intel | Retina (2x) | - | + +- WLAN: Broadcom BCM4360 (kein Treiber im Ubuntu-Installer!) +- m16 erreichbar per `ssh rene@m16.local`, sudo ohne Passwort konfiguriert + +## Netzwerk +- Subnetz: 10.47.11.0/24 +- Fritz!Box: 10.47.11.1 +- Synology: 10.47.11.10 (dsm.motocamp.de) + +## Installations-Workflow (WICHTIG) +1. **Stock Ubuntu 24.04 Server ISO** auf USB-Stick (dd) - **NICHT** das custom ISO (build-iso.sh)! +2. Interaktiv installieren: Sprache, Tastatur, **WLAN im Installer einrichten**, User `rene`, LVM +3. Neustarten, einloggen als rene +4. `curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16` +5. Neustarten, in XFCE einloggen +6. `curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash` + +**Warum kein custom ISO:** Broadcom-WLAN hat keinen Treiber in der Live-Umgebung. +Der interaktive Installer hat einen eingebauten WLAN-Schritt. Ohne Netzwerk koennen +die Setup-Skripte nicht heruntergeladen werden. + +## Arbeitsweise +- Rene verbindet sich per SSH auf das MacBook und fuehrt Befehle dort aus +- Wenn Befehle auf dem MacBook noetig sind: per `ssh rene@` verbinden und dort ausfuehren (statt den User bitten, Befehle abzutippen) + +## Paketquellen-Zuordnung +- **apt:** System-Pakete, xubuntu-desktop, Thunderbird, KeePassXC, default-jre etc. +- **Snap:** FreeCAD, LibreOffice (wegen "benutzerdefinierte Installation nicht abgeschlossen" Bug bei .deb) +- **Flatpak:** Brave Browser (wegen SIGTRAP/int3 Crash bei .deb auf aelterer HW), PrusaSlicer +- flatpak muss in setup-base.sh (root) installiert werden, nicht in setup-desktop.sh (user) + +## Geloeste Probleme (Lessons Learned) + +### Brave Browser +- .deb Version crasht mit SIGTRAP (int3) auf aelterer Hardware +- AppArmor `apparmor_restrict_unprivileged_userns=1` war NICHT die Ursache +- Loesung: Flatpak verwenden + +### LibreOffice +- .deb Version zeigt "benutzerdefinierte Installation nicht abgeschlossen" +- Loesung: Snap verwenden +- default-jre Paket noetig (behebt "javaldx failed" in Writer) + +### HiDPI / Retina Display +- GDK WindowScalingFactor=2 + DPI=96 (NICHT 128!) +- Cursor-Groesse: 48 +- xfwm4: Default-xhdpi Theme +- XFCE Compositor deaktivieren +- xfce4-display-settings deaktivieren (verursacht Endlosschleife) + +### Tastatur +- iso_layout=1 + de nodeadkeys + lv3:lalt_switch +- XFCE Keyboard-Override deaktivieren (XkbDisable) + +### Netzwerk & WLAN +- NetworkManager statt netplan fuer WLAN +- WLAN-Config beim netplan-zu-NM Umstieg erhalten +- systemd-networkd-wait-online deaktivieren +- cloud-init deaktivieren nach Installation + +### WireGuard VPN +- Konfiguration via NetworkManager .nmconnection (nicht wg-quick) +- DNS + dns-search direkt im NM-Profil +- **Key-Verwechslung:** m16/m13 hatten eigenen PublicKey als Peer-PublicKey eingetragen. NM zeigt keinen Fehler, wg show zeigt einfach keine Peers. Immer pruefen: local public key darf NICHT gleich dem Peer-PublicKey sein. +- Server-PublicKey gegen funktionierende Clients verifizieren + +### WireGuard Server-Referenz +- Server: 24.134.39.137:443 (VPS, Interface ens3) +- Server-PublicKey: mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +- Peer-IPs: .2=iPhoneR, .3=iPhoneM, .4=iPadR, .5=iPadM, .6=m1, .7=m16, .8=m13 +- DNS im VPN: 10.47.11.20 (Fritz!Box), 10.47.11.1 (Gateway) +- Server macht NAT/Masquerade ueber ens3 + +### Setup-Skripte +- macOS-Installer hinterlaesst macOS-sudoers: setup-base.sh ersetzt sie durch Linux-Standard +- setup-desktop.sh: set -e entfernt, Unicode durch ASCII ersetzt +- setup-desktop.sh Autostart braucht Terminal-Fenster (xfce4-terminal) fuer interaktive Eingaben +- setup.sh: read von /dev/tty bei curl|bash +- Sleep/Suspend waehrend Installation verhindern +- DPMS gestaffelt: 5/6/7 Min (Blank/Sleep/Off) + +### Zsh & Tools +- oh-my-zsh, Powerlevel10k, zsh-syntax-highlighting, MesloLGS NF Font +- PlatformIO via pipx +- h2j (HEIC-Konverter), zoxide, micro +- gitcheck Alias funktioniert in interaktiver Shell (nicht via `zsh -l -c`, das ist normal) + +## Autoinstall (archiviert, nicht mehr verwendet) +- YAML-Heredocs brechen den Parser: printf mit \n verwenden +- Kernel-Parameter-Syntax fuer autoinstall dokumentiert +- Wurde verworfen wegen fehlendem WLAN-Treiber im Live-System From 1b09ea5708305c9e8887fe15bfd1d02ccba943d0 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 08:15:31 +0100 Subject: [PATCH 088/122] CLAUDE.md mit allen Projekt-Erkenntnissen fuer portable Nutzung --- CLAUDE.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..fba521f --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,103 @@ +# macbook-setup - Projektkontext fuer Claude Code + +## Projekt-Uebersicht +Setup-Skripte fuer Ubuntu 24.04 auf alten MacBook Pros (Xubuntu-Desktop). +Repo liegt auf Gitea: git.motocamp.de/rene/macbook-setup + +## Hardware + +| Bezeichnung | Modell | CPU | GPU | Display | Besonderheiten | +|---|---|---|---|---|---| +| m16 | MBP 15" Mid 2014 | i7-4980HQ | Intel HD 5200 + AMD Radeon R9 M370X | Retina (2x) | AMD muss geblockt werden (amdgpu blacklist) | +| m13 | MBP 13" Late 2013 | - | nur Intel | Retina (2x) | - | + +- WLAN: Broadcom BCM4360 (kein Treiber im Ubuntu-Installer!) +- m16 erreichbar per `ssh rene@m16.local`, sudo ohne Passwort konfiguriert + +## Netzwerk +- Subnetz: 10.47.11.0/24 +- Fritz!Box: 10.47.11.1 +- Synology: 10.47.11.10 (dsm.motocamp.de) + +## Installations-Workflow (WICHTIG) +1. **Stock Ubuntu 24.04 Server ISO** auf USB-Stick (dd) - **NICHT** das custom ISO (build-iso.sh)! +2. Interaktiv installieren: Sprache, Tastatur, **WLAN im Installer einrichten**, User `rene`, LVM +3. Neustarten, einloggen als rene +4. `curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16` +5. Neustarten, in XFCE einloggen +6. `curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash` + +**Warum kein custom ISO:** Broadcom-WLAN hat keinen Treiber in der Live-Umgebung. +Der interaktive Installer hat einen eingebauten WLAN-Schritt. Ohne Netzwerk koennen +die Setup-Skripte nicht heruntergeladen werden. + +## Arbeitsweise +- Rene verbindet sich per SSH auf das MacBook und fuehrt Befehle dort aus +- Wenn Befehle auf dem MacBook noetig sind: per `ssh rene@` verbinden und dort ausfuehren (statt den User bitten, Befehle abzutippen) + +## Paketquellen-Zuordnung +- **apt:** System-Pakete, xubuntu-desktop, Thunderbird, KeePassXC, default-jre etc. +- **Snap:** FreeCAD, LibreOffice (wegen "benutzerdefinierte Installation nicht abgeschlossen" Bug bei .deb) +- **Flatpak:** Brave Browser (wegen SIGTRAP/int3 Crash bei .deb auf aelterer HW), PrusaSlicer +- flatpak muss in setup-base.sh (root) installiert werden, nicht in setup-desktop.sh (user) + +## Geloeste Probleme (Lessons Learned) + +### Brave Browser +- .deb Version crasht mit SIGTRAP (int3) auf aelterer Hardware +- AppArmor `apparmor_restrict_unprivileged_userns=1` war NICHT die Ursache +- Loesung: Flatpak verwenden + +### LibreOffice +- .deb Version zeigt "benutzerdefinierte Installation nicht abgeschlossen" +- Loesung: Snap verwenden +- default-jre Paket noetig (behebt "javaldx failed" in Writer) + +### HiDPI / Retina Display +- GDK WindowScalingFactor=2 + DPI=96 (NICHT 128!) +- Cursor-Groesse: 48 +- xfwm4: Default-xhdpi Theme +- XFCE Compositor deaktivieren +- xfce4-display-settings deaktivieren (verursacht Endlosschleife) + +### Tastatur +- iso_layout=1 + de nodeadkeys + lv3:lalt_switch +- XFCE Keyboard-Override deaktivieren (XkbDisable) + +### Netzwerk & WLAN +- NetworkManager statt netplan fuer WLAN +- WLAN-Config beim netplan-zu-NM Umstieg erhalten +- systemd-networkd-wait-online deaktivieren +- cloud-init deaktivieren nach Installation + +### WireGuard VPN +- Konfiguration via NetworkManager .nmconnection (nicht wg-quick) +- DNS + dns-search direkt im NM-Profil +- **Key-Verwechslung:** m16/m13 hatten eigenen PublicKey als Peer-PublicKey eingetragen. NM zeigt keinen Fehler, wg show zeigt einfach keine Peers. Immer pruefen: local public key darf NICHT gleich dem Peer-PublicKey sein. +- Server-PublicKey gegen funktionierende Clients verifizieren + +### WireGuard Server-Referenz +- Server: 24.134.39.137:443 (VPS, Interface ens3) +- Server-PublicKey: mp0YKEjsUbnld3aTAnF6cSzTfixhZETQCoKiFHIcF30= +- Peer-IPs: .2=iPhoneR, .3=iPhoneM, .4=iPadR, .5=iPadM, .6=m1, .7=m16, .8=m13 +- DNS im VPN: 10.47.11.20 (Fritz!Box), 10.47.11.1 (Gateway) +- Server macht NAT/Masquerade ueber ens3 + +### Setup-Skripte +- macOS-Installer hinterlaesst macOS-sudoers: setup-base.sh ersetzt sie durch Linux-Standard +- setup-desktop.sh: set -e entfernt, Unicode durch ASCII ersetzt +- setup-desktop.sh Autostart braucht Terminal-Fenster (xfce4-terminal) fuer interaktive Eingaben +- setup.sh: read von /dev/tty bei curl|bash +- Sleep/Suspend waehrend Installation verhindern +- DPMS gestaffelt: 5/6/7 Min (Blank/Sleep/Off) + +### Zsh & Tools +- oh-my-zsh, Powerlevel10k, zsh-syntax-highlighting, MesloLGS NF Font +- PlatformIO via pipx +- h2j (HEIC-Konverter), zoxide, micro +- gitcheck Alias funktioniert in interaktiver Shell (nicht via `zsh -l -c`, das ist normal) + +## Autoinstall (archiviert, nicht mehr verwendet) +- YAML-Heredocs brechen den Parser: printf mit \n verwenden +- Kernel-Parameter-Syntax fuer autoinstall dokumentiert +- Wurde verworfen wegen fehlendem WLAN-Treiber im Live-System From fa40de742913d9f27c75e9a94b8da64b97670e3b Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 08:18:39 +0100 Subject: [PATCH 089/122] Claude Code Permissions aktualisiert Co-Authored-By: Claude Opus 4.6 --- .claude/settings.local.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index ded820a..f328cf4 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,7 +1,36 @@ { "permissions": { "allow": [ - "Bash(git:*)" + "Bash(git:*)", + "Bash(do echo:*)", + "Bash(python3:*)", + "Bash(openssl passwd:*)", + "Bash(brew list:*)", + "Bash(brew search:*)", + "Bash(brew install:*)", + "Bash(chmod +x:*)", + "Bash(./build-iso.sh:*)", + "Bash(hdiutil attach:*)", + "Bash(curl:*)", + "Bash(xorriso:*)", + "WebFetch(domain:git.motocamp.de)", + "Bash(bash:*)", + "Bash(diskutil list:*)", + "Bash(diskutil unmountDisk:*)", + "Bash(sudo dd:*)", + "Bash(gh api:*)", + "WebFetch(domain:github.com)", + "WebFetch(domain:api.github.com)", + "WebFetch(domain:brave.com)", + "Bash(echo:*)", + "Bash(ls:*)", + "Bash(cp:*)", + "WebSearch", + "WebFetch(domain:discourse.ubuntu.com)", + "WebFetch(domain:canonical-subiquity.readthedocs-hosted.com)", + "Bash(ssh:*)", + "Bash(ping -c 2 -W 2 10.47.11.71)", + "Bash(ifconfig utun0:*)" ] } } From a805d10ae5f0eec796d4414cf761ddebd337ba53 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 08:18:39 +0100 Subject: [PATCH 090/122] Claude Code Permissions aktualisiert --- .claude/settings.local.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index ded820a..f328cf4 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,7 +1,36 @@ { "permissions": { "allow": [ - "Bash(git:*)" + "Bash(git:*)", + "Bash(do echo:*)", + "Bash(python3:*)", + "Bash(openssl passwd:*)", + "Bash(brew list:*)", + "Bash(brew search:*)", + "Bash(brew install:*)", + "Bash(chmod +x:*)", + "Bash(./build-iso.sh:*)", + "Bash(hdiutil attach:*)", + "Bash(curl:*)", + "Bash(xorriso:*)", + "WebFetch(domain:git.motocamp.de)", + "Bash(bash:*)", + "Bash(diskutil list:*)", + "Bash(diskutil unmountDisk:*)", + "Bash(sudo dd:*)", + "Bash(gh api:*)", + "WebFetch(domain:github.com)", + "WebFetch(domain:api.github.com)", + "WebFetch(domain:brave.com)", + "Bash(echo:*)", + "Bash(ls:*)", + "Bash(cp:*)", + "WebSearch", + "WebFetch(domain:discourse.ubuntu.com)", + "WebFetch(domain:canonical-subiquity.readthedocs-hosted.com)", + "Bash(ssh:*)", + "Bash(ping -c 2 -W 2 10.47.11.71)", + "Bash(ifconfig utun0:*)" ] } } From 1e04028342514ea495164e9c085bea52f5dbd821 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 08:29:52 +0100 Subject: [PATCH 091/122] gitsync Alias in .zshrc ergaenzt Co-Authored-By: Claude Opus 4.6 --- setup-desktop.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index 5759371..dc6eedb 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -129,7 +129,7 @@ if [[ -d "$DOTFILES_DIR/bin" ]]; then for script in "$DOTFILES_DIR/bin"/*; do [[ -f "$script" ]] && chmod +x "$script" && ln -sf "$script" ~/ done - ok "Dot-Files: git-check-all.sh, git-update-all.sh → ~/" + ok "Dot-Files: git-check-all.sh, git-update-all.sh, git-sync-all.sh → ~/" fi # .zshrc (Linux-Version, ohne Conda/LM Studio/iTerm2) @@ -192,6 +192,7 @@ alias gp='git push' alias gl='git log --oneline --graph --decorate' alias gitcheck="~/git-check-all.sh --short" alias gitupdate="~/git-update-all.sh" +alias gitsync="~/git-sync-all.sh" # 7) History HISTFILE="$HOME/.zsh_history" From d2ce20624346d2dbc300b6ba2c2f3d074acda53b Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 08:29:52 +0100 Subject: [PATCH 092/122] gitsync Alias in .zshrc ergaenzt --- setup-desktop.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index 5759371..dc6eedb 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -129,7 +129,7 @@ if [[ -d "$DOTFILES_DIR/bin" ]]; then for script in "$DOTFILES_DIR/bin"/*; do [[ -f "$script" ]] && chmod +x "$script" && ln -sf "$script" ~/ done - ok "Dot-Files: git-check-all.sh, git-update-all.sh → ~/" + ok "Dot-Files: git-check-all.sh, git-update-all.sh, git-sync-all.sh → ~/" fi # .zshrc (Linux-Version, ohne Conda/LM Studio/iTerm2) @@ -192,6 +192,7 @@ alias gp='git push' alias gl='git log --oneline --graph --decorate' alias gitcheck="~/git-check-all.sh --short" alias gitupdate="~/git-update-all.sh" +alias gitsync="~/git-sync-all.sh" # 7) History HISTFILE="$HOME/.zsh_history" From cea17088f84fe658ac931fe64df17591ca6bf92c Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:16:46 +0100 Subject: [PATCH 093/122] README aktualisiert: Stock ISO statt custom, AMD statt Nvidia, aktueller Ablauf Co-Authored-By: Claude Opus 4.6 --- README.md | 173 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 2522032..caf0318 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,140 @@ # macbook-setup -Automatisiertes Linux-Setup für MacBook Pro 13" Late 2013 und 16" Mid 2014. +Automatisiertes Ubuntu 24.04 (Xubuntu-Desktop) Setup fuer alte MacBook Pros. -## Inhalt +## Unterstuetzte Hardware + +| Bezeichnung | Modell | CPU | GPU | Besonderheiten | +|---|---|---|---|---| +| m16 | MBP 15" Mid 2014 | i7-4980HQ | Intel HD 5200 + AMD Radeon R9 M370X | AMD wird geblockt | +| m13 | MBP 13" Late 2013 | i5 | Intel Iris | keine Dual-GPU-Probleme | + +Beide haben Broadcom BCM4360 WLAN (kein Treiber im Ubuntu-Installer!). + +## Installations-Ablauf + +**WICHTIG:** Immer das **Stock Ubuntu 24.04 Server ISO** verwenden, NICHT das custom ISO (build-iso.sh). +Grund: Broadcom-WLAN hat keinen Treiber in der Live-Umgebung. Nur der interaktive Installer hat einen eingebauten WLAN-Schritt. + +### 1. USB-Stick vorbereiten + +```bash +# Stock ISO herunterladen +# https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso + +# Auf USB-Stick schreiben (macOS) +sudo dd if=ubuntu-24.04-live-server-amd64.iso of=/dev/rdiskN bs=4m status=progress +``` + +### 2. Ubuntu installieren + +1. USB-Stick einstecken, MacBook einschalten, **Alt-Taste** gedrückt halten +2. "EFI Boot" auswaehlen +3. Interaktiv installieren: + - Sprache: Deutsch + - Tastatur: Deutsch + - **WLAN im Installer einrichten** (wichtig!) + - User: `rene` + - LVM: ja +4. Neustarten, als `rene` einloggen + +### 3. System-Setup (setup-base.sh) + +```bash +# Fuer MBP 16": +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16 + +# Fuer MBP 13": +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 13 +``` + +Installiert: xubuntu-desktop, Treiber, WireGuard, NetworkManager, mbpfan, Flatpak, SSH-Server u.v.m. + +Danach: `sudo reboot` + +### 4. Desktop-Setup (setup-desktop.sh) + +In XFCE einloggen. Das Skript startet automatisch via Autostart im Terminal-Fenster. + +Falls nicht automatisch gestartet: +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash +``` + +Installiert: oh-my-zsh, Powerlevel10k, Claude Code, PrusaSlicer, Dotfiles, XFCE-Konfiguration. + +### 5. Manuelle Schritte + +- **Synology Drive Client:** `.deb` von synology.com, `sudo dpkg -i ...` +- **Thunderbird:** Profil aus Synology Drive einbinden +- **Brave Browser:** Sync-Kette beitreten + +## Dateien | Datei | Beschreibung | -|-------|-------------| -| `setup.sh` | Wrapper: ruft setup-base.sh + setup-desktop.sh auf (Option A) | -| `setup-base.sh` | System-Setup: Pakete, Configs, Locale, Services (chroot-sicher) | -| `setup-desktop.sh` | Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE | -| `user-data` | Ubuntu Autoinstall (cloud-init) für ISO-Erstellung | -| `meta-data` | cloud-init Metadaten (erforderlich) | -| `mbpfan-13.conf` | mbpfan-Konfiguration für MBP 13" Late 2013 | -| `mbpfan-16.conf` | mbpfan-Konfiguration für MBP 16" Mid 2014 (Nvidia, aggressiver) | -| `hid_apple.conf` | Fn-Tasten als Standard (fnmode=2) | +|---|---| +| `setup-base.sh` | System-Setup: Pakete, Configs, Locale, Services | +| `setup-desktop.sh` | Desktop-Setup: oh-my-zsh, Claude Code, Dotfiles, XFCE | +| `setup.sh` | Wrapper (ruft beide auf) | +| `CLAUDE.md` | Projektkontext fuer Claude Code (Erkenntnisse, Lessons Learned) | +| `mbpfan-13.conf` | Lueftersteuerung MBP 13" | +| `mbpfan-16.conf` | Lueftersteuerung MBP 16" (aggressiver) | +| `hid_apple.conf` | Fn-Tasten als Standard | | `keyboard` | Tastaturbelegung Deutsch (Macintosh) | -| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten (optional, für Intel-only Betrieb) | -| `temp-watch.sh` | Temperatur-Überwachung mit Desktop-Notification | -| `build-iso.sh` | ISO-Erstellungs-Skript für Ventoy | - -## Schnellstart - -### Option A: Automatisches Setup nach Minimalinstallation -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -``` - -### Option B: Vollautomatische ISO erstellen -```bash -git clone https://git.motocamp.de/rene/macbook-setup.git -cd macbook-setup -./build-iso.sh -# → ubuntu-macbook-autoinstall.iso (für Ventoy) -``` - -## Voraussetzungen - -- WireGuard-Config für das jeweilige MacBook (separat aufbewahren) -- Forgejo-Zugang für Dot-Files-Clone -- Thunderbird-Profil-Backup in Synology Drive +| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten | +| `temp-watch.sh` | Temperatur-Ueberwachung mit Notification | +| `wireguard/` | WireGuard-Konfigurationen (m13, m16) | ## Paketquellen | App | Quelle | Grund | -|-----|--------|-------| -| LibreOffice | Snap | .deb-Version hat Installationsfehler auf MBP | +|---|---|---| +| LibreOffice | Snap | .deb zeigt "benutzerdefinierte Installation nicht abgeschlossen" | | FreeCAD | Snap | Standard | -| Brave Browser | Flatpak | .deb crasht (int3/SIGTRAP) auf aelterer Hardware | +| Brave Browser | Flatpak | .deb crasht (SIGTRAP/int3) auf aelterer Hardware | | PrusaSlicer | Flatpak | Standard | -## Hardware-Besonderheiten +## Netzwerk -### MBP 16" Mid 2014 (Intel + Nvidia GT 750M) -- Nvidia Optimus: `prime-select intel` als Standard -- Aggressivere Lüfter-Konfiguration via `mbpfan-16.conf` -- Bei Problemen: `blacklist-nvidia.conf` aktivieren +- Heimnetz: `10.47.11.0/24` +- Fritz!Box: `10.47.11.1` +- Synology: `10.47.11.10` (dsm.motocamp.de) +- WireGuard VPN: `10.13.13.x` (Server: `24.134.39.137:443`) +- m16 erreichbar per `ssh rene@m16.local` -### MBP 13" Late 2013 -- Robuster, keine Dual-GPU-Probleme -- Standard `mbpfan-13.conf` reicht aus +## Troubleshooting -## Abhängigkeiten +### WLAN geht nicht nach Installation -- Netzwerk: `10.47.11.0/24` (via WireGuard `10.13.13.x`) -- DiskStation: `10.47.11.10` (SMTP, IMAP, Synology Drive) -- Dot-Files: `https://git.motocamp.de/rene/dotfiles-rene.git` +```bash +sudo apt install bcmwl-kernel-source +sudo modprobe wl +``` + +### Bildschirm flackert / Grafikartefakte (MBP 16") + +AMD Radeon R9 M370X muss geblockt werden: +```bash +echo -e "blacklist radeon\nblacklist amdgpu" | sudo tee /etc/modprobe.d/blacklist-radeon.conf +sudo update-initramfs -u && sudo reboot +``` + +### Boot haengt (wartet auf Netzwerk) + +```bash +sudo systemctl disable systemd-networkd-wait-online.service +``` + +### Display-Einstellungen oeffnen sich in Endlosschleife (MBP 16") + +```bash +sudo mv /usr/bin/xfce4-display-settings /usr/bin/xfce4-display-settings.bak +``` + +### WireGuard: keine Verbindung + +```bash +sudo wg show +# Pruefen: local public key darf NICHT gleich dem Peer-PublicKey sein! +# Falls doch: falscher Key in der Config, Server-PublicKey einsetzen. +``` From 667db5049a1f49e11416b691369c0e464152cc0f Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:16:46 +0100 Subject: [PATCH 094/122] README aktualisiert: Stock ISO statt custom, AMD statt Nvidia, aktueller Ablauf --- README.md | 173 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 2522032..caf0318 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,140 @@ # macbook-setup -Automatisiertes Linux-Setup für MacBook Pro 13" Late 2013 und 16" Mid 2014. +Automatisiertes Ubuntu 24.04 (Xubuntu-Desktop) Setup fuer alte MacBook Pros. -## Inhalt +## Unterstuetzte Hardware + +| Bezeichnung | Modell | CPU | GPU | Besonderheiten | +|---|---|---|---|---| +| m16 | MBP 15" Mid 2014 | i7-4980HQ | Intel HD 5200 + AMD Radeon R9 M370X | AMD wird geblockt | +| m13 | MBP 13" Late 2013 | i5 | Intel Iris | keine Dual-GPU-Probleme | + +Beide haben Broadcom BCM4360 WLAN (kein Treiber im Ubuntu-Installer!). + +## Installations-Ablauf + +**WICHTIG:** Immer das **Stock Ubuntu 24.04 Server ISO** verwenden, NICHT das custom ISO (build-iso.sh). +Grund: Broadcom-WLAN hat keinen Treiber in der Live-Umgebung. Nur der interaktive Installer hat einen eingebauten WLAN-Schritt. + +### 1. USB-Stick vorbereiten + +```bash +# Stock ISO herunterladen +# https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso + +# Auf USB-Stick schreiben (macOS) +sudo dd if=ubuntu-24.04-live-server-amd64.iso of=/dev/rdiskN bs=4m status=progress +``` + +### 2. Ubuntu installieren + +1. USB-Stick einstecken, MacBook einschalten, **Alt-Taste** gedrückt halten +2. "EFI Boot" auswaehlen +3. Interaktiv installieren: + - Sprache: Deutsch + - Tastatur: Deutsch + - **WLAN im Installer einrichten** (wichtig!) + - User: `rene` + - LVM: ja +4. Neustarten, als `rene` einloggen + +### 3. System-Setup (setup-base.sh) + +```bash +# Fuer MBP 16": +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16 + +# Fuer MBP 13": +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 13 +``` + +Installiert: xubuntu-desktop, Treiber, WireGuard, NetworkManager, mbpfan, Flatpak, SSH-Server u.v.m. + +Danach: `sudo reboot` + +### 4. Desktop-Setup (setup-desktop.sh) + +In XFCE einloggen. Das Skript startet automatisch via Autostart im Terminal-Fenster. + +Falls nicht automatisch gestartet: +```bash +curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash +``` + +Installiert: oh-my-zsh, Powerlevel10k, Claude Code, PrusaSlicer, Dotfiles, XFCE-Konfiguration. + +### 5. Manuelle Schritte + +- **Synology Drive Client:** `.deb` von synology.com, `sudo dpkg -i ...` +- **Thunderbird:** Profil aus Synology Drive einbinden +- **Brave Browser:** Sync-Kette beitreten + +## Dateien | Datei | Beschreibung | -|-------|-------------| -| `setup.sh` | Wrapper: ruft setup-base.sh + setup-desktop.sh auf (Option A) | -| `setup-base.sh` | System-Setup: Pakete, Configs, Locale, Services (chroot-sicher) | -| `setup-desktop.sh` | Desktop-Setup: oh-my-zsh, Claude Code, PrusaSlicer, Dotfiles, XFCE | -| `user-data` | Ubuntu Autoinstall (cloud-init) für ISO-Erstellung | -| `meta-data` | cloud-init Metadaten (erforderlich) | -| `mbpfan-13.conf` | mbpfan-Konfiguration für MBP 13" Late 2013 | -| `mbpfan-16.conf` | mbpfan-Konfiguration für MBP 16" Mid 2014 (Nvidia, aggressiver) | -| `hid_apple.conf` | Fn-Tasten als Standard (fnmode=2) | +|---|---| +| `setup-base.sh` | System-Setup: Pakete, Configs, Locale, Services | +| `setup-desktop.sh` | Desktop-Setup: oh-my-zsh, Claude Code, Dotfiles, XFCE | +| `setup.sh` | Wrapper (ruft beide auf) | +| `CLAUDE.md` | Projektkontext fuer Claude Code (Erkenntnisse, Lessons Learned) | +| `mbpfan-13.conf` | Lueftersteuerung MBP 13" | +| `mbpfan-16.conf` | Lueftersteuerung MBP 16" (aggressiver) | +| `hid_apple.conf` | Fn-Tasten als Standard | | `keyboard` | Tastaturbelegung Deutsch (Macintosh) | -| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten (optional, für Intel-only Betrieb) | -| `temp-watch.sh` | Temperatur-Überwachung mit Desktop-Notification | -| `build-iso.sh` | ISO-Erstellungs-Skript für Ventoy | - -## Schnellstart - -### Option A: Automatisches Setup nach Minimalinstallation -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup.sh | bash -``` - -### Option B: Vollautomatische ISO erstellen -```bash -git clone https://git.motocamp.de/rene/macbook-setup.git -cd macbook-setup -./build-iso.sh -# → ubuntu-macbook-autoinstall.iso (für Ventoy) -``` - -## Voraussetzungen - -- WireGuard-Config für das jeweilige MacBook (separat aufbewahren) -- Forgejo-Zugang für Dot-Files-Clone -- Thunderbird-Profil-Backup in Synology Drive +| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten | +| `temp-watch.sh` | Temperatur-Ueberwachung mit Notification | +| `wireguard/` | WireGuard-Konfigurationen (m13, m16) | ## Paketquellen | App | Quelle | Grund | -|-----|--------|-------| -| LibreOffice | Snap | .deb-Version hat Installationsfehler auf MBP | +|---|---|---| +| LibreOffice | Snap | .deb zeigt "benutzerdefinierte Installation nicht abgeschlossen" | | FreeCAD | Snap | Standard | -| Brave Browser | Flatpak | .deb crasht (int3/SIGTRAP) auf aelterer Hardware | +| Brave Browser | Flatpak | .deb crasht (SIGTRAP/int3) auf aelterer Hardware | | PrusaSlicer | Flatpak | Standard | -## Hardware-Besonderheiten +## Netzwerk -### MBP 16" Mid 2014 (Intel + Nvidia GT 750M) -- Nvidia Optimus: `prime-select intel` als Standard -- Aggressivere Lüfter-Konfiguration via `mbpfan-16.conf` -- Bei Problemen: `blacklist-nvidia.conf` aktivieren +- Heimnetz: `10.47.11.0/24` +- Fritz!Box: `10.47.11.1` +- Synology: `10.47.11.10` (dsm.motocamp.de) +- WireGuard VPN: `10.13.13.x` (Server: `24.134.39.137:443`) +- m16 erreichbar per `ssh rene@m16.local` -### MBP 13" Late 2013 -- Robuster, keine Dual-GPU-Probleme -- Standard `mbpfan-13.conf` reicht aus +## Troubleshooting -## Abhängigkeiten +### WLAN geht nicht nach Installation -- Netzwerk: `10.47.11.0/24` (via WireGuard `10.13.13.x`) -- DiskStation: `10.47.11.10` (SMTP, IMAP, Synology Drive) -- Dot-Files: `https://git.motocamp.de/rene/dotfiles-rene.git` +```bash +sudo apt install bcmwl-kernel-source +sudo modprobe wl +``` + +### Bildschirm flackert / Grafikartefakte (MBP 16") + +AMD Radeon R9 M370X muss geblockt werden: +```bash +echo -e "blacklist radeon\nblacklist amdgpu" | sudo tee /etc/modprobe.d/blacklist-radeon.conf +sudo update-initramfs -u && sudo reboot +``` + +### Boot haengt (wartet auf Netzwerk) + +```bash +sudo systemctl disable systemd-networkd-wait-online.service +``` + +### Display-Einstellungen oeffnen sich in Endlosschleife (MBP 16") + +```bash +sudo mv /usr/bin/xfce4-display-settings /usr/bin/xfce4-display-settings.bak +``` + +### WireGuard: keine Verbindung + +```bash +sudo wg show +# Pruefen: local public key darf NICHT gleich dem Peer-PublicKey sein! +# Falls doch: falscher Key in der Config, Server-PublicKey einsetzen. +``` From cba5f63a4eebdd6baf28bc65bc6a5b55b48ceb64 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:24:32 +0100 Subject: [PATCH 095/122] mac-sync Alias: git-sync-all.sh direkt vom Gitea-Server ausfuehren Co-Authored-By: Claude Opus 4.6 --- setup-desktop.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup-desktop.sh b/setup-desktop.sh index dc6eedb..876c149 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -193,6 +193,7 @@ alias gl='git log --oneline --graph --decorate' alias gitcheck="~/git-check-all.sh --short" alias gitupdate="~/git-update-all.sh" alias gitsync="~/git-sync-all.sh" +alias mac-sync="curl -fsSL https://git.motocamp.de/rene/dotfiles-rene/raw/branch/main/bin/git-sync-all.sh | bash" # 7) History HISTFILE="$HOME/.zsh_history" From 1e4ebaca63a347a565a8d486b123003807a9e381 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:24:32 +0100 Subject: [PATCH 096/122] mac-sync Alias: git-sync-all.sh direkt vom Gitea-Server ausfuehren --- setup-desktop.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup-desktop.sh b/setup-desktop.sh index dc6eedb..876c149 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -193,6 +193,7 @@ alias gl='git log --oneline --graph --decorate' alias gitcheck="~/git-check-all.sh --short" alias gitupdate="~/git-update-all.sh" alias gitsync="~/git-sync-all.sh" +alias mac-sync="curl -fsSL https://git.motocamp.de/rene/dotfiles-rene/raw/branch/main/bin/git-sync-all.sh | bash" # 7) History HISTFILE="$HOME/.zsh_history" From 22e02ddcf50900a3f9e85bfe90c794d24a096238 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:26:03 +0100 Subject: [PATCH 097/122] README: Sync-Befehle (gitsync, mac-sync) dokumentiert Co-Authored-By: Claude Opus 4.6 --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index caf0318..b7dc1c4 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,24 @@ Automatisiertes Ubuntu 24.04 (Xubuntu-Desktop) Setup fuer alte MacBook Pros. Beide haben Broadcom BCM4360 WLAN (kein Treiber im Ubuntu-Installer!). +## Projekte synchronisieren + +Alle Git-Projekte zwischen Macs synchron halten: + +```bash +gitsync # lokales Skript - taegliche Arbeit +mac-sync # holt Skript frisch vom Server - nach laengerer Pause +``` + +Auf einem komplett frischen Mac (noch ohne .zshrc) einmalig: +```bash +curl -fsSL https://git.motocamp.de/rene/dotfiles-rene/raw/branch/main/bin/git-sync-all.sh | bash +``` + +Danach stehen `gitsync` und `mac-sync` als Alias zur Verfuegung. + +Das Skript klont fehlende Repos, pullt Remote-Aenderungen und pusht lokale Commits. + ## Installations-Ablauf **WICHTIG:** Immer das **Stock Ubuntu 24.04 Server ISO** verwenden, NICHT das custom ISO (build-iso.sh). From ad00265bc615699d48422637cd9d3c042baad6d6 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:26:03 +0100 Subject: [PATCH 098/122] README: Sync-Befehle (gitsync, mac-sync) dokumentiert --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index caf0318..b7dc1c4 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,24 @@ Automatisiertes Ubuntu 24.04 (Xubuntu-Desktop) Setup fuer alte MacBook Pros. Beide haben Broadcom BCM4360 WLAN (kein Treiber im Ubuntu-Installer!). +## Projekte synchronisieren + +Alle Git-Projekte zwischen Macs synchron halten: + +```bash +gitsync # lokales Skript - taegliche Arbeit +mac-sync # holt Skript frisch vom Server - nach laengerer Pause +``` + +Auf einem komplett frischen Mac (noch ohne .zshrc) einmalig: +```bash +curl -fsSL https://git.motocamp.de/rene/dotfiles-rene/raw/branch/main/bin/git-sync-all.sh | bash +``` + +Danach stehen `gitsync` und `mac-sync` als Alias zur Verfuegung. + +Das Skript klont fehlende Repos, pullt Remote-Aenderungen und pusht lokale Commits. + ## Installations-Ablauf **WICHTIG:** Immer das **Stock Ubuntu 24.04 Server ISO** verwenden, NICHT das custom ISO (build-iso.sh). From 14ae8573c2a5dbcb22a8faa7e67a5c66f345afb3 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:29:26 +0100 Subject: [PATCH 099/122] README: blacklist-nvidia.conf Beschreibung praezisiert Co-Authored-By: Claude Opus 4.6 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7dc1c4..bb43c8b 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Installiert: oh-my-zsh, Powerlevel10k, Claude Code, PrusaSlicer, Dotfiles, XFCE- | `mbpfan-16.conf` | Lueftersteuerung MBP 16" (aggressiver) | | `hid_apple.conf` | Fn-Tasten als Standard | | `keyboard` | Tastaturbelegung Deutsch (Macintosh) | -| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten | +| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten (MBP 13", optional) | | `temp-watch.sh` | Temperatur-Ueberwachung mit Notification | | `wireguard/` | WireGuard-Konfigurationen (m13, m16) | From 6102e680a1dc22d086ef25f7598af00a26b2bbc0 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:29:26 +0100 Subject: [PATCH 100/122] README: blacklist-nvidia.conf Beschreibung praezisiert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7dc1c4..bb43c8b 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Installiert: oh-my-zsh, Powerlevel10k, Claude Code, PrusaSlicer, Dotfiles, XFCE- | `mbpfan-16.conf` | Lueftersteuerung MBP 16" (aggressiver) | | `hid_apple.conf` | Fn-Tasten als Standard | | `keyboard` | Tastaturbelegung Deutsch (Macintosh) | -| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten | +| `blacklist-nvidia.conf` | Nvidia/nouveau blacklisten (MBP 13", optional) | | `temp-watch.sh` | Temperatur-Ueberwachung mit Notification | | `wireguard/` | WireGuard-Konfigurationen (m13, m16) | From 8e17d2b150b3d9fa35b30848f2d61d36f80b0622 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:29:52 +0100 Subject: [PATCH 101/122] Veraltete INSTALL.md entfernt (Ablauf steht jetzt in README.md) Co-Authored-By: Claude Opus 4.6 --- INSTALL.md | 195 ----------------------------------------------------- 1 file changed, 195 deletions(-) delete mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index c87208c..0000000 --- a/INSTALL.md +++ /dev/null @@ -1,195 +0,0 @@ -# Installation - -## 1. ISO auf Ventoy-Stick kopieren - -```bash -cp ubuntu-macbook-autoinstall.iso /Volumes/Ventoy/ -``` - -Falls kein Ventoy-Stick vorhanden: [ventoy.net](https://www.ventoy.net/) — beliebigen USB-Stick mit Ventoy formatieren, dann ISO einfach draufkopieren. - -## 2. MacBook booten - -1. USB-Stick einstecken -2. MacBook einschalten, **Alt-Taste (⌥)** gedrückt halten -3. "EFI Boot" auswählen -4. Im Ventoy-Menü die `ubuntu-macbook-autoinstall.iso` wählen -5. GRUB zeigt "Ubuntu MacBook AutoInstall" — startet nach 10 Sekunden automatisch - -## 3. Automatische Installation - -Die Autoinstall installiert Ubuntu 24.04 Server (LVM, User `rene`). Je nach Netzwerk und Mirrors dauert das 10-30 Minuten. - -Nach Abschluss erscheint cloud-init-Output mit SSH Host Key Fingerprints und der Login-Prompt: -``` -Cloud-init v. ... finished ... Datasource DataSourceNone. -m16 login: -``` - -**Enter drücken**, dann als `rene` anmelden. - -## 4. Prüfen ob setup-base.sh gelaufen ist - -`setup-base.sh` sollte in den Autoinstall `late-commands` gelaufen sein. Prüfen: - -```bash -dpkg -l | grep xubuntu-desktop -``` - -### Fall A: xubuntu-desktop ist installiert - -Desktop starten: -```bash -sudo systemctl start lightdm -``` -Weiter mit **Schritt 5**. - -### Fall B: xubuntu-desktop fehlt - -`setup-base.sh` manuell ausführen (MBP 13" oder 16"): -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16 -``` -**Dauer:** ca. 20-40 Minuten (Xubuntu-Desktop, Brave, Treiber, etc.) - -Danach neu starten: -```bash -sudo reboot -``` - -## 5. Erster Desktop-Login - -Nach Reboot erscheint LightDM. Anmelden als `rene`. - -`setup-desktop.sh` startet automatisch via Autostart und installiert: - -| Was | Details | -|-----|---------| -| oh-my-zsh | Inkl. zsh als Standard-Shell | -| Claude Code | via npm global | -| PrusaSlicer | AppImage nach ~/Applications | -| Dotfiles | nvim, micro, oh-my-zsh custom, heic-scripts | -| XFCE Energie | AC: Bildschirm bleibt an / Akku: aus nach 10 Min | - -Der Autostart-Eintrag entfernt sich nach erfolgreichem Durchlauf selbst. - -**Falls setup-desktop.sh nicht automatisch startet**, manuell ausführen: -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash -``` - -**Log prüfen:** -```bash -cat /tmp/setup-desktop.log -``` - -## 6. Manuelle Schritte - -### WireGuard - -WireGuard wird automatisch von `setup-base.sh` konfiguriert (Config aus `wireguard/m13.conf` bzw. `wireguard/m16.conf`). Falls nötig, manuell prüfen: - -```bash -sudo systemctl status wg-quick@wg0 -sudo wg show -``` - -Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). - -### Synology Drive Client - -1. `.deb` von [synology.com](https://www.synology.com/de-de/dsm/feature/drive) herunterladen -2. `sudo dpkg -i synology-drive-client-*.deb` -3. Starten, mit DiskStation verbinden (10.47.11.10 oder dsm.motocamp.de) - -### Thunderbird - -1. Thunderbird starten -2. Profil aus Synology Drive einbinden (vorheriges Backup) -3. IMAP: 10.47.11.10 (nach WireGuard-Verbindung) - -### Brave Browser - -1. Brave starten -2. Einstellungen → Brave Sync → Sync-Kette beitreten - -## 7. Modell: MBP 13" vs 16" - -Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"** vor dem ISO-Bau in `user-data` ändern: - -```yaml -# Zeile in late-commands: -- curtin in-target --target=/target -- bash -c '... setup-base.sh | bash -s -- 16' -# hier: 13 → 16 ^^^ -``` - -MBP 16" (Mid 2014, Intel + AMD Radeon R9 M370X) bekommt zusätzlich: -- AMD Radeon geblockt (`blacklist-radeon.conf`) — nur Intel i915 nutzen -- XFCE Compositor deaktiviert (keine GPU-Beschleunigung) -- Display-Skalierung 2x / DPI 168 (Retina) -- `xfce4-display-settings` deaktiviert (öffnet sich sonst in Endlosschleife) -- Aggressivere Lüftersteuerung (`mbpfan-16.conf`) - -## Troubleshooting - -### WLAN geht nicht nach Installation - -Broadcom BCM4360 braucht den proprietären Treiber. Falls er nicht installiert wurde: -```bash -sudo apt install bcmwl-kernel-source -sudo modprobe wl -``` - -### WLAN "Device not managed" - -NetworkManager verwaltet das WLAN nicht, weil netplan/cloud-init es konfiguriert: -```bash -# Prüfen -cat /etc/netplan/*.yaml -cat /etc/NetworkManager/NetworkManager.conf - -# Fix: NetworkManager als Renderer setzen -echo -e "network:\n version: 2\n renderer: NetworkManager" | sudo tee /etc/netplan/01-network-manager.yaml -sudo rm -f /etc/netplan/50-cloud-init.yaml -sudo netplan apply -``` - -### Bildschirm flackert / Grafikartefakte (MBP 16") - -Das MBP 16" hat eine AMD Radeon R9 M370X die Probleme macht. AMD-GPU komplett blacklisten: -```bash -echo -e "blacklist radeon\nblacklist amdgpu" | sudo tee /etc/modprobe.d/blacklist-radeon.conf -sudo update-initramfs -u -sudo reboot -``` - -Falls `xfce4-display-settings` sich in Endlosschleife öffnet: -```bash -sudo mv /usr/bin/xfce4-display-settings /usr/bin/xfce4-display-settings.bak -``` - -### Lüfter drehen nicht hoch / MacBook wird zu heiß - -```bash -# mbpfan läuft? -sudo systemctl status mbpfan - -# Temperaturen prüfen -sensors - -# temp-watch.sh manuell starten -sudo /usr/local/bin/temp-watch.sh -``` - -### Boot hängt (wartet auf Netzwerk) - -```bash -sudo systemctl disable systemd-networkd-wait-online.service -sudo reboot -``` - -### setup-desktop.sh manuell ausführen - -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash -``` From 2856356f9af1411cf6a639174e298d9bda4efc9d Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:29:52 +0100 Subject: [PATCH 102/122] Veraltete INSTALL.md entfernt (Ablauf steht jetzt in README.md) --- INSTALL.md | 195 ----------------------------------------------------- 1 file changed, 195 deletions(-) delete mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index c87208c..0000000 --- a/INSTALL.md +++ /dev/null @@ -1,195 +0,0 @@ -# Installation - -## 1. ISO auf Ventoy-Stick kopieren - -```bash -cp ubuntu-macbook-autoinstall.iso /Volumes/Ventoy/ -``` - -Falls kein Ventoy-Stick vorhanden: [ventoy.net](https://www.ventoy.net/) — beliebigen USB-Stick mit Ventoy formatieren, dann ISO einfach draufkopieren. - -## 2. MacBook booten - -1. USB-Stick einstecken -2. MacBook einschalten, **Alt-Taste (⌥)** gedrückt halten -3. "EFI Boot" auswählen -4. Im Ventoy-Menü die `ubuntu-macbook-autoinstall.iso` wählen -5. GRUB zeigt "Ubuntu MacBook AutoInstall" — startet nach 10 Sekunden automatisch - -## 3. Automatische Installation - -Die Autoinstall installiert Ubuntu 24.04 Server (LVM, User `rene`). Je nach Netzwerk und Mirrors dauert das 10-30 Minuten. - -Nach Abschluss erscheint cloud-init-Output mit SSH Host Key Fingerprints und der Login-Prompt: -``` -Cloud-init v. ... finished ... Datasource DataSourceNone. -m16 login: -``` - -**Enter drücken**, dann als `rene` anmelden. - -## 4. Prüfen ob setup-base.sh gelaufen ist - -`setup-base.sh` sollte in den Autoinstall `late-commands` gelaufen sein. Prüfen: - -```bash -dpkg -l | grep xubuntu-desktop -``` - -### Fall A: xubuntu-desktop ist installiert - -Desktop starten: -```bash -sudo systemctl start lightdm -``` -Weiter mit **Schritt 5**. - -### Fall B: xubuntu-desktop fehlt - -`setup-base.sh` manuell ausführen (MBP 13" oder 16"): -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-base.sh | sudo bash -s -- 16 -``` -**Dauer:** ca. 20-40 Minuten (Xubuntu-Desktop, Brave, Treiber, etc.) - -Danach neu starten: -```bash -sudo reboot -``` - -## 5. Erster Desktop-Login - -Nach Reboot erscheint LightDM. Anmelden als `rene`. - -`setup-desktop.sh` startet automatisch via Autostart und installiert: - -| Was | Details | -|-----|---------| -| oh-my-zsh | Inkl. zsh als Standard-Shell | -| Claude Code | via npm global | -| PrusaSlicer | AppImage nach ~/Applications | -| Dotfiles | nvim, micro, oh-my-zsh custom, heic-scripts | -| XFCE Energie | AC: Bildschirm bleibt an / Akku: aus nach 10 Min | - -Der Autostart-Eintrag entfernt sich nach erfolgreichem Durchlauf selbst. - -**Falls setup-desktop.sh nicht automatisch startet**, manuell ausführen: -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash -``` - -**Log prüfen:** -```bash -cat /tmp/setup-desktop.log -``` - -## 6. Manuelle Schritte - -### WireGuard - -WireGuard wird automatisch von `setup-base.sh` konfiguriert (Config aus `wireguard/m13.conf` bzw. `wireguard/m16.conf`). Falls nötig, manuell prüfen: - -```bash -sudo systemctl status wg-quick@wg0 -sudo wg show -``` - -Danach ist das Heimnetz erreichbar (10.47.11.0/24 via 10.13.13.x). - -### Synology Drive Client - -1. `.deb` von [synology.com](https://www.synology.com/de-de/dsm/feature/drive) herunterladen -2. `sudo dpkg -i synology-drive-client-*.deb` -3. Starten, mit DiskStation verbinden (10.47.11.10 oder dsm.motocamp.de) - -### Thunderbird - -1. Thunderbird starten -2. Profil aus Synology Drive einbinden (vorheriges Backup) -3. IMAP: 10.47.11.10 (nach WireGuard-Verbindung) - -### Brave Browser - -1. Brave starten -2. Einstellungen → Brave Sync → Sync-Kette beitreten - -## 7. Modell: MBP 13" vs 16" - -Die `user-data` ist standardmäßig auf **MBP 13"** eingestellt. Für **MBP 16"** vor dem ISO-Bau in `user-data` ändern: - -```yaml -# Zeile in late-commands: -- curtin in-target --target=/target -- bash -c '... setup-base.sh | bash -s -- 16' -# hier: 13 → 16 ^^^ -``` - -MBP 16" (Mid 2014, Intel + AMD Radeon R9 M370X) bekommt zusätzlich: -- AMD Radeon geblockt (`blacklist-radeon.conf`) — nur Intel i915 nutzen -- XFCE Compositor deaktiviert (keine GPU-Beschleunigung) -- Display-Skalierung 2x / DPI 168 (Retina) -- `xfce4-display-settings` deaktiviert (öffnet sich sonst in Endlosschleife) -- Aggressivere Lüftersteuerung (`mbpfan-16.conf`) - -## Troubleshooting - -### WLAN geht nicht nach Installation - -Broadcom BCM4360 braucht den proprietären Treiber. Falls er nicht installiert wurde: -```bash -sudo apt install bcmwl-kernel-source -sudo modprobe wl -``` - -### WLAN "Device not managed" - -NetworkManager verwaltet das WLAN nicht, weil netplan/cloud-init es konfiguriert: -```bash -# Prüfen -cat /etc/netplan/*.yaml -cat /etc/NetworkManager/NetworkManager.conf - -# Fix: NetworkManager als Renderer setzen -echo -e "network:\n version: 2\n renderer: NetworkManager" | sudo tee /etc/netplan/01-network-manager.yaml -sudo rm -f /etc/netplan/50-cloud-init.yaml -sudo netplan apply -``` - -### Bildschirm flackert / Grafikartefakte (MBP 16") - -Das MBP 16" hat eine AMD Radeon R9 M370X die Probleme macht. AMD-GPU komplett blacklisten: -```bash -echo -e "blacklist radeon\nblacklist amdgpu" | sudo tee /etc/modprobe.d/blacklist-radeon.conf -sudo update-initramfs -u -sudo reboot -``` - -Falls `xfce4-display-settings` sich in Endlosschleife öffnet: -```bash -sudo mv /usr/bin/xfce4-display-settings /usr/bin/xfce4-display-settings.bak -``` - -### Lüfter drehen nicht hoch / MacBook wird zu heiß - -```bash -# mbpfan läuft? -sudo systemctl status mbpfan - -# Temperaturen prüfen -sensors - -# temp-watch.sh manuell starten -sudo /usr/local/bin/temp-watch.sh -``` - -### Boot hängt (wartet auf Netzwerk) - -```bash -sudo systemctl disable systemd-networkd-wait-online.service -sudo reboot -``` - -### setup-desktop.sh manuell ausführen - -```bash -curl -fsSL https://git.motocamp.de/rene/macbook-setup/raw/branch/main/setup-desktop.sh | bash -``` From 091fb2337e3f97d1b17d227a926ff7340f289733 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:49:54 +0100 Subject: [PATCH 103/122] Bitwarden als Snap in setup-base.sh aufgenommen Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- setup-base.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index fba521f..6bc69b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,7 +37,7 @@ die Setup-Skripte nicht heruntergeladen werden. ## Paketquellen-Zuordnung - **apt:** System-Pakete, xubuntu-desktop, Thunderbird, KeePassXC, default-jre etc. -- **Snap:** FreeCAD, LibreOffice (wegen "benutzerdefinierte Installation nicht abgeschlossen" Bug bei .deb) +- **Snap:** FreeCAD, LibreOffice (wegen "benutzerdefinierte Installation nicht abgeschlossen" Bug bei .deb), Bitwarden - **Flatpak:** Brave Browser (wegen SIGTRAP/int3 Crash bei .deb auf aelterer HW), PrusaSlicer - flatpak muss in setup-base.sh (root) installiert werden, nicht in setup-desktop.sh (user) diff --git a/setup-base.sh b/setup-base.sh index ea750ae..cac99a1 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -143,9 +143,10 @@ apt install -y \ || { fail "apt install fehlgeschlagen"; dpkg --configure -a; apt install -f -y; } ok "Pakete installiert (apt)" -# FreeCAD + LibreOffice via Snap +# FreeCAD + LibreOffice + Bitwarden via Snap snap install freecad 2>/dev/null || warn "FreeCAD Snap uebersprungen" snap install libreoffice 2>/dev/null || warn "LibreOffice Snap uebersprungen" +snap install bitwarden 2>/dev/null || warn "Bitwarden Snap uebersprungen" # ── 6. Brave Browser (wird in setup-desktop.sh als Flatpak installiert) ── echo -e "\n=== 6/11 Brave Browser ===" From fbb650ab4d784521c2b56b8fe37bcce18d160963 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:49:54 +0100 Subject: [PATCH 104/122] Bitwarden als Snap in setup-base.sh aufgenommen --- CLAUDE.md | 2 +- setup-base.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index fba521f..6bc69b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,7 +37,7 @@ die Setup-Skripte nicht heruntergeladen werden. ## Paketquellen-Zuordnung - **apt:** System-Pakete, xubuntu-desktop, Thunderbird, KeePassXC, default-jre etc. -- **Snap:** FreeCAD, LibreOffice (wegen "benutzerdefinierte Installation nicht abgeschlossen" Bug bei .deb) +- **Snap:** FreeCAD, LibreOffice (wegen "benutzerdefinierte Installation nicht abgeschlossen" Bug bei .deb), Bitwarden - **Flatpak:** Brave Browser (wegen SIGTRAP/int3 Crash bei .deb auf aelterer HW), PrusaSlicer - flatpak muss in setup-base.sh (root) installiert werden, nicht in setup-desktop.sh (user) diff --git a/setup-base.sh b/setup-base.sh index ea750ae..cac99a1 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -143,9 +143,10 @@ apt install -y \ || { fail "apt install fehlgeschlagen"; dpkg --configure -a; apt install -f -y; } ok "Pakete installiert (apt)" -# FreeCAD + LibreOffice via Snap +# FreeCAD + LibreOffice + Bitwarden via Snap snap install freecad 2>/dev/null || warn "FreeCAD Snap uebersprungen" snap install libreoffice 2>/dev/null || warn "LibreOffice Snap uebersprungen" +snap install bitwarden 2>/dev/null || warn "Bitwarden Snap uebersprungen" # ── 6. Brave Browser (wird in setup-desktop.sh als Flatpak installiert) ── echo -e "\n=== 6/11 Brave Browser ===" From 346e3488155ce2aae1a1ec210a73ed13ff92ccb8 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:59:43 +0100 Subject: [PATCH 105/122] setup-desktop: .zshrc aus dotfiles-rene per Symlink statt inline Die .zshrc wird jetzt im dotfiles-rene Repo gepflegt und per install-zsh-dotfiles.sh als Symlink installiert. Aenderungen an Aliases kommen damit automatisch per git pull / mac-sync. Co-Authored-By: Claude Opus 4.6 --- setup-desktop.sh | 82 +++--------------------------------------------- 1 file changed, 4 insertions(+), 78 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index 876c149..edf3128 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -132,86 +132,12 @@ if [[ -d "$DOTFILES_DIR/bin" ]]; then ok "Dot-Files: git-check-all.sh, git-update-all.sh, git-sync-all.sh → ~/" fi -# .zshrc (Linux-Version, ohne Conda/LM Studio/iTerm2) -cat > ~/.zshrc <<'ZSHEOF' -# ---------------------------------------------------------- -# Zsh-Konfiguration fuer Rene (Linux / MacBook Pro) -# Oh My Zsh + Powerlevel10k + Micro -# ---------------------------------------------------------- - -# 1) Powerlevel10k Instant Prompt (muss sehr weit oben stehen) -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +# .zshrc (Symlink aus dotfiles-rene) +if [[ -f "$DOTFILES_DIR/zsh/install-zsh-dotfiles.sh" ]]; then + bash "$DOTFILES_DIR/zsh/install-zsh-dotfiles.sh" + ok "Dot-Files: .zshrc" fi -# 2) Oh My Zsh Basis -export ZSH="$HOME/.oh-my-zsh" -ZSH_THEME="powerlevel10k/powerlevel10k" - -plugins=( - git - zsh-syntax-highlighting - zoxide -) - -source "$ZSH/oh-my-zsh.sh" - -# 3) Powerlevel10k-Konfiguration -[[ -f "$HOME/.p10k.zsh" ]] && source "$HOME/.p10k.zsh" - -# 4) Standard-Editor (lokal: micro, SSH: nicht erzwingen) -if [[ -z "$SSH_CONNECTION" ]]; then - export EDITOR="micro" - export VISUAL="micro" -fi - -# 5) Pfade -export PATH="$HOME/bin:$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" - -# 6) Aliases - -# ls-Varianten -alias ll='ls -lha' -alias la='ls -A' -alias l='ls -lh' - -# Verzeichnisse -alias ..='cd ..' -alias ...='cd ../..' -alias ....='cd ../../..' - -# Konfigdateien -alias zshconfig='micro ~/.zshrc' -alias p10kconfig='micro ~/.p10k.zsh' - -# Git-Kurzbefehle -alias gs='git status' -alias ga='git add' -alias gc='git commit' -alias gp='git push' -alias gl='git log --oneline --graph --decorate' -alias gitcheck="~/git-check-all.sh --short" -alias gitupdate="~/git-update-all.sh" -alias gitsync="~/git-sync-all.sh" -alias mac-sync="curl -fsSL https://git.motocamp.de/rene/dotfiles-rene/raw/branch/main/bin/git-sync-all.sh | bash" - -# 7) History -HISTFILE="$HOME/.zsh_history" -HISTSIZE=5000 -SAVEHIST=5000 -setopt HIST_IGNORE_DUPS -setopt HIST_IGNORE_SPACE -setopt SHARE_HISTORY - -# 8) Zsh-Optionen -setopt AUTO_CD - -# 9) Fenster-/Tab-Titel -precmd() { print -Pn "\e]0;%n@%m: %~\a" } -export COLORTERM=truecolor -ZSHEOF -ok "Dot-Files: .zshrc" - # .p10k.zsh (vom Mac kopieren, falls im Repo vorhanden, sonst Wizard beim ersten Start) if [[ -f "$DOTFILES_DIR/.p10k.zsh" ]]; then cp "$DOTFILES_DIR/.p10k.zsh" ~/.p10k.zsh From bbebe6cb4c96df0f4a9d55f2c95fd888dff744cc Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 09:59:43 +0100 Subject: [PATCH 106/122] setup-desktop: .zshrc aus dotfiles-rene per Symlink statt inline Die .zshrc wird jetzt im dotfiles-rene Repo gepflegt und per install-zsh-dotfiles.sh als Symlink installiert. Aenderungen an Aliases kommen damit automatisch per git pull / mac-sync. --- setup-desktop.sh | 82 +++--------------------------------------------- 1 file changed, 4 insertions(+), 78 deletions(-) diff --git a/setup-desktop.sh b/setup-desktop.sh index 876c149..edf3128 100755 --- a/setup-desktop.sh +++ b/setup-desktop.sh @@ -132,86 +132,12 @@ if [[ -d "$DOTFILES_DIR/bin" ]]; then ok "Dot-Files: git-check-all.sh, git-update-all.sh, git-sync-all.sh → ~/" fi -# .zshrc (Linux-Version, ohne Conda/LM Studio/iTerm2) -cat > ~/.zshrc <<'ZSHEOF' -# ---------------------------------------------------------- -# Zsh-Konfiguration fuer Rene (Linux / MacBook Pro) -# Oh My Zsh + Powerlevel10k + Micro -# ---------------------------------------------------------- - -# 1) Powerlevel10k Instant Prompt (muss sehr weit oben stehen) -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +# .zshrc (Symlink aus dotfiles-rene) +if [[ -f "$DOTFILES_DIR/zsh/install-zsh-dotfiles.sh" ]]; then + bash "$DOTFILES_DIR/zsh/install-zsh-dotfiles.sh" + ok "Dot-Files: .zshrc" fi -# 2) Oh My Zsh Basis -export ZSH="$HOME/.oh-my-zsh" -ZSH_THEME="powerlevel10k/powerlevel10k" - -plugins=( - git - zsh-syntax-highlighting - zoxide -) - -source "$ZSH/oh-my-zsh.sh" - -# 3) Powerlevel10k-Konfiguration -[[ -f "$HOME/.p10k.zsh" ]] && source "$HOME/.p10k.zsh" - -# 4) Standard-Editor (lokal: micro, SSH: nicht erzwingen) -if [[ -z "$SSH_CONNECTION" ]]; then - export EDITOR="micro" - export VISUAL="micro" -fi - -# 5) Pfade -export PATH="$HOME/bin:$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" - -# 6) Aliases - -# ls-Varianten -alias ll='ls -lha' -alias la='ls -A' -alias l='ls -lh' - -# Verzeichnisse -alias ..='cd ..' -alias ...='cd ../..' -alias ....='cd ../../..' - -# Konfigdateien -alias zshconfig='micro ~/.zshrc' -alias p10kconfig='micro ~/.p10k.zsh' - -# Git-Kurzbefehle -alias gs='git status' -alias ga='git add' -alias gc='git commit' -alias gp='git push' -alias gl='git log --oneline --graph --decorate' -alias gitcheck="~/git-check-all.sh --short" -alias gitupdate="~/git-update-all.sh" -alias gitsync="~/git-sync-all.sh" -alias mac-sync="curl -fsSL https://git.motocamp.de/rene/dotfiles-rene/raw/branch/main/bin/git-sync-all.sh | bash" - -# 7) History -HISTFILE="$HOME/.zsh_history" -HISTSIZE=5000 -SAVEHIST=5000 -setopt HIST_IGNORE_DUPS -setopt HIST_IGNORE_SPACE -setopt SHARE_HISTORY - -# 8) Zsh-Optionen -setopt AUTO_CD - -# 9) Fenster-/Tab-Titel -precmd() { print -Pn "\e]0;%n@%m: %~\a" } -export COLORTERM=truecolor -ZSHEOF -ok "Dot-Files: .zshrc" - # .p10k.zsh (vom Mac kopieren, falls im Repo vorhanden, sonst Wizard beim ersten Start) if [[ -f "$DOTFILES_DIR/.p10k.zsh" ]]; then cp "$DOTFILES_DIR/.p10k.zsh" ~/.p10k.zsh From 3d9e15d8ab28cb0fe88a25e0eaa3017cd90f9991 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 10:42:02 +0100 Subject: [PATCH 107/122] setup-base: /etc/hosts Eintrag fuer dsm.motocamp.de Synology DiskStation ist intern nicht per DNS erreichbar. Ohne den hosts-Eintrag schlaegt Thunderbird/MailPlus fehl. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index cac99a1..bbe2ea2 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -298,6 +298,14 @@ systemctl disable systemd-networkd-wait-online.service 2>/dev/null || true systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" +# /etc/hosts: Synology DiskStation im LAN (fuer Thunderbird/MailPlus etc.) +if ! grep -q "dsm.motocamp.de" /etc/hosts; then + echo "10.47.11.10 dsm.motocamp.de" >> /etc/hosts + ok "/etc/hosts: dsm.motocamp.de" +else + ok "/etc/hosts: dsm.motocamp.de (bereits vorhanden)" +fi + # ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── echo -e "\n=== 10/11 Energie & Lokalisierung ===" From 2d9320bb77530c94b9f2c6539d9c0a81f7feb3cd Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 10:42:02 +0100 Subject: [PATCH 108/122] setup-base: /etc/hosts Eintrag fuer dsm.motocamp.de Synology DiskStation ist intern nicht per DNS erreichbar. Ohne den hosts-Eintrag schlaegt Thunderbird/MailPlus fehl. --- setup-base.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index cac99a1..bbe2ea2 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -298,6 +298,14 @@ systemctl disable systemd-networkd-wait-online.service 2>/dev/null || true systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" +# /etc/hosts: Synology DiskStation im LAN (fuer Thunderbird/MailPlus etc.) +if ! grep -q "dsm.motocamp.de" /etc/hosts; then + echo "10.47.11.10 dsm.motocamp.de" >> /etc/hosts + ok "/etc/hosts: dsm.motocamp.de" +else + ok "/etc/hosts: dsm.motocamp.de (bereits vorhanden)" +fi + # ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── echo -e "\n=== 10/11 Energie & Lokalisierung ===" From 0b5a5ae9979055fcc73782a270feb3407f7bad45 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 10:50:04 +0100 Subject: [PATCH 109/122] Tastatur: nodeadkeys durch deadkeys ersetzt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mit nodeadkeys werden Akzente nicht kombiniert (´e statt é). Deadkeys-Variante ermoeglicht korrekte Akzent-Eingabe. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index bbe2ea2..76658e6 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -75,15 +75,15 @@ fi echo 'options hid_apple fnmode=2 iso_layout=1' > /etc/modprobe.d/hid_apple.conf ok "hid_apple: fnmode=2, iso_layout=1" -# Tastaturbelegung (nodeadkeys + lv3:lalt_switch: @=Alt+Q, |=Alt+<) +# Tastaturbelegung (deadkeys + lv3:lalt_switch: @=Alt+Q, |=Alt+<) cat > /etc/default/keyboard </dev/null || true -ok "Tastatur: mac_nodeadkeys" +ok "Tastatur: mac_deadkeys" # cloud-init deaktivieren (blockiert Boot ohne Cloud-Provider) if command -v cloud-init &>/dev/null; then From 21389740bb62eb22b003559963c43a8392ca83b5 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 10:50:04 +0100 Subject: [PATCH 110/122] Tastatur: nodeadkeys durch deadkeys ersetzt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mit nodeadkeys werden Akzente nicht kombiniert (´e statt é). Deadkeys-Variante ermoeglicht korrekte Akzent-Eingabe. --- setup-base.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup-base.sh b/setup-base.sh index bbe2ea2..76658e6 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -75,15 +75,15 @@ fi echo 'options hid_apple fnmode=2 iso_layout=1' > /etc/modprobe.d/hid_apple.conf ok "hid_apple: fnmode=2, iso_layout=1" -# Tastaturbelegung (nodeadkeys + lv3:lalt_switch: @=Alt+Q, |=Alt+<) +# Tastaturbelegung (deadkeys + lv3:lalt_switch: @=Alt+Q, |=Alt+<) cat > /etc/default/keyboard </dev/null || true -ok "Tastatur: mac_nodeadkeys" +ok "Tastatur: mac_deadkeys" # cloud-init deaktivieren (blockiert Boot ohne Cloud-Provider) if command -v cloud-init &>/dev/null; then From e41a08ff0c599a20232de0c6ae4f854b7fc12182 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 10:52:27 +0100 Subject: [PATCH 111/122] CLAUDE.md: Tastatur-Deadkeys und hosts-Eintrag dokumentiert Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 6bc69b2..bb463d4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -61,7 +61,8 @@ die Setup-Skripte nicht heruntergeladen werden. - xfce4-display-settings deaktivieren (verursacht Endlosschleife) ### Tastatur -- iso_layout=1 + de nodeadkeys + lv3:lalt_switch +- iso_layout=1 + de (mit Dead Keys, NICHT nodeadkeys) + lv3:lalt_switch +- nodeadkeys verhindert Akzent-Kombination (´e statt é) - XFCE Keyboard-Override deaktivieren (XkbDisable) ### Netzwerk & WLAN @@ -69,6 +70,7 @@ die Setup-Skripte nicht heruntergeladen werden. - WLAN-Config beim netplan-zu-NM Umstieg erhalten - systemd-networkd-wait-online deaktivieren - cloud-init deaktivieren nach Installation +- /etc/hosts: dsm.motocamp.de → 10.47.11.10 (DiskStation intern nicht per DNS erreichbar) ### WireGuard VPN - Konfiguration via NetworkManager .nmconnection (nicht wg-quick) From 208f292d4d590da7807539351e903322a2f26dba Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 14 Mar 2026 10:52:27 +0100 Subject: [PATCH 112/122] CLAUDE.md: Tastatur-Deadkeys und hosts-Eintrag dokumentiert --- CLAUDE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 6bc69b2..bb463d4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -61,7 +61,8 @@ die Setup-Skripte nicht heruntergeladen werden. - xfce4-display-settings deaktivieren (verursacht Endlosschleife) ### Tastatur -- iso_layout=1 + de nodeadkeys + lv3:lalt_switch +- iso_layout=1 + de (mit Dead Keys, NICHT nodeadkeys) + lv3:lalt_switch +- nodeadkeys verhindert Akzent-Kombination (´e statt é) - XFCE Keyboard-Override deaktivieren (XkbDisable) ### Netzwerk & WLAN @@ -69,6 +70,7 @@ die Setup-Skripte nicht heruntergeladen werden. - WLAN-Config beim netplan-zu-NM Umstieg erhalten - systemd-networkd-wait-online deaktivieren - cloud-init deaktivieren nach Installation +- /etc/hosts: dsm.motocamp.de → 10.47.11.10 (DiskStation intern nicht per DNS erreichbar) ### WireGuard VPN - Konfiguration via NetworkManager .nmconnection (nicht wg-quick) From 63fcced45025553fef462d3513e908f1a5a44827 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:33:39 +0100 Subject: [PATCH 113/122] setup-base: git.motocamp.de in /etc/hosts aufgenommen Synology-Dienste (dsm + git) sind intern nicht per DNS erreichbar. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- setup-base.sh | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bb463d4..c78fb76 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,7 +70,7 @@ die Setup-Skripte nicht heruntergeladen werden. - WLAN-Config beim netplan-zu-NM Umstieg erhalten - systemd-networkd-wait-online deaktivieren - cloud-init deaktivieren nach Installation -- /etc/hosts: dsm.motocamp.de → 10.47.11.10 (DiskStation intern nicht per DNS erreichbar) +- /etc/hosts: dsm.motocamp.de + git.motocamp.de → 10.47.11.10 (Synology intern nicht per DNS erreichbar) ### WireGuard VPN - Konfiguration via NetworkManager .nmconnection (nicht wg-quick) diff --git a/setup-base.sh b/setup-base.sh index 76658e6..0df6980 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -298,13 +298,15 @@ systemctl disable systemd-networkd-wait-online.service 2>/dev/null || true systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" -# /etc/hosts: Synology DiskStation im LAN (fuer Thunderbird/MailPlus etc.) -if ! grep -q "dsm.motocamp.de" /etc/hosts; then - echo "10.47.11.10 dsm.motocamp.de" >> /etc/hosts - ok "/etc/hosts: dsm.motocamp.de" -else - ok "/etc/hosts: dsm.motocamp.de (bereits vorhanden)" -fi +# /etc/hosts: Synology-Dienste im LAN (intern nicht per DNS erreichbar) +for host in dsm.motocamp.de git.motocamp.de; do + if ! grep -q "$host" /etc/hosts; then + echo "10.47.11.10 $host" >> /etc/hosts + ok "/etc/hosts: $host" + else + ok "/etc/hosts: $host (bereits vorhanden)" + fi +done # ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── echo -e "\n=== 10/11 Energie & Lokalisierung ===" From b70b3ef8a4927b8dc26c347d38c8d14e936e860a Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:33:39 +0100 Subject: [PATCH 114/122] setup-base: git.motocamp.de in /etc/hosts aufgenommen Synology-Dienste (dsm + git) sind intern nicht per DNS erreichbar. --- CLAUDE.md | 2 +- setup-base.sh | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bb463d4..c78fb76 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,7 +70,7 @@ die Setup-Skripte nicht heruntergeladen werden. - WLAN-Config beim netplan-zu-NM Umstieg erhalten - systemd-networkd-wait-online deaktivieren - cloud-init deaktivieren nach Installation -- /etc/hosts: dsm.motocamp.de → 10.47.11.10 (DiskStation intern nicht per DNS erreichbar) +- /etc/hosts: dsm.motocamp.de + git.motocamp.de → 10.47.11.10 (Synology intern nicht per DNS erreichbar) ### WireGuard VPN - Konfiguration via NetworkManager .nmconnection (nicht wg-quick) diff --git a/setup-base.sh b/setup-base.sh index 76658e6..0df6980 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -298,13 +298,15 @@ systemctl disable systemd-networkd-wait-online.service 2>/dev/null || true systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" -# /etc/hosts: Synology DiskStation im LAN (fuer Thunderbird/MailPlus etc.) -if ! grep -q "dsm.motocamp.de" /etc/hosts; then - echo "10.47.11.10 dsm.motocamp.de" >> /etc/hosts - ok "/etc/hosts: dsm.motocamp.de" -else - ok "/etc/hosts: dsm.motocamp.de (bereits vorhanden)" -fi +# /etc/hosts: Synology-Dienste im LAN (intern nicht per DNS erreichbar) +for host in dsm.motocamp.de git.motocamp.de; do + if ! grep -q "$host" /etc/hosts; then + echo "10.47.11.10 $host" >> /etc/hosts + ok "/etc/hosts: $host" + else + ok "/etc/hosts: $host (bereits vorhanden)" + fi +done # ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── echo -e "\n=== 10/11 Energie & Lokalisierung ===" From e8d353c69e273cacf680052e219d607ab5b2bca9 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:36:48 +0100 Subject: [PATCH 115/122] setup-base: git.motocamp.de auf NPM-IP (10.47.11.23) statt Synology direkt Gitea laeuft hinter dem Nginx Proxy Manager (macvlan). Direkter Zugriff auf die Synology-IP liefert DSM statt Gitea. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- setup-base.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index c78fb76..a0a1694 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,7 +70,7 @@ die Setup-Skripte nicht heruntergeladen werden. - WLAN-Config beim netplan-zu-NM Umstieg erhalten - systemd-networkd-wait-online deaktivieren - cloud-init deaktivieren nach Installation -- /etc/hosts: dsm.motocamp.de + git.motocamp.de → 10.47.11.10 (Synology intern nicht per DNS erreichbar) +- /etc/hosts: dsm.motocamp.de → 10.47.11.10 (Synology direkt), git.motocamp.de → 10.47.11.23 (NPM/macvlan, da Gitea hinter Reverse Proxy) ### WireGuard VPN - Konfiguration via NetworkManager .nmconnection (nicht wg-quick) diff --git a/setup-base.sh b/setup-base.sh index 0df6980..7440626 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -299,9 +299,11 @@ systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" # /etc/hosts: Synology-Dienste im LAN (intern nicht per DNS erreichbar) -for host in dsm.motocamp.de git.motocamp.de; do +# dsm -> Synology direkt, git -> Nginx Proxy Manager (macvlan) +for entry in "10.47.11.10 dsm.motocamp.de" "10.47.11.23 git.motocamp.de"; do + host="${entry##* }" if ! grep -q "$host" /etc/hosts; then - echo "10.47.11.10 $host" >> /etc/hosts + echo "$entry" >> /etc/hosts ok "/etc/hosts: $host" else ok "/etc/hosts: $host (bereits vorhanden)" From 792a107fe9385a008bcc96a569ae8d76e32c6a53 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:36:48 +0100 Subject: [PATCH 116/122] setup-base: git.motocamp.de auf NPM-IP (10.47.11.23) statt Synology direkt Gitea laeuft hinter dem Nginx Proxy Manager (macvlan). Direkter Zugriff auf die Synology-IP liefert DSM statt Gitea. --- CLAUDE.md | 2 +- setup-base.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index c78fb76..a0a1694 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,7 +70,7 @@ die Setup-Skripte nicht heruntergeladen werden. - WLAN-Config beim netplan-zu-NM Umstieg erhalten - systemd-networkd-wait-online deaktivieren - cloud-init deaktivieren nach Installation -- /etc/hosts: dsm.motocamp.de + git.motocamp.de → 10.47.11.10 (Synology intern nicht per DNS erreichbar) +- /etc/hosts: dsm.motocamp.de → 10.47.11.10 (Synology direkt), git.motocamp.de → 10.47.11.23 (NPM/macvlan, da Gitea hinter Reverse Proxy) ### WireGuard VPN - Konfiguration via NetworkManager .nmconnection (nicht wg-quick) diff --git a/setup-base.sh b/setup-base.sh index 0df6980..7440626 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -299,9 +299,11 @@ systemctl enable NetworkManager-wait-online.service 2>/dev/null || true ok "NetworkManager als Netzwerk-Renderer" # /etc/hosts: Synology-Dienste im LAN (intern nicht per DNS erreichbar) -for host in dsm.motocamp.de git.motocamp.de; do +# dsm -> Synology direkt, git -> Nginx Proxy Manager (macvlan) +for entry in "10.47.11.10 dsm.motocamp.de" "10.47.11.23 git.motocamp.de"; do + host="${entry##* }" if ! grep -q "$host" /etc/hosts; then - echo "10.47.11.10 $host" >> /etc/hosts + echo "$entry" >> /etc/hosts ok "/etc/hosts: $host" else ok "/etc/hosts: $host (bereits vorhanden)" From 94efa8be9737b5ec910570efe8244fa337f14c38 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:49:32 +0100 Subject: [PATCH 117/122] setup-base: auto-boot beim Netzteil-Anstecken deaktivieren MacBooks starten sonst automatisch wenn sie im Akkubetrieb heruntergefahren wurden und ein Netzteil angesteckt wird. Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index 7440626..cb8a357 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -310,6 +310,14 @@ for entry in "10.47.11.10 dsm.motocamp.de" "10.47.11.23 git.motocamp.de"; do fi done +# Auto-Boot beim Anstecken des Netzteils deaktivieren +EFI_VAR="/sys/firmware/efi/efivars/auto-boot-7c436110-ab2a-4bbb-a880-fe41995c9f82" +if [ -f "$EFI_VAR" ]; then + chattr -i "$EFI_VAR" 2>/dev/null + printf '\x07\x00\x00\x00\x66\x61\x6c\x73\x65' > "$EFI_VAR" + ok "auto-boot deaktiviert (kein Start beim Netzteil-Anstecken)" +fi + # ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── echo -e "\n=== 10/11 Energie & Lokalisierung ===" From 8145f46c934f76a6cd7a664d35e88d576a79ba8d Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:49:32 +0100 Subject: [PATCH 118/122] setup-base: auto-boot beim Netzteil-Anstecken deaktivieren MacBooks starten sonst automatisch wenn sie im Akkubetrieb heruntergefahren wurden und ein Netzteil angesteckt wird. --- setup-base.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup-base.sh b/setup-base.sh index 7440626..cb8a357 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -310,6 +310,14 @@ for entry in "10.47.11.10 dsm.motocamp.de" "10.47.11.23 git.motocamp.de"; do fi done +# Auto-Boot beim Anstecken des Netzteils deaktivieren +EFI_VAR="/sys/firmware/efi/efivars/auto-boot-7c436110-ab2a-4bbb-a880-fe41995c9f82" +if [ -f "$EFI_VAR" ]; then + chattr -i "$EFI_VAR" 2>/dev/null + printf '\x07\x00\x00\x00\x66\x61\x6c\x73\x65' > "$EFI_VAR" + ok "auto-boot deaktiviert (kein Start beim Netzteil-Anstecken)" +fi + # ── 10. Energieeinstellungen & Lokalisierung ───────────────────────────── echo -e "\n=== 10/11 Energie & Lokalisierung ===" From 9440d89862121b65ce7bbb8b8e086df407ced614 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:50:05 +0100 Subject: [PATCH 119/122] CLAUDE.md: auto-boot EFI-Variable dokumentiert Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index a0a1694..86e0751 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -85,6 +85,10 @@ die Setup-Skripte nicht heruntergeladen werden. - DNS im VPN: 10.47.11.20 (Fritz!Box), 10.47.11.1 (Gateway) - Server macht NAT/Masquerade ueber ens3 +### EFI / Boot +- auto-boot EFI-Variable auf false setzen: verhindert automatischen Start beim Anstecken des Netzteils +- Variable: /sys/firmware/efi/efivars/auto-boot-7c436110-ab2a-4bbb-a880-fe41995c9f82 + ### Setup-Skripte - macOS-Installer hinterlaesst macOS-sudoers: setup-base.sh ersetzt sie durch Linux-Standard - setup-desktop.sh: set -e entfernt, Unicode durch ASCII ersetzt From 86ae6f42dc4b25b465b1166aa10673a3e44953e9 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 09:50:05 +0100 Subject: [PATCH 120/122] CLAUDE.md: auto-boot EFI-Variable dokumentiert --- CLAUDE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index a0a1694..86e0751 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -85,6 +85,10 @@ die Setup-Skripte nicht heruntergeladen werden. - DNS im VPN: 10.47.11.20 (Fritz!Box), 10.47.11.1 (Gateway) - Server macht NAT/Masquerade ueber ens3 +### EFI / Boot +- auto-boot EFI-Variable auf false setzen: verhindert automatischen Start beim Anstecken des Netzteils +- Variable: /sys/firmware/efi/efivars/auto-boot-7c436110-ab2a-4bbb-a880-fe41995c9f82 + ### Setup-Skripte - macOS-Installer hinterlaesst macOS-sudoers: setup-base.sh ersetzt sie durch Linux-Standard - setup-desktop.sh: set -e entfernt, Unicode durch ASCII ersetzt From ac4a58bdfdd0015de8867053ec49375e5dc603cb Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 10:28:08 +0100 Subject: [PATCH 121/122] setup-base: cmatrix als Paket aufgenommen Co-Authored-By: Claude Opus 4.6 --- setup-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-base.sh b/setup-base.sh index cb8a357..1939271 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -133,7 +133,7 @@ apt install -y \ flatpak \ thunderbird thunderbird-locale-de \ keepassxc \ - htop btop \ + htop btop cmatrix \ timeshift \ vlc \ language-pack-de \ From 538201879ae0e50ff58d60c13332b0b09e2e3903 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 15 Mar 2026 10:28:08 +0100 Subject: [PATCH 122/122] setup-base: cmatrix als Paket aufgenommen --- setup-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-base.sh b/setup-base.sh index cb8a357..1939271 100755 --- a/setup-base.sh +++ b/setup-base.sh @@ -133,7 +133,7 @@ apt install -y \ flatpak \ thunderbird thunderbird-locale-de \ keepassxc \ - htop btop \ + htop btop cmatrix \ timeshift \ vlc \ language-pack-de \