From 8ef2be380494479af752c327a2352b132106753c Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 10:32:24 +0200 Subject: [PATCH 1/8] Fix regression error --- plugins/dynamix/include/DefaultPageLayout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php index d5b59d5c2..d27d63676 100644 --- a/plugins/dynamix/include/DefaultPageLayout.php +++ b/plugins/dynamix/include/DefaultPageLayout.php @@ -72,7 +72,7 @@ if ($themes2) { } $notes = '/var/tmp/unRAIDServer.txt'; if (!file_exists($notes)) file_put_contents($notes,shell_exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin changes $docroot/plugins/unRAIDServer/unRAIDServer.plg")); -$notes = " " +$notes = " " ?> From 97da37a4fcdb674bc7561b487ac8b8c5f469f722 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 11:17:47 +0200 Subject: [PATCH 2/8] Multi-language support --- plugins/dynamix/include/SysDevs.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/dynamix/include/SysDevs.php b/plugins/dynamix/include/SysDevs.php index 3dc7848db..1769e873d 100644 --- a/plugins/dynamix/include/SysDevs.php +++ b/plugins/dynamix/include/SysDevs.php @@ -11,6 +11,11 @@ */ ?> "; exec("lspci -v -s $pciaddress", $outputvfio); if (preg_grep("/vfio-pci/i", $outputvfio)) { - echo ""; + echo ""; $isbound = "true"; } echo ""; if ((strpos($line, 'Host bridge') === false) && (strpos($line, 'PCI bridge') === false)) { - if (file_exists('/sys/kernel/iommu_groups/'.$iommu.'/devices/0000:'.$pciaddress.'/reset')) echo ""; + if (file_exists('/sys/kernel/iommu_groups/'.$iommu.'/devices/0000:'.$pciaddress.'/reset')) echo ""; echo ""; - echo in_array($iommu, $iommuinuse) ? ' " : ">"; } else { echo ""; } echo 'This controller is bound to vfio, connected USB devices are not visible.'; + echo ''._('This controller is bound to vfio, connected USB devices are not visible').'.'; } else { exec('for usb_ctrl in $(find /sys/bus/usb/devices/usb* -maxdepth 0 -type l);do path="$(realpath "${usb_ctrl}")";if [[ $path == *'.$pciaddress.'* ]];then bus="$(cat "${usb_ctrl}/busnum")";lsusb -s $bus:|sort;fi;done',$getusb); foreach($getusb as $usbdevice) { @@ -103,7 +108,7 @@ case 't1': case (strpos($line, 'Mass storage controller') !== false): case (strpos($line, 'Non-Volatile memory controller') !== false): if ($isbound) { - echo 'This controller is bound to vfio, connected drives are not visible.'; + echo ''._('This controller is bound to vfio, connected drives are not visible').'.'; } else { exec('ls -al /sys/block/sd* | grep -i "'.$pciaddress.'"',$getsata); exec('ls -al /sys/block/hd* | grep -i "'.$pciaddress.'"',$getsata); @@ -125,7 +130,7 @@ case 't1': $append = false; } } - echo '
'; + echo '
'; } break; case 't2': From ba0e2955d9d5909465aefe1d89ee53b929ce43a7 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 12:10:26 +0200 Subject: [PATCH 3/8] Multi-language support --- plugins/dynamix/SysDevs.page | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/plugins/dynamix/SysDevs.page b/plugins/dynamix/SysDevs.page index f56b04d07..afe7a4d22 100644 --- a/plugins/dynamix/SysDevs.page +++ b/plugins/dynamix/SysDevs.page @@ -29,7 +29,7 @@ $(function(){ $('#t4').load('/webGui/include/SysDevs.php',{table:'t4'}); }); function applyCfg() { - var message = "System Devices: A reboot is required to apply changes"; + var message = "_(System Devices)_: _(A reboot is required to apply changes)_"; var string = "BIND="; var elements = document.getElementById("vfiopci").elements; for (var i = 0, element; element = elements[i++];) { @@ -44,10 +44,10 @@ function applyCfg() { .done(function(d) { if (d==1) { addRebootNotice(message); - document.getElementById("warning").innerHTML = "ALERT: Changes saved. Reboot to take effect."; + document.getElementById("warning").innerHTML = "ALERT: _(Changes saved)_. _(Reboot to take effect)_."; } else { removeRebootNotice(message); - document.getElementById("warning").innerHTML = "No changes."; + document.getElementById("warning").innerHTML = "_(No changes)_."; } }); } @@ -55,42 +55,30 @@ function applyCfg() { **PCI Devices and IOMMU Groups** -> This displays a list of IOMMU groups available on your system along with the output of the `lspci` command for each IOMMU group. The numeric identifiers are used to configure PCI pass-through. -> -> Devices you select will be bound to the vfio-pci driver at boot, which makes them available for assignment to a virtual machine, and also prevents the Linux kernel from automatically binding them to any present host driver. -> -> **Note that selecting a device will bind not only the specified device(s), but *all* other devices in the same IOMMU group as well.** -> ->   This symbol indicates the device is currently bound to the vfio-pci driver. -> ->     This symbol indicates the device supports FLR (Function Level Reset). -> ->   If a checkbox is greyed out it means the device is in use by Unraid and can not be passed through. +:sysdevs_iommu_groups_help: -

Warning: Your system has booted with the PCIe ACS Override setting enabled. The below list doesn't not reflect the way IOMMU would naturally group devices.
-To see natural IOMMU groups for your hardware, go to the VM Manager page and set the PCIe ACS override setting to Disabled.

+

_(Warning)_: _(Your system has booted with the PCIe ACS Override setting enabled)_. _(The below list doesn't not reflect the way IOMMU would naturally group devices)_.
+","")?>.


**CPU Thread Pairings** -> This displays a list of CPU thread pairings. +:sysdevs_thread_pairings_help:

**USB Devices** -> This displays the output of the `lsusb` command. The numeric identifiers are used to configure PCI pass-through. +:sysdevs_usb_devices_help:

**SCSI Devices** -> This displays the output of the `lsscsi` command. The numeric identifiers are used to configure PCI pass-through. -> -> Note that linux groups ATA, SATA and SAS devices with true SCSI devices. +:sysdevs_scsi_devices_help:
From c9661256f90896b419a760a80b081a07b6eac7d4 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 12:14:24 +0200 Subject: [PATCH 4/8] Update helptext.txt --- languages/en_US/helptext.txt | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/languages/en_US/helptext.txt b/languages/en_US/helptext.txt index 1ffe56893..6737705f4 100644 --- a/languages/en_US/helptext.txt +++ b/languages/en_US/helptext.txt @@ -2042,4 +2042,32 @@ IMPORTANT NOTE: If adjusting port mappings, do not modify the settings for the :docker_privileged_help: For containers that require the use of host-device access directly or need full exposure to host capabilities, this option will need to be selected. For more information, see this link: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities -:end \ No newline at end of file +:end + +:sysdevs_iommu_groups_help: +This displays a list of IOMMU groups available on your system along with the output of the `lspci` command for each IOMMU group. The numeric identifiers are used to configure PCI pass-through. + +Devices you select will be bound to the vfio-pci driver at boot, which makes them available for assignment to a virtual machine, and also prevents the Linux kernel from automatically binding them to any present host driver. + +**Note that selecting a device will bind not only the specified device(s), but *all* other devices in the same IOMMU group as well.** + +  This symbol indicates the device is currently bound to the vfio-pci driver. + +    This symbol indicates the device supports FLR (Function Level Reset). + +  If a checkbox is greyed out it means the device is in use by Unraid and can not be passed through. +:end + +:sysdevs_thread_pairings_help: +This displays a list of CPU thread pairings. +:end + +:sysdevs_usb_devices_help: +This displays the output of the `lsusb` command. The numeric identifiers are used to configure PCI pass-through. +:end + +:sysdevs_scsi_devices_help: +This displays the output of the `lsscsi` command. The numeric identifiers are used to configure PCI pass-through. + +Note that linux groups ATA, SATA and SAS devices with true SCSI devices. +:end From ea32069664d0269773bd7f5ab2de5193b74dec4f Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 12:22:45 +0200 Subject: [PATCH 5/8] Multi-language support --- plugins/dynamix/SysDevs.page | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/SysDevs.page b/plugins/dynamix/SysDevs.page index afe7a4d22..29ac65cfe 100644 --- a/plugins/dynamix/SysDevs.page +++ b/plugins/dynamix/SysDevs.page @@ -44,7 +44,7 @@ function applyCfg() { .done(function(d) { if (d==1) { addRebootNotice(message); - document.getElementById("warning").innerHTML = "ALERT: _(Changes saved)_. _(Reboot to take effect)_."; + document.getElementById("warning").innerHTML = "_(ALERT)_: _(Changes saved)_. _(Reboot to take effect)_."; } else { removeRebootNotice(message); document.getElementById("warning").innerHTML = "_(No changes)_."; From 444e14211400bc24337e0626d08281feec9b68d9 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 12:55:32 +0200 Subject: [PATCH 6/8] Multi-language support --- plugins/dynamix/SysDevs.page | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/dynamix/SysDevs.page b/plugins/dynamix/SysDevs.page index 29ac65cfe..720a4aed6 100644 --- a/plugins/dynamix/SysDevs.page +++ b/plugins/dynamix/SysDevs.page @@ -53,7 +53,7 @@ function applyCfg() { } -**PCI Devices and IOMMU Groups** +**_(PCI Devices and IOMMU Groups)_** :sysdevs_iommu_groups_help: @@ -64,19 +64,19 @@ function applyCfg() {

-**CPU Thread Pairings** +**_(CPU Thread Pairings)_** :sysdevs_thread_pairings_help:

-**USB Devices** +**_(USB Devices)_** :sysdevs_usb_devices_help:

-**SCSI Devices** +**_(SCSI Devices)_** :sysdevs_scsi_devices_help: From 8e12830273cce097c6f7338d6ecccc3c6137ea77 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 13:06:59 +0200 Subject: [PATCH 7/8] Update helptext.txt --- languages/en_US/helptext.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/languages/en_US/helptext.txt b/languages/en_US/helptext.txt index 6737705f4..1515cf2e8 100644 --- a/languages/en_US/helptext.txt +++ b/languages/en_US/helptext.txt @@ -2044,6 +2044,7 @@ For containers that require the use of host-device access directly or need full For more information, see this link: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities :end +; sysdevs help - added May 18, 2020 :sysdevs_iommu_groups_help: This displays a list of IOMMU groups available on your system along with the output of the `lspci` command for each IOMMU group. The numeric identifiers are used to configure PCI pass-through. From ef28429833567b6b68323ce583fb1c35cbef4356 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 18 May 2020 13:45:40 +0200 Subject: [PATCH 8/8] Multi-language support --- plugins/dynamix/SysDevs.page | 2 +- plugins/dynamix/include/Helpers.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/dynamix/SysDevs.page b/plugins/dynamix/SysDevs.page index 720a4aed6..016d66943 100644 --- a/plugins/dynamix/SysDevs.page +++ b/plugins/dynamix/SysDevs.page @@ -59,7 +59,7 @@ function applyCfg() {

_(Warning)_: _(Your system has booted with the PCIe ACS Override setting enabled)_. _(The below list doesn't not reflect the way IOMMU would naturally group devices)_.
-","")?>.

+.


diff --git a/plugins/dynamix/include/Helpers.php b/plugins/dynamix/include/Helpers.php index 72b6e7543..5482f07a5 100644 --- a/plugins/dynamix/include/Helpers.php +++ b/plugins/dynamix/include/Helpers.php @@ -59,6 +59,9 @@ function my_disk($name,$raw=false) { function my_disks($disk) { return strpos($disk['status'],'_NP')===false; } +function my_hyperlink($text,$link) { + return str_replace(['[',']'],["",""],$text); +} function prefix($key) { return preg_replace('/\d+$/','',$key); }