Advertisement
Guest User

Retroarch install fixed

a guest
Jul 26th, 2017
1,689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #check for root
  4. if [ "$(id -u)" -ne "0" ]; then
  5. echo "This script requires root."
  6. exit 1
  7. fi
  8.  
  9. #echo commands and arguments, and exit if any command returns non-zero status
  10. set -xe
  11.  
  12. #add repositories and update
  13. add-apt-repository ppa:libretro/testing -y
  14. apt-add-repository -y ppa:ayufan/pine64-ppa -y
  15. apt-get update -y
  16.  
  17. #Installs x for retroarch to run in
  18. apt-get install x-window-system xterm twm -y
  19.  
  20. #Necessary dependencies
  21. apt-get install libsdl1.2-dev libsdl1.2debian pkg-config build-essential -y
  22.  
  23. #Adds libretro and installs retroarch
  24. apt-get install retroarch* libretro* -y
  25.  
  26. #Adds aufan's ppa for armsoc and libmali
  27. apt-get install -y xserver-xorg-video-armsoc-sunxi libmali-sunxi-utgard0-r6p0
  28.  
  29. #enable autologin
  30. mkdir -pv /etc/systemd/system/getty@tty1.service.d/
  31. cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf <<EOF
  32. [Service]
  33. ExecStart=
  34. ExecStart=-/sbin/agetty --autologin pine64 --noclear %I 38400 linux
  35. EOF
  36. systemctl enable getty@tty1.service
  37.  
  38. #Autostart retroarch on login
  39. cat > /etc/profile.d/10-start-retroarch.sh <<EOF
  40. # autolaunch retroarch if not serial console login
  41. if [ -z "\$DISPLAY" ] && [ "\$(tty)" != "/dev/ttyS0" ]; then
  42. echo -e "\n\nRetroarch will start momentarily...\n\n"
  43. sleep 2
  44. startx retroarch
  45. fi
  46. EOF
  47. chmod +x /etc/profile.d/10-start-retroarch.sh
  48.  
  49. #change hostname (will also update motd banner)
  50. echo "retroarch" > /etc/hostname
  51.  
  52. #retropie header
  53. cat > /etc/update-motd.d/05-figlet <<EOF
  54. #!/bin/sh
  55. figlet \$(hostname)
  56. EOF
  57. chmod +x /etc/update-motd.d/05-figlet
  58.  
  59. #hide other MOTD banners
  60. chmod -x /etc/update-motd.d/00-header
  61. chmod -x /etc/update-motd.d/10-help-text
  62. chmod -x /etc/update-motd.d/11-pine-a64-help-text
  63.  
  64. #prevent any tty permission X.org errors
  65. usermod pine64 -aG tty
  66.  
  67. #backup stock default config and customise
  68. DEFAULT_CFG="/etc/retroarch.cfg"
  69. cp ${DEFAULT_CFG} /etc/retroarch.cfg.stock
  70. sed -i '/# video_fullscreen = false/c\video_fullscreen = true' ${DEFAULT_CFG}
  71.  
  72. #Installs and sets up SMB share for ROMs folder
  73. apt-get install samba samba-common-bin -y
  74. mkdir /home/pine64/ROMs
  75. chown nobody:nogroup -R /home/pine64/ROMs
  76.  
  77. echo "[ROMs]
  78. comment = ROMs Folder
  79. path = /home/pine64/ROMs
  80. writeable = yes
  81. browseable = yes
  82. guest ok = yes
  83. create mask = 0644
  84. directory mask = 2777
  85. " >> /etc/samba/smb.conf
  86.  
  87. /etc/init.d/samba restart
  88.  
  89. #Enables mali + drm
  90. exec /usr/local/sbin/pine64_enable_sunxidrm.sh
  91.  
  92. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement