From 70925e1feb5fc95701ecc04e8db573d35e2a6204 Mon Sep 17 00:00:00 2001 From: ich777 Date: Thu, 26 Nov 2020 22:35:53 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9Evendor-reset.plg=E2=80=9C=20hinzuf?= =?UTF-8?q?=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor-reset.plg | 119 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 vendor-reset.plg diff --git a/vendor-reset.plg b/vendor-reset.plg new file mode 100644 index 0000000..59529aa --- /dev/null +++ b/vendor-reset.plg @@ -0,0 +1,119 @@ + + + + + + + + + + +]> + + + + + +###2020.11.26 +- Initial release + + + + + +rm -f $(ls /boot/config/plugins/&name;/&name;*.txz 2>/dev/null|grep -v '&version;') + + + + +&gitURL;/packages/&name;-&version;.txz +&md5; + + + + +**AMD Vendor-Reset Patch** + +This package contains the Vendor-Reset module for Polaris and Vega10 cards by Adam Madsen & Geoffrey McRae. You can get more details here: https://github.com/gnif/vendor-reset + + + + + + +KERNEL_V="$(uname -r)" +PACKAGE="vendorreset" +DL_URL="https://github.com/ich777/unraid-plugins-repo/releases/download/$KERNEL_V" + +if [ ! -d "&plugin;/packages/${KERNEL_V%%-*}" ]; then + mkdir -p "&plugin;/packages/${KERNEL_V%%-*}" +fi + +#Check for old packages +rm -rf $(ls -d &plugin;/packages/* | grep -v "${KERNEL_V%%-*}") + +download() { +#Download vendor-reset +if wget -q -nc --show-progress --progress=bar:force:noscroll -O "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" "${DL_URL}/${PACKAGE}-1.txz" ; then + if [ "$(md5sum "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" | cut -d ' ' -f1)" != "$(wget -qO- "${DL_URL}/${PACKAGE}-1.txz.md5" | cut -d ' ' -f1)" ]; then + echo + echo "---CHECKSUM ERROR!---" + exit 1 + fi + echo + echo "---------------------Sucessfully downloaded vendor-reset----------------------" +else + echo + echo "-------------------------Can't download vendor-reset--------------------------" + exit 1 +fi +} + +check() { +if [ ! -f "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" ]; then + echo + echo "---------------------------Downloading vendor-reset---------------------------" + echo "----------This could take some time, please don't close this window!----------" + download +else + echo + echo "--------------------------vendor-reset found locally--------------------------" +fi +} + +install() { +#Install vendor-reset +/sbin/installpkg "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" +} + +#Check if vendor-reset is allready downloaded +check +install > /dev/null + +echo +echo "-------------------------Installation of vendor-reset-------------------------" +echo + + + + + + + +echo "----------------------------------------" +echo "-------Uninstalling vendor-reset--------" +echo "----------------------------------------" +# Remove plugin related files +removepkg &name;-&version; +rm -rf /usr/local/emhttp/plugins/&name; +rm -rf &plugin; +echo +echo "----------------------------------------------------------------------------" +echo "-----------vendor-reset uninstalled, please reboot your server!-------------" +echo "----------------------------------------------------------------------------" +echo + + + + \ No newline at end of file