diff --git a/0-preinstall.sh b/0-preinstall.sh index b82ded5..ef69e2a 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -8,10 +8,21 @@ # ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ #------------------------------------------------------------------------- SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +echo -ne " +------------------------------------------------------------------------- + █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ + ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ + ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ + ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ + ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ + ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ +------------------------------------------------------------------------- + Automated Arch Linux Installer +------------------------------------------------------------------------- + +Setting up mirrors for optimal download +" source setup.conf -echo "-------------------------------------------------" -echo "Setting up mirrors for optimal download " -echo "-------------------------------------------------" iso=$(curl -4 ifconfig.co/country-iso) timedatectl set-ntp true pacman -S --noconfirm pacman-contrib terminus-font @@ -19,38 +30,24 @@ setfont ter-v22b sed -i 's/^#Para/Para/' /etc/pacman.conf pacman -S --noconfirm reflector rsync grub cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup -echo -e "-------------------------------------------------------------------------" -echo -e " █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗" -echo -e " ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝" -echo -e " ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗" -echo -e " ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║" -echo -e " ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║" -echo -e " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝" -echo -e "-------------------------------------------------------------------------" -echo -e "-Setting up $iso mirrors for faster downloads" -echo -e "-------------------------------------------------------------------------" - +echo -ne " +------------------------------------------------------------------------- + Setting up $iso mirrors for faster downloads +------------------------------------------------------------------------- +" reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist -mkdir /mnt - -echo -e "\nInstalling prereqs...\n$HR" +mkdir /mnt &>/dev/null # Hiding error message if any +echo -ne " +------------------------------------------------------------------------- + Installing Prerequisites +------------------------------------------------------------------------- +" pacman -S --noconfirm gptfdisk btrfs-progs - -# echo "-------------------------------------------------" -# echo "-------select your disk to format----------------" -# echo "-------------------------------------------------" -# lsblk -# echo "Please enter disk to work on: (example /dev/sda)" -# read DISK -# echo "THIS WILL FORMAT AND DELETE ALL DATA ON THE DISK" -# read -p "are you sure you want to continue (Y/N):" formatdisk -# case $formatdisk in - -# y|Y|yes|Yes|YES) -echo "--------------------------------------" -echo -e "\nFormatting disk...\n$HR" -echo "--------------------------------------" - +echo -ne " +------------------------------------------------------------------------- + Formating Disk +------------------------------------------------------------------------- +" # disk prep sgdisk -Z ${DISK} # zap all on disk sgdisk -a 2048 -o ${DISK} # new gpt disk 2048 alignment @@ -59,12 +56,15 @@ sgdisk -a 2048 -o ${DISK} # new gpt disk 2048 alignment sgdisk -n 1::+1M --typecode=1:ef02 --change-name=1:'BIOSBOOT' ${DISK} # partition 1 (BIOS Boot Partition) sgdisk -n 2::+100M --typecode=2:ef00 --change-name=2:'EFIBOOT' ${DISK} # partition 2 (UEFI Boot Partition) sgdisk -n 3::-0 --typecode=3:8300 --change-name=3:'ROOT' ${DISK} # partition 3 (Root), default start, remaining -if [[ ! -d "/sys/firmware/efi" ]]; then +if [[ ! -d "/sys/firmware/efi" ]]; then # Checking for bios system sgdisk -A 1:set:2 ${DISK} fi - # make filesystems -echo -e "\nCreating Filesystems...\n$HR" +echo -ne " +------------------------------------------------------------------------- + Creating Filesystems +------------------------------------------------------------------------- +" if [[ ${DISK} =~ "nvme" ]]; then if [[ ${FS} == "btrfs" ]]; then @@ -93,14 +93,6 @@ btrfs subvolume create /mnt/@ umount /mnt mount -t btrfs -o subvol=@ -L ROOT /mnt fi -# ;; -# *) -# echo "Rebooting in 3 Seconds ..." && sleep 1 -# echo "Rebooting in 2 Seconds ..." && sleep 1 -# echo "Rebooting in 1 Second ..." && sleep 1 -# reboot now -# ;; -# esac # mount target mkdir /mnt/boot @@ -114,24 +106,29 @@ if ! grep -qs '/mnt' /proc/mounts; then echo "Rebooting in 1 Second ..." && sleep 1 reboot now fi - -echo "--------------------------------------" -echo "-- Arch Install on Main Drive --" -echo "--------------------------------------" +echo -ne " +------------------------------------------------------------------------- + Arch Install on Main Drive +------------------------------------------------------------------------- +" pacstrap /mnt base base-devel linux linux-firmware vim nano sudo archlinux-keyring wget libnewt --noconfirm --needed genfstab -U /mnt >> /mnt/etc/fstab echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf cp -R ${SCRIPT_DIR} /mnt/root/ArchTitus cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist -echo "--------------------------------------" -echo "--GRUB BIOS Bootloader Install&Check--" -echo "--------------------------------------" +echo -ne " +------------------------------------------------------------------------- + GRUB BIOS Bootloader Install & Check +------------------------------------------------------------------------- +" if [[ ! -d "/sys/firmware/efi" ]]; then grub-install --boot-directory=/mnt/boot ${DISK} fi -echo "--------------------------------------" -echo "-- Check for low memory systems <8G --" -echo "--------------------------------------" +echo -ne " +------------------------------------------------------------------------- + Checking for low memory systems <8G +------------------------------------------------------------------------- +" TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') if [[ $TOTALMEM -lt 8000000 ]]; then #Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything. @@ -145,6 +142,8 @@ if [[ $TOTALMEM -lt 8000000 ]]; then #The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the sysytem itself. echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab #Add swap to fstab, so it KEEPS working after installation. fi -echo "--------------------------------------" -echo "-- SYSTEM READY FOR 1-setup --" -echo "--------------------------------------" +echo -ne " +------------------------------------------------------------------------- + SYSTEM READY FOR 1-setup.sh +------------------------------------------------------------------------- +" \ No newline at end of file diff --git a/1-setup.sh b/1-setup.sh index 9722cb1..ed99a8b 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -1,38 +1,51 @@ #!/usr/bin/env bash -#------------------------------------------------------------------------- -# █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ -# ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ -# ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ -# ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ -# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ -# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ -#------------------------------------------------------------------------- +echo -ne " +------------------------------------------------------------------------- + █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ + ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ + ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ + ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ + ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ + ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ +------------------------------------------------------------------------- + Automated Arch Linux Installer +------------------------------------------------------------------------- +" source setup.conf -echo "--------------------------------------" -echo "-- Network Setup --" -echo "--------------------------------------" +echo -ne " +------------------------------------------------------------------------- + Network Setup +------------------------------------------------------------------------- +" pacman -S networkmanager dhclient --noconfirm --needed systemctl enable --now NetworkManager -echo "-------------------------------------------------" -echo "Setting up mirrors for optimal download " -echo "-------------------------------------------------" +echo -ne " +------------------------------------------------------------------------- + Setting up mirrors for optimal download +------------------------------------------------------------------------- +" pacman -S --noconfirm pacman-contrib curl pacman -S --noconfirm reflector rsync cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak nc=$(grep -c ^processor /proc/cpuinfo) -echo "You have " $nc" cores." -echo "-------------------------------------------------" -echo "Changing the makeflags for "$nc" cores." +echo -ne " +------------------------------------------------------------------------- + You have " $nc" cores. And + changing the makeflags for "$nc" cores. Aswell as + changing the compression settings. +------------------------------------------------------------------------- +" TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') if [[ $TOTALMEM -gt 8000000 ]]; then sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf -echo "Changing the compression settings for "$nc" cores." sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf fi -echo "-------------------------------------------------" -echo " Setup Language to US and set locale " -echo "-------------------------------------------------" +echo -ne " +------------------------------------------------------------------------- + Setup Language to US and set locale +------------------------------------------------------------------------- +" sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen locale-gen timedatectl --no-ask-password set-timezone ${timezone} @@ -51,14 +64,18 @@ sed -i 's/^#Para/Para/' /etc/pacman.conf #Enable multilib sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf pacman -Sy --noconfirm - -echo -e "\nInstalling Base System\n" - +echo -ne " +------------------------------------------------------------------------- + Installing Base System +------------------------------------------------------------------------- +" sudo pacman -S --noconfirm --needed - < /pkg-files/pacman-pkgs.txt - -# +echo -ne " +------------------------------------------------------------------------- + Installing Microcode +------------------------------------------------------------------------- +" # determine processor type and install microcode -# proc_type=$(lscpu | awk '/Vendor ID:/ {print $3}') case "$proc_type" in GenuineIntel) @@ -71,8 +88,12 @@ case "$proc_type" in pacman -S --noconfirm amd-ucode proc_ucode=amd-ucode.img ;; -esac - +esac +echo -ne " +------------------------------------------------------------------------- + Installing Graphics Drivers +------------------------------------------------------------------------- +" # Graphics Drivers find and install if lspci | grep -E "NVIDIA|GeForce"; then pacman -S nvidia --noconfirm --needed @@ -82,8 +103,11 @@ elif lspci | grep -E "Radeon"; then 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 fi - -echo -e "\nDone!\n" +echo -ne " +------------------------------------------------------------------------- + Adding User +------------------------------------------------------------------------- +" if ! source install.conf; then read -p "Please enter username:" username echo "username=$username" >> ${HOME}/$SCRIPTHOME/install.conf @@ -99,4 +123,8 @@ then else echo "You are already a user proceed with aur installs" fi - +echo -ne " +------------------------------------------------------------------------- + SYSTEM READY FOR 2-user.sh +------------------------------------------------------------------------- +" \ No newline at end of file diff --git a/2-user.sh b/2-user.sh index 7a32541..f583586 100755 --- a/2-user.sh +++ b/2-user.sh @@ -1,17 +1,20 @@ #!/usr/bin/env bash -#------------------------------------------------------------------------- -# █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ -# ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ -# ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ -# ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ -# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ -# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ -#------------------------------------------------------------------------- +echo -ne " +------------------------------------------------------------------------- + █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ + ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ + ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ + ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ + ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ + ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ +------------------------------------------------------------------------- + Automated Arch Linux Installer +------------------------------------------------------------------------- -echo -e "\nINSTALLING AUR SOFTWARE\n" +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. -echo "CLONING: YAY" cd ~ git clone "https://aur.archlinux.org/yay.git" cd ${HOME}/yay @@ -31,5 +34,9 @@ konsave -i $HOME/$SCRIPTHOME/kde.knsv sleep 1 konsave -a kde -echo -e "\nDone!\n" +echo -ne " +------------------------------------------------------------------------- + SYSTEM READY FOR 3-post-setup.sh +------------------------------------------------------------------------- +" exit diff --git a/3-post-setup.sh b/3-post-setup.sh index c230620..f90f9c9 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -1,36 +1,45 @@ #!/usr/bin/env bash -#------------------------------------------------------------------------- -# █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ -# ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ -# ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ -# ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ -# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ -# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ -#------------------------------------------------------------------------- +echo -ne " +------------------------------------------------------------------------- + █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ + ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ + ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ + ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ + ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ + ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ +------------------------------------------------------------------------- + Automated Arch Linux Installer +------------------------------------------------------------------------- -echo -e "\nFINAL SETUP AND CONFIGURATION" -echo "--------------------------------------" -echo "-- GRUB EFI Bootloader Install&Check--" -echo "--------------------------------------" +Final Setup and Configurations +GRUB EFI Bootloader Install & Check +" if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} fi grub-mkconfig -o /boot/grub/grub.cfg -# ------------------------------------------------------------------------ - -echo -e "\nEnabling Login Display Manager" +echo -ne " +------------------------------------------------------------------------- + Enabling Login Display Manager +------------------------------------------------------------------------- +" systemctl enable sddm.service -echo -e "\nSetup SDDM Theme" +echo -ne " +------------------------------------------------------------------------- + Setting up SDDM Theme +------------------------------------------------------------------------- +" cat < /etc/sddm.conf [Theme] Current=Nordic EOF -# ------------------------------------------------------------------------ - -echo -e "\nEnabling essential services" - +echo -ne " +------------------------------------------------------------------------- + Enabling Essential Services +------------------------------------------------------------------------- +" systemctl enable cups.service ntpd -qg systemctl enable ntpd.service @@ -38,10 +47,10 @@ systemctl disable dhcpcd.service systemctl stop dhcpcd.service systemctl enable NetworkManager.service systemctl enable bluetooth -echo " -############################################################################### -# Cleaning -############################################################################### +echo -ne " +------------------------------------------------------------------------- + Cleaning +------------------------------------------------------------------------- " # Remove no password sudo rights sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers diff --git a/archtitus.sh b/archtitus.sh index f8b33c6..c6e09e4 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -2,8 +2,19 @@ # Find the name of the folder the scripts are in export SCRIPTHOME="$(basename -- $PWD)" -echo "Scripts are in dir named $SCRIPTHOME" - +echo -ne " +------------------------------------------------------------------------- + █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ + ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ + ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ + ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ + ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ + ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ +------------------------------------------------------------------------- + Automated Arch Linux Installer +------------------------------------------------------------------------- + Scripts are in directory named $SCRIPTHOME +" bash startup.sh source setup.conf bash 0-preinstall.sh @@ -12,8 +23,16 @@ echo "Scripts are in dir named $SCRIPTHOME" arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh -echo " -############################################################################### -# Done - Please Eject Install Media and Reboot -############################################################################### +echo -ne " +------------------------------------------------------------------------- + █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ + ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ + ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ + ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ + ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ + ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ +------------------------------------------------------------------------- + Automated Arch Linux Installer +------------------------------------------------------------------------- + Done - Please Eject Install Media and Reboot " \ No newline at end of file diff --git a/startup.sh b/startup.sh index 681cb67..5cfbcb3 100644 --- a/startup.sh +++ b/startup.sh @@ -11,7 +11,7 @@ echo -ne " ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------ - Please select presetup settings for your system + Please select presetup settings for your system ------------------------------------------------------------------------ " }