From 7a69886935e967a4d97251d9f9b2830c87d99361 Mon Sep 17 00:00:00 2001 From: natemaia Date: Thu, 17 Oct 2019 20:57:47 -0700 Subject: [PATCH] Add tearfree configs for both amd and intel gpus --- archlabs-installer | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/archlabs-installer b/archlabs-installer index 9b8a0bf..56dee67 100755 --- a/archlabs-installer +++ b/archlabs-installer @@ -224,23 +224,20 @@ select_boot() select_show() { local pkgs="${USER_PKGS// / } ${PACKAGES// / }" - [[ $BOOT_PART ]] && local mnt="/$BOOTDIR" [[ $INSTALL_WMS == *dwm* ]] && pkgs="dwm st dmenu $pkgs" pkgs="${pkgs// / }" pkgs="${pkgs# }" msg "Show Configuration" " ---------- PARTITION CONFIGURATION ------------ - Root: ${ROOT_PART:-none} - Boot: ${BOOT_PART:-${BOOT_DEV:-none}} - Mount: ${mnt:-none} - Swap: ${SWAP_PART:-none} - Size: ${SWAP_SIZE:-none} - Extra: ${EXMNTS:-${EXMNT:-none}} - Hooks: ${HOOKS:-none} - - LVM: ${LVM:-none} - LUKS: ${LUKS:-none} + Root Part: $ROOT_PART + Boot Part: ${BOOT_PART:-${BOOT_DEV:-none}} + Swap Part/File: ${SWAP_PART:-none} + Swap Size: ${SWAP_SIZE:-none} + Extra Mounts: ${EXMNTS:-${EXMNT:-none}} + Mkinit Hooks: ${HOOKS:-none} + LVM used: ${LVM:-none} + LUKS used: ${LUKS:-none} ------------ SYSTEM CONFIGURATION ------------- @@ -249,7 +246,6 @@ select_show() Hostname: ${MYHOST:-none} Timezone: ${ZONE:-none}/${SUBZ:-none} - ------------ USER CONFIGURATION --------------- Username: ${NEWUSER:-none} @@ -258,7 +254,6 @@ select_show() Autologin: ${AUTOLOGIN:-none} Login Type: ${LOGIN_TYPE:-none} - ----------- PACKAGE CONFIGURATION ------------- Kernel: ${KERNEL:-none} @@ -810,7 +805,7 @@ part_format() mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part" >/dev/null 2>$ERR errshow "mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part"" || return 1 FORMATTED+="$part " - sleep "${delay:-0}" + sleep $delay } part_device() @@ -1029,7 +1024,7 @@ select_filesystem() [[ $fs == 'skip' ]] && return 0 yesno "Filesystem" "\nFormat $part as $fs?\n" || fs='' done - part_format "$part" "$fs" + part_format "$part" "$fs" 0 } select_efi_partition() @@ -1240,7 +1235,7 @@ install_base() if [[ $VM ]]; then find $MNT/etc/X11/xorg.conf.d/ -name '*.conf' -delete elif lspci | grep ' VGA ' | grep -q 'Intel'; then - echo "Creating Intel VGA Tear Free config /etc/X11/xorg.conf.d/20-intel.conf" + echo "Creating Intel Tear Free config /etc/X11/xorg.conf.d/20-intel.conf" cat > $MNT/etc/X11/xorg.conf.d/20-intel.conf <<- EOF Section "Device" Identifier "Intel Graphics" @@ -1248,6 +1243,24 @@ install_base() Option "TearFree" "true" EndSection EOF + elif lspci | grep ' VGA ' | grep -q 'AMD/ATI.*RX'; then # newer RX cards can use the amdgpu driver + echo "Creating AMD Tear Free config /etc/X11/xorg.conf.d/20-amdgpu.conf" + cat > $MNT/etc/X11/xorg.conf.d/20-amdgpu.conf <<- EOF + Section "Device" + Identifier "AMD Graphics" + Driver "amdgpu" + Option "TearFree" "true" + EndSection + EOF + elif lspci | grep ' VGA ' | grep -q 'AMD/ATI.*HD [2-6][0-9]*'; then # older HD 2xxx-6xxx cards must use the radeon driver + echo "Creating Radeon Tear Free config /etc/X11/xorg.conf.d/20-radeon.conf" + cat > $MNT/etc/X11/xorg.conf.d/20-radeon.conf <<- EOF + Section "Device" + Identifier "AMD Graphics" + Driver "radeon" + Option "TearFree" "on" + EndSection + EOF fi [[ -e /run/archiso/sfs/airootfs ]] && cp -vf $RUN/x86_64/vmlinuz $MNT/boot/vmlinuz-linux