Page 1 of 1

RetroPie Auto Startup Script

Posted: Mon Jul 11, 2016 3:29 pm
by GaM3r2Xtreme
Hey guys,

When selecting RetroPie as the startup from dietpi-autostart, what script is being used and where is it located in order to call up emulationstation?

I'm looking to inject a few commands right before emulationstation begins in order to connect a few wii remotes via wminput.

Re: RetroPie Auto Startup Script

Posted: Mon Jul 11, 2016 7:10 pm
by Fourdee
GaM3r2Xtreme wrote:Hey guys,

When selecting RetroPie as the startup from dietpi-autostart, what script is being used and where is it located in order to call up emulationstation?

I'm looking to inject a few commands right before emulationstation begins in order to connect a few wii remotes via wminput.
Here she is :) https://github.com/Fourdee/DietPi/blob/ ... /login#L79

Code: Select all

/opt/retropie/supplementary/emulationstation/emulationstation

Re: RetroPie Auto Startup Script

Posted: Thu Jul 14, 2016 1:27 am
by GaM3r2Xtreme
That's what I'm talking about. Thanks!

Re: RetroPie Auto Startup Script

Posted: Thu Nov 03, 2016 2:49 am
by GaM3r2Xtreme
Hey Fourdee,

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:

Code: Select all

#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:

Code: Select all

/opt/retropie/supplementary/emulationstation/emulationstation.sh
The emulationstation.sh looks like this:

Code: Select all

#!/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.

I found this out with a little help from the Retropie community in the following thread and figured I should share the knowledge:
https://retropie.org.uk/forum/topic/483 ... own-script

Re: RetroPie Auto Startup Script

Posted: Fri Nov 04, 2016 1:14 pm
by Fourdee
GaM3r2Xtreme wrote: 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.

I found this out with a little help from the Retropie community in the following thread and figured I should share the knowledge:
https://retropie.org.uk/forum/topic/483 ... own-script
Hi,

Excellent, thank you for letting us know.

I'll update the login script to use /opt/retropie/supplementary/emulationstation/emulationstation.sh for v137.

Re: RetroPie Auto Startup Script

Posted: Tue Oct 17, 2017 5:22 pm
by loran
Hello, I would like to ask if I select Retropie on autostart, is there an option to go back to retropie?