tl;dr: I’d like an easier way (or a better documented way) to activate thunderbolt devices via the GUI. I’m not asking for help with Thunderbolt support, but just an easier way to toggle the hardware on in the device tree. Problem and proposed solutions below.
EDIT: Even logged in as root via the shell, added udev rules don’t survive restart. So, forget everything I said about that below.
(Proposed feature request below the wall of text, I promise.)
I’ve got a TB3 NIC I’m using with my TrueNAS Scale Electric Eel box. It actually works fine, even though it’s an Aquantia. Turning it on is the problem.
By default, Linux does not authorize new TB devices, so they don’t receive a PCie lane allocation and don’t even show up in lspci
. This is a great way to think your device is broken if you’re not willing to do enough digging, but that’s not a TrueNAS issue.
Devices have to be manually authorized via udev
rules or a sysfsutils
config.
After some trial and error, I figured out that sysfsutils
is not installed in Electric Eel. That’s a shame, as it’s easier to use for non-Linux super nerds (or pro admins) and probably less dangerous than trying to learn udev
rules on the fly and screwing something up with the device rules that get enforced when your server boots.
I also figured out how to automatically authorize all Thunderbolt devices via udev
, and have that working now. But I had to have root access in the shell. That’s not ideal. Root access is dangerous.
I thought of a couple things that might make this sort of thing easier, with an addition to the Advanced Settings:
- Add
sysfsutils
to TrueNAS SCALE and expose a way to edit the config file in the GUI. It’s just a text file that lives in/etc/
. - Add a box, similar to the current
sysctl
interface, forudev
rules. Putting a warning on it similar to the debug kernel enabler would be a good idea, but it’d be very nice to be able to create and manage rules there. Each added rule would correspond to a separate rule text config file in therules.d
folder forudev
. Given thatudev
is needed to control certain settings of disks, USB devices, NICs, and Thunderbolt devices, this is probably the more broadly applicable tool to add to the GUI and would be what I’d suggest in a submitted feature request.
I’m guessing it’s also possible to brute force Thunderbolt activation via a “command” in the Init/Shutdown Scripts config box, in this case something like echo 1 > $deviceTreePathToTBDeviceAuthorizationFlag
, which would run at boot. For something like a disk or a NIC, though, a boot script would probably cause problems, as it’s not going to run as early as the udev
rule; that would lead to reliability issues.
EDIT @ Wednesday, December 25, 2024, 11:20 am US Central Time:
So, there’s a problem with just echoing a 1 into the device tree to authorize the device during init. If for any reason the device gets disconnected, it won’t still be authorized when it’s plugged back in. This isn’t great, and makes the init script option for a prodution system.
My motherboard doesn’t allow me to disable the DMA/Thunderbolt protection, so I’m stuck doing it at the kernel level.
We really need a way to set udev rules that will persist across reboots.
I’m going to try to make a feature request for this once JIRA will let me log in again.