Compare commits
No commits in common. "master" and "5.10.41-Unraid" have entirely different histories.
master
...
5.10.41-Un
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +0,0 @@
|
|||||||
github: ich777
|
|
@ -2,31 +2,17 @@
|
|||||||
<!DOCTYPE PLUGIN [
|
<!DOCTYPE PLUGIN [
|
||||||
<!ENTITY name "AMD-Vendor-Reset">
|
<!ENTITY name "AMD-Vendor-Reset">
|
||||||
<!ENTITY author "ich777">
|
<!ENTITY author "ich777">
|
||||||
<!ENTITY version "2022.07.21">
|
<!ENTITY version "2021.05.25">
|
||||||
<!ENTITY gitURL "https://git.lat/Flummi/unraid-amd-vendor-reset/raw/branch/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">
|
||||||
<!ENTITY emhttp "/usr/local/emhttp/plugins/AMD-Vendor-Reset">
|
<!ENTITY emhttp "/usr/local/emhttp/plugins/AMD-Vendor-Reset">
|
||||||
<!ENTITY packages "/boot/config/plugins/amd-vendor-reset/packages">
|
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="6.10.0-beta17">
|
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="6.10.0-beta17">
|
||||||
|
|
||||||
<CHANGES>
|
<CHANGES>
|
||||||
|
|
||||||
###2022.07.21
|
|
||||||
- Version detection from package via GitHub API
|
|
||||||
- Save md5 in packages directory
|
|
||||||
|
|
||||||
###2022.07.19
|
|
||||||
- Necessary changes for unRAID 6.11+
|
|
||||||
|
|
||||||
###2022.03.21
|
|
||||||
- Added change for reset_method for Kernel 5.15+
|
|
||||||
|
|
||||||
###2021.06.23
|
|
||||||
- Changed package download repo
|
|
||||||
|
|
||||||
###2021.05.25
|
###2021.05.25
|
||||||
- Initial release
|
- Initial release
|
||||||
|
|
||||||
@ -34,153 +20,97 @@
|
|||||||
|
|
||||||
<FILE Name="&emhttp;/README.md">
|
<FILE Name="&emhttp;/README.md">
|
||||||
<INLINE>
|
<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>
|
</INLINE>
|
||||||
</FILE>
|
</FILE>
|
||||||
|
|
||||||
<FILE Run="/bin/bash">
|
<FILE Run="/bin/bash">
|
||||||
<INLINE>
|
<INLINE>
|
||||||
|
|
||||||
|
KERNEL_V="$(uname -r)"
|
||||||
|
PACKAGE="gnif_vendor_reset"
|
||||||
|
DL_URL="https://github.com/ich777/unraid-plugins-repo/releases/download/$KERNEL_V"
|
||||||
|
|
||||||
|
#Wait for Network and timeout after 30 seconds
|
||||||
|
HOST="8.8.8.8"
|
||||||
|
for i in {1..10}; do
|
||||||
|
ping -c1 $HOST &> /dev/null && break;
|
||||||
|
done
|
||||||
|
|
||||||
|
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%%-*}")
|
||||||
|
|
||||||
|
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"
|
||||||
|
fi
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
#Download vendor-reset
|
#Download vendor-reset
|
||||||
if wget -q -nc --show-progress --progress=bar:force:noscroll -O "&packages;/${KERNEL_V%%-*}/${LAT_PACKAGE}" "${DL_URL}/${LAT_PACKAGE}" ; then
|
if wget -q -nc --show-progress --progress=bar:force:noscroll -O "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" "${DL_URL}/${PACKAGE}-1.txz" ; then
|
||||||
wget -q -nc --show-progress --progress=bar:force:noscroll -O "&packages;/${KERNEL_V%%-*}/${LAT_PACKAGE}.md5" "${DL_URL}/${LAT_PACKAGE}.md5"
|
if [ "$(md5sum "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" | cut -d ' ' -f1)" != "$(wget -qO- "${DL_URL}/${PACKAGE}-1.txz.md5" | cut -d ' ' -f1)" ]; then
|
||||||
if [ "$(md5sum &packages;/${KERNEL_V%%-*}/${LAT_PACKAGE} | awk '{print $1}')" != "$(cat &packages;/${KERNEL_V%%-*}/${LAT_PACKAGE}.md5 | awk '{print $1}')" ]; then
|
|
||||||
echo
|
echo
|
||||||
echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR------"
|
echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR------"
|
||||||
echo "--------------------------------CHECKSUM ERROR!---------------------------------"
|
echo "--------------------------------CHECKSUM ERROR!---------------------------------"
|
||||||
rm -rf &plugin; &emhttp;
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
echo "----------Successfully downloaded AMD Vendor Reset, please wait...!-----------"
|
echo "------------Successfully downloaded vendor-reset, please wait...!-------------"
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR-----"
|
echo "-----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR-----"
|
||||||
echo "----------------------Can't download AMD Vendor Reset--------------------------"
|
echo "------------------------Can't download vendor-reset----------------------------"
|
||||||
rm -rf &plugin; &emhttp;
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
if ! ls -1 &packages;/${KERNEL_V%%-*}/ | grep -q "${PACKAGE}" ; then
|
if [ ! -f "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz" ]; then
|
||||||
LAT_PACKAGE="$(wget -qO- https://api.github.com/repos/ich777/unraid-amd-vendor-reset/releases/tags/${KERNEL_V} | jq -r '.assets[].name' | grep "${PACKAGE}" | grep -E -v '\.md5$' | sort -V | tail -1)"
|
|
||||||
echo
|
echo
|
||||||
echo "-----------------Downloading AMD Vendor Reset, please wait...!----------------"
|
echo "-------------------Downloading vendor-reset, please wait...!------------------"
|
||||||
echo "----------This could take some time, please don't close this window!----------"
|
echo "----------This could take some time, please don't close this window!----------"
|
||||||
download
|
download
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "-----------------------AMD Vendor Reset found locally!------------------------"
|
echo "-------------------------vendor-reset found locally!--------------------------"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
# Install AMD Vendor Reset
|
#Install vendor-reset
|
||||||
/sbin/installpkg "&packages;/${KERNEL_V%%-*}/${PACKAGE}*.txz"
|
/sbin/installpkg "&plugin;/packages/${KERNEL_V%%-*}/${PACKAGE}-1.txz"
|
||||||
depmod -a
|
depmod -a
|
||||||
|
modprobe vendor_reset
|
||||||
}
|
}
|
||||||
|
|
||||||
activate() {
|
#Check if vendor-reset is already downloaded
|
||||||
# Modprobe AMD Vendor Reset
|
|
||||||
/sbin/modprobe vendor_reset
|
|
||||||
}
|
|
||||||
|
|
||||||
# Define Variables
|
|
||||||
KERNEL_V="$(uname -r)"
|
|
||||||
PACKAGE="gnif_vendor_reset"
|
|
||||||
DL_URL="https://github.com/ich777/unraid-amd-vendor-reset/releases/download/$KERNEL_V"
|
|
||||||
|
|
||||||
if [ ! -d "&packages;/${KERNEL_V%%-*}" ]; then
|
|
||||||
mkdir -p "&packages;/${KERNEL_V%%-*}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Check for old packages
|
|
||||||
rm -rf $(ls -d &packages;/* | grep -v "${KERNEL_V%%-*}")
|
|
||||||
|
|
||||||
if [ ! -f "&plugin;/AMD-Vendor-Reset.png" ]; then
|
|
||||||
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
|
|
||||||
|
|
||||||
#Check if AMD Vendor Reset is already downloaded
|
|
||||||
check
|
check
|
||||||
|
|
||||||
# Check if AMD Vendor Reset module is already installed
|
if [ ! -z "$(lsmod | grep "vendor_reset")" ]; then
|
||||||
if ! modinfo vendor_reset -0 >/dev/null 2>&1 ; then
|
modprobe vendor_reset
|
||||||
echo
|
echo
|
||||||
echo "-----------------Installing AMD Vendor Reset, please wait...!-----------------"
|
echo "--------------Nothing to do, vendor-reset is already installed!---------------"
|
||||||
install > /dev/null
|
|
||||||
activate
|
|
||||||
echo
|
|
||||||
echo "----------------Installation of AMD Vendor Reset successful-------------------"
|
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
activate
|
|
||||||
echo
|
echo
|
||||||
echo "----------------Installation of AMD Vendor Reset successful-------------------"
|
echo "-------------------Installing vendor-reset, please wait...!-------------------"
|
||||||
fi
|
install > /dev/null
|
||||||
|
echo
|
||||||
# Change reset_method for installed AMD VGA adapters for Kernel 5.15+
|
echo "------------------Installation of vendor-reset successful---------------------"
|
||||||
# https://github.com/gnif/vendor-reset/issues/46#issuecomment-992282166
|
echo
|
||||||
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
|
fi
|
||||||
|
|
||||||
#Install icon
|
#Install icon
|
||||||
if [ ! -f "&emhttp;/images/&name;.png" ]; then
|
if [ ! -f "&emhttp;/images/AMD-Vendor-Reset.png" ]; then
|
||||||
if [ ! -d "&emhttp;/images" ]; then
|
if [ ! -d "&emhttp;/images" ]; then
|
||||||
mkdir -p &emhttp;/images
|
mkdir -p &emhttp;/images
|
||||||
fi
|
fi
|
||||||
cp &plugin;/&name;.png &emhttp;/images/
|
cp &plugin;/AMD-Vendor-Reset.png &emhttp;/images/
|
||||||
fi
|
|
||||||
|
|
||||||
#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
|
fi
|
||||||
|
|
||||||
</INLINE>
|
</INLINE>
|
||||||
@ -190,14 +120,14 @@ fi
|
|||||||
<INLINE>
|
<INLINE>
|
||||||
|
|
||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
echo "-----Uninstalling AMD Vendor Reset------"
|
echo "-------Uninstalling vendor-reset--------"
|
||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
# Remove plugin related files
|
# Remove plugin related files
|
||||||
rm -rf &emhttp;
|
rm -rf &emhttp;
|
||||||
rm -rf &plugin;
|
rm -rf &plugin;
|
||||||
echo
|
echo
|
||||||
echo "----------------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------------"
|
||||||
echo "---------AMD Vendor Reset uninstalled, please reboot your server!-----------"
|
echo "-----------vendor-reset uninstalled, please reboot your server!-------------"
|
||||||
echo "----------------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------------"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
BIN
packages/vendor-reset-2020.11.26.txz
Normal file
BIN
packages/vendor-reset-2020.11.26.txz
Normal file
Binary file not shown.
1
packages/vendor-reset-2020.11.26.txz.md5
Normal file
1
packages/vendor-reset-2020.11.26.txz.md5
Normal file
@ -0,0 +1 @@
|
|||||||
|
13ca31a1b721079994bef697654b45c7 /tmp/vendor-reset_8186/vendor-reset-2020.11.26.txz
|
@ -1,37 +0,0 @@
|
|||||||
# 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://git.lat/Flummi/vendor-reset.git
|
|
||||||
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://git.lat/Flummi/vendor-reset.git
|
|
||||||
$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
|
|
15
source/makepkg.sh
Normal file
15
source/makepkg.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/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
|
Loading…
x
Reference in New Issue
Block a user