I'm normally not compiling stuff from scratch but I need a driver for my nic (Aquantia AQC107).
I've Googled a lot about this and also compiled OpenWRT SDK etc but I still do not understand what I need to do. I thought I needed to get the OpenWRT running with the SDK/kernel headers present and then simply unpack the driver I downloaded and follow the instructions (make etc) but that didn't work.
What is the way to do this? All info I find seem to start in the middle of things or focus on how to compile OpenWRT with modules that already have src included.
I already have OpenWRT running on x86_64 hardware so I want to build a .ko file in a simple way.
I'm running Windows so I'm using Debian through VirtualBox.
So what is your suggestion?
Try to get in contact with the guy who are trying to submit it and ask him for a .ko file?
Try to understand how he does things, which is what I asked about to begin with?
Just wait until something happens and it might be integrated into a OpenWRT release?
I'm still not up to level on how to do this, in a general perspective.
I think I know what to do with the code in that pull-request but what about the actual source code from aquantia? I'm guessing that I need to put that somewhere as well.
Thanks for the info.
I got the .ipk packages by doing this:
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
mkdir ./package/kernel/aquantia
nano ./package/kernel/aquantia/Makefile
# add makefile text in file
./scripts/feeds update -a
./scripts/feeds install -a
git fetch --tags
git tag -l
git checkout v19.07.1
make menuconfig
# Set Target/subtarget etc
# Kernel modules > Network Devices
# kmod-aquantia
# kmod-atlantic
make
Got the following:
ls -al bin/targets/x86/64/packages/
...
855 Jun 19 05:22 kmod-aquantia_4.14.167+1.0-1_x86_64.ipk
25306 Jun 19 05:22 kmod-atlantic_4.14.167+1.0-1_x86_64.ipk
I installed the packages but got this warning:
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-aquantia:
* kernel (= 4.14.167-1-943b6d01b96513d59198249849327200)
* opkg_install_cmd: Cannot install package kmod-aquantia.
In my running OpenWRT system packages has either "4.14.167-1" or "4.14.167+4.19.98-1-1" but i got "4.14.167+1.0-1" ipk packages.
I was hoping for the best and force installed them anyway but it seems that the kmod isn't used for the device:
"03:00.0 0200" is the Aquantia Corp. AQC107, which says it's not using a kernel driver.
Because of the forced install might it be best to start over again and compile an image with everything in it and then install that into the router instead of only trying to compile the driver or at least update my router to the latest version and try again from there.
No, there is only atlantic.ko in /lib/modules/4.14.180/.
I wonder what went wrong in this and what the connection between aquantia and atlantic is?
Maybe something i missed in make menuconfig
You're doing something wrong. I finally got around to compile testing this. It creates both modules for me and both ipk packages contain the required module. You can see below from the output of my make target/linux/compile that it builds both modules
make[4]: Entering directory '/opt/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/linux-5.4.42'
scripts/kconfig/conf --syncconfig Kconfig
DESCEND objtool
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
GZIP kernel/config_data.gz
CC [M] kernel/configs.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_main.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_nic.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_pci_func.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_vec.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_ring.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.o
CC [M] drivers/net/phy/aquantia_main.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_ethtool.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.o
CC [M] drivers/net/ethernet/aquantia/atlantic/aq_filters.o
CC [M] drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.o
CC [M] drivers/net/phy/aquantia_hwmon.o
CC [M] drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.o
CC [M] drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.o
LD [M] drivers/net/phy/aquantia.o
CC [M] drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.o
CC [M] drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.o
LD [M] drivers/net/ethernet/aquantia/atlantic/atlantic.o
Building modules, stage 2.
MODPOST 107 modules
LD [M] kernel/configs.ko
CC [M] drivers/net/ethernet/aquantia/atlantic/atlantic.mod.o
CC [M] drivers/net/phy/aquantia.mod.o
LD [M] drivers/net/ethernet/aquantia/atlantic/atlantic.ko
LD [M] drivers/net/phy/aquantia.ko
make[4]: Leaving directory '/opt/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/linux-5.4.42'
and here's the find . listing of the package install folder
This Makefile is a little cleaner, but both the original one I posted and this one should work to produce two ipk files containing the relevant kernel modules.
include $(TOPDIR)/rules.mk
PKG_NAME:=kmod-aquantia
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/aquantia
SUBMENU:=Network Devices
TITLE:=aQuantia device support
DEPENDS:=@PCI_SUPPORT @TARGET_x86_64 +kmod-i2c-core +kmod-i2c-algo-bit +kmod-ptp +kmod-hwmon-core +LINUX_5_4:kmod-libphy
KCONFIG:=CONFIG_AQUANTIA_PHY
HIDDEN:=1
FILES:=$(LINUX_DIR)/drivers/net/phy/aquantia.ko
AUTOLOAD:=$(call AutoLoad,35,aquantia)
endef
define KernelPackage/aquantia/description
Kernel modules for aQuantia Ethernet adapters.
endef
define KernelPackage/atlantic
SUBMENU:=Network Devices
TITLE:=aQuantia AQtion(tm) Support
DEPENDS:=@PCI_SUPPORT @TARGET_x86_64 +kmod-i2c-core +kmod-i2c-algo-bit +kmod-ptp +kmod-aquantia
KCONFIG:=CONFIG_AQTION
FILES:=$(LINUX_DIR)/drivers/net/ethernet/aquantia/atlantic/atlantic.ko
AUTOLOAD:=$(call AutoLoad,35,atlantic)
endef
define KernelPackage/atlantic/description
Kernel modules for the aQuantia AQtion(tm) Ethernet card
endef
define Build/Compile
endef
$(eval $(call KernelPackage,aquantia))
$(eval $(call KernelPackage,atlantic))
I think try a make target/linux/clean before doing a make -j9 V=s