Some basic trivia on kernels and their configuration might be of use.
Both modules (set with “=m
”) and integrated features (set with “=y
”) are part of the kernel. However, modules can be added as the kernel runs. If you have an existing kernel, which is what I’ll call only the “=y
” features, then it is easy enough to build a module which can plug in to that integrated feature set. Technically, in the configuration file, those are called symbols (it is part of the “kbuild” system).
If you plug in anything dynamically, then there is both an API and an ABI (application binary interface) which must be followed. If you are set to a given set of integrated features (“=y
” symbols), on the same source code, then you could say that the “shape” of the plugin remains constant and you can expect any module to be able to plug in. As soon as you change an “=y
” integrated feature all guarantees are gone so far as module components being interchangeable.
One of the symbols for a Linux kernel is “CONFIG_LOCALVERSION
”. When you run the Linux command “uname -r
”, this is a reply from the kernel. The prefix of the output is the kernel source version, and the suffix is the CONFIG_LOCALVERSION
. If you run “uname -r
”, and get the result “5.15.0-tegra
”, then the “5.15.0
” is the source version of the integrated kernel, and the “-tegra
” is the setting of CONFIG_LOCALVERSION
at the time of compile:
CONFIG_LOCALVERSION="-tegra"
This, in turn, is how a kernel can find modules to load. This is also how a single kernel version can have multiple boot entries if desired. If you run a kernel which replies to “uname -r
” as “5.15.0-tegra
”, then it will find its modules here:
/lib/modules/$(uname -r)/kernel
- …which is “
/lib/modules/5.15.0-tegra/kernel
”
Now if you’ve changed an integrated feature symbol, and you keep the “uname -r
” the same via constant “CONFIG_LOCALVERSION
”, then you might find your system won’t boot (or at least the modules for the original kernel will possibly fail). If you have a backup of the original kernel, and instead of the new kernel having the same “CONFIG_LOCALVERSION
”, for example “CONFIG_LOCALVERSION=-debug
”, then the original kernel can remain a working backup, and the new kernel will look here for its modules:
/lib/modules/5.15.0-debug/kernel
…and you can pick boot entries and choose either.
Because you are altering an integrated symbol which is invasive, it is almost certain the old modules won’t work correctly. You need to build with all configuration matching, except for your updates and maybe “CONFIG_LOCALVERSION=-coresight
” (notice I do have a hyphen). Then you might consider saving your original kernel Image
file and not altering it. Instead, add your new kernel as:
/boot/Image-coresight
Then install 100% of all kernel modules. These will end up at “/lib/modules/$(uname -r)/kernel
” (it is part of the modules_install
target).
If you then add a secondary boot entry which points at the -coresight
kernel, you get that in boot. If you still have an entry to the original Image
, then you also have that.
The above is just about kernels, and I can’t tell you the requirements for CoreSight. However, if you want to add the requirements in kernel features, then that’s where you start. Find the configuration of the default running kernel, configure your source to that. Make your modifications to the “=y
” of symbols. Set CONFIG_LOCALVERSION
to something like “-coresight
”. Install Image
as Image-coresight
. Install all modules (they will end up in the -coresight
subdirectory for modules). Set a new boot entry while leaving the original for rescue.
A huge complication: If you are using an initrd boot, e.g., with external media, then kernel install itself changes somewhat and you must work with the different procedures for that. The integrated kernel Image
is still on a /boot
somewhere, but any modules which are mandatory to loading the kernel and the filesystem have to exist in the initrd. Remember what I said about changing an integrated symbol probably causing old modules to invalidate load? It is possible for an initrd case that you would also have to put modules in a new initrd. The initrd itself can be named in a boot entry paired with the new kernel, and you only need this for boot stage, but it is possible adding the kernel also requires a second initrd.
EDIT: Forgot to mention, that step is just showing you how to tar a full new set of modules you’ve just built, copy it over to the Jetson, and untar it. Do a test run in an empty directory, see if it shows “/lib/modules/$(uname -r)
”, where the “uname -r
” is from the new kernel version and CONFIG_LOCALVERSION
.