From de7d147bdfb88ae1c4ef867e817a51f60ac7752e Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 6 Jan 2022 13:56:08 -0600 Subject: [PATCH 1/4] Update 1-setup.sh Added AMD GPU fix --- 1-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-setup.sh b/1-setup.sh index a0aacf6..42baf52 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -103,7 +103,7 @@ gpu_type=$(lspci) if grep -E "NVIDIA|GeForce" <<< ${gpu_type}; then pacman -S nvidia --noconfirm --needed nvidia-xconfig -elif grep -E "Radeon" <<< ${gpu_type}; then +elif lspci | grep 'VGA' | grep -E "Radeon|AMD"; then pacman -S xf86-video-amdgpu --noconfirm --needed 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 From 6bbf796984b534507152f0ec37e7f47f7865da95 Mon Sep 17 00:00:00 2001 From: fenris Date: Fri, 7 Jan 2022 17:55:45 +0100 Subject: [PATCH 2/4] removed duplication --- 0-preinstall.sh | 65 ++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/0-preinstall.sh b/0-preinstall.sh index 516edbd..d852b05 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -81,19 +81,25 @@ mountallsubvol () { } 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 -v luksFormat ${DISK}p3 - + partition2=${DISK}p2 + partition3=${DISK}p3 +else + 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 @@ -103,42 +109,13 @@ if [[ "${DISK}" =~ "nvme" ]]; then createsubvolumes umount /mnt # mount @ subvolume - - mount -o ${mountoptions},subvol=@ /dev/mapper/ROOT /mnt - + mount -o ${mountoptions},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 - - mountallsubvol - fi -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 -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 ${mountoptions},subvol=@ /dev/mapper/ROOT /mnt -# make directories home, .snapshots, var, tmp - mkdir -p /mnt/{home,var,tmp,.snapshots} -# mount subvolumes - mountallsubvol - fi - fi # checking if user selected btrfs From b75139876be42bdaf6c8e03614788fbe75ac4f67 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Sun, 9 Jan 2022 18:42:18 -0600 Subject: [PATCH 3/4] username fix --- 1-setup.sh | 2 +- 3-post-setup.sh | 2 +- archtitus.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 42baf52..14d5577 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -159,7 +159,7 @@ if [ $(whoami) = "root" ]; then groupadd libvirt useradd -m -G wheel,libvirt -s /bin/bash $USERNAME -# use chpasswd to enter $username:$password +# use chpasswd to enter $USERNAME:$password echo "$USERNAME:$PASSWORD" | chpasswd cp -R /root/ArchTitus /home/$USERNAME/ chown -R $USERNAME: /home/$USERNAME/ArchTitus diff --git a/3-post-setup.sh b/3-post-setup.sh index 9690617..1671f1c 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -80,7 +80,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/ArchTitus -rm -r /home/$username/ArchTitus +rm -r /home/$USERNAME/ArchTitus # Replace in the same state cd $pwd diff --git a/archtitus.sh b/archtitus.sh index adb1d2d..461a58e 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -20,7 +20,7 @@ echo -ne " source $SCRIPT_DIR/setup.conf bash 0-preinstall.sh arch-chroot /mnt /root/ArchTitus/1-setup.sh - 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 echo -ne " From 85d3760dc7ac02683612bcd37aac47feedb6220c Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 10 Jan 2022 21:46:42 -0600 Subject: [PATCH 4/4] Add log files for scripts --- archtitus.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/archtitus.sh b/archtitus.sh index 461a58e..e18bdd6 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -1,7 +1,6 @@ #!/bin/bash # Find the name of the folder the scripts are in - SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" echo -ne " ------------------------------------------------------------------------- @@ -16,12 +15,12 @@ echo -ne " ------------------------------------------------------------------------- Scripts are in directory named ArchTitus " - bash startup.sh + ( bash startup.sh )|& tee startup.log source $SCRIPT_DIR/setup.conf - bash 0-preinstall.sh - arch-chroot /mnt /root/ArchTitus/1-setup.sh - arch-chroot /mnt /usr/bin/runuser -u $USERNAME -- /home/$USERNAME/ArchTitus/2-user.sh - arch-chroot /mnt /root/ArchTitus/3-post-setup.sh + ( bash 0-preinstall.sh )|& tee 0-preinstall.log + ( arch-chroot /mnt /root/ArchTitus/1-setup.sh )|& tee 1-setup.log + ( arch-chroot /mnt /usr/bin/runuser -u $USERNAME -- /home/$USERNAME/ArchTitus/2-user.sh )|& tee 2-user.log + ( arch-chroot /mnt /root/ArchTitus/3-post-setup.sh )|& tee 3-post-setup.log echo -ne " -------------------------------------------------------------------------