install/install.sh

211 lines
7.0 KiB
Bash
Raw Normal View History

#!/bin/bash
# Void Linux post-install script
echo "$(tput setaf 3)Starting Void Linux post-install script$(tput sgr 0)"
# Ask part
echo "$(tput setaf 1)Which CPU do you use?$(tput sgr 0)"
read -p "AMD (a) or INTEL (i) [a/i] " -n 1 cpu
echo
echo "$(tput setaf 1)Which GPU do you use?$(tput sgr 0)"
read -p "NVIDIA (n), AMD (a), INTEL (i) or QEMU (q) [n/a/i/q] " -n 1 video
echo
echo "$(tput setaf 1)Do you want to install PCI passthrough?$(tput sgr 0)"
read -p "NO (n) or YES (y) [n/y] " -n 1 pass
echo
echo "$(tput setaf 1)Which window manager do you want to use?$(tput sgr 0)"
read -p "OPENBOX (o) or AWESOME (a) or SOMETHING ELSE (s) [o/a/s] " -n 1 vm
echo
echo "$(tput setaf 1)Do you want to install printer support?$(tput sgr 0)"
read -p "NO (n) or YES (y) [n/y] " -n 1 cups
echo
echo "$(tput setaf 1)Do you want to share package statistics with void devs?$(tput sgr 0)"
read -p "NO (n) or YES (y) [n/y] " -n 1 pop
echo
echo "$(tput setaf 1)Unncomment desired language(s) $(tput sgr 0)"
sleep 3
sudo micro /etc/default/libc-locales
2020-08-28 03:25:21 +02:00
# Prerequisities-----------------------------------------------------------------------------------------
# Freshly installed base system
# Script will inastall rest..
# git
# And clone this repository
2020-08-28 03:25:21 +02:00
sudo xbps-install -Sy git
mkdir ~/bin
git clone https://gitlab.com/awesome-void/install ~/bin/install
cd ~/bin/install
# Install packages-----------------------------------------------------------------------------------------
2020-08-28 03:25:21 +02:00
# Nonfree and multilib repos
sudo xbps-install -y $(cat INSTALL/1_repos)
2020-08-23 20:50:47 +02:00
sudo xbps-install -Sy $(cat INSTALL/2_base)
2020-08-23 20:41:58 +02:00
2020-08-28 03:25:21 +02:00
# Remember git login information?
#git config --global credential.helper store
# Clone also personal dotfiles from gitlab?
2020-08-27 06:27:28 +02:00
#git clone https://gitlab.com/awesome-void/awesomeVoid ~/bin/dotfiles
2020-08-28 03:25:21 +02:00
# Choose cpu-----------------------------------------------------------------------------------------
if [[ $cpu = "a" ]]; then
echo amd
if [[ $video = "n" ]]; then
echo amd nvidia
sudo xbps-install -y $(cat INSTALL/3_nvidia)
sudo nvidia-xconfig
if [[ $pass = "y" ]]; then
echo amd nvidia yes
modprobe kvm-amd
sudo cp -r OVMF /usr/share/ovmf
chmod +x INSTALL/pass.sh
sudo ./INSTALL/pass.sh
fi
elif [[ $video = "a" ]]; then
echo amd amd
if [[ $pass = "y" ]]; then
echo amd amd yes
modprobe kvm-amd
sudo cp -r OVMF /usr/share/ovmf
chmod +x INSTALL/pass.sh
sudo ./INSTALL/pass.sh
fi
elif [[ $video = "i" ]]; then
echo amd intel
if [[ $pass = "y" ]]; then
echo amd intel yes
modprobe kvm-amd
sudo cp -r OVMF /usr/share/ovmf
chmod +x INSTALL/pass.sh
sudo ./INSTALL/pass.sh
fi
elif [[ $video = "q" ]]; then
echo amd qemu
sudo xbps-install -y $(cat INSTALL/3_qemu)
fi
elif [[ $cpu = "i" ]]; then
echo intel
if [[ $video = "n" ]]; then
echo intel nvidia
sudo xbps-install -y $(cat INSTALL/3_nvidia)
sudo nvidia-xconfig
if [[ $pass = "y" ]]; then
echo intel nvidia yes
modprobe kvm-intel
sudo cp -r OVMF /usr/share/ovmf
chmod +x INSTALL/pass.sh
sudo ./INSTALL/pass.sh
fi
elif [[ $video = "a" ]]; then
echo intel amd
if [[ $pass = "y" ]]; then
echo intel amd yes
modprobe kvm-intel
sudo cp -r OVMF /usr/share/ovmf
chmod +x INSTALL/pass.sh
sudo ./INSTALL/pass.sh
fi
elif [[ $video = "i" ]]; then
echo intel intel
if [[ $pass = "y" ]]; then
echo intel intel yes
modprobe kvm-intel
sudo cp -r OVMF /usr/share/ovmf
chmod +x INSTALL/pass.sh
sudo ./INSTALL/pass.sh
fi
elif [[ $video = "q" ]]; then
echo intel qemu
# sudo xbps-install -y $(cat INSTALL/3_qemu)
fi
fi
# Choose gpu-----------------------------------------------------------------------------------------
# if [[ $video = "n" ]]; then
2020-08-28 04:02:20 +02:00
# sudo xbps-install -y $(cat INSTALL/3_nvidia)
# sudo nvidia-xconfig
# if [[ $pass = "y" ]]; then
# modprobe kvm-amd
# sudo cp -r /OVMF /usr/share/ovmf
# chmod +x /INSTALL/pass.sh
# sudo ./INSTALL/pass.sh
# fi
# elif [[ $video = "a" ]]; then
# sudo xbps-install -y $(cat INSTALL/3_ati)
# modprobe kvm-amd
# elif [[ $video = "i" ]]; then
# sudo xbps-install -y $(cat INSTALL/3_intel)
2020-08-28 04:02:20 +02:00
#
# elif [[ $video = "q" ]]; then
# sudo xbps-install -y $(cat INSTALL/3_qemu)
#fi
# Choose window manager-----------------------------------------------------------------------------------------
2020-08-23 10:12:04 +02:00
if [[ $vm = "o" ]]; then
2020-08-28 03:25:21 +02:00
sudo xbps-install -y $(cat INSTALL/4_desktop)
sudo xbps-install -y $(cat INSTALL/5_openbox)
2020-08-23 20:50:47 +02:00
sudo -u $USER obmenu-generator -p -i -u -d -c
echo "autorandr common &
tint2 &
setxkbmap cz &
nitrogen --restore &
volumeicon &
conky &" >> ~/.config/openbox/autostart
2020-08-23 23:12:09 +02:00
# cp ~/bin/dotfiles/home/zen/.config/openbox/rc.xml ~/.config/openbox
2020-08-23 10:12:04 +02:00
elif [[ $vm = "a" ]]; then
echo awesome
2020-08-28 03:25:21 +02:00
sudo xbps-install -y $(cat INSTALL/4_desktop)
sudo xbps-install -y $(cat INSTALL/5_awesome)
fi
2020-08-23 11:42:14 +02:00
sudo xbps-install -Sy $(cat INSTALL/6_media)
2020-08-23 09:41:59 +02:00
#sudo xbps-install -Sy $(cat INSTALL/7_virtual)
#sudo xbps-install -Sy $(cat INSTALL/8_big)
#sudo xbps-install -Sy $(cat INSTALL/)
# printer support-----------------------------------------------------------------------------------------
if [[ $cups = "y" ]]; then
2020-08-28 03:25:21 +02:00
sudo xbps-install -y $(cat INSTALL/9_print)
sudo ln -s /etc/sv/cupsd /var/service
fi
# make fish base shell-----------------------------------------------------------------------------------------
2020-08-28 03:25:21 +02:00
sudo usermod --shell /bin/fish $USER
2020-08-25 21:50:56 +02:00
#echo ". ~/.config/fish/aliases.fish" >> ~/.config/fish/config.fish
#echo "alias xterm 'sakura'" >> ~/.config/fish/aliases.fish
2020-08-23 20:45:13 +02:00
# socklog-----------------------------------------------------------------------------------------
2020-08-23 20:45:13 +02:00
sudo usermod -a -G socklog $USER
# čeština-----------------------------------------------------------------------------------------
2020-08-23 06:29:31 +02:00
sudo xbps-reconfigure -f glibc-locales
# creating bare repository-----------------------------------------------------------------------------------------
2020-08-23 11:52:45 +02:00
mkdir ~/.void
cd ~/.void
2020-08-15 09:36:25 +02:00
git init --bare
2020-08-27 01:53:29 +02:00
# Share packages with void devs-----------------------------------------------------------------------------------------
if [[ $pop = "y" ]]; then
2020-08-28 04:44:51 +02:00
sudo xbps-install -y PopCorn
sudo ln -s /etc/sv/popcorn /var/service/
2020-08-27 01:53:29 +02:00
fi
# Install services-----------------------------------------------------------------------------------------
sudo ln -s /etc/sv/dbus /var/service/
sudo ln -s /etc/sv/elogind /var/service/
#sudo ln -s /etc/sv/acpid /var/service/
sudo ln -s /etc/sv/socklog-unix /var/service/
sudo ln -s /etc/sv/nanoklogd /var/service/
sudo ln -s /etc/sv/crond /var/service/
sudo ln -s /etc/sv/chronyd /var/service/
2020-08-28 03:25:21 +02:00
echo "$(tput setaf 1) Do you want to run lightdm now?$(tput sgr 0)"
2020-08-27 01:46:37 +02:00
read -p "Run lightdm now? YES (y) or NO (n)? [y/n] " -n 1 lightdm
2020-08-23 11:51:15 +02:00
echo
2020-08-27 01:46:37 +02:00
if [[ $lightdm = "y" ]]; then
sudo ln -s /etc/sv/lightdm /var/service/
2020-08-27 00:11:39 +02:00
echo "$(tput setaf 1) Enjoy void linux$(tput sgr 0)"
2020-08-23 11:51:15 +02:00
fi
#sudo restart