Compare commits

...

4 Commits

Author SHA1 Message Date
c99dc10b39 „amd-vendor-reset.plg“ ändern 2022-04-11 17:35:38 +02:00
5ab8fa3a6e „amd-vendor-reset.plg“ ändern 2022-04-11 17:29:02 +02:00
7ce92b4161 „amd-vendor-reset.plg“ ändern 2022-03-21 09:08:46 +01:00
fa4a632f46 „.github/FUNDING.yml“ hinzufügen 2021-08-27 23:28:21 +02:00
2 changed files with 60 additions and 1 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
github: ich777

View File

@ -2,7 +2,7 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "AMD-Vendor-Reset">
<!ENTITY author "ich777">
<!ENTITY version "2021.06.23">
<!ENTITY version "2022.04.11">
<!ENTITY gitURL "https://raw.githubusercontent.com/&author;/unraid-amd-vendor-reset/master">
<!ENTITY pluginURL "&gitURL;/amd-vendor-reset.plg">
<!ENTITY plugin "/boot/config/plugins/amd-vendor-reset">
@ -13,6 +13,12 @@
<CHANGES>
###2022.04.11
- Added Plugin Update Helper when up-/downgrading unRAID version
###2022.03.21
- Added change for reset_method for Kernel 5.15+
###2021.06.23
- Changed package download repo
@ -94,6 +100,46 @@ modprobe vendor_reset
#Check if AMD Vendor Reset is already downloaded
check
#Check if Plugin Update Helper is downloaded and up-to-date
if [ ! -f &plugin;/plugin_update_helper ]; then
wget -q -T 5 -O &plugin;/plugin_update_helper "https://raw.githubusercontent.com/ich777/unraid-plugin_update_helper/master/plugin_update_helper"
else
CUR_V="$(grep -E "Plugin-Update-Helper version:" &plugin;/plugin_update_helper | awk '{print $4}')"
if [ ! -s /tmp/update-helper ]; then
echo "$(wget -T5 -qO- https://raw.githubusercontent.com/ich777/unraid-plugin_update_helper/master/plugin_update_helper | grep -E "Plugin-Update-Helper version:" | awk '{print $4}')" > /tmp/update-helper
AVAIL_V="$(cat /tmp/update-helper)"
else
AVAIL_V="$(cat /tmp/update-helper)"
fi
if [ ! -z "$AVAIL_V" ]; then
COMPARE="$(sort -V &lt;(echo -e "${AVAIL_V}\n$CUR_V") | tail -1)"
if [ "$CUR_V" != "$COMPARE" ]; then
wget -q -T 5 -O &plugin;/plugin_update_helper "https://raw.githubusercontent.com/ich777/unraid-plugin_update_helper/master/plugin_update_helper"
fi
fi
fi
#Check if Plugin Update Helper is installed and up to date
if [ ! -f /usr/bin/plugin_update_helper ]; then
cp &plugin;/plugin_update_helper /usr/bin/plugin_update_helper
chmod +x /usr/bin/plugin_update_helper
else
PLUGIN_V="$(grep -E "Plugin-Update-Helper version:" &plugin;/plugin_update_helper | awk '{print $4}')"
INST_V="$(grep -E "Plugin-Update-Helper version:" /usr/bin/plugin_update_helper | awk '{print $4}')"
COMPARE="$(sort -V &lt;(echo -e "${PLUGIN_V}\n$INST_V") | tail -1)"
if [ "$INST_V" != "$COMPARE" ]; then
kill $(ps aux | grep -E "inotifywait -q /boot/changes.txt -e move_self,delete_self" | grep -v "grep -E inotifywait" | awk '{print $2}') 2>/dev/null
sleep 1
cp &plugin;/plugin_update_helper /usr/bin/plugin_update_helper
chmod +x /usr/bin/plugin_update_helper
fi
fi
#Start Plugin Update Helper
if [ -z "$(ps aux | grep -E "inotifywait -q /boot/changes.txt -e move_self,delete_self" | grep -v "grep -E inotifywait" | awk '{print $2}')" ]; then
echo "/usr/bin/plugin_update_helper" | at now &gt; /dev/null 2&gt;&amp;1
fi
if [ ! -z "$(lsmod | grep "vendor_reset")" ]; then
modprobe vendor_reset
echo
@ -108,6 +154,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' &gt; $(find /sys/bus/pci/devices/* -name "*$line")/reset_method
done &lt;&lt;&lt; "$(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