Add Override File support and default support for Coral TPu

This commit is contained in:
SimonFair
2023-10-11 19:16:01 +01:00
parent fee32792f9
commit 357171fec5

View File

@@ -756,6 +756,15 @@ private static $encoding = 'UTF-8';
$arrWhitelistGPUClassIDregex = '/^(0001|03)/';
$arrWhitelistAudioClassIDregex = '/^(0403)/';
# "System peripheral [0880]" "Global unichip corp. [1ac1]" "Coral Edge Tpu [089a]" -pff "Global unichip corp. [1ac1]" "Coral Edge Tpu [089a]"
# typeid productid
# file is csv typeid:productid
#
if (is_file("/boot/config/VMPCIOverride.cfg")) {
$arrWhiteListOverride = str_getcsv(file_get_contents("/boot/config/VMPCIOverride.cfg")) ;
}
$arrWhiteListOverride[] = "0880:089a" ;
$arrValidPCIDevices = [];
exec("lspci -m -nn 2>/dev/null", $arrAllPCIDevices);
@@ -770,6 +779,9 @@ private static $encoding = 'UTF-8';
$boolBlacklisted = true;
}
$overrideCheck = "${arrMatch['typeid']}:${arrMatch['productid']}" ;
if (in_array($overrideCheck,$arrWhiteListOverride) ) $boolBlacklisted = false;
$strClass = 'other';
if (preg_match($arrWhitelistGPUClassIDregex, $arrMatch['typeid'])) {
$strClass = 'vga';