diff --git a/amd-vendor-reset.plg b/amd-vendor-reset.plg index 1287678..ccf68ac 100644 --- a/amd-vendor-reset.plg +++ b/amd-vendor-reset.plg @@ -2,7 +2,7 @@ - + @@ -13,6 +13,9 @@ +###2022.03.21 +- Added change for reset_method for Kernel 5.15+ + ###2021.06.23 - Changed package download repo @@ -108,6 +111,18 @@ else echo fi +#Change reset_method for installed AMD VGA adapters for Kernel 5.15+ +#https://github.com/gnif/vendor-reset/issues/46#issuecomment-992282166 +TARGET_V="5.14.99" +COMPARE="$(uname -r | cut -d '-' -f1) +$TARGET_V" +if [ "$TARGET_V" != "$(echo "$COMPARE" | sort -V | tail -1)" ]; then + while read -r line + do + echo 'device_specific' > $(find /sys/bus/pci/devices/* -name "*$line")/reset_method + done <<< "$(lspci -nn | grep -E "VGA compatible controller|Display controller" | grep -E "AMD|ATI|Advanced Micro Devices" | awk '{print $1}')" +fi + #Install icon if [ ! -f "&emhttp;/images/&name;.png" ]; then if [ ! -d "&emhttp;/images" ]; then