After applying the RT-patch solution - see here, I was trying to install an EtherCAT package without success.
The package is IgH-EtherCAT (EtherLAB), and it works fine on a clear install of JetPack 5.1.1 using SDK manager without RT-patch.
There is an old issue which I was not able to extract any clear actions from it, but it deals with the same problem.
After several attempts, it came down to installing the RT headers. My question is - how do I build the RT headers and get similar output to the ones extracted from “kernel_headers.tbz2” during “apply_binaries.sh” ?
In r3541, this issue can cause external kernel modules (such as the above-mentioned igh EtherCAT modules @shir1@Gorgo90) not to install at /lib/modules/5.10.120-rt70-tegra/ in rt kernel built by the official method and hence modprobe it failed. Because there is no matching kernel header file in /usr/src/ (only linux-headers-5.10.120-tegra-ubuntu20.04_aarch64/ exists). The linux-headers-5.10.120-rt70-tegra-ubuntu20.04_aarch64/ should exist. If I include linux-headers-5.10.120-tegra-ubuntu20.04_aarch64/ to build my external modules, it will install at /lib/modules/5.10.120-tegra/ instead of /lib/modules/5.10.120-rt70-tegra/.
In r3274, the rt kernel is installed by apt install. It will install the rt kernel headers. I think this version doesn’t have this issue. This is just based on my experience and has not been verified in practice.
In my opinion, the developer team should propose a method to install the rt kernel headers of r35xx. Then everything will be fine.
I hope the developer team can higher the priority of this issue and resolve it as soon as possible. I think it will cause all external kernel modules to be installed failed under the r35xx rt kernel.
Maybe the rt kernel headers could be built by the make-kpkg command, like:
Unfortunately, my attempt was unsuccessful on host computer. It may be that the cross_compile environment was not configured successfully, or there may be other reasons (L4T may don’t support this compiling manner).
Thank you.
I think cross-compiling should do it, but make-kpkg is deprecated, and for building Debian kernel packages, you should use make deb-pkg.
Assuming you are building natively on Jetson:
make ARCH=arm64 LOCALVERSION=“-tegra” -j<x> deb-pkg
My bad that I didn’t fully verify it.
I’m sure make deb-pkg is working, but the dtbs_install target in the Makefile is buggy, so you need to comment out some lines.
The the generated .deb file is good to go.
Please refer to /Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/package/builddeb and take out the following script:
if is_enabled CONFIG_OF_EARLY_FLATTREE; then
# Only some architectures with OF support have this target
if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then
$MAKE -f $srctree/Makefile INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install
fi
fi
Then dtbs_install should not be triggered with make deb-pkg.
I ran into the same issue with the kernel headers not being installed with RT but was able to get it installed and working by cross compiling on the host. Here are the steps I used