diff --git a/0-preinstall.sh b/0-preinstall.sh index d8dea46..adfb68a 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -79,6 +79,7 @@ mountallsubvol () { mount -o ${mountoptions},subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots mount -o ${mountoptions},subvol=@var /dev/mapper/ROOT /mnt/var } + if [[ "${DISK}" =~ "nvme" ]]; then if [[ "${FS}" == "btrfs" ]]; then mkfs.vfat -F32 -n "EFIBOOT" ${DISK}p2 @@ -92,19 +93,25 @@ if [[ "${DISK}" =~ "nvme" ]]; then mkfs.vfat -F32 -n "EFIBOOT" ${DISK}p2 # enter luks password to cryptsetup and format root partition echo -n "${luks_password}" | cryptsetup -v luksFormat ${DISK}p3 - + # open luks container and ROOT will be place holder - echo -n "${luks_password}" | cryptsetup open ${DISK}p3 ROOT - + echo -n "${luks_password}" | cryptsetup open ${partition3} ROOT - # now format that container - mkfs.btrfs -L ROOT /dev/mapper/ROOT + mkfs.btrfs -L ROOT /dev/mapper/ROOT # create subvolumes for btrfs - mount -t btrfs /dev/mapper/ROOT /mnt - createsubvolumes - umount /mnt + mount -t btrfs /dev/mapper/ROOT /mnt + createsubvolumes + umount /mnt # mount @ subvolume + mount -o ${mountoptions},subvol=@ /dev/mapper/ROOT /mnt + # make directories home, .snapshots, var, tmp - mkdir -p /mnt/{home,var,tmp,.snapshots} -# mount subvolumes + mkdir -p /mnt/{home,var,tmp,.snapshots} + +# store uuid of encrypted partition for grub + echo encryped_partition_uuid=$(blkid -s UUID -o value ${partition3}) >> setup.conf + mountallsubvol fi else @@ -131,7 +138,9 @@ else # mount subvolumes mountallsubvol fi + fi + # checking if user selected btrfs if [[ ${FS} =~ "btrfs" ]]; then ls /mnt | xargs btrfs subvolume delete diff --git a/1-setup.sh b/1-setup.sh index c3c89fb..21c8454 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -9,9 +9,10 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer + SCRIPTHOME: $SCRIPTHOME ------------------------------------------------------------------------- " -source setup.conf +source /root/$SCRIPTHOME/setup.conf echo -ne " ------------------------------------------------------------------------- Network Setup @@ -69,39 +70,44 @@ echo -ne " Installing Base System ------------------------------------------------------------------------- " -sudo pacman -S --noconfirm --needed - < /pkg-files/pacman-pkgs.txt +cat /root/$SCRIPTHOME/pkg-files/pacman-pkgs.txt | while read line +do + echo "INSTALLING: ${line}" + sudo pacman -S --noconfirm --needed ${line} +done echo -ne " ------------------------------------------------------------------------- Installing Microcode ------------------------------------------------------------------------- " # determine processor type and install microcode -proc_type=$(lscpu | awk '/Vendor ID:/ {print $3}') -case "$proc_type" in - GenuineIntel) - print "Installing Intel microcode" - pacman -S --noconfirm intel-ucode - proc_ucode=intel-ucode.img - ;; - AuthenticAMD) - print "Installing AMD microcode" - pacman -S --noconfirm amd-ucode - proc_ucode=amd-ucode.img - ;; -esac +proc_type=$(lscpu) +if grep -E "GenuineIntel" <<< ${proc_type}; then + echo "Installing Intel microcode" + pacman -S --noconfirm intel-ucode + proc_ucode=intel-ucode.img +elif grep -E "AuthenticAMD" <<< ${proc_type}; then + echo "Installing AMD microcode" + pacman -S --noconfirm amd-ucode + proc_ucode=amd-ucode.img +fi + echo -ne " ------------------------------------------------------------------------- Installing Graphics Drivers ------------------------------------------------------------------------- " # Graphics Drivers find and install -if lspci | grep -E "NVIDIA|GeForce"; then +gpu_type=$(lspci) +if grep -E "NVIDIA|GeForce" <<< ${gpu_type}; then pacman -S nvidia --noconfirm --needed nvidia-xconfig -elif lspci | grep -E "Radeon"; then +elif grep -E "Radeon" <<< ${gpu_type}; then pacman -S xf86-video-amdgpu --noconfirm --needed -elif lspci | grep -E "Integrated Graphics Controller"; then - pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils --needed --noconfirm +elif grep -E "Integrated Graphics Controller" <<< ${gpu_type}; then + pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa --needed --noconfirm +elif grep -E "Intel Corporation UHD" <<< ${gpu_type}; then + pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa --needed --noconfirm fi if ! source install.conf; then @@ -151,7 +157,9 @@ echo -ne " ------------------------------------------------------------------------- " if [ $(whoami) = "root" ]; then + groupadd libvirt useradd -m -G wheel,libvirt -s /bin/bash $USERNAME + # use chpasswd to enter $username:$password echo "$USERNAME:$PASSWORD" | chpasswd cp -R /root/$SCRIPTHOME /home/$USERNAME/ diff --git a/2-user.sh b/2-user.sh index f583586..2c93677 100755 --- a/2-user.sh +++ b/2-user.sh @@ -9,28 +9,30 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer + SCRIPTHOME: $SCRIPTHOME ------------------------------------------------------------------------- Installing AUR Softwares " # You can solve users running this script as root with this and then doing the same for the next for statement. However I will leave this up to you. +source ~/$SCRIPTHOME/setup.conf cd ~ git clone "https://aur.archlinux.org/yay.git" -cd ${HOME}/yay +cd ~/yay makepkg -si --noconfirm cd ~ -touch "$HOME/.cache/zshhistory" +touch "~/.cache/zshhistory" git clone "https://github.com/ChrisTitusTech/zsh" -git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $HOME/powerlevel10k -ln -s "$HOME/zsh/.zshrc" $HOME/.zshrc +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k +ln -s "~/zsh/.zshrc" ~/.zshrc -yay -S --noconfirm --needed - < /pkg-files/aur-pkgs.txt +yay -S --noconfirm --needed - < ~/$SCRIPTHOME/pkg-files/aur-pkgs.txt export PATH=$PATH:~/.local/bin -cp -r $HOME/$SCRIPTHOME/dotfiles/* $HOME/.config/ +cp -r ~/$SCRIPTHOME/dotfiles/* ~/.config/ pip install konsave -konsave -i $HOME/$SCRIPTHOME/kde.knsv +konsave -i ~/$SCRIPTHOME/kde.knsv sleep 1 konsave -a kde diff --git a/3-post-setup.sh b/3-post-setup.sh index 2c1c9d1..f71555a 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -9,14 +9,20 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer + SCRIPTHOME: $SCRIPTHOME ------------------------------------------------------------------------- Final Setup and Configurations GRUB EFI Bootloader Install & Check " +source /root/$SCRIPTHOME/setup.conf if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} fi +# set kernel parameter for decrypting the drive +if [[ "${FS}" == "luks" ]]; then +sed -i "s%GRUB_CMDLINE_LINUX_DEFAULT=\"%GRUB_CMDLINE_LINUX_DEFAULT=\"cryptdevice=UUID=${encryped_partition_uuid}:ROOT root=/dev/mapper/ROOT %g" /etc/default/grub +fi echo -e "Installing CyberRe Grub theme..." THEME_DIR="/boot/grub/themes" @@ -73,5 +79,8 @@ sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /et # Add sudo rights sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers +rm -r /root/$SCRIPTHOME +rm -r /home/$username/$SCRIPTHOME + # Replace in the same state cd $pwd diff --git a/archtitus.sh b/archtitus.sh index c6e09e4..3f748b9 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -18,10 +18,9 @@ echo -ne " bash startup.sh source setup.conf bash 0-preinstall.sh - arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh - source /mnt/root/$SCRIPTHOME/install.conf - arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh - arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh + SCRIPTHOME=$SCRIPTHOME arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh + SCRIPTHOME=$SCRIPTHOME arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh + SCRIPTHOME=$SCRIPTHOME arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh echo -ne " -------------------------------------------------------------------------