Compare commits

...

5 Commits

6 changed files with 60 additions and 36 deletions

View File

@ -2,4 +2,4 @@
This is the repository for the AMD Vendor Reset plugin based on: https://github.com/gnif/vendor-reset
Support Thread: https://forums.unraid.net/topic/92865-support-ich777-nvidiadvbzfsiscsimft-kernel-helperbuilder-docker/
Support Thread: https://forums.unraid.net/topic/92865-support-ich777-nvidiadvbzfsiscsimft-kernel-helperbuilder-docker/

View File

@ -2,7 +2,7 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "AMD-Vendor-Reset">
<!ENTITY author "ich777">
<!ENTITY version "2021.05.25">
<!ENTITY version "2021.06.23">
<!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,9 @@
<CHANGES>
###2021.06.23
- Changed package download repo
###2021.05.25
- Initial release
@ -20,9 +23,9 @@
<FILE Name="&emhttp;/README.md">
<INLINE>
**AMD Vendor-Reset**
**AMD Vendor Reset**
This package contains the Vendor-Reset module for Polaris, Vega10/20 and Navi10/12/14 cards by Adam Madsen and Geoffrey McRae. You can get more details here: https://github.com/gnif/vendor-reset
This package contains the Vendor Reset module for Polaris, Vega10/20 and Navi10/12/14 cards by Adam Madsen and Geoffrey McRae. You can get more details here: https://github.com/gnif/vendor-reset
</INLINE>
</FILE>
@ -30,8 +33,8 @@ This package contains the Vendor-Reset module for Polaris, Vega10/20 and Navi10/
<INLINE>
KERNEL_V="$(uname -r)"
PACKAGE="gnif_vendor_reset"
DL_URL="https://github.com/ich777/unraid-plugins-repo/releases/download/$KERNEL_V"
PACKAGE="gnif_vendor_reset-plugin-${KERNEL_V}"
DL_URL="https://github.com/ich777/unraid-amd-vendor-reset/releases/download/$KERNEL_V"
#Wait for Network and timeout after 30 seconds
HOST="8.8.8.8"
@ -47,7 +50,7 @@ fi
rm -rf $(ls -d &plugin;/packages/* | grep -v "${KERNEL_V%%-*}")
if [ ! -f "&plugin;/AMD-Vendor-Reset.png" ]; then
wget -q -nc --show-progress --progress=bar:force:noscroll -O "&plugin;/AMD-Vendor-Reset.png" "https://raw.githubusercontent.com/ich777/docker-templates/master/ich777/images/gnif.png"
wget -q -nc --show-progress --progress=bar:force:noscroll -O "&plugin;/&name;.png" "https://raw.githubusercontent.com/ich777/docker-templates/master/ich777/images/gnif.png"
fi
download() {
@ -60,11 +63,11 @@ if wget -q -nc --show-progress --progress=bar:force:noscroll -O "&plugin;/packag
exit 1
fi
echo
echo "------------Successfully downloaded vendor-reset, please wait...!-------------"
echo "----------Successfully downloaded AMD Vendor Reset, please wait...!-----------"
else
echo
echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR-----"
echo "------------------------Can't download vendor-reset----------------------------"
echo "----------------------Can't download AMD Vendor Reset--------------------------"
exit 1
fi
}
@ -72,45 +75,45 @@ fi
check() {
if [ ! -f "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" ]; then
echo
echo "-------------------Downloading vendor-reset, please wait...!------------------"
echo "-----------------Downloading AMD Vendor Reset, please wait...!----------------"
echo "----------This could take some time, please don't close this window!----------"
download
else
echo
echo "-------------------------vendor-reset found locally!--------------------------"
echo "-----------------------AMD Vendor Reset found locally!------------------------"
fi
}
install() {
#Install vendor-reset
#Install AMD Vendor Reset
/sbin/installpkg "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz"
depmod -a
modprobe vendor_reset
}
#Check if vendor-reset is already downloaded
#Check if AMD Vendor Reset is already downloaded
check
if [ ! -z "$(lsmod | grep "vendor_reset")" ]; then
modprobe vendor_reset
echo
echo "--------------Nothing to do, vendor-reset is already installed!---------------"
echo "------------Nothing to do, AMD Vendor Reset is already installed!-------------"
echo
else
echo
echo "-------------------Installing vendor-reset, please wait...!-------------------"
echo "-----------------Installing AMD Vendor Reset, please wait...!-----------------"
install > /dev/null
echo
echo "------------------Installation of vendor-reset successful---------------------"
echo "----------------Installation of AMD Vendor Reset successful-------------------"
echo
fi
#Install icon
if [ ! -f "&emhttp;/images/AMD-Vendor-Reset.png" ]; then
if [ ! -f "&emhttp;/images/&name;.png" ]; then
if [ ! -d "&emhttp;/images" ]; then
mkdir -p &emhttp;/images
fi
cp &plugin;/AMD-Vendor-Reset.png &emhttp;/images/
cp &plugin;/&name;.png &emhttp;/images/
fi
</INLINE>
@ -120,14 +123,14 @@ fi
<INLINE>
echo "----------------------------------------"
echo "-------Uninstalling vendor-reset--------"
echo "-----Uninstalling AMD Vendor Reset------"
echo "----------------------------------------"
# Remove plugin related files
rm -rf &emhttp;
rm -rf &plugin;
echo
echo "----------------------------------------------------------------------------"
echo "-----------vendor-reset uninstalled, please reboot your server!-------------"
echo "---------AMD Vendor Reset uninstalled, please reboot your server!-----------"
echo "----------------------------------------------------------------------------"
echo

Binary file not shown.

View File

@ -1 +0,0 @@
13ca31a1b721079994bef697654b45c7 /tmp/vendor-reset_8186/vendor-reset-2020.11.26.txz

37
source/compile.sh Normal file
View File

@ -0,0 +1,37 @@
# Create necessary directories and clone repository
mkdir ${DATA_DIR}/vendor-reset
mkdir -p ${DATA_DIR}/vendor-reset/vendorreset/lib/modules/${UNAME}
cd ${DATA_DIR}/vendor-reset
git clone https://github.com/gnif/vendor-reset
cd ${DATA_DIR}/vendor-reset/vendor-reset
git checkout master
# Compile Kernel Module to temporary directory
make build -j${CPU_COUNT}
make INSTALL_MOD_PATH=/${DATA_DIR}/vendor-reset/vendorreset install -j${CPU_COUNT}
# Clean up temporary directory
cd ${DATA_DIR}/vendor-reset/vendorreset/lib/modules/${UNAME}/
rm ${DATA_DIR}/vendor-reset/vendorreset/lib/modules/${UNAME}/* 2>/dev/null
find . -depth -exec rmdir {} \; 2>/dev/null
# Create Slackware package
PLUGIN_NAME="gnif_vendor_reset"
BASE_DIR="${DATA_DIR}/vendor-reset/vendorreset"
TMP_DIR="/tmp/${PLUGIN_NAME}_"$(echo $RANDOM)""
VERSION="$(date +'%Y.%m.%d')"
mkdir -p $TMP_DIR/$VERSION
cd $TMP_DIR/$VERSION
cp -R $BASE_DIR/* $TMP_DIR/$VERSION/
mkdir $TMP_DIR/$VERSION/install
tee $TMP_DIR/$VERSION/install/slack-desc <<EOF
|-----handy-ruler------------------------------------------------------|
$PLUGIN_NAME: $PLUGIN_NAME
$PLUGIN_NAME: Source: https://github.com/gnif/vendor-reset
$PLUGIN_NAME:
$PLUGIN_NAME: Custom $PLUGIN_NAME for Unraid Kernel v${UNAME%%-*} by ich777
$PLUGIN_NAME:
EOF
${DATA_DIR}/bzroot-extracted-$UNAME/sbin/makepkg -l n -c n $TMP_DIR/$PLUGIN_NAME-plugin-$UNAME-1.txz
md5sum $TMP_DIR/$PLUGIN_NAME-plugin-$UNAME-1.txz | awk '{print $1}' > $TMP_DIR/$PLUGIN_NAME-plugin-$UNAME-1.txz.md5

View File

@ -1,15 +0,0 @@
#!/bin/bash
PLUGIN_NAME="vendor-reset"
BASE_DIR="/usr/local/emhttp/plugins"
TMP_DIR="/tmp/${PLUGIN_NAME}_"$(echo $RANDOM)""
VERSION="$(date +'%Y.%m.%d')"
mkdir -p $TMP_DIR/$VERSION
cd $TMP_DIR/$VERSION
cp --parents -R $BASE_DIR/$PLUGIN_NAME/ $TMP_DIR/$VERSION/
rm $TMP_DIR/$VERSION/$BASE_DIR/$PLUGIN_NAME/README.md
makepkg -l y -c y $TMP_DIR/$PLUGIN_NAME-$VERSION.txz
md5sum $TMP_DIR/$PLUGIN_NAME-$VERSION.txz > $TMP_DIR/$PLUGIN_NAME-$VERSION.txz.md5
rm -R $TMP_DIR/$VERSION/
#rm -R $TMP_DIR