Enhance first-boot.sh and one-shot scripts for improved logging and error handling: add detailed logging to track download successes and failures, implement structured logging in set-rotation-once.sh and set-wallpaper-once.sh, and ensure user permissions for log file access. Update package installation and kiosk file setup processes for better clarity and reliability.

This commit is contained in:
nearxos
2026-02-20 10:44:34 +02:00
parent 00d53b8158
commit 359645296e
3 changed files with 72 additions and 11 deletions

View File

@@ -1,7 +1,20 @@
#!/bin/bash
# One-shot: set desktop wallpaper to splash image, then remove self. Runs as user pi at first login.
# Logs to /var/log/first-boot.log (same as first-boot.sh).
FIRST_BOOT_LOG="/var/log/first-boot.log"
log() { echo "[$(date -Iseconds)] [set-wallpaper-once] $*" >> "$FIRST_BOOT_LOG" 2>/dev/null || true; }
export DISPLAY=:0
log "started (DISPLAY=$DISPLAY)"
log "waiting 8s for desktop ..."
sleep 8
WALLPAPER="/usr/share/rpd-wallpaper/splash.png"
[[ -f "$WALLPAPER" ]] && plasma-apply-wallpaperimage "$WALLPAPER" 2>/dev/null || true
if [[ -f "$WALLPAPER" ]]; then
log "applying wallpaper $WALLPAPER"
plasma-apply-wallpaperimage "$WALLPAPER" 2>&1 | while read -r line; do log "$line"; done
else
log "WARNING: wallpaper not found $WALLPAPER"
fi
log "removing one-shot desktop and script"
rm -f /home/pi/.config/autostart/set-wallpaper-once.desktop /home/pi/set-wallpaper-once.sh
log "finished"