From 75d3eb60211261f10157ca88e310023fd64729a7 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 19:06:49 +0100 Subject: [PATCH 01/19] source setup conf --- 1-setup.sh | 2 +- 2-user.sh | 1 + 3-post-setup.sh | 1 + archtitus.sh | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 1633cda..1cb2c48 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -11,7 +11,7 @@ echo -ne " Automated Arch Linux Installer ------------------------------------------------------------------------- " -source setup.conf +source $SCRIPTHOME/setup.conf echo -ne " ------------------------------------------------------------------------- Network Setup diff --git a/2-user.sh b/2-user.sh index f583586..a749a8c 100755 --- a/2-user.sh +++ b/2-user.sh @@ -14,6 +14,7 @@ echo -ne " 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" diff --git a/3-post-setup.sh b/3-post-setup.sh index f90f9c9..3d37714 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -14,6 +14,7 @@ echo -ne " Final Setup and Configurations GRUB EFI Bootloader Install & Check " +source $SCRIPTHOME/setup.conf if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} fi diff --git a/archtitus.sh b/archtitus.sh index c6e09e4..fc1ef36 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -18,8 +18,8 @@ echo -ne " bash startup.sh source setup.conf bash 0-preinstall.sh + cp setup.conf /mnt/root/$SCRIPTHOME/setup.conf 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 From 65986d16570b7dbcfc67123fea5a0b8a26edd96d Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 19:10:33 +0100 Subject: [PATCH 02/19] copy scripts --- archtitus.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/archtitus.sh b/archtitus.sh index fc1ef36..d68c9eb 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -19,6 +19,9 @@ echo -ne " source setup.conf bash 0-preinstall.sh cp setup.conf /mnt/root/$SCRIPTHOME/setup.conf + cp 1-setup.sh /mnt/root/$SCRIPTHOME/1-setup.sh + cp 2-user.sh /mnt/home/$username/$SCRIPTHOME/2-user.sh + cp 3-post-setup.sh /mnt/root/$SCRIPTHOME/3-post-setup.sh arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh From 06373c62b68874bd51106fbb5e163eb85d520980 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 19:14:50 +0100 Subject: [PATCH 03/19] make directory --- archtitus.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/archtitus.sh b/archtitus.sh index d68c9eb..08a0072 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -18,9 +18,10 @@ echo -ne " bash startup.sh source setup.conf bash 0-preinstall.sh + mkdir /mnt/root/$SCRIPTHOME cp setup.conf /mnt/root/$SCRIPTHOME/setup.conf cp 1-setup.sh /mnt/root/$SCRIPTHOME/1-setup.sh - cp 2-user.sh /mnt/home/$username/$SCRIPTHOME/2-user.sh + cp 2-user.sh /mnt/root/$SCRIPTHOME/2-user.sh cp 3-post-setup.sh /mnt/root/$SCRIPTHOME/3-post-setup.sh arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh From 91a8dbf40e8f501ae4b72c31fad4cef4fb002efa Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 19:17:58 +0100 Subject: [PATCH 04/19] move mkdir --- 0-preinstall.sh | 1 + archtitus.sh | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/0-preinstall.sh b/0-preinstall.sh index ddc03c9..f93b3d5 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -160,6 +160,7 @@ echo -ne " 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 +mkdir /mnt/root/ArchTitus cp -R ${SCRIPT_DIR} /mnt/root/ArchTitus cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist echo -ne " diff --git a/archtitus.sh b/archtitus.sh index 08a0072..59d562c 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -18,11 +18,6 @@ echo -ne " bash startup.sh source setup.conf bash 0-preinstall.sh - mkdir /mnt/root/$SCRIPTHOME - cp setup.conf /mnt/root/$SCRIPTHOME/setup.conf - cp 1-setup.sh /mnt/root/$SCRIPTHOME/1-setup.sh - cp 2-user.sh /mnt/root/$SCRIPTHOME/2-user.sh - cp 3-post-setup.sh /mnt/root/$SCRIPTHOME/3-post-setup.sh arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh From 1b81bef254877ef47aa910a1866fb24d07b9a65b Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 19:42:50 +0100 Subject: [PATCH 05/19] mkdir not necessary --- 0-preinstall.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/0-preinstall.sh b/0-preinstall.sh index f93b3d5..ddc03c9 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -160,7 +160,6 @@ echo -ne " 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 -mkdir /mnt/root/ArchTitus cp -R ${SCRIPT_DIR} /mnt/root/ArchTitus cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist echo -ne " From c8628e395c1b61146227432b81809d88c9b109cf Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 19:56:54 +0100 Subject: [PATCH 06/19] set and source scripthome --- 1-setup.sh | 2 ++ 2-user.sh | 1 + 3-post-setup.sh | 6 ++++++ archtitus.sh | 1 + 4 files changed, 10 insertions(+) diff --git a/1-setup.sh b/1-setup.sh index 1cb2c48..308f463 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -11,6 +11,7 @@ echo -ne " Automated Arch Linux Installer ------------------------------------------------------------------------- " +source /root/installscripthome.conf source $SCRIPTHOME/setup.conf echo -ne " ------------------------------------------------------------------------- @@ -113,6 +114,7 @@ if [ $(whoami) = "root" ]; then # use chpasswd to enter $username:$password echo "$username:$password" | chpasswd cp -R /root/$SCRIPTHOME /home/$username/ + cp /root/installscripthome.conf /home/$username/installscripthome.conf chown -R $username: /home/$username/$SCRIPTHOME # enter $hostname to /etc/hostname echo $hostname > /etc/hostname diff --git a/2-user.sh b/2-user.sh index a749a8c..57fd82c 100755 --- a/2-user.sh +++ b/2-user.sh @@ -14,6 +14,7 @@ echo -ne " 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 installscripthome.conf source $SCRIPTHOME/setup.conf cd ~ diff --git a/3-post-setup.sh b/3-post-setup.sh index 3d37714..9368a9f 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -14,6 +14,7 @@ echo -ne " Final Setup and Configurations GRUB EFI Bootloader Install & Check " +source /root/installscripthome.conf source $SCRIPTHOME/setup.conf if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} @@ -58,5 +59,10 @@ 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 /root/installscripthome.conf +rm -r /home/$username/$SCRIPTHOME +rm -r /home/$username/installscripthome.conf + # Replace in the same state cd $pwd diff --git a/archtitus.sh b/archtitus.sh index 59d562c..dfc5639 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -18,6 +18,7 @@ echo -ne " bash startup.sh source setup.conf bash 0-preinstall.sh + echo "SCRIPTHOME=$SCRIPTHOME" >> /mnt/root/installscripthome.conf arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh From a72da2d292fe39067510e4ae9cbc5f3f4eb99bf7 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 20:06:56 +0100 Subject: [PATCH 07/19] set scripthome manually --- 1-setup.sh | 3 +-- 2-user.sh | 2 +- 3-post-setup.sh | 4 +--- archtitus.sh | 7 +++---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 308f463..6c40300 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -9,9 +9,9 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer + SCRIPTHOME: $SCRIPTHOME ------------------------------------------------------------------------- " -source /root/installscripthome.conf source $SCRIPTHOME/setup.conf echo -ne " ------------------------------------------------------------------------- @@ -114,7 +114,6 @@ if [ $(whoami) = "root" ]; then # use chpasswd to enter $username:$password echo "$username:$password" | chpasswd cp -R /root/$SCRIPTHOME /home/$username/ - cp /root/installscripthome.conf /home/$username/installscripthome.conf chown -R $username: /home/$username/$SCRIPTHOME # enter $hostname to /etc/hostname echo $hostname > /etc/hostname diff --git a/2-user.sh b/2-user.sh index 57fd82c..14b62a2 100755 --- a/2-user.sh +++ b/2-user.sh @@ -9,12 +9,12 @@ 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 installscripthome.conf source $SCRIPTHOME/setup.conf cd ~ diff --git a/3-post-setup.sh b/3-post-setup.sh index 9368a9f..182de40 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -9,12 +9,12 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer + SCRIPTHOME: $SCRIPTHOME ------------------------------------------------------------------------- Final Setup and Configurations GRUB EFI Bootloader Install & Check " -source /root/installscripthome.conf source $SCRIPTHOME/setup.conf if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} @@ -60,9 +60,7 @@ sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /et sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers rm -r /root/$SCRIPTHOME -rm -r /root/installscripthome.conf rm -r /home/$username/$SCRIPTHOME -rm -r /home/$username/installscripthome.conf # Replace in the same state cd $pwd diff --git a/archtitus.sh b/archtitus.sh index dfc5639..3f748b9 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -18,10 +18,9 @@ echo -ne " bash startup.sh source setup.conf bash 0-preinstall.sh - echo "SCRIPTHOME=$SCRIPTHOME" >> /mnt/root/installscripthome.conf - arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh - 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 " ------------------------------------------------------------------------- From 8d82a0f39ad6e0b2d47a4569c1aeb7eeabb628dd Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 20:18:22 +0100 Subject: [PATCH 08/19] fix source --- 1-setup.sh | 2 +- 2-user.sh | 2 +- 3-post-setup.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 6c40300..f05f380 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -12,7 +12,7 @@ echo -ne " SCRIPTHOME: $SCRIPTHOME ------------------------------------------------------------------------- " -source $SCRIPTHOME/setup.conf +source /root/$SCRIPTHOME/setup.conf echo -ne " ------------------------------------------------------------------------- Network Setup diff --git a/2-user.sh b/2-user.sh index 14b62a2..417ef88 100755 --- a/2-user.sh +++ b/2-user.sh @@ -15,7 +15,7 @@ echo -ne " 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 +source ~/$SCRIPTHOME/setup.conf cd ~ git clone "https://aur.archlinux.org/yay.git" diff --git a/3-post-setup.sh b/3-post-setup.sh index 182de40..21b900f 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -15,7 +15,7 @@ echo -ne " Final Setup and Configurations GRUB EFI Bootloader Install & Check " -source $SCRIPTHOME/setup.conf +source /root/$SCRIPTHOME/setup.conf if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} fi From 4645abd790053d4c65ac712684e91507f582a986 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 22:35:42 +0100 Subject: [PATCH 09/19] absolute paths --- 1-setup.sh | 2 +- 2-user.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index f05f380..e6ca610 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -70,7 +70,7 @@ echo -ne " Installing Base System ------------------------------------------------------------------------- " -sudo pacman -S --noconfirm --needed - < /pkg-files/pacman-pkgs.txt +sudo pacman -S --noconfirm --needed - < /root/$SCRIPTHOME/pkg-files/pacman-pkgs.txt echo -ne " ------------------------------------------------------------------------- Installing Microcode diff --git a/2-user.sh b/2-user.sh index 417ef88..2e0a105 100755 --- a/2-user.sh +++ b/2-user.sh @@ -27,7 +27,7 @@ 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 -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/ From 763393367383e879c61a84d85e19568f5c5eb6a2 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 23:02:54 +0100 Subject: [PATCH 10/19] drivers for uhd gpu --- 1-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/1-setup.sh b/1-setup.sh index e6ca610..a07c492 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -102,7 +102,9 @@ if lspci | grep -E "NVIDIA|GeForce"; then elif lspci | grep -E "Radeon"; 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 + pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa --needed --noconfirm +elif lspci | grep -E "Intel Corporation UHD"; then + pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa --needed --noconfirm fi echo -ne " ------------------------------------------------------------------------- From 8cfb19e4e039a2881cbc0a02037f8debdc58accd Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 23:18:25 +0100 Subject: [PATCH 11/19] detect cpu --- 1-setup.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index a07c492..f2a3699 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -77,19 +77,16 @@ echo -ne " ------------------------------------------------------------------------- " # 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 +if lscpu | grep -E "GenuineIntel"; then + print "Installing Intel microcode" + pacman -S --noconfirm intel-ucode + proc_ucode=intel-ucode.img +elif lscpu | grep -E "AuthenticAMD"; then + print "Installing AMD microcode" + pacman -S --noconfirm amd-ucode + proc_ucode=amd-ucode.img +fi + echo -ne " ------------------------------------------------------------------------- Installing Graphics Drivers From 7884e19edb1f9c5a8f0e4b818e9f35a1581a1924 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 23:31:13 +0100 Subject: [PATCH 12/19] add group --- 1-setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index f2a3699..d78d3ae 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -78,11 +78,11 @@ echo -ne " " # determine processor type and install microcode if lscpu | grep -E "GenuineIntel"; then - print "Installing Intel microcode" + echo "Installing Intel microcode" pacman -S --noconfirm intel-ucode proc_ucode=intel-ucode.img elif lscpu | grep -E "AuthenticAMD"; then - print "Installing AMD microcode" + echo "Installing AMD microcode" pacman -S --noconfirm amd-ucode proc_ucode=amd-ucode.img fi @@ -109,6 +109,7 @@ 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 From 65e721a27de9ca4c83351f9c5c78524e675cd711 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 23:40:04 +0100 Subject: [PATCH 13/19] $HOME -> ~ --- 2-user.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/2-user.sh b/2-user.sh index 2e0a105..2c93677 100755 --- a/2-user.sh +++ b/2-user.sh @@ -19,20 +19,20 @@ 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 - < ~/$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 From 72e0d2c1f6f8dacf468626125b57daf0cbc5d474 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 23:52:52 +0100 Subject: [PATCH 14/19] test with confirm --- 1-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-setup.sh b/1-setup.sh index d78d3ae..cd77d37 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -70,7 +70,7 @@ echo -ne " Installing Base System ------------------------------------------------------------------------- " -sudo pacman -S --noconfirm --needed - < /root/$SCRIPTHOME/pkg-files/pacman-pkgs.txt +sudo pacman -S --needed - < /root/$SCRIPTHOME/pkg-files/pacman-pkgs.txt echo -ne " ------------------------------------------------------------------------- Installing Microcode From 3401c357fd5d06b0547df57be84228f6a83e60d1 Mon Sep 17 00:00:00 2001 From: fenris Date: Thu, 9 Dec 2021 23:56:59 +0100 Subject: [PATCH 15/19] Revert "test with confirm" This reverts commit 72e0d2c1f6f8dacf468626125b57daf0cbc5d474. --- 1-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-setup.sh b/1-setup.sh index cd77d37..d78d3ae 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -70,7 +70,7 @@ echo -ne " Installing Base System ------------------------------------------------------------------------- " -sudo pacman -S --needed - < /root/$SCRIPTHOME/pkg-files/pacman-pkgs.txt +sudo pacman -S --noconfirm --needed - < /root/$SCRIPTHOME/pkg-files/pacman-pkgs.txt echo -ne " ------------------------------------------------------------------------- Installing Microcode From d15cb30153032df3efecd81f615a2cc25c122b16 Mon Sep 17 00:00:00 2001 From: fenris Date: Fri, 10 Dec 2021 00:28:05 +0100 Subject: [PATCH 16/19] install packages one after another installing groups doesn't work otherwise --- 1-setup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/1-setup.sh b/1-setup.sh index d78d3ae..eae4d0d 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -70,7 +70,11 @@ echo -ne " Installing Base System ------------------------------------------------------------------------- " -sudo pacman -S --noconfirm --needed - < /root/$SCRIPTHOME/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 From 1c02677a68861bbdd5414438c75f90265396e7ad Mon Sep 17 00:00:00 2001 From: fenris Date: Fri, 10 Dec 2021 00:53:46 +0100 Subject: [PATCH 17/19] call lscpu and lspci only one time --- 1-setup.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index eae4d0d..d3db49b 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -81,11 +81,12 @@ echo -ne " ------------------------------------------------------------------------- " # determine processor type and install microcode -if lscpu | grep -E "GenuineIntel"; then +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 lscpu | grep -E "AuthenticAMD"; then +elif grep -E "AuthenticAMD" <<< ${proc_type}; then echo "Installing AMD microcode" pacman -S --noconfirm amd-ucode proc_ucode=amd-ucode.img @@ -97,14 +98,15 @@ echo -ne " ------------------------------------------------------------------------- " # 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 +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 lspci | grep -E "Intel Corporation UHD"; then +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 echo -ne " From 4d3f24061f852dd6d71b74febd7c2e50fc42a183 Mon Sep 17 00:00:00 2001 From: fenris Date: Fri, 10 Dec 2021 19:11:59 +0100 Subject: [PATCH 18/19] set kernel parameter for decryption --- 0-preinstall.sh | 4 ++++ 3-post-setup.sh | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/0-preinstall.sh b/0-preinstall.sh index ddc03c9..b2090ad 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -106,6 +106,8 @@ if [[ "${DISK}" == "nvme" ]]; then mkdir -p /mnt/{home,var,tmp,.snapshots} # mount subvolumes mountallsubvol +# store uuid of encrypted partition for grub + echo encryped_partition_uuid=$(blkid -s UUID -o value ${DISK}p3) >> setup.conf fi else if [[ "${FS}" == "btrfs" ]]; then @@ -130,6 +132,8 @@ else mkdir -p /mnt/{home,var,tmp,.snapshots} # mount subvolumes mountallsubvol +# store uuid of encrypted partition for grub + echo encryped_partition_uuid=$(blkid -s UUID -o value ${DISK}3) >> setup.conf fi fi # checking if user selected btrfs diff --git a/3-post-setup.sh b/3-post-setup.sh index 21b900f..207858d 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -19,6 +19,11 @@ 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 + grub-mkconfig -o /boot/grub/grub.cfg echo -ne " From fcc5af1125ec6f7503ed3d3cc04506c5605db14d Mon Sep 17 00:00:00 2001 From: fenris Date: Tue, 14 Dec 2021 17:09:06 +0100 Subject: [PATCH 19/19] removed duplication --- 0-preinstall.sh | 90 ++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/0-preinstall.sh b/0-preinstall.sh index b2090ad..de150c8 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -79,63 +79,45 @@ mountallsubvol () { mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots mount -o subvol=@var /dev/mapper/ROOT /mnt/var } + if [[ "${DISK}" == "nvme" ]]; then - if [[ "${FS}" == "btrfs" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" ${DISK}p2 - mkfs.btrfs -L ROOT ${DISK}p3 -f - mount -t btrfs ${DISK}p3 /mnt - elif [[ "${FS}" == "ext4" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" ${DISK}p2 - mkfs.ext4 -L ROOT ${DISK}p3 - mount -t ext4 ${DISK}p3 /mnt - elif [[ "${FS}" == "luks" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" ${DISK}p2 -# enter luks password to cryptsetup and format root partition - echo -n "${luks_password}" | cryptsetup -y -v luksFormat ${DISK}p3 - -# open luks container and ROOT will be place holder - echo -n "${luks_password}" | cryptsetup open ${DISK}p3 ROOT - -# now format that container - mkfs.btrfs -L ROOT /dev/mapper/ROOT -# create subvolumes for btrfs - mount -t btrfs /dev/mapper/ROOT /mnt - createsubvolumes - umount /mnt -# mount @ subvolume - mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/ROOT /mnt -# make directories home, .snapshots, var, tmp - mkdir -p /mnt/{home,var,tmp,.snapshots} -# mount subvolumes - mountallsubvol -# store uuid of encrypted partition for grub - echo encryped_partition_uuid=$(blkid -s UUID -o value ${DISK}p3) >> setup.conf - fi + partition2=${DISK}p2 + partition3=${DISK}p3 else - if [[ "${FS}" == "btrfs" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" ${DISK}2 - mkfs.btrfs -f -L ROOT ${DISK}3 - mount -t btrfs ${DISK}3 /mnt - elif [[ "${FS}" == "ext4" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" ${DISK}2 - mkfs.ext4 -L ROOT ${DISK}3 - mount -t ext4 ${DISK}3 /mnt - elif [[ "${FS}" == "luks" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" ${DISK}2 - echo -n "${luks_password}" | cryptsetup -y -v luksFormat ${DISK}3 - - echo -n "${luks_password}" | cryptsetup open ${DISK}3 ROOT - - mkfs.btrfs -L ROOT /dev/mapper/ROOT - mount -t btrfs /dev/mapper/ROOT /mnt - createsubvolumes - umount /mnt -# mount all the subvolumes - mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/ROOT /mnt -# make directories home, .snapshots, var, tmp - mkdir -p /mnt/{home,var,tmp,.snapshots} -# mount subvolumes - mountallsubvol -# store uuid of encrypted partition for grub - echo encryped_partition_uuid=$(blkid -s UUID -o value ${DISK}3) >> setup.conf - fi + partition2=${DISK}2 + partition3=${DISK}3 fi + +if [[ "${FS}" == "btrfs" ]]; then + mkfs.vfat -F32 -n "EFIBOOT" ${partition2} + mkfs.btrfs -L ROOT ${partition3} -f + mount -t btrfs ${partition3} /mnt +elif [[ "${FS}" == "ext4" ]]; then + mkfs.vfat -F32 -n "EFIBOOT" ${partition2} + mkfs.ext4 -L ROOT ${partition3} + mount -t ext4 ${partition3} /mnt +elif [[ "${FS}" == "luks" ]]; then + mkfs.vfat -F32 -n "EFIBOOT" ${partition2} +# enter luks password to cryptsetup and format root partition + echo -n "${luks_password}" | cryptsetup -y -v luksFormat ${partition3} - +# open luks container and ROOT will be place holder + echo -n "${luks_password}" | cryptsetup open ${partition3} ROOT - +# now format that container + mkfs.btrfs -L ROOT /dev/mapper/ROOT +# create subvolumes for btrfs + mount -t btrfs /dev/mapper/ROOT /mnt + createsubvolumes + umount /mnt +# mount @ subvolume + mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/ROOT /mnt +# make directories home, .snapshots, var, tmp + mkdir -p /mnt/{home,var,tmp,.snapshots} +# mount subvolumes + mountallsubvol +# store uuid of encrypted partition for grub + echo encryped_partition_uuid=$(blkid -s UUID -o value ${partition3}) >> setup.conf +fi + # checking if user selected btrfs if [[ ${FS} =~ "btrfs" ]]; then ls /mnt | xargs btrfs subvolume delete