Advertisement
Emulatorman

Ultimate Parabola Install

Jan 5th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.77 KB | None | 0 0
  1. #!/bin/bash
  2. #-------------------------------------------------------------------------------
  3. #Created by helmuthdu mailto: helmuthdu[at]gmail[dot]com
  4. #Inspired by Andreas Freitag, aka nexxx script
  5. #Modified and adapted for the Freedom and for Parabola distro by André Silva (Emulatorman) mailto: andre.paulista[at]adinet[dot]com[dot]uy
  6. #-------------------------------------------------------------------------------
  7. #This program is free software: you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation, either version 3 of the License, or
  10. #(at your option) any later version.
  11. #
  12. #This program is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. #GNU General Public License for more details.
  16. #
  17. #You should have received a copy of the GNU General Public License
  18. #along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #-------------------------------------------------------------------------------
  20. # Run this script after your first boot with parabola (as root)
  21.  
  22. GNOME=0
  23. ARCHI=`uname -m`
  24.  
  25. # Automatically detects the system language based on your rc.conf
  26. LOCATION=`cat /etc/rc.conf | sed -n '/LOCALE=/p' | sed '1!d' | cut -c9-13`
  27. LOCATION_KDE=`echo $LOCATION | tr '[:upper:]' '[:lower:]'`
  28. LOCATION_GNOME=`echo $LOCATION | tr '[:upper:]' '[:lower:]' | sed 's/_/-/'`
  29. LOCATION_LO=`echo $LOCATION | sed 's/_/-/'`
  30.  
  31. function question_for_answer(){ #{{{
  32. read -p "$1 [y][n]: " OPTION
  33. echo ""
  34. } #}}}
  35. function install_status(){ #{{{
  36. if [ $? -ne 0 ] ; then
  37. CURRENT_STATUS=-1
  38. else
  39. CURRENT_STATUS=1
  40. fi
  41. } #}}}
  42. function print_line(){ #{{{
  43. echo "--------------------------------------------------------------------------------"
  44. } #}}}
  45. function print_title (){ #{{{
  46. clear
  47. echo "#-------------------------------------------------------------------------------"
  48. echo -e "# $1"
  49. echo "#-------------------------------------------------------------------------------"
  50. echo ""
  51. } #}}}
  52. function add_new_daemon(){ #{{{
  53. remove_daemon "$1"
  54. sed -i '/DAEMONS[=]/s/\(.*\)\>/& '"$1"'/' /etc/rc.conf
  55. } #}}}
  56. function remove_daemon(){ #{{{
  57. sed -i '/DAEMONS[=]/s/'"$1"' //' /etc/rc.conf
  58. } #}}}
  59. function add_new_module(){ #{{{
  60. remove_module "$1"
  61. sed -i '/MODULES[=]/s/\(.*\)\>/& '"$1"'/' /etc/rc.conf
  62. #sed -i '/MODULES[=]/s/^[^ ]*\>/& '"$1"'/' /etc/rc.conf
  63. } #}}}
  64. function remove_module(){ #{{{
  65. sed -i '/MODULES[=]/s/'"$1"' //' /etc/rc.conf
  66. } #}}}
  67. function finish_function(){ #{{{
  68. print_line
  69. echo "Continue with RETURN"
  70. read
  71. clear
  72. } #}}}
  73. function sumary(){ #{{{
  74. case $CURRENT_STATUS in
  75. 0)
  76. print_line
  77. echo "$1 not successfull (Canceled)"
  78. ;;
  79. -1)
  80. print_line
  81. echo "$1 not successfull (Error)"
  82. ;;
  83. 1)
  84. print_line
  85. echo "$1 successfull"
  86. ;;
  87. *)
  88. print_line
  89. echo "WRONG ARG GIVEN"
  90. ;;
  91. esac
  92. } #}}}
  93. #begin #{{{
  94. clear
  95. echo "Welcome to the Ultimate Parabola install script by helmuthdu"
  96. echo "Inspired by freitag parabola helper script install"
  97. echo "Modified and adapted for the Freedom and for Parabola distro by emulatorman"
  98. print_line
  99. echo "Requirements:"
  100. echo "-> Parabola installation"
  101. echo "-> Run script as root user"
  102. echo "-> Working internet connection"
  103. print_line
  104. echo "Script can be canceled all the time with CTRL+C"
  105. print_line
  106. echo "OPEN THIS SCRIPTS AND READ ALL OPTIONS BEFORE USE IT"
  107. echo "Not recommended use this script more then 1 time (create duplicate values)"
  108. echo "This version is still in BETA. Send bugreports to: "
  109. echo "helmuthdu at gmail dot com"
  110. finish_function
  111. #}}}
  112. #system update #{{{
  113. print_title "UPDATING YOUR SYSTEM"
  114. pacman -Syu
  115. read -p "Reboot your system [y][n]: " OPTION
  116. if [ $OPTION = "y" ]; then
  117. reboot
  118. exit 0
  119. fi
  120. #}}}
  121. #create a new user #{{{
  122. print_title "CREATE USER ACCOUNT"
  123. read -p "New user name: " USERNAME
  124. useradd -m -g users -G users,audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash $USERNAME
  125. passwd $USERNAME
  126. #set user as sudo #{{{
  127. pacman -S --noconfirm sudo
  128. ## Uncomment to allow members of group wheel to execute any command
  129. sed -i '/%wheel ALL=(ALL) ALL/s/^#//' /etc/sudoers
  130. ## Same thing without a password (not secure)
  131. #sed -i '/%wheel ALL=(ALL) NOPASSWD: ALL/s/^#//' /etc/sudoers
  132. #}}}
  133. #base system #{{{
  134. print_title "BASH TOOLS - https://wiki.parabolagnulinux.org/index.php/Bash"
  135. pacman -S --noconfirm curl bc rsync mlocate bash-completion vim
  136. print_title "(UN)COMPRESS TOOLS - https://wiki.parabolagnulinux.org/index.php/P7zip-libre"
  137. pacman -S --noconfirm tar gzip bzip2 unzip unrar p7zip-libre
  138. print_title "DBUS - https://wiki.parabolagnulinux.org/index.php/D-Bus"
  139. pacman -S --noconfirm dbus
  140. add_new_daemon "dbus"
  141. print_title "ACPI - https://wiki.parabolagnulinux.org/index.php/ACPI_modules"
  142. pacman -S --noconfirm acpi acpid
  143. add_new_daemon "acpid"
  144. finish_function
  145. #}}}
  146. print_title "CUPS - https://wiki.parabolagnulinux.org/index.php/Cups"
  147. pacman -S --noconfirm cups-libre ghostscript-libre gsfonts
  148. pacman -S --noconfirm gutenprint foomatic-db foomatic-db-engine foomatic-filters-libre hplip-libre splix cups-pdf
  149. add_new_daemon "@cupsd"
  150. print_title "NTFS/FAT - https://wiki.parabolagnulinux.org/index.php/Ntfs"
  151. pacman -S --noconfirm ntfs-3g ntfsprogs dosfstools
  152. print_title "SSH - https://wiki.parabolagnulinux.org/index.php/Ssh"
  153. pacman -S --noconfirm rssh openssh
  154. add_new_daemon "@sshd"
  155. #configure ssh/samba #{{{
  156. echo -e "sshd: ALL\n# End of file" > /etc/hosts.allow
  157. echo -e "ALL: ALL: DENY\n# End of file" > /etc/hosts.deny
  158. #ssh_conf #{{{
  159. sed -i '/ListenAddress/s/^#//' /etc/ssh/sshd_config
  160. sed -i '/SyslogFacility/s/^#//' /etc/ssh/sshd_config
  161. sed -i '/LogLevel/s/^#//' /etc/ssh/sshd_config
  162. sed -i '/LoginGraceTime/s/^#//' /etc/ssh/sshd_config
  163. sed -i '/PermitRootLogin/s/^#//' /etc/ssh/sshd_config
  164. sed -i '/StrictModes/s/^#//' /etc/ssh/sshd_config
  165. sed -i '/RSAAuthentication/s/^#//' /etc/ssh/sshd_config
  166. sed -i '/PubkeyAuthentication/s/^#//' /etc/ssh/sshd_config
  167. sed -i '/IgnoreRhosts/s/^#//' /etc/ssh/sshd_config
  168. sed -i '/PermitEmptyPasswords/s/^#//' /etc/ssh/sshd_config
  169. sed -i '/X11Forwarding/s/^#//' /etc/ssh/sshd_config
  170. sed -i '/X11Forwarding/s/no/yes/' /etc/ssh/sshd_config
  171. sed -i '/X11DisplayOffset/s/^#//' /etc/ssh/sshd_config
  172. sed -i '/X11UseLocalhost/s/^#//' /etc/ssh/sshd_config
  173. sed -i '/PrintMotd/s/^#//' /etc/ssh/sshd_config
  174. sed -i '/PrintMotd/s/yes/no/' /etc/ssh/sshd_config
  175. sed -i '/PrintLastLog/s/^#//' /etc/ssh/sshd_config
  176. sed -i '/TCPKeepAlive/s/^#//' /etc/ssh/sshd_config
  177. sed -i '/the setting of/s/^/#/' /etc/ssh/sshd_config
  178. sed -i '/RhostsRSAAuthentication and HostbasedAuthentication/s/^/#/' /etc/ssh/sshd_config
  179. sed -i 's/ListenAddress ::/s/^/#/' /etc/ssh/sshd_config
  180. #}}}
  181. #}}}
  182. print_title "SAMBA - https://wiki.parabolagnulinux.org/index.php/Samba"
  183. pacman -S --noconfirm samba
  184. cp /etc/samba/smb.conf.default /etc/samba/smb.conf
  185. add_new_daemon "@samba"
  186. print_title "ALSA - https://wiki.parabolagnulinux.org/index.php/Alsa"
  187. pacman -S --noconfirm alsa-utils alsa-plugins
  188. sed -i '/MODULES[=]/s/snd-usb-audio//' /etc/rc.conf
  189. sed -i '/MODULES[=]/s/MODULES[=](/&snd-usb-audio/' /etc/rc.conf
  190. add_new_daemon "@alsa"
  191. #}}}
  192. #X #{{{
  193. print_title "XORG - https://wiki.parabolagnulinux.org/index.php/Xorg"
  194. echo "Installing X-Server (req. for Desktopenvironment, GPU Drivers, Keyboardlayout,...)"
  195. pacman -S --noconfirm xorg-server xorg-xinit xorg-utils xorg-server-utils xorg-xkill xorg-xauth
  196. pacman -S --noconfirm xf86-input-evdev xf86-input-synaptics
  197. pacman -S --noconfirm mesa mesa-demos-libre
  198. pacman -S --noconfirm xorg-twm xorg-xclock xterm
  199. pacman -S --noconfirm udisks gamin
  200. #}}}
  201. #graphic cards #{{{
  202. print_title "GRAPHIC CARD"
  203. echo "Select your GPU:"
  204. echo "[1] Intel"
  205. echo "[2] ATI"
  206. echo "[3] Nouveau"
  207. echo "[4] Virtualbox"
  208. echo ""
  209. echo "[q] QUIT"
  210. echo ""
  211. read -p "Option: " OPTION
  212. case "$OPTION" in
  213. 1)
  214. pacman -S --noconfirm libgl xf86-video-intel
  215. install_status
  216. sumary "Intel GPU driver installation"
  217. ;;
  218. 2)
  219. pacman -S --noconfirm libgl xf86-video-ati ati-dri
  220. install_status
  221. sumary "ATI GPU driver installation"
  222. ;;
  223. 3)
  224. pacman -S --noconfirm libgl xf86-video-nouveau nouveau-dri
  225. modprobe nouveau
  226. add_new_module "nouveau"
  227. install_status
  228. sumary "Nouveau GPU driver installation"
  229. ;;
  230. 4)
  231. pacman -S --noconfirm virtualbox-parabola-additions virtualbox-source
  232. vboxbuild
  233. modprobe -a vboxguest vboxsf vboxvideo
  234. add_new_module "vboxguest vboxsf vboxvideo"
  235. groupadd vboxsf
  236. gpasswd -a $USERNAME vboxsf
  237. install_status
  238. sumary "Virtualbox guest additions (incl. video drivers) installation"
  239. ;;
  240. *)
  241. CURRENT_STATUS=0
  242. sumary "GPU drivers installation"
  243. ;;
  244. esac
  245. finish_function
  246. #}}}
  247. #desktop environment #{{{
  248. print_title "DESKTOP ENVIRONMENT - https://wiki.parabolagnulinux.org/index.php/Desktop_Environment"
  249. echo "Choose your desktop-environment:"
  250. echo "[1] GNOME"
  251. echo "[2] KDE"
  252. echo "[3] XFCE"
  253. read -p "Option: " OPTION
  254. case "$OPTION" in
  255. 1)
  256. #GNOME #{{{
  257. print_title "GNOME - https://wiki.parabolagnulinux.org/index.php/GNOME"
  258. pacman -S --noconfirm gnome gnome-extra
  259. pacman -S --noconfirm gedit-plugins pulseaudio-gnome gnome-tweak-tool telepathy deja-dup
  260. pacman -S --noconfirm system-config-printer-gnome
  261. pacman -S --noconfirm sushi
  262. pacman -S --noconfirm gksu gvfs-smb xdg-user-dirs
  263. LOOP=1
  264. while [ "$LOOP" -ne 0 ]
  265. do
  266. print_title "FAVORITE GNOME APPS"
  267. echo "[1] Openshot"
  268. echo "[2] Shotwell"
  269. echo "[3] Guake"
  270. echo "[4] X-Chat"
  271. echo "[5] Packagekit"
  272. echo ""
  273. echo "[a] ALL"
  274. echo "[q] QUIT"
  275. echo ""
  276. read -p "Option: " OPTION
  277. case "$OPTION" in
  278. 1)
  279. pacman -S --noconfirm openshot
  280. ;;
  281. 2)
  282. pacman -S --noconfirm shotwell
  283. ;;
  284. 3)
  285. pacman -S --noconfirm guake
  286. ;;
  287. 4)
  288. pacman -S --noconfirm xchat
  289. ;;
  290. 13)
  291. pacman -S --noconfirm gnome-packagekit gnome-settings-daemon-updates
  292. ;;
  293. "a")
  294. pacman -S --noconfirm openshot
  295. pacman -S --noconfirm shotwell
  296. pacman -S --noconfirm guake
  297. pacman -S --noconfirm xchat
  298. pacman -S --noconfirm gnome-packagekit gnome-settings-daemon-updates
  299. LOOP=0
  300. ;;
  301. *)
  302. LOOP=0
  303. ;;
  304. esac
  305. finish_function
  306. done
  307. GNOME=1
  308. add_new_daemon "gdm"
  309. sumary "GNOME installation"
  310. finish_function
  311. #}}}
  312. ;;
  313. 2)
  314. #KDE #{{{
  315. print_title "KDE - https://wiki.parabolagnulinux.org/index.php/KDE"
  316. pacman -S --noconfirm kde kde-l10n-$LOCATION_KDE
  317. pacman -S --noconfirm kdeadmin-system-config-printer-kde xdg-user-dirs
  318. LOOP=1
  319. while [ "$LOOP" -ne 0 ]
  320. do
  321. print_title "FAVORITE KDE APPS"
  322. echo "[4] Choqok"
  323. echo "[5] K3b"
  324. echo "[10] Digikam"
  325. echo "[11] Yakuake"
  326. echo ""
  327. echo "[a] ALL"
  328. echo "[q] QUIT"
  329. echo ""
  330. read -p "Option: " OPTION
  331. case "$OPTION" in
  332. 4)
  333. pacman -S --noconfirm choqok
  334. ;;
  335. 5)
  336. pacman -S --noconfirm k3b dvd+rw-tools
  337. ;;
  338. 10)
  339. pacman -S --noconfirm digikam kipi-plugins
  340. ;;
  341. 11)
  342. pacman -S --noconfirm yakuake
  343. ;;
  344. "a")
  345. pacman -S --noconfirm choqok
  346. pacman -S --noconfirm k3b dvd+rw-tools
  347. pacman -S --noconfirm digikam kipi-plugins
  348. pacman -S --noconfirm yakuake
  349. su -l $USERNAME --command="yaourt -S --noconfirm yakuake-skin-plasma-oxygen-panel"
  350. LOOP=0
  351. ;;
  352. *)
  353. LOOP=0
  354. ;;
  355. esac
  356. finish_function
  357. done
  358. GNOME=0
  359. add_new_daemon "kdm"
  360. sumary "KDE installation"
  361. finish_function
  362. #}}}
  363. ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement