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:
@@ -1,6 +1,15 @@
|
||||
#!/bin/bash
|
||||
# One-shot: set DSI-1 (reTerminal DM) rotation to Right, 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-rotation-once] $*" >> "$FIRST_BOOT_LOG" 2>/dev/null || true; }
|
||||
|
||||
export DISPLAY=:0
|
||||
log "started (DISPLAY=$DISPLAY)"
|
||||
log "waiting 5s for display ..."
|
||||
sleep 5
|
||||
kscreen-doctor output.DSI-1.rotation.right
|
||||
log "running kscreen-doctor output.DSI-1.rotation.right"
|
||||
kscreen-doctor output.DSI-1.rotation.right 2>&1 | while read -r line; do log "$line"; done
|
||||
log "removing one-shot desktop and script"
|
||||
rm -f /home/pi/.config/autostart/set-rotation-once.desktop /home/pi/set-rotation-once.sh
|
||||
log "finished"
|
||||
|
||||
Reference in New Issue
Block a user