Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Install dependencies for SDL2
- sudo apt-get install -y libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
- #Install dependencies for EmulationStation
- #NOTE: if you don't install libudev-dev before building SDL2, the keyboard will mysteriously not work in EmulationStation.
- sudo apt-get install -y libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libboost-locale-dev libfreeimage-dev libfreetype6-dev libeigen3-dev libcurl4-openssl-dev libasound2-dev cmake g++-4.7
- #Compile and install SDL2
- wget http://libsdl.org/release/SDL2-2.0.1.tar.gz
- tar xvfz SDL2-2.0.1.tar.gz
- rm SDL2-2.0.1.tar.gz
- pushd SDL2-2.0.1
- # "--disable-video-opengl" is used to disable the software implementation of desktop OpenGL on the Pi
- # "--host=*" is used to force the Raspberry Pi host. See issue #395 on GitHub for details on why.
- ./configure --disable-video-opengl --host=arm-raspberry-linux-gnueabihf
- make
- sudo make install
- popd
- #If you like, you can delete the SDL2-2.0.1 folder now (the library has been installed)
- sudo rm -rf SDL2-2.0.1
- #Compile and install EmulationStation... This will take a very, very long time (multiple hours)
- sudo rm -rf EmulationStation
- git clone https://github.com/Aloshi/EmulationStation
- cd EmulationStation
- git checkout unstable
- # On the RPi 2, you may need to add '-DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/' before the period.
- # See issue #384 on GitHub for details.
- cmake -DCMAKE_CXX_COMPILER=g++-4.7 .
- make
- # If you want to install emulationstation to /usr/local/bin/emulationstation, which will let you just type 'emulationstation' to run it, you can do...
- echo 'Compiled, making install file available.'
- echo ' '
- sudo make install
- # Otherwise, you can run the binary from this folder with: ./emulationstation
- # /usr/local/bin/emulationstation/./emulationstation
- # Reset GPU RAM to normal values and reboot
- if grep -Fxq "gpu_mem = 32" /home/pi/Public/gpu_mem_temporary.txt ; then
- echo 'Using 32 MB of GPU Memory, no changes previously made.'
- sudo rm /home/pi/Public/gpu_mem_temporary.txt
- elif grep -Fxq "gpu_mem = 64" /home/pi/Public/gpu_mem_temporary.txt ; then
- echo 'Resetting GPU memory back to 64 MB.'
- sudo sed -i '/gpu_mem = 32/ c\gpu_mem = 64/' /boot/config.txt
- sudo rm /home/pi/Public/gpu_mem_temporary.txt
- elif grep -Fxq "gpu_mem = 128" /home/pi/Public/gpu_mem_temporary.txt ; then
- echo 'Resetting GPU memory back to 128 MB.'
- sudo sed -i '/gpu_mem = 32/ c\gpu_mem = 128/' /boot/config.txt
- sudo rm /home/pi/Public/gpu_mem_temporary.txt
- elif grep -Fxq "gpu_mem = 256" /home/pi/Public/gpu_mem_temporary.txt ; then
- echo 'Resetting GPU memory back to 256 MB.'
- sudo sed -i '/gpu_mem = 32/ c\gpu_mem = 256/' /boot/config.txt
- sudo rm /home/pi/Public/gpu_mem_temporary.txt
- elif grep -Fxq "gpu_mem = 64 - value not found" /home/pi/Public/gpu_mem_temporary.txt ; then
- echo 'Resetting GPU memory back to default.'
- sudo sed -i '/gpu_mem = 32/ c\/' /boot/config.txt
- sudo rm /home/pi/Public/gpu_mem_temporary.txt
- else
- echo 'This script was not able to restore settings.'
- echo 'Please reset settings manually by typing in the following:'
- echo 'sudo nano /boot/config.txt'
- echo
- echo 'And type in the appropriate desired value.'
- echo 'i.e. gpu_mem = 64'
- sleep 30s
- fi
- echo 'Installation completed, configuration required.'
- echo 'Reboot to occur in 30 seconds.'
- sleep 30s
- sudo reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement