install.sh 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/sh
  2. # author : bachir soussi chiadmi
  3. # date : 10/06/2016
  4. _cwd="$(pwd)"
  5. # candy
  6. echo 'ILoveCandy (pacman)'
  7. sudo sed -i.back 's/.*\[options\].*/&\nILoveCandy/' /etc/pacman.conf
  8. sudo sed -i.back 's/^#Color$/Color/' /etc/pacman.conf
  9. sudo sed -i.back 's/^#TotalDownload$/TotalDownload/' /etc/pacman.conf
  10. sudo pacman -Syyu
  11. sudo pacman -S --needed --noconfirm vim rsync wget tmux
  12. # vim
  13. echo 'vim configuration'
  14. sudo pacman -S --needed --noconfirm vim-{spell-fr,spell-en,nerdtree,supertab,systemd}
  15. cp -r $_cwp/assets/vim /home/$USER/.vim
  16. cp $_cwd/assets/vimrc /home/$USER/.vimrc
  17. sudo cp $_cwd/assets/vim /root/.vim
  18. sudo cp $_cwd/assets/vimrc /root/.vimrc
  19. # git
  20. echo 'Git Completion'
  21. sudo pacman -S --needed --noconfirm bash-completion
  22. sudo mkdir /etc/bash_completion.d
  23. sudo wget -O /etc/bash_completion.d/git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
  24. # yaourt
  25. # only needed for gps with pynmea2 on python
  26. sudo pacman -S --needed --noconfirm base-devel
  27. mkdir -p /home/$USER/build-repos
  28. wget -O /home/$USER/build-repos/package-query.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz
  29. wget -O /home/$USER/build-repos/yaourt.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz
  30. cd /home/$USER/build-repos
  31. tar -xvf package-query.tar.gz
  32. tar -xvf yaourt.tar.gz
  33. cd package-query
  34. makepkg -sri
  35. cd ../yaourt
  36. makepkg -sri
  37. echo "EDITFILES=1" >> ~/.yaourtrc
  38. echo "Yaourt install complete!"
  39. # bash & prompt
  40. echo 'Bash and Prompt (liquidprompt)'
  41. git clone https://github.com/nojhan/liquidprompt.git -o github /home/$USER/.liquidprompt
  42. cp $_cwd/assets/bash_profile /home/$USER/.bash_profile
  43. cp $_cwd/assets/bashrc /home/$USER/.bashrc
  44. mkdir /home/$USER/.config
  45. cp $_cwd/assets/config/liquidpromptrc /home/$USER/.config/
  46. # sudo pacman -S --needed --noconfirm bash-completion
  47. source /home/$USER/.bashrc
  48. # cp: cannot stat '/home/alarm/hehe-rover/rpi/assets/config/liquipromptrc': No such file or directory
  49. # /home/alarm/.bashrc: line 14: ruby: command not found
  50. # /home/alarm/.bashrc: line 23: bind: warning: line editing not enabled
  51. # /home/alarm/.bashrc: line 24: bind: warning: line editing not enabled
  52. # hostname
  53. sudo hostnamectl set-hostname hehe-rail-rover
  54. sudo sed -i 's/^127\.0\.0\.1\blocalhost\.localdomain\blocalhost/&\thehe-rail-rover/' /etc/hosts
  55. sudo sed -i 's/^::1\blocalhost\.localdomain\blocalhost/&\thehe-rail-rover/' /etc/hosts
  56. # avahi
  57. echo "install avahi"
  58. sudo pacman -S --needed --noconfirm avahi nss-mdns
  59. echo "configure avahi"
  60. sudo systemctl enable avahi-daemon
  61. sudo systemctl start avahi-deamon
  62. sudo sed -i.back 's/hosts: files dns myhostname/hosts: files mdns_minimal [NOTFOUND=return] dns myhostname/' /etc/nsswitch.conf
  63. # Camera
  64. echo "Camera Module"
  65. sudo sed -i.back 's/gpu_mem=.*$/gpu_mem=128\nstart_file=start_x.elf\nfixup_file=fixup_x.dat/' /boot/config.txt
  66. # gps cli
  67. sudo sed -i 's/console=ttyAMA0,115200//' /boot/cmdline.txt
  68. sudo sed -i 's/kgdboc=ttyAMA0,115200//' /boot/cmdline.txt
  69. sudo systemctl disable serial-getty@ttyAMA0.service
  70. sudo pacman -S --needed --noconfirm minicom gpsd
  71. #sudo systemctl stop gpsd.socket
  72. #sudo systemctl disable gpsd.socket
  73. sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock
  74. # gps python