I hate to revive this thread, but the issue I just noticed involves the auto startup script.
Alright, so currently the autostart calls the emulationstation binary directly, which works nice until a user decides to use the Quit menu within emulationstation. The user would not be able to restart or shutdown the system nor restart emulationstation. All selections would lead to emulationstation closing out to the terminal.
My solution is this, instead of having the login script call the emulationstation binary directly like this:
#RetroPie/Emulation station
elif (( $AUTO_START_INDEX == 3 )); then
#emulationstation - can no longer be run as root
/opt/retropie/supplementary/emulationstation/emulationstation
The emulationstation script should be called instead, which then calls the binary:
#!/bin/sh
esdir="$(dirname $0)"
while true; do
rm -f /tmp/es-restart /tmp/es-sysrestart /tmp/es-shutdown
"$esdir/emulationstation" "$@"
[ -f /tmp/es-restart ] && continue
if [ -f /tmp/es-sysrestart ]; then
rm -f /tmp/es-sysrestart
sudo reboot
break
fi
if [ -f /tmp/es-shutdown ]; then
rm -f /tmp/es-shutdown
sudo poweroff
break
fi
break
done
I found that the emulationstation binary ends up creating a temp file acting like a flag for the shutdown/restart options. During the shutdown of emulationstation, one of the three files is created by the binary and then analyzed by the script.