Building kernel modules for TX1

With the cross compiler environment required at the present time for kernel compile on the TX1 kernel modules can be frustrating to compile. However it is doable. First off the make files will most likely have a few uname -r statements in them This is to grab the major minor and distro information from the os. You will have to look in the makefile and for any of those statements you find enter the same command on the TX1 and hard code that into the makefile. This usually will get the module compiled but you can’t use the make install command since it needs to go into the rootfs folder in the Linux_for_Tegra folder that the JetPack makes. So you will have to read the install commands in the makefile and transpose those over to locations under the rootfs directory. Then when you flash the new kernel you made to go along with the kernel modules everything will be in the right places. Use this link to set up your kernel cross compile environment. You can cut and paste from this page and have a working kernel in no time. Just did this for a 4 port pcie serial card. The mknod’s were a little hard to dig up the info for. But if you do a search on devices.txt on google there is a complete listing of major and minor numbers for making nodes in /dev The chipset for this card was introduced into the kernel at 3.1 so just a little commenting out of a few lines was all that was required to get it supported with the kernel. Just make sure your ARCH variable is set for arm64. If you are doing anything with modules or drivers you will get an error about a build directory missing. The build directory is a soft link. So just go to the modules directory of the host system to find out where to point it for the cross compile. Actually there are two of them build and source.