I have a new Raspberry Pi 4 being used to replace an easily hacked Netgear device. I have it goign well with built-in GB and added USB3 Gig Ethernet. However I want to add a QNAP 5GBe USB dongle. The internals are made by Aquantia aqc111 and they have a linux driver source code available.
I am trying to make sense of the build-process, I can successfully build my own snapshot. However I can't figure out how to add the new driver in the kernel and actually add it to menuconfig. I understand I need a local feeds and a Makefile, but I can't figure out where to put those (not going to be a tar.gz and not downloaded, but local) and would love to see an example of an existing Makefile (the rtl8152 is already in the system so would be great)
The first questions I have are:
Where do I put the driver source and accompanying Makefile so that openwrt build process see it.
Where can I see existing Makefile for rtl8152
How do I make sure this all survives a git pull and/or make download
Notwithstanding that, I would love to understand where to put things and configure them. That's the info I am looking for. I want to a have a snapshot with my hardware built-in and not as modules, so it just starts.
Thank you for that info. I was already aware of it. As stated, I am working on Raspberry Pi4 with arch BCM2711 and that arch does not have the driver in it. I do have access to the source, their website has even a newer version. Just wanted to insert it into my particular build/arch .
I have a driver for widget and would like to know how to add it to menuconfig from OpenWRT. The documentation is not clear enough (for me) as to where and how. I am reasonably competent and have build kernels before , just not in the OpenWRT build toolchain. So the question is where should I put my widget source and Makefile AND where can I see the current Makefile for another widget
Instead of trying to expose a kernel module to the OpenWrt configuration, I would rather built the driver included in the kernel.
You can do it by running make kernel_menuconfig, and then enabling the driver as * (as opposed to m) to be built in the final image (i.e. not a module but part of the kernel itself).
The support in kernel is for x86 NOT for the arm arch. I even put a screenshot. It's not there and anyways that is irrelevant because:
I am asking how things are done in the buildsystem
If you don't know. You can say I don't know or ignore this message.
If you do know, just point me to the right place. My question is how does the build system work. It was pretty clearly laid out in the OP.
No Linux kernel drivers for USB are architecture dependent. In fact, the whole Linux USB subsystem is architecture independent. That's not your problem at all.
1.1 Even if it existed "only for x86", exposing it to the menuconfig and loading the module to a kernel running ARM kernel will cause it to inmediately crash. Guaranteed.
The driver indeed exist, but it was added recently. It doesn't exist in the current 4.19 (the latest available in OpenWrt master), therefore you will have to either backport or to update to a newer kernel.
Once backported, the module can be built into the kernel image. No need to edit or hack any build ssytem at all.
Don't be rude, dude. You have no idea what the hell are you doing. Be repectful and accept the help from people that knows better than you.
You can't expect to copy a C file into the kernel, expose it in the menuconfig and then building it without crashing the whole thing. That's why an specific project, the Linux Backports, exists.
Do yourself a favour and backport your driver. And I repeat: No Linux driver for USB is architecture dependet. And the AQC111 is not the exception. And I repeat: Even if the driver exists only for x86, you will need to port it to ARM. Exposing it in menuconfig will cause the kernel to crash when the module loads.
Considering that git is at the core of how Linux is developed and maintained and you don’t seem to even have a basic understanding of branches, you probably would also do well reading any of scores of tutorials on how Linux is configured and compiled.
My question was desperately trying to be clear, I am looking for info about the build toolchain, not a specific driver. I do not want to just put a c code somewhere and compile it. All I asked is where to put the source code and the OpenWRT Makefile on my local drive and the proper syntax for said Makefile. I appreciate your effort to answer me, but that's is not the question I keep asking.
The old documentation mentions 2 types of Makefiles , one for OpenWRT and one for kernel. Can't find documentation for that. They seem to require a download URL and a compression algorithm. And not quite sure about the compile macros. Kernel modules usually require a Makefile and a konfig file that is not the same syntax.
And forgive me for asking a stupid question , but aren't the 2 facts that USB drivers are architecture independent, and they should be (back)ported to ARM mutually contradictory? I have tried very hard to formulate this question without being offensive. forgive me if I failed. Just confusing.
Still the same answer: you need to backport it or to use an updated kernel.
Once you've done that, you don't need to do whatever you're asking for. You asked a question about a specific driver in the kernel and then tried to generalize.
There is no other way of doing it correctly. Also, backport is not a thing of architecture but a thing of kernel versions.
It's clear that you didn't ever bother to watch the link, but that's your problem.
It's not such a thing "backporting to ARM". You need to backport from the latest stable kernel (5.3) to the latest LTS (the one used by OpenWrt, 4.19).