I got Armbian 23.8.2 Bookworm with Linux 5.10.160-legacy-rk35xx successfully running on a couple of NanoPi R6S boxes. So far so good.
Now I would like to use Wifi dongles (USB sticks) that I have on these machines. They use the `ath9k_htc` kernel driver. I have used this successfully on ARM-based machines earlier.
However, Armbian does not provide this module. So I need to compile it myself (either obtain the exact sources that were used in the kernel I'm currently running, so I can recompile this single module or, perhaps more realistically, start a custom tree with the Armbian patches and config, from which I can rebuild on my own).
I'm familiar with Linux kernel compilation from the mainline kernel sources (and cross-compilation is no issue here since I can run the compilation on the ARM box itself), but not the way Armbian does it. So my question is: how do I obtain a copy of the sources (and config file!) that were used to compile the precise kernel that I installed?
I read on https://docs.armbian.com/Developer-Guide_Build-Preparation/ that one can regenerate the Armbian kernel by cloning https://github.com/armbian/build and then running something like this:
./compile.sh BRANCH=legacy BOARD=nanopi-r6s kernel
However there are a number of issues with this: first it requires root access which is something making me quite uneasy¹ (I just want to recompile a kernel), second it proceeds to the full build without letting me stop to examine the config, review the patches; third, I'm not even sure the parameters I passed are the exact right ones to recreate the kernel that's currently running on my system.
So, question: how can I produce an Armbian kernel tree for 5.10.160-legacy-rk35xx for the nanopi-r6s board with the patches and config that are running on my system, and then pause so I tweak the config and do whatever I feel necessary before starting the compilation? And if possible, in a way that does not require root access.
Many thanks in advance!
Footnote: 1. Just to be clear, my uneasiness is not about security issues per se (I'm running Armbian anyway, so of course I have to trust the Armbian devs), but once something starts running as root, there's no telling what it modifies where. For example, I just discovered it had written lots of junk in /root/.cache which has very little storage place, and I'd like to avoid this sort of problems.