Chroot-Install.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/bin/bash
  2. SDA1=/dev/sda1 # change as needed
  3. SDA=/dev/sda # change as needed
  4. MNT=/mnt # change as needed
  5. FSTAB=/etc/fstab
  6. PACMAN_MIRROR=/etc/pacman.d/mirrorlist
  7. HOSTNAME=/etc/hostname
  8. LOCAL_TIME=/etc/localtime
  9. LOCALE_GEN=/etc/locale.gen
  10. LOCALE_CONF=/etc/locale.conf
  11. MKINITCPIO_CONF=/etc/mkinitcpio.conf
  12. GRUB_CFG=/boot/grub/grub.cfg
  13. BASH=/bin/bash
  14. SUDOERS=/etc/sudoers
  15. CREATOR="CSCoder4ever"
  16. echo "Welcome to $CREATOR's installation script! part 2 of 2"
  17. echo "generating locale"
  18. locale-gen && locale > $LOCALE_CONF
  19. sleep 1 && echo "Creating Initial RAM disk"
  20. mkinitcpio -p linux
  21. sleep 1 && echo "set root password"
  22. passwd
  23. sleep 1 && echo "Configuring grub"
  24. grub-install --target=i386-pc --recheck --debug --force $SDA && grub-mkconfig -o /boot/grub/grub.cfg
  25. sleep 1 && read -p "Create user now? y/n: " userResponse
  26. if [ "$userResponse" = "y" ]; then
  27. read -p "Enter new username: " userName
  28. useradd -m -g users -G audio,video,optical,storage,disk,lp,sys,wheel,rfkill,log,systemd-journal -s $BASH $userName
  29. passwd $userName
  30. else
  31. echo "Skipping..."
  32. fi
  33. sleep 1 && read -p "Would you like to update the machine and install necessary programs? y/n: " SyuR
  34. if [ "$SyuR" = "y" ]; then
  35. pacman -Syyu
  36. sleep 1 && echo "Installing necessary programs" # Optimized for a laptop with Intel Graphics.
  37. pacman -S wpa_supplicant dialog git alsa-utils alsa-plugins xorg-server xorg-xinit xorg-server-utils\
  38. ttf-dejavu mesa arandr xf86-video-intel xf86-input-synaptics i3 sakura nitrogen dmenu networkmanager\
  39. xfce4-notifyd network-manager-applet gnome-icon-theme wicd wicd-gtk wireless_tools gnome-keyring\
  40. thunar thunar-volman gvfs gvfs-afc tilda conky firefox htop pavucontrol xfce4-power-manager audacious\
  41. vlc terminator leafpad pulseaudio screenfetch scrot gimp lxappearance viewnior thunderbird libreoffice\
  42. flashplugin volumeicon fakeroot jshon expac wget gparted clipit transmission-gtk file-roller p7zip zip\
  43. unrar arj unace lib32-glibc emacs mc openssh nfs-utils dzen2 remmina freerdp ntfs-3g gksu\
  44. lxde-icon-theme moc wavpack xfce4-screenshooter tmux timidity++ libstdc++5 linux-headers dosfstools\
  45. galculator figlet bc evince abs zsh wicd
  46. else
  47. echo "skipping..."
  48. fi
  49. # if packer's PKGBUILD file is found, it will install it.
  50. if [ -f PKGBUILD ]; then
  51. echo "Packer PKGBUILD found, installing.. "
  52. makepkg --asroot
  53. pacman -U packer-*.pkg.tar.*
  54. echo "updating packer"
  55. packer -Syyu
  56. fi
  57. # Below is to copy the most current i3 file on github to the local install.
  58. sleep 1 && echo "Copying dzen2 conky and i3-related files"
  59. git clone https://github.com/CSCoder4ever/cscoder-files.git # clone my personal repo
  60. cd cscoder-files
  61. mkdir /home/$userName/.i3 # make i3 directory
  62. cp i3-configs/config /home/$userName/.i3/config # copy i3 config && i3status.conf
  63. cp i3-configs/.i3status.conf /home/$userName/
  64. cp conky-configs/DzenConkyBar /home/$userName/.conkyrc # copy dzen2 conky to $HOME
  65. cp conky-configs/zconky /home/$userName/.programs/Various-Scripts/zconky.sh # copy dzen2 settings for conky
  66. ln -s /home/$userName/.programs/Various-Scripts/zconky.sh /usr/bin/zconky # make symlink for dzen2 conky
  67. cp post-install/post-install-laptop.sh /etc/post-install.sh # copy post-install config
  68. ln -s /etc/post-install.sh /usr/bin/post-install # make symlink for post-install
  69. cd ..
  70. rm -r cscoder-files # remove personal repo since it's no longer necessary
  71. #sleep 1 && echo "setting up dwm"
  72. # abs community/dwm
  73. # cp -r /var/abs/community/dwm /home/$userName/.dwm
  74. sleep 1 && echo "removing temporary files"
  75. rm /part2.sh
  76. # if either PKGBUILD and/or packer tar exist, remove them at will
  77. if [ -f PKGBUILD ]; then
  78. rm /PKGBUILD
  79. fi
  80. if [ -f packer-*.pkg.tar.* ]; then
  81. rm /packer-*.pkg.tar.*
  82. fi
  83. sleep 1 && echo "Installation complete!"
  84. echo
  85. echo "enter \'post-install\' in the terminal as root when you reboot. "
  86. exit