Advertisement
Bluestrings

ES02

Jan 10th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.41 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #Install dependencies for SDL2
  4. sudo apt-get install -y libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
  5.  
  6.  
  7. #Install dependencies for EmulationStation
  8. #NOTE: if you don't install libudev-dev before building SDL2, the keyboard will mysteriously not work in EmulationStation.
  9. 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
  10.  
  11. #Compile and install SDL2
  12. wget http://libsdl.org/release/SDL2-2.0.1.tar.gz
  13. tar xvfz SDL2-2.0.1.tar.gz
  14. rm SDL2-2.0.1.tar.gz
  15. pushd SDL2-2.0.1
  16. # "--disable-video-opengl" is used to disable the software implementation of desktop OpenGL on the Pi
  17. # "--host=*" is used to force the Raspberry Pi host. See issue #395 on GitHub for details on why.
  18. ./configure --disable-video-opengl --host=arm-raspberry-linux-gnueabihf
  19. make
  20. sudo make install
  21. popd
  22.  
  23. #If you like, you can delete the SDL2-2.0.1 folder now (the library has been installed)
  24. sudo rm -rf SDL2-2.0.1
  25.  
  26. #Compile and install EmulationStation... This will take a very, very long time (multiple hours)
  27. sudo rm -rf EmulationStation
  28. git clone https://github.com/Aloshi/EmulationStation
  29. cd EmulationStation
  30. git checkout unstable
  31. # On the RPi 2, you may need to add '-DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/' before the period.
  32. # See issue #384 on GitHub for details.
  33. cmake -DCMAKE_CXX_COMPILER=g++-4.7 .
  34. make
  35.  
  36. # If you want to install emulationstation to /usr/local/bin/emulationstation, which will let you just type 'emulationstation' to run it, you can do...
  37.  
  38. echo 'Compiled, making install file available.'
  39. echo ' '
  40. sudo make install
  41.  
  42. # Otherwise, you can run the binary from this folder with: ./emulationstation
  43. # /usr/local/bin/emulationstation/./emulationstation
  44.  
  45. # Reset GPU RAM to normal values and reboot
  46. if grep -Fxq "gpu_mem = 32" /home/pi/Public/gpu_mem_temporary.txt ; then
  47.   echo 'Using 32 MB of GPU Memory, no changes previously made.'
  48.   sudo rm /home/pi/Public/gpu_mem_temporary.txt
  49. elif grep -Fxq "gpu_mem = 64" /home/pi/Public/gpu_mem_temporary.txt ; then
  50.   echo 'Resetting GPU memory back to 64 MB.'
  51.   sudo sed -i '/gpu_mem = 32/ c\gpu_mem = 64/' /boot/config.txt
  52.   sudo rm /home/pi/Public/gpu_mem_temporary.txt
  53. elif grep -Fxq "gpu_mem = 128" /home/pi/Public/gpu_mem_temporary.txt ; then
  54.   echo 'Resetting GPU memory back to 128 MB.'
  55.   sudo sed -i '/gpu_mem = 32/ c\gpu_mem = 128/' /boot/config.txt
  56.   sudo rm /home/pi/Public/gpu_mem_temporary.txt
  57. elif grep -Fxq "gpu_mem = 256" /home/pi/Public/gpu_mem_temporary.txt ; then
  58.   echo 'Resetting GPU memory back to 256 MB.'
  59.   sudo sed -i '/gpu_mem = 32/ c\gpu_mem = 256/' /boot/config.txt
  60.   sudo rm /home/pi/Public/gpu_mem_temporary.txt
  61. elif grep -Fxq "gpu_mem = 64 - value not found" /home/pi/Public/gpu_mem_temporary.txt ; then
  62.   echo 'Resetting GPU memory back to default.'
  63.   sudo sed -i '/gpu_mem = 32/ c\/' /boot/config.txt
  64.   sudo rm /home/pi/Public/gpu_mem_temporary.txt
  65. else
  66.   echo 'This script was not able to restore settings.'
  67.   echo 'Please reset settings manually by typing in the following:'
  68.   echo 'sudo nano /boot/config.txt'
  69.   echo
  70.   echo 'And type in the appropriate desired value.'
  71.   echo 'i.e. gpu_mem = 64'
  72.   sleep 30s
  73. fi
  74.  
  75. echo 'Installation completed, configuration required.'
  76. echo 'Reboot to occur in 30 seconds.'
  77. sleep 30s
  78.  
  79. sudo reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement