I am trying to toggle the gpio pin 22. I wrote a kernel driver for this and I wrote a makefile.While I try to build, I am facing the following error.
make ARCH=arm64 -C /lib/modules/5.10.104-tegra/build M=/home/mcw/xavier modules
make[1]: Entering directory ‘/usr/src/linux-headers-5.10.104-tegra-ubuntu20.04_aarch64/kernel-5.10’
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run ‘make oldconfig && make prepare’ on kernel src to fix it.
When I try to install headers, I get the following error
E: Unable to locate package linux-headers-5.10.104-tegra
E: Couldn’t find any package by glob ‘linux-headers-5.10.104-tegra’
E: Couldn’t find any package by regex ‘linux-headers-5.10.104-tegra’
Hi ilies,
Thanks for the immediate reply.
usr/src/linux-headers-5.10.104-tegra-ubuntu20.04_aarch64/kernel-5.10/
This is the path I am mentioning for the kernel directory, I think It might be correct.
uname -r → 5.10.104-tegra
Is my makefile is correct? Or what I need to do?
And sorry its not accessible to public.
If you need any further information on my process, please let me know I will tell.
Hi Hiker,
/usr/src/linux-headers-5.10.104-tegra-ubuntu20.04_aarch64/kernel-5.10# ls
arch .config drivers include Kbuild kernel-int-overlays.txt Makefile net security usr
block .config.old fs init Kconfig kernel-overlays.txt mm samples sound virt
certs crypto .gitignore ipc kernel lib Module.symvers scripts tools
See, in the above kernel directory , it has the .config file.
And when I try to run the “make oldconfig && make prepare”
in the kernel directory it throws error like,
make oldconfig
make: *** No rule to make target ‘oldconfig’. Stop.
Yes, I have visited this site.
But I have a doubt on that. Is that we need to follow all the steps below the preparing to build external kernel modules title?
It isn’t in general.
As I remember, I could find everything what I need on the NVIDIA’s Online jetson documents site, kernel build, kernel module build.
I recommend you following the guides from the bottom line.