Compare commits
3 Commits
5.15.13-Un
...
5.18.9-Unr
Author | SHA1 | Date | |
---|---|---|---|
c99dc10b39 | |||
5ab8fa3a6e | |||
7ce92b4161 |
@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE PLUGIN [
|
<!DOCTYPE PLUGIN [
|
||||||
<!ENTITY name "AMD-Vendor-Reset">
|
<!ENTITY name "AMD-Vendor-Reset">
|
||||||
<!ENTITY author "ich777">
|
<!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 gitURL "https://raw.githubusercontent.com/&author;/unraid-amd-vendor-reset/master">
|
||||||
<!ENTITY pluginURL "&gitURL;/amd-vendor-reset.plg">
|
<!ENTITY pluginURL "&gitURL;/amd-vendor-reset.plg">
|
||||||
<!ENTITY plugin "/boot/config/plugins/amd-vendor-reset">
|
<!ENTITY plugin "/boot/config/plugins/amd-vendor-reset">
|
||||||
@ -13,6 +13,12 @@
|
|||||||
|
|
||||||
<CHANGES>
|
<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
|
###2021.06.23
|
||||||
- Changed package download repo
|
- Changed package download repo
|
||||||
|
|
||||||
@ -94,6 +100,46 @@ modprobe vendor_reset
|
|||||||
#Check if AMD Vendor Reset is already downloaded
|
#Check if AMD Vendor Reset is already downloaded
|
||||||
check
|
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 <(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 <(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 > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z "$(lsmod | grep "vendor_reset")" ]; then
|
if [ ! -z "$(lsmod | grep "vendor_reset")" ]; then
|
||||||
modprobe vendor_reset
|
modprobe vendor_reset
|
||||||
echo
|
echo
|
||||||
@ -108,6 +154,18 @@ else
|
|||||||
echo
|
echo
|
||||||
fi
|
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
|
#Install icon
|
||||||
if [ ! -f "&emhttp;/images/&name;.png" ]; then
|
if [ ! -f "&emhttp;/images/&name;.png" ]; then
|
||||||
if [ ! -d "&emhttp;/images" ]; then
|
if [ ! -d "&emhttp;/images" ]; then
|
||||||
|
Reference in New Issue
Block a user