【FreeBSD】安装 Aquantia AQtion 10G 网卡驱动

Posted by 西维蜀黍 on 2021-03-04, Last Modified on 2021-09-21

Knowledge

If the driver for the NIC is not present in GENERIC, but a driver is available, the driver will need to be loaded before the NIC can be configured and used. This may be accomplished in one of two ways:

  • The easiest way is to load a kernel module for the NIC using kldload(8). To also automatically load the driver at boot time, add the appropriate line to /boot/loader.conf. Not all NIC drivers are available as modules.
  • Alternatively, statically compile support for the NIC into a custom kernel. Refer to /usr/src/sys/conf/NOTES, /usr/src/sys/*arch*/conf/NOTES and the manual page of the driver to determine which line to add to the custom kernel configuration file. For more information about recompiling the kernel, refer to Chapter 8, Configuring the FreeBSD Kernel. If the NIC was detected at boot, the kernel does not need to be recompiled.

Aquantia AQtion 10G Ethernet Network Adapter with PCI-E 3.0 and RJ-45 (AQN-107)

Install from Port

cd /usr/ports/net/aquantia-atlantic-kmod/ && make install clean

Install from pkg

# pkg search aquantia
aquantia-atlantic-kmod-0.0.5 Aquantia AQtion (Atlantic) Network Driver (Development Preview)
# pkg install aquantia-atlantic-kmod-0.0.5

Install by Compilation

Within a jail that is running FreeBSD 12.2:

$ pkg install git
$ git clone https://github.com/Aquantia/aqtion-freebsd.git
$ cd aqtion-freebsd
$ make

That creates the if_atlantic.ko file that we need.

From the TrueNAS shell:

# Find where if_atlantic.ko is located
$ find / if_atlantic.ko | grep if_atlantic.ko
# Replace PATH_TO_JAIL to the correct one
$ cp [PATH_TO_JAIL]/if_atlantic.ko /boot/modules
$ cd /boot/modules
# Load the driver at once and you can see if it works
$ kldload ./if_atlantic.ko
# Load the driver every time the OS starts
$ echo 'if_atlantic_load="YES""' >> /boot/loader.conf

Reference