parent
313b9b0219
commit
2a6a17d3ad
232
0-preinstall.sh
232
0-preinstall.sh
|
|
@ -7,116 +7,82 @@
|
||||||
# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║
|
# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║
|
||||||
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
||||||
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
|
|
||||||
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 "-------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
|
|
||||||
mkdir /mnt
|
|
||||||
|
|
||||||
|
|
||||||
echo -e "\nInstalling prereqs...\n$HR"
|
|
||||||
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 "--------------------------------------"
|
|
||||||
|
|
||||||
|
function formatdisk {
|
||||||
# disk prep
|
# disk prep
|
||||||
sgdisk -Z ${DISK} # zap all on disk
|
sgdisk -Z ${1} # zap all on disk
|
||||||
sgdisk -a 2048 -o ${DISK} # new gpt disk 2048 alignment
|
sgdisk -a 2048 -o ${1} # new gpt disk 2048 alignment
|
||||||
|
|
||||||
# create partitions
|
# create partitions
|
||||||
sgdisk -n 1::+1M --typecode=1:ef02 --change-name=1:'BIOSBOOT' ${DISK} # partition 1 (BIOS Boot Partition)
|
sgdisk -n 1::+1M --typecode=1:ef02 --change-name=1:'BIOSBOOT' ${1} # partition 1 (BIOS Boot Partition)
|
||||||
sgdisk -n 2::+100M --typecode=2:ef00 --change-name=2:'EFIBOOT' ${DISK} # partition 2 (UEFI Boot Partition)
|
sgdisk -n 2::+100M --typecode=2:ef00 --change-name=2:'BOOT' ${1} # partition 2 (UEFI Boot Partition)
|
||||||
sgdisk -n 3::-0 --typecode=3:8300 --change-name=3:'ROOT' ${DISK} # partition 3 (Root), default start, remaining
|
sgdisk -n 3::-0 --typecode=3:8300 --change-name=3:'ROOT' ${1} # partition 3 (Root), default start, remaining
|
||||||
if [[ ! -d "/sys/firmware/efi" ]]; then
|
if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
sgdisk -A 1:set:2 ${DISK}
|
sgdisk -A 1:set:2 ${1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make filesystems
|
# make filesystems
|
||||||
echo -e "\nCreating Filesystems...\n$HR"
|
if [[ ${1} =~ "nvme" ]]; then
|
||||||
if [[ ${DISK} =~ "nvme" ]]; then
|
mkfs.vfat -F32 -n "BOOT" "${1}p2"
|
||||||
mkfs.vfat -F32 -n "EFIBOOT" "${DISK}p2"
|
mkfs.btrfs -L "ROOT" "${1}p3" -f
|
||||||
mkfs.btrfs -L "ROOT" "${DISK}p3" -f
|
mount -t btrfs "${1}p3" /mnt
|
||||||
mount -t btrfs "${DISK}p3" /mnt
|
|
||||||
else
|
else
|
||||||
mkfs.vfat -F32 -n "EFIBOOT" "${DISK}2"
|
mkfs.vfat -F32 -n "BOOT" "${1}2"
|
||||||
mkfs.btrfs -L "ROOT" "${DISK}3" -f
|
mkfs.btrfs -L "ROOT" "${1}3" -f
|
||||||
mount -t btrfs "${DISK}3" /mnt
|
mount -t btrfs "${1}3" /mnt
|
||||||
fi
|
fi
|
||||||
ls /mnt | xargs btrfs subvolume delete
|
ls /mnt #| xargs btrfs subvolume delete #ERROR: btrfs subvolumne delete: not enough arguments: 0 but at least 1 expected
|
||||||
btrfs subvolume create /mnt/@
|
btrfs subvolume create /mnt/@
|
||||||
umount /mnt
|
umount /mnt
|
||||||
;;
|
|
||||||
*)
|
|
||||||
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
|
~/ArchTitus/x-mount.sh
|
||||||
mount -t btrfs -o subvol=@ -L ROOT /mnt
|
}
|
||||||
mkdir /mnt/boot
|
|
||||||
mkdir /mnt/boot/efi
|
|
||||||
mount -t vfat -L EFIBOOT /mnt/boot/
|
|
||||||
|
|
||||||
if ! grep -qs '/mnt' /proc/mounts; then
|
|
||||||
echo "Drive is not mounted can not continue"
|
|
||||||
echo "Rebooting in 3 Seconds ..." && sleep 1
|
|
||||||
echo "Rebooting in 2 Seconds ..." && sleep 1
|
|
||||||
echo "Rebooting in 1 Second ..." && sleep 1
|
|
||||||
reboot now
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "--------------------------------------"
|
function install {
|
||||||
echo "-- Arch Install on Main Drive --"
|
ISO=$(curl -4 ifconfig.co/country-iso)
|
||||||
echo "--------------------------------------"
|
echo "-------------------------------------------------------------------------"
|
||||||
pacstrap /mnt base base-devel linux linux-firmware vim nano sudo archlinux-keyring wget libnewt --noconfirm --needed
|
echo "-- Setting up $ISO mirrors for faster downloads --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
pacman -S --noconfirm reflector rsync
|
||||||
|
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
|
||||||
|
echo "reflector is running, please wait..."
|
||||||
|
reflector -a 48 -c $ISO -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
# Add parallel downloading
|
||||||
|
sed -i 's/^#Para/Para/' /etc/pacman.conf
|
||||||
|
|
||||||
|
# Enable multilib
|
||||||
|
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
|
||||||
|
pacman -Sy --noconfirm
|
||||||
|
|
||||||
|
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
echo "-- Base Install on Main Drive --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
pacstrap /mnt linux base sudo networkmanager iwd --noconfirm --needed
|
||||||
genfstab -U /mnt >> /mnt/etc/fstab
|
genfstab -U /mnt >> /mnt/etc/fstab
|
||||||
echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
|
#echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
|
||||||
cp -R ${SCRIPT_DIR} /mnt/root/ArchTitus
|
cp -R ${SCRIPT_DIR} /mnt/root/ArchTitus
|
||||||
|
cp /mnt/etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist.backup
|
||||||
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
|
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
|
||||||
echo "--------------------------------------"
|
|
||||||
echo "--GRUB BIOS Bootloader Install&Check--"
|
#GRUB has been flaky...moving to chroot...BE SURE TO INSTALL GRUB IF YOU MOVE BACK
|
||||||
echo "--------------------------------------"
|
#echo "-------------------------------------------------------------------------"
|
||||||
if [[ ! -d "/sys/firmware/efi" ]]; then
|
#echo "-- GRUB Bootloader Install --"
|
||||||
grub-install --boot-directory=/mnt/boot ${DISK}
|
#echo "-------------------------------------------------------------------------"
|
||||||
fi
|
#if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
echo "--------------------------------------"
|
# echo "Detected BIOS"
|
||||||
|
# grub-install --boot-directory=/mnt/boot ${1}
|
||||||
|
#fi
|
||||||
|
#if [[ -d "/sys/firmware/efi" ]]; then
|
||||||
|
# echo "Detected EFI"
|
||||||
|
# grub-install --efi-directory=/mnt/boot --root-directory=/mnt
|
||||||
|
#fi
|
||||||
|
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
echo "-- Check for low memory systems <8G --"
|
echo "-- Check for low memory systems <8G --"
|
||||||
echo "--------------------------------------"
|
echo "-------------------------------------------------------------------------"
|
||||||
TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
||||||
if [[ $TOTALMEM -lt 8000000 ]]; then
|
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.
|
#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.
|
||||||
|
|
@ -130,6 +96,84 @@ 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.
|
#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.
|
echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab #Add swap to fstab, so it KEEPS working after installation.
|
||||||
fi
|
fi
|
||||||
echo "--------------------------------------"
|
}
|
||||||
echo "-- SYSTEM READY FOR 1-setup --"
|
|
||||||
echo "--------------------------------------"
|
|
||||||
|
# Misc Setup
|
||||||
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
timedatectl set-ntp true
|
||||||
|
pacman -S --noconfirm terminus-font
|
||||||
|
setfont ter-v22b
|
||||||
|
|
||||||
|
# Read config file, if it exists
|
||||||
|
configFileName=${HOME}/ArchTitus/install.conf
|
||||||
|
if [ -e "$configFileName" ]; then
|
||||||
|
echo "Using configuration file $configFileName."
|
||||||
|
. $configFileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "-------------------------------------------------------------------------"
|
||||||
|
echo -e " █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗"
|
||||||
|
echo -e " ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝"
|
||||||
|
echo -e " ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗"
|
||||||
|
echo -e " ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║"
|
||||||
|
echo -e " ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║"
|
||||||
|
echo -e " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝"
|
||||||
|
|
||||||
|
# Get Disk
|
||||||
|
if [ -e "$configFileName" ] && [ ! -z "$disk" ]; then
|
||||||
|
echo -e "-------------------------------------------------------------------------"
|
||||||
|
echo -e "-- User - $username"
|
||||||
|
echo -e "-- Password - $password"
|
||||||
|
echo -e "-- Host - $hostname"
|
||||||
|
echo -e "-- Disk - $disk"
|
||||||
|
echo -e "-------------------------------------------------------------------------"
|
||||||
|
echo -e " *Blank values will be asked for during setup process..."
|
||||||
|
echo -e "-------------------------------------------------------------------------"
|
||||||
|
if [ "$password" == "*!*CHANGEME*!*...and-dont-store-in-plantext..." ]; then
|
||||||
|
while true; do
|
||||||
|
read -s -p "Password for $username: " password
|
||||||
|
echo
|
||||||
|
read -s -p "Password for $username (again): " password2
|
||||||
|
echo
|
||||||
|
if [ "$password" = "$password2" ] && [ "$password" != "" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Please try again"
|
||||||
|
done
|
||||||
|
sed -i.bak "s/^\(password=\).*/\1$password/" $configFileName
|
||||||
|
fi
|
||||||
|
lsblk
|
||||||
|
else
|
||||||
|
echo -e "-------------------------------------------------------------------------"
|
||||||
|
echo -e " Configuration File $configFileName not found..."
|
||||||
|
echo -e " Will ask for disk, user, password and hostname during setup process... "
|
||||||
|
echo -e "-------------------------------------------------------------------------"
|
||||||
|
echo -e "------------------------select your disk to format-----------------------"
|
||||||
|
echo -e "-------------------------------------------------------------------------"
|
||||||
|
lsblk
|
||||||
|
echo "Please enter disk to format: (example /dev/sda)"
|
||||||
|
read disk
|
||||||
|
disk="${disk,,}"
|
||||||
|
if [[ "${disk}" != *"/dev/"* ]]; then
|
||||||
|
disk="/dev/${disk}"
|
||||||
|
fi
|
||||||
|
echo "disk=$disk" >> $configFileName
|
||||||
|
fi
|
||||||
|
echo "THIS WILL FORMAT AND DELETE ALL DATA ON ${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}..."
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
formatdisk "${disk}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Figure out your drive situation, and try again."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
install "${disk}"
|
||||||
|
echo "ready for 'arch-chroot /mnt /root/ArchTitus/1-setup.sh'"
|
||||||
|
|
|
||||||
526
1-setup.sh
526
1-setup.sh
|
|
@ -7,42 +7,15 @@
|
||||||
# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║
|
# ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║
|
||||||
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
echo "--------------------------------------"
|
|
||||||
echo "-- Network Setup --"
|
|
||||||
echo "--------------------------------------"
|
|
||||||
pacman -S networkmanager dhclient --noconfirm --needed
|
|
||||||
systemctl enable --now NetworkManager
|
|
||||||
echo "-------------------------------------------------"
|
|
||||||
echo "Setting up mirrors for optimal download "
|
|
||||||
echo "-------------------------------------------------"
|
|
||||||
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)
|
ISO=$(curl -4 ifconfig.co/country-iso)
|
||||||
echo "You have " $nc" cores."
|
echo "-------------------------------------------------------------------------"
|
||||||
echo "-------------------------------------------------"
|
echo "-- Changes for optimal downloading --"
|
||||||
echo "Changing the makeflags for "$nc" cores."
|
echo "-------------------------------------------------------------------------"
|
||||||
TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
#commented because we just did this..
|
||||||
if [[ $TOTALMEM -gt 8000000 ]]; then
|
#pacman -S --noconfirm reflector rsync
|
||||||
sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf
|
#cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
|
||||||
echo "Changing the compression settings for "$nc" cores."
|
#reflector -a 48 -c $ISO -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
|
||||||
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 "-------------------------------------------------"
|
|
||||||
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 America/Chicago
|
|
||||||
timedatectl --no-ask-password set-ntp 1
|
|
||||||
localectl --no-ask-password set-locale LANG="en_US.UTF-8" LC_TIME="en_US.UTF-8"
|
|
||||||
|
|
||||||
# Set keymaps
|
|
||||||
localectl --no-ask-password set-keymap us
|
|
||||||
|
|
||||||
# Add sudo no password rights
|
|
||||||
sed -i 's/^# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers
|
|
||||||
|
|
||||||
# Add parallel downloading
|
# Add parallel downloading
|
||||||
sed -i 's/^#Para/Para/' /etc/pacman.conf
|
sed -i 's/^#Para/Para/' /etc/pacman.conf
|
||||||
|
|
@ -51,203 +24,352 @@ sed -i 's/^#Para/Para/' /etc/pacman.conf
|
||||||
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
|
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
|
||||||
pacman -Sy --noconfirm
|
pacman -Sy --noconfirm
|
||||||
|
|
||||||
echo -e "\nInstalling Base System\n"
|
|
||||||
|
|
||||||
PKGS=(
|
nc=$(grep -c ^processor /proc/cpuinfo)
|
||||||
'mesa' # Essential Xorg First
|
echo "-------------------------------------------------------------------------"
|
||||||
'xorg'
|
echo "-- Changing the makeflags for "$nc" core(s). --"
|
||||||
'xorg-server'
|
echo "-------------------------------------------------------------------------"
|
||||||
'xorg-apps'
|
TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
||||||
'xorg-drivers'
|
if [[ $TOTALMEM -gt 8000000 ]]; then
|
||||||
'xorg-xkill'
|
sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf
|
||||||
'xorg-xinit'
|
echo "Changing the compression settings for "$nc" cores."
|
||||||
'xterm'
|
sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf
|
||||||
'plasma-desktop' # KDE Load second
|
fi
|
||||||
'alsa-plugins' # audio plugins
|
|
||||||
'alsa-utils' # audio utils
|
|
||||||
'ark' # compression
|
echo "-------------------------------------------------------------------------"
|
||||||
'audiocd-kio'
|
echo "-- Setup Language to US and set locale --"
|
||||||
'autoconf' # build
|
echo "-------------------------------------------------------------------------"
|
||||||
'automake' # build
|
timezone=$(curl -4 http://ip-api.com/line?fields=timezone)
|
||||||
'base'
|
locale=en_US.UTF-8
|
||||||
'bash-completion'
|
|
||||||
'bind'
|
# Set locale
|
||||||
'binutils'
|
sed -i s/^#$locale/$locale/ /etc/locale.gen
|
||||||
'bison'
|
locale-gen
|
||||||
'bluedevil'
|
echo LANG=$locale > /etc/locale.conf
|
||||||
'bluez'
|
localectl --no-ask-password set-locale LANG=$locale LC_TIME=$locale
|
||||||
'bluez-libs'
|
|
||||||
'bluez-utils'
|
# Set time
|
||||||
'breeze'
|
timedatectl --no-ask-password set-ntp 1
|
||||||
'breeze-gtk'
|
timedatectl --no-ask-password set-timezone $timezone
|
||||||
'bridge-utils'
|
#ln -sf /usr/share/zoneinfo/$timezone /etc/localtime
|
||||||
'btrfs-progs'
|
|
||||||
'celluloid' # video players
|
# Set keymaps
|
||||||
'cmatrix'
|
localectl --no-ask-password set-keymap us
|
||||||
'code' # Visual Studio code
|
#echo "KEYMAP=US" > /etc/vconsole.conf
|
||||||
'cronie'
|
|
||||||
'cups'
|
# Set timezone when NetworkManager connects to a network
|
||||||
'dialog'
|
file=/etc/NetworkManager/dispatcher.d/09-timezone.sh
|
||||||
'discover'
|
cat <<EOF > $file
|
||||||
'dolphin'
|
#!/bin/sh
|
||||||
'dosfstools'
|
case "\$2" in
|
||||||
'dtc'
|
up)
|
||||||
'efibootmgr' # EFI boot
|
timezone=\$(curl --fail http://ip-api.com/line?fields=timezone)
|
||||||
'egl-wayland'
|
timedatectl --no-ask-password set-timezone \$timezone
|
||||||
'exfat-utils'
|
#ln -sf /usr/share/zoneinfo/\$timezone /etc/localtime
|
||||||
'extra-cmake-modules'
|
;;
|
||||||
'filelight'
|
esac
|
||||||
'flex'
|
EOF
|
||||||
'fuse2'
|
chmod +x $file
|
||||||
'fuse3'
|
|
||||||
'fuseiso'
|
|
||||||
'gamemode'
|
echo "-------------------------------------------------------------------------"
|
||||||
'gcc'
|
echo "-- X Display Manager Setup --"
|
||||||
'gimp' # Photo editing
|
echo "-------------------------------------------------------------------------"
|
||||||
'git'
|
pacman -S xorg --noconfirm --needed
|
||||||
'gparted' # partition management
|
|
||||||
'gptfdisk'
|
|
||||||
'grub'
|
echo "-------------------------------------------------------------------------"
|
||||||
'grub-customizer'
|
echo "-- KDE Plasma Setup --"
|
||||||
'gst-libav'
|
echo "-------------------------------------------------------------------------"
|
||||||
'gst-plugins-good'
|
pacman -S plasma dolphin --noconfirm --needed
|
||||||
'gst-plugins-ugly'
|
pacman -S packagekit-qt5 --noconfirm --needed #needed for discover, which is in the plasma group
|
||||||
'gwenview'
|
pacman -S kdialog --noconfirm --needed #needed for some apps to display native kde dialogs
|
||||||
'haveged'
|
|
||||||
'htop'
|
|
||||||
'iptables-nft'
|
echo "-------------------------------------------------------------------------"
|
||||||
'jdk-openjdk' # Java 17
|
echo "-- Installing Requested Packages --"
|
||||||
'kate'
|
echo "-------------------------------------------------------------------------"
|
||||||
'kcodecs'
|
PKGS_ARCH_DEFAULT=(
|
||||||
'kcoreaddons'
|
|
||||||
'kdeplasma-addons'
|
#...THEME...
|
||||||
'kde-gtk-config'
|
'terminus-font'
|
||||||
'kinfocenter'
|
|
||||||
'kscreen'
|
|
||||||
'kvantum-qt5'
|
|
||||||
'kitty'
|
|
||||||
'konsole'
|
|
||||||
'kscreen'
|
|
||||||
'layer-shell-qt'
|
|
||||||
'libdvdcss'
|
|
||||||
'libnewt'
|
|
||||||
'libtool'
|
|
||||||
'linux'
|
|
||||||
'linux-firmware'
|
|
||||||
'linux-headers'
|
|
||||||
'lsof'
|
|
||||||
'lutris'
|
|
||||||
'lzop'
|
|
||||||
'm4'
|
|
||||||
'make'
|
|
||||||
'milou'
|
|
||||||
'nano'
|
|
||||||
'neofetch'
|
|
||||||
'networkmanager'
|
|
||||||
'ntfs-3g'
|
|
||||||
'ntp'
|
|
||||||
'okular'
|
|
||||||
'openbsd-netcat'
|
|
||||||
'openssh'
|
|
||||||
'os-prober'
|
|
||||||
'oxygen'
|
|
||||||
'p7zip'
|
|
||||||
'pacman-contrib'
|
|
||||||
'patch'
|
|
||||||
'picom'
|
|
||||||
'pkgconf'
|
|
||||||
'plasma-meta'
|
|
||||||
'plasma-nm'
|
|
||||||
'powerdevil'
|
|
||||||
'powerline-fonts'
|
'powerline-fonts'
|
||||||
'print-manager'
|
|
||||||
'pulseaudio'
|
#...TOOLS...
|
||||||
|
'usbutils' # query connected USB devices
|
||||||
|
'ntp' # network time protocol reference implementation
|
||||||
|
|
||||||
|
#...NETWORK TOOLS...
|
||||||
|
'bridge-utils' # configuring etnernet bridge
|
||||||
|
'iptables-nft' # replaces iptables
|
||||||
|
'traceroute' # track route taken by packets over an IP network
|
||||||
|
'openbsd-netcat' # tcp/ip network tools
|
||||||
|
'bind' #DNS tools
|
||||||
|
|
||||||
|
#...MAIN TOOLS...
|
||||||
|
'cmatrix' # matix screen
|
||||||
|
'cronie' # schedule tasks/jobs
|
||||||
|
'htop' # see running processes
|
||||||
|
'lsof' # list open files for running Unix processes
|
||||||
|
'nano' # a famous text editor
|
||||||
|
'neofetch' # displays information about your computer
|
||||||
|
'openssh' # remote login with the SSH protocol
|
||||||
|
'os-prober' # detect other OSes on a set of drives (for grub)
|
||||||
|
'vim' # a famous text editor
|
||||||
|
'wget' # get files from web
|
||||||
|
'git' # get files from web, development sync
|
||||||
|
'bash-completion' # programmable completion for the bash shell
|
||||||
|
'zsh' # command line intrepreter
|
||||||
|
'zsh-syntax-highlighting'
|
||||||
|
'zsh-autosuggestions'
|
||||||
|
'zsh-completions'
|
||||||
|
'pacman-contrib' # scripts and tools for pacman systems
|
||||||
|
'rsync' # sync files
|
||||||
|
'reflector' # sort and filter pacman mirror list
|
||||||
|
'snapper' # managing BTRFS and LVM snapshots tool...also installed by snap-pac and snapper-gui-git!!
|
||||||
|
# btrfs can't create snapshots of a volume that also contains a swapfile. I fixed this by moving my swapfile to its own subvolume.
|
||||||
|
'gufw' # manage netfilter firewall...added by me replacing ufw
|
||||||
|
|
||||||
|
#...KDE...
|
||||||
|
'konsole' # KDE terminal
|
||||||
|
'kate' # KDE text editor
|
||||||
|
'ark' # KDE file archive tool
|
||||||
|
'p7zip' # 7Z format support
|
||||||
|
'unrar' # RAR decompression support
|
||||||
|
'unarchiver' # RAR format support
|
||||||
|
'lzop' # LZO format support
|
||||||
|
'lrzip' # LRZ format support
|
||||||
|
'gwenview' # KDE image viewer
|
||||||
|
'qt5-imageformats' # tiff, webp and more formats
|
||||||
|
'kimageformats' # dds, xcf, exr, psd, and more formats
|
||||||
|
'kipi-plugins' # export to various online services
|
||||||
|
'kamera' # imports from gphoto2 cameras
|
||||||
|
'filelight' # KDE tool to view disk useage
|
||||||
|
'spectacle' # KDE screenshot capture utility
|
||||||
|
'kipi-plugins' # export to various online services
|
||||||
|
|
||||||
|
#...MISC/OTHER...
|
||||||
|
'picom' # X compositor that may fix tearing issues
|
||||||
|
'gparted' # graphical partition management
|
||||||
|
'grub-customizer' # gui to customize grub
|
||||||
|
'kitty' # terminal
|
||||||
|
'celluloid' # video players
|
||||||
|
'code' # Visual Studio code
|
||||||
|
'gimp' # Photo editing
|
||||||
|
'jdk-openjdk' # Java 17
|
||||||
|
'lutris' # gaming platform
|
||||||
|
'okular'
|
||||||
|
'qemu'
|
||||||
|
'steam'
|
||||||
|
'gamemode' # gaming optimizations
|
||||||
|
'synergy'
|
||||||
|
'virt-manager'
|
||||||
|
'virt-viewer'
|
||||||
|
'wine-gecko' #why not just wine?
|
||||||
|
'wine-mono' #why not just wine?
|
||||||
|
'winetricks' #why not just wine?
|
||||||
|
|
||||||
|
#...AUDIO/SOUND SUPPORT...
|
||||||
|
'alsa-plugins' #installed by steam
|
||||||
|
'alsa-utils'
|
||||||
|
'pulseaudio' #installed as part of plasma-pa
|
||||||
'pulseaudio-alsa'
|
'pulseaudio-alsa'
|
||||||
'pulseaudio-bluetooth'
|
'pulseaudio-bluetooth'
|
||||||
|
|
||||||
|
#...POWER/BATTERY/SUSPEND SUPPORT...
|
||||||
|
'powerdevil' # KDE tool to manage power consumption...installed as part of plasma-desktop
|
||||||
|
|
||||||
|
#...BLUETOOTH SUPPORT...
|
||||||
|
'bluedevil'
|
||||||
|
'bluez' # bluetooth support...installed as part of bluedevil and powerdevil
|
||||||
|
'bluez-libs' #installed as part of networkmanager
|
||||||
|
'bluez-utils'
|
||||||
|
|
||||||
|
#...PRINTER SUPPORT...
|
||||||
|
'cups' # printer support
|
||||||
|
'print-manager' # KDE tool to manage printers
|
||||||
|
|
||||||
|
#...FILESYSTEM SUPPORT...
|
||||||
|
'ntfs-3g' # NTFS support
|
||||||
|
'dosfstools' #installed by k things
|
||||||
|
'exfat-utils' # exfat support
|
||||||
|
'btrfs-progs' #installed installed by snap-pac and snapper-gui-git MIGHT MIGHT Be installed by K!
|
||||||
|
'fuseiso' # mount ISO images
|
||||||
|
|
||||||
|
#...SAMBA-WINDOWS NETWORK SHARE SUPPORT...
|
||||||
|
'samba'
|
||||||
|
'smbnetfs'
|
||||||
|
|
||||||
|
#...UNNEEDED...
|
||||||
|
'unzip' # file compression installed by other things when needed as a depenency
|
||||||
|
'zip' # file compression
|
||||||
|
'audiocd-kio' # Audio CDs
|
||||||
|
'swtpm' # small tpm emulator
|
||||||
|
'dialog' # Shows a dialog by command line
|
||||||
|
'dtc' # Device Tree Compilier (required for qemu and spike a ISA emulator)
|
||||||
|
'egl-wayland' # graphics/nvidia
|
||||||
|
'extra-cmake-modules' #I saw these get installed by some aur program, but no dep listed...
|
||||||
|
'fuse2' #installed as part of fuseiso
|
||||||
|
'fuse3' #installed as part of plasma-worksapce
|
||||||
|
'gptfdisk' #DOES CFDISK work without it? YES Installed as part of a bunch of K things
|
||||||
|
'kcoreaddons' #installed as part of a bunch of k things
|
||||||
|
'zeroconf-ioslave' # network Monitor for DNS-SD services for KDE
|
||||||
|
'kvantum-qt5'
|
||||||
|
'linux-firmware'
|
||||||
|
'linux-headers'
|
||||||
'python-notify2'
|
'python-notify2'
|
||||||
'python-psutil'
|
'python-psutil'
|
||||||
'python-pyqt5'
|
'python-pyqt5'
|
||||||
'python-pip'
|
#CODECS
|
||||||
'qemu'
|
'gst-libav' #installed as part of wine dxvk-bin I DID NOT INSTALL WINE..its DXVK-BIN
|
||||||
'rsync'
|
'gst-plugins-good' #installed by virt
|
||||||
'sddm'
|
'gst-plugins-ugly'
|
||||||
'sddm-kcm'
|
'libdvdcss' # Portable abstraction library for DVD decryption
|
||||||
'snapper'
|
'kcodecs' #installed as part of a bunch of k things
|
||||||
'spectacle'
|
|
||||||
'steam'
|
|
||||||
'sudo'
|
|
||||||
'swtpm'
|
|
||||||
'synergy'
|
|
||||||
'systemsettings'
|
|
||||||
'terminus-font'
|
|
||||||
'traceroute'
|
|
||||||
'ufw'
|
|
||||||
'unrar'
|
|
||||||
'unzip'
|
|
||||||
'usbutils'
|
|
||||||
'vim'
|
|
||||||
'virt-manager'
|
|
||||||
'virt-viewer'
|
|
||||||
'wget'
|
|
||||||
'which'
|
|
||||||
'wine-gecko'
|
|
||||||
'wine-mono'
|
|
||||||
'winetricks'
|
|
||||||
'xdg-desktop-portal-kde'
|
|
||||||
'xdg-user-dirs'
|
|
||||||
'zeroconf-ioslave'
|
|
||||||
'zip'
|
|
||||||
'zsh'
|
|
||||||
'zsh-syntax-highlighting'
|
|
||||||
'zsh-autosuggestions'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for PKG in "${PKGS[@]}"; do
|
# Read config file, if it exists
|
||||||
echo "INSTALLING: ${PKG}"
|
configFileName=${HOME}/ArchTitus/install.conf
|
||||||
sudo pacman -S "$PKG" --noconfirm --needed
|
if [ -e "$configFileName" ]; then
|
||||||
done
|
echo "Using configuration file $configFileName."
|
||||||
|
. $configFileName
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
# install default or user specified packages (if they exist)
|
||||||
# determine processor type and install microcode
|
if [ ${#PKGS_ARCH[@]} -eq 0 ]; then
|
||||||
#
|
echo "installing arch default packages"
|
||||||
|
for PKG in "${PKGS_ARCH_DEFAULT[@]}"; do
|
||||||
|
echo "INSTALLING ARCH DEFAULT PACKAGE: ${PKG}"
|
||||||
|
pacman -S "$PKG" --noconfirm --needed
|
||||||
|
break
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "installing arch user specified packages"
|
||||||
|
for PKG in "${PKGS_ARCH[@]}"; do
|
||||||
|
echo "INSTALLING ARCH USER SPECIFIED PACKAGE: ${PKG}"
|
||||||
|
pacman -S "$PKG" --noconfirm --needed
|
||||||
|
break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
echo "-- Installing Processor Microcode --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
proc_type=$(lscpu | awk '/Vendor ID:/ {print $3}')
|
proc_type=$(lscpu | awk '/Vendor ID:/ {print $3}')
|
||||||
case "$proc_type" in
|
case "$proc_type" in
|
||||||
GenuineIntel)
|
GenuineIntel)
|
||||||
print "Installing Intel microcode"
|
echo "Installing Intel microcode"
|
||||||
pacman -S --noconfirm intel-ucode
|
pacman -S --noconfirm intel-ucode
|
||||||
proc_ucode=intel-ucode.img
|
proc_ucode=intel-ucode.img
|
||||||
;;
|
;;
|
||||||
AuthenticAMD)
|
AuthenticAMD)
|
||||||
print "Installing AMD microcode"
|
echo "Installing AMD microcode"
|
||||||
pacman -S --noconfirm amd-ucode
|
pacman -S --noconfirm amd-ucode
|
||||||
proc_ucode=amd-ucode.img
|
proc_ucode=amd-ucode.img
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Graphics Drivers find and install
|
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
echo "-- Installing Grapics Drivers --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
if lspci | grep -E "NVIDIA|GeForce"; then
|
if lspci | grep -E "NVIDIA|GeForce"; then
|
||||||
|
echo "Installing NVIDIA Drivers."
|
||||||
pacman -S nvidia --noconfirm --needed
|
pacman -S nvidia --noconfirm --needed
|
||||||
nvidia-xconfig
|
nvidia-xconfig
|
||||||
elif lspci | grep -E "Radeon"; then
|
elif lspci | grep -E "Radeon"; then
|
||||||
|
echo "Installing ATI/AMD Drivers."
|
||||||
pacman -S xf86-video-amdgpu --noconfirm --needed
|
pacman -S xf86-video-amdgpu --noconfirm --needed
|
||||||
elif lspci | grep -E "Integrated Graphics Controller"; then
|
elif lspci | grep -E "Integrated Graphics Controller"; then
|
||||||
|
echo "Installing Intel Integrated Drivers."
|
||||||
pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils --needed --noconfirm
|
pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils --needed --noconfirm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\nDone!\n"
|
hypervisor=$(systemd-detect-virt)
|
||||||
if ! source install.conf; then
|
case $hypervisor in
|
||||||
read -p "Please enter username:" username
|
kvm ) echo "Installing KVM guest tools."
|
||||||
echo "username=$username" >> ${HOME}/ArchTitus/install.conf
|
pacman -S qemu-guest-agent --noconfirm --needed
|
||||||
fi
|
systemctl enable qemu-guest-agent
|
||||||
if [ $(whoami) = "root" ];
|
;;
|
||||||
then
|
vmware ) echo "Installing VMWare guest tools."
|
||||||
useradd -m -G wheel,libvirt -s /bin/bash $username
|
pacman -S open-vm-tools --noconfirm --needed
|
||||||
passwd $username
|
systemctl enable vmtoolsd
|
||||||
cp -R /root/ArchTitus /home/$username/
|
systemctl enable vmware-vmblock-fuse
|
||||||
chown -R $username: /home/$username/ArchTitus
|
;;
|
||||||
read -p "Please name your machine:" nameofmachine
|
oracle ) echo "Installing VirtualBox guest tools."
|
||||||
echo $nameofmachine > /etc/hostname
|
pacman -S virtualbox-guest-utils --noconfirm --needed
|
||||||
else
|
systemctl enable vboxservice
|
||||||
echo "You are already a user proceed with aur installs"
|
;;
|
||||||
|
microsoft ) echo "Installing Hyper-V guest tools."
|
||||||
|
pacman -S hyperv --noconfirm --needed
|
||||||
|
systemctl enable hv_fcopy_daemon
|
||||||
|
systemctl enable hv_kvp_daemon
|
||||||
|
systemctl enable hv_vss_daemon
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
echo "-- Setup User --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
# Read config file, if it exists
|
||||||
|
configFileName=${HOME}/ArchTitus/install.conf
|
||||||
|
if [ -e "$configFileName" ]; then
|
||||||
|
echo "Using configuration file $configFileName."
|
||||||
|
. $configFileName
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Get username
|
||||||
|
if [ -e "$configFileName" ] && [ ! -z "$username" ]; then
|
||||||
|
echo "Creating user - $username."
|
||||||
|
else
|
||||||
|
read -p "Please enter username:" username
|
||||||
|
echo "username=$username" >> $configFileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add user
|
||||||
|
egrep -i "libvirt" /etc/group;
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
useradd -m -G wheel,libvirt -s /bin/bash $username
|
||||||
|
else
|
||||||
|
useradd -m -G wheel -s /bin/bash $username
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set user password
|
||||||
|
if [ -e "$configFileName" ] && [ ! -z "$password" ] && [ "$password" != "*!*CHANGEME*!*...and-dont-store-in-plantext..." ]; then
|
||||||
|
echo "Got a password for $username."
|
||||||
|
echo "$username:$password" | chpasswd
|
||||||
|
echo "Masking password in config file."
|
||||||
|
sed -i.bak 's/^\(password=\).*/\1*!*CHANGEME*!*...and-dont-store-in-plantext.../' $configFileName
|
||||||
|
else
|
||||||
|
passwd $username
|
||||||
|
if [ "$password" != "*!*CHANGEME*!*...and-dont-store-in-plantext..." ]; then
|
||||||
|
echo "password=*!*CHANGEME*!*...and-dont-store-in-plantext..." >> ${HOME}/ArchTitus/install.conf
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set hostname
|
||||||
|
if [ -e "$configFileName" ] && [ ! -z "$hostname" ]; then
|
||||||
|
echo "hostname: $hostname"
|
||||||
|
else
|
||||||
|
read -p "Please name your machine:" hostname
|
||||||
|
echo "hostname=$hostname" >> $configFileName
|
||||||
|
fi
|
||||||
|
echo $hostname > /etc/hostname
|
||||||
|
|
||||||
|
# Set hosts file.
|
||||||
|
cat <<EOF > /etc/hosts
|
||||||
|
127.0.0.1 localhost
|
||||||
|
::1 localhost
|
||||||
|
127.0.1.1 $hostname.localdomain $hostname
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Copy this script to new user home directory
|
||||||
|
cp -R /root/ArchTitus /home/$username/
|
||||||
|
chown -R $username: /home/$username/ArchTitus
|
||||||
|
|
||||||
|
# Add sudo no password rights
|
||||||
|
sed -i 's/^# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers
|
||||||
|
|
||||||
|
echo "ready for 'arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/ArchTitus/2-user.sh'"
|
||||||
|
|
|
||||||
92
2-user.sh
92
2-user.sh
|
|
@ -8,30 +8,27 @@
|
||||||
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
echo -e "\nINSTALLING AUR SOFTWARE\n"
|
echo "-------------------------------------------------------------------------"
|
||||||
# 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 "-- Setup yay to download packages from AUR --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
# Make sure these packages are installed for installing AUR manager
|
||||||
|
sudo pacman -S git base-devel --noconfirm --needed
|
||||||
|
|
||||||
echo "CLONING: YAY"
|
# Download and Install yay
|
||||||
cd ~
|
cd ~
|
||||||
git clone "https://aur.archlinux.org/yay.git"
|
git clone "https://aur.archlinux.org/yay.git"
|
||||||
cd ${HOME}/yay
|
cd ${HOME}/yay
|
||||||
makepkg -si --noconfirm
|
makepkg -si --noconfirm
|
||||||
cd ~
|
|
||||||
touch "$HOME/.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
|
|
||||||
|
|
||||||
PKGS=(
|
|
||||||
'autojump'
|
echo "-------------------------------------------------------------------------"
|
||||||
|
echo "-- Installing Requested Packages from AUR --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
PKGS_AUR_CORE=(
|
||||||
|
'autojump' # A faster way to navigate your filesystem from the command line
|
||||||
'awesome-terminal-fonts'
|
'awesome-terminal-fonts'
|
||||||
'brave-bin' # Brave Browser
|
'lightly-git' # theme (for qt)
|
||||||
'dxvk-bin' # DXVK DirectX to Vulcan
|
|
||||||
'github-desktop-bin' # Github Desktop sync
|
|
||||||
'lightly-git'
|
|
||||||
'lightlyshaders-git'
|
'lightlyshaders-git'
|
||||||
'mangohud' # Gaming FPS Counter
|
|
||||||
'mangohud-common'
|
|
||||||
'nerd-fonts-fira-code'
|
'nerd-fonts-fira-code'
|
||||||
'nordic-darker-standard-buttons-theme'
|
'nordic-darker-standard-buttons-theme'
|
||||||
'nordic-darker-theme'
|
'nordic-darker-theme'
|
||||||
|
|
@ -42,19 +39,64 @@ PKGS=(
|
||||||
'plasma-pa'
|
'plasma-pa'
|
||||||
'ocs-url' # install packages from websites
|
'ocs-url' # install packages from websites
|
||||||
'sddm-nordic-theme-git'
|
'sddm-nordic-theme-git'
|
||||||
'snapper-gui-git'
|
|
||||||
'ttf-droid'
|
'ttf-droid'
|
||||||
'ttf-hack'
|
'ttf-hack'
|
||||||
'ttf-meslo' # Nerdfont package
|
'ttf-meslo' # Nerdfont package
|
||||||
'ttf-roboto'
|
'ttf-roboto'
|
||||||
'zoom' # video conferences
|
|
||||||
'snap-pac'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for PKG in "${PKGS[@]}"; do
|
PKGS_AUR_DEFAULT=(
|
||||||
|
'brave-bin' # Brave Browser
|
||||||
|
'dxvk-bin' # DXVK DirectX to Vulcan
|
||||||
|
'github-desktop-bin' # Github Desktop sync
|
||||||
|
'mangohud' # Gaming FPS Counter
|
||||||
|
'mangohud-common' #installs with mangohud
|
||||||
|
'zoom' # video conferences
|
||||||
|
'snap-pac' # btrfs tools...runs snapshot after every pacman install
|
||||||
|
'snapper-gui-git' # a tool of managing snapshots of Btrfs subvolumes and LVM volumes
|
||||||
|
)
|
||||||
|
|
||||||
|
# install core packages
|
||||||
|
for PKG in "${PKGS_AUR_CORE[@]}"; do
|
||||||
|
echo "INSTALLING AUR CORE PACKAGE: ${PKG}"
|
||||||
yay -S --noconfirm $PKG
|
yay -S --noconfirm $PKG
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Read config file, if it exists
|
||||||
|
configFileName=${HOME}/ArchTitus/install.conf
|
||||||
|
if [ -e "$configFileName" ]; then
|
||||||
|
echo "Using configuration file $configFileName."
|
||||||
|
. $configFileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install default or user specified packages (if they exist)
|
||||||
|
if [ ${#PKGS_AUR[@]} -eq 0 ]; then
|
||||||
|
echo "installing AUR default packages"
|
||||||
|
for PKG in "${PKGS_AUR_DEFAULT[@]}"; do
|
||||||
|
echo "INSTALLING AUR DEFAULT PACKAGE: ${PKG}"
|
||||||
|
yay -S --noconfirm $PKG
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "installing AUR user specified packages"
|
||||||
|
for PKG in "${PKGS_AUR[@]}"; do
|
||||||
|
echo "INSTALLING AUR USER SPECIFIED PACKAGE: ${PKG}"
|
||||||
|
yay -S --noconfirm $PKG
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
echo "-- Setup User Theme --"
|
||||||
|
echo "-------------------------------------------------------------------------"
|
||||||
|
# Zsh syntax highlighting
|
||||||
|
cd ~
|
||||||
|
touch "$HOME/.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
|
||||||
|
|
||||||
|
# KDE config
|
||||||
|
sudo pacman -S python-pip --noconfirm --needed
|
||||||
export PATH=$PATH:~/.local/bin
|
export PATH=$PATH:~/.local/bin
|
||||||
cp -r $HOME/ArchTitus/dotfiles/* $HOME/.config/
|
cp -r $HOME/ArchTitus/dotfiles/* $HOME/.config/
|
||||||
pip install konsave
|
pip install konsave
|
||||||
|
|
@ -62,5 +104,11 @@ konsave -i $HOME/ArchTitus/kde.knsv
|
||||||
sleep 1
|
sleep 1
|
||||||
konsave -a kde
|
konsave -a kde
|
||||||
|
|
||||||
echo -e "\nDone!\n"
|
sudo systemctl enable sddm.service
|
||||||
exit
|
sudo bash -c 'cat <<EOF > /etc/sddm.conf
|
||||||
|
[Theme]
|
||||||
|
Current=Nordic
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
echo "ready for 'arch-chroot /mnt /root/ArchTitus/3-post-setup.sh'"
|
||||||
|
|
|
||||||
|
|
@ -8,50 +8,47 @@
|
||||||
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
echo -e "\nFINAL SETUP AND CONFIGURATION"
|
echo "-------------------------------------------------------------------------"
|
||||||
echo "--------------------------------------"
|
echo "-- GRUB Bootloader --"
|
||||||
echo "-- GRUB EFI Bootloader Install&Check--"
|
echo "-------------------------------------------------------------------------"
|
||||||
echo "--------------------------------------"
|
~/ArchTitus/x-bootloader.sh
|
||||||
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 "-------------------------------------------------------------------------"
|
||||||
systemctl enable sddm.service
|
echo "-- Cleaning Up / Misc --"
|
||||||
echo -e "\nSetup SDDM Theme"
|
echo "-------------------------------------------------------------------------"
|
||||||
cat <<EOF > /etc/sddm.conf
|
# Remove no password sudo rights granted previously
|
||||||
[Theme]
|
|
||||||
Current=Nordic
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
echo -e "\nEnabling essential services"
|
|
||||||
|
|
||||||
systemctl enable cups.service
|
|
||||||
ntpd -qg
|
|
||||||
systemctl enable ntpd.service
|
|
||||||
systemctl disable dhcpcd.service
|
|
||||||
systemctl stop dhcpcd.service
|
|
||||||
systemctl enable NetworkManager.service
|
|
||||||
systemctl enable bluetooth
|
|
||||||
echo "
|
|
||||||
###############################################################################
|
|
||||||
# Cleaning
|
|
||||||
###############################################################################
|
|
||||||
"
|
|
||||||
# Remove no password sudo rights
|
|
||||||
sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers
|
sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers
|
||||||
# Add sudo rights
|
# Add sudo rights
|
||||||
sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
|
sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
|
||||||
|
|
||||||
# Replace in the same state
|
# Cleanup unused packages
|
||||||
|
pacman -Rsc --noconfirm "$(pacman -Qqdt)"
|
||||||
|
|
||||||
|
# Enable btrfs snapshots
|
||||||
|
snapper -c root create-config /
|
||||||
|
|
||||||
|
|
||||||
|
# Enable services
|
||||||
|
systemctl disable dhcpcd.service
|
||||||
|
systemctl stop dhcpcd.service
|
||||||
|
|
||||||
|
systemctl enable sddm.service
|
||||||
|
|
||||||
|
ntpd -qg #netowrk time sync
|
||||||
|
systemctl enable ntpd.service
|
||||||
|
|
||||||
|
systemctl enable cups.service
|
||||||
|
systemctl enable bluetooth
|
||||||
|
|
||||||
|
systemctl enable smb.service
|
||||||
|
systemctl enable nmb.service
|
||||||
|
systemctl enable NetworkManager.service
|
||||||
|
systemctl enable NetworkManager-dispatcher.service
|
||||||
|
|
||||||
|
# change directory back
|
||||||
cd $pwd
|
cd $pwd
|
||||||
echo "
|
|
||||||
###############################################################################
|
echo "-------------------------------------------------------------------------"
|
||||||
# Done - Please Eject Install Media and Reboot
|
echo "-- Done - Please Eject Install Media and Reboot --"
|
||||||
###############################################################################
|
echo "-------------------------------------------------------------------------"
|
||||||
"
|
|
||||||
|
|
|
||||||
10
archtitus.sh
10
archtitus.sh
|
|
@ -1,7 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
bash 0-preinstall.sh
|
read -t 60 -p 'Welcome! Please wait 60 seconds for lingering tasks (time set, reflector, graphical interface...) to complete. Press enter to skip.'
|
||||||
|
|
||||||
|
status=$?
|
||||||
|
cmd="bash 0-preinstall.sh"
|
||||||
|
$cmd
|
||||||
|
status=$? && [ $status -eq 0 ] || exit
|
||||||
|
|
||||||
arch-chroot /mnt /root/ArchTitus/1-setup.sh
|
arch-chroot /mnt /root/ArchTitus/1-setup.sh
|
||||||
source /mnt/root/ArchTitus/install.conf
|
source /mnt/root/ArchTitus/install.conf #read config file
|
||||||
arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/ArchTitus/2-user.sh
|
arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/ArchTitus/2-user.sh
|
||||||
arch-chroot /mnt /root/ArchTitus/3-post-setup.sh
|
arch-chroot /mnt /root/ArchTitus/3-post-setup.sh
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
disk=/dev/sda
|
||||||
hostname=host
|
hostname=host
|
||||||
username=titus
|
username=titus
|
||||||
password=1234
|
password=1234
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Read config file, if it exists
|
||||||
|
configFileName=${HOME}/ArchTitus/install.conf
|
||||||
|
if [ -e "$configFileName" ]; then
|
||||||
|
echo "Using configuration file $configFileName."
|
||||||
|
. $configFileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check partitions are mounted
|
||||||
|
if ! grep -qs '/boot ' /proc/mounts; then
|
||||||
|
umount -fl /mnt
|
||||||
|
~/ArchTitus/x-mount.sh
|
||||||
|
arch-chroot /mnt /root/ArchTitus/x-bootloader.sh
|
||||||
|
echo "Done. Please reboot and/or try again if needed".
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install grub
|
||||||
|
if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
|
pacman -S grub --noconfirm --needed
|
||||||
|
echo "Detected BIOS..."
|
||||||
|
if [ -z "$disk" ]; then
|
||||||
|
lsblk
|
||||||
|
echo "Please enter disk to install bootloader to: (example /dev/sda)"
|
||||||
|
read disk
|
||||||
|
disk="${disk,,}"
|
||||||
|
if [[ "${disk}" != *"/dev/"* ]]; then
|
||||||
|
disk="/dev/${disk}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Installing BIOS GRUB to $disk."
|
||||||
|
fi
|
||||||
|
grub-install --boot-directory=/boot $disk
|
||||||
|
fi
|
||||||
|
if [[ -d "/sys/firmware/efi" ]]; then
|
||||||
|
pacman -S grub efibootmgr --noconfirm --needed
|
||||||
|
echo "Detected EFI..."
|
||||||
|
grub-install --efi-directory=/boot
|
||||||
|
fi
|
||||||
|
|
||||||
|
grubfile=/boot/grub/grub.cfg
|
||||||
|
grub-mkconfig -o $grubfile
|
||||||
|
|
||||||
|
if [[ -s $grubfile ]]; then
|
||||||
|
cat $grubfile
|
||||||
|
echo "$grubfile exists and not empty"
|
||||||
|
read -n 1 -s -r -p "Press any key to continue...or manually break script here."
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "$grubfile doesn't exist or is empty. Is grub downloading correctly?".
|
||||||
|
echo "Sometimes file wont exist, or a grub.new file is presnet in /boot/grub"
|
||||||
|
echo "Other times the file will be blank and grub-mkconfig outputs nothing..."
|
||||||
|
echo "Try again or break the script here and investigate"
|
||||||
|
echo "you'll find the following commands useful to investigate"
|
||||||
|
echo "arch-chroot /mnt"
|
||||||
|
echo "grub-mkconfig -o $grubfile"
|
||||||
|
read -n 1 -s -r -p "Press any key to continue...or manually break script here."
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# mount target
|
||||||
|
echo "Mounting Filesystems..."
|
||||||
|
mount -t btrfs -o subvol=@ -L ROOT /mnt
|
||||||
|
mkdir /mnt/boot
|
||||||
|
mkdir /mnt/boot/efi
|
||||||
|
mount -t vfat -L BOOT /mnt/boot
|
||||||
|
|
||||||
|
if ! grep -qs '/mnt' /proc/mounts; then
|
||||||
|
echo "Drive did not mount correctly. Can not continue!"
|
||||||
|
read -n 1 -s -r -p "Press any key to reboot..."
|
||||||
|
reboot now
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue