Skip to content

Instantly share code, notes, and snippets.

@hex007
Last active May 4, 2017 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hex007/a6e67bbd64957acdcc4ec68c5c75fd6f to your computer and use it in GitHub Desktop.
Save hex007/a6e67bbd64957acdcc4ec68c5c75fd6f to your computer and use it in GitHub Desktop.
# on your pi, Press f4 if you have emulationstation running or kill EmulationStation if running ssh
# Get binary zip file
wget http://www.sudomod.com/forum/download/file.php?id=5057 -O es.zip
# Extract zip file
unzip es.zip
# Backup original EmulationStation
sudo mv "/opt/retropie/supplementary/emulationstation/emulationstation" "/opt/retropie/supplimentary/emulationstation/emulationstation_bkp"
# Copy new binary to destination
sudo cp "emulationstation" "/opt/retropie/supplementary/emulationstation/emulationstation"
# Reboot
sudo reboot
# note the pid of emulationstation
top
# press q to exit
# Kill emulation station using pid noted above
kill PID
# To build on pi zero we need more ram. Get root previleges to turn swap on
sudo su
# We define a way to increase the Swap space.
function rpSwap() {
local command=$1
local swapfile="$__swapdir/swap"
case $command in
on)
rpSwap off
local memory=$(free -t -m | awk '/^Total:/{print $2}')
local needed=$2
local size=$((needed - memory))
mkdir -p "$__swapdir/"
if [[ $size -ge 0 ]]; then
echo "Adding $size MB of additional swap"
fallocate -l ${size}M "$swapfile"
chmod 600 "$swapfile"
mkswap "$swapfile"
swapon "$swapfile"
fi
;;
off)
echo "Removing additional swap"
swapoff "$swapfile" 2>/dev/null
rm -f "$swapfile"
;;
esac
}
# Increase Swap space
rpSwap on 512
# Exit from superuser shell
exit
# Clone Repository
git clone --depth 1 --recurse-submodules https://github.com/hex007/EmulationStation
# Build EmulationStation
cd EmulationStation
cmake ./
make
# This will take a long time ~ 1.5-2 Hrs
# Once build is successful, bkp original ES binary and replace with one just built
sudo mv "/opt/retropie/supplementary/emulationstation/emulationstation" "/opt/retropie/supplimentary/emulationstation/emulationstation_bkp"
sudo cp "emulationstation" "/opt/retropie/supplementary/emulationstation/emulationstation"
# Turn Swap off
sudo su
rpSwap off
# Reboot
sudo reboot
# If you would like to restore your binary to stock EmulationStation
sudo cp "/opt/retropie/supplimentary/emulationstation/emulationstation_bkp" "/opt/retropie/supplementary/emulationstation/emulationstation"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment