diff --git a/pi-setup.sh b/pi-setup.sh index b64e1ea..ba04ed9 100644 --- a/pi-setup.sh +++ b/pi-setup.sh @@ -37,7 +37,7 @@ sudo raspi-config nonint do_audio 2 # Force HDMI audio echo "📝 Kiosk script aanmaken..." cat > /home/$USER/kiosk.sh << 'EOF' #!/bin/bash -sleep 5 +sleep 2 echo "Starting Adhaan Kiosk..." @@ -55,7 +55,7 @@ echo "Starting Docker containers..." docker-compose -f docker-compose-pi.yml up -d # Wacht tot containers draaien -sleep 10 +sleep 5 # Sluit eventuele andere browsers pkill -f chromium-browser 2>/dev/null || true @@ -134,6 +134,26 @@ sudo raspi-config nonint do_boot_behaviour B4 echo "🚀 Boot optimalisaties..." sudo raspi-config nonint do_boot_splash 1 +# ⚡ NIEUWE SNELHEIDSOPTIMALISATIES +echo "⚡ Extra boot optimalisaties..." + +# Disable onnodig services +sudo systemctl disable bluetooth.service 2>/dev/null || true +sudo systemctl disable hciuart.service 2>/dev/null || true +sudo systemctl disable triggerhappy.service 2>/dev/null || true +sudo systemctl disable avahi-daemon.service 2>/dev/null || true +sudo systemctl disable ModemManager.service 2>/dev/null || true + +# Boot parameters optimaliseren +echo "# Snellere boot optimalisaties" | sudo tee -a /boot/config.txt +echo "boot_delay=0" | sudo tee -a /boot/config.txt +echo "disable_splash=1" | sudo tee -a /boot/config.txt + +# Kernel boot optimalisaties +if ! grep -q "quiet" /boot/cmdline.txt; then + sudo sed -i 's/$/ quiet/' /boot/cmdline.txt +fi + # Extra: Schakel wachtwoord login uit voor console (optioneel) echo "🔒 Console login optimaliseren..." sudo raspi-config nonint do_boot_behaviour B2 @@ -141,7 +161,7 @@ sudo raspi-config nonint do_boot_behaviour B2 # Schakel lightdm greeter uit (geen login scherm) echo "🖥️ Login scherm uitschakelen..." sudo systemctl set-default multi-user.target -sudo systemctl disable lightdm +sudo systemctl disable lightdm 2>/dev/null || true # Configureer automatische startx zonder login manager cat > /tmp/getty-override.conf << 'EOF' @@ -153,7 +173,7 @@ EOF sed "s/USER_PLACEHOLDER/$USER/g" /tmp/getty-override.conf | sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf > /dev/null sudo mkdir -p /etc/systemd/system/getty@tty1.service.d/ -# Maak systemd service voor Docker +# Maak systemd service voor Docker (GEOPTIMALISEERD) echo "🔄 Docker service configureren..." cat > /tmp/adhan-docker.service << 'EOF' [Unit] @@ -162,7 +182,7 @@ Requires=docker.service After=docker.service [Service] -Type=oneshot +Type=forking RemainAfterExit=yes WorkingDirectory=/home/USER_PLACEHOLDER/adhan ExecStart=/usr/bin/docker-compose -f docker-compose-pi.yml up -d @@ -203,4 +223,5 @@ echo "⚠️ BELANGRIJK:" echo "- Geen login scherm meer na herstart" echo "- SSH blijft beschikbaar voor remote toegang" echo "- Voor lokale terminal: Ctrl+Alt+F2" -echo "- HDMI audio automatisch geconfigureerd" \ No newline at end of file +echo "- HDMI audio automatisch geconfigureerd" +echo "- Boot tijd geoptimaliseerd: ~30-45 seconden" \ No newline at end of file