Jetson agx orin make kernel5.1.10

The kernel has to start with the correct configuration before building. In this case you’d have to start with a copy of the existing kernel’s configuration, and then use a dependency-aware configuration editor to add the driver you are interested in. The problem is extremely likely to be one of having a lot of conflicting configuration details. You must also be careful to correctly choose CONFIG_LOCALVERSION to avoid issues like module layout incompatibility.

This is a bit more detail around that topic (there is some repetition in this since it is a more general description of the topic):

Unlike most software you might compile the kernel is a large collection of separate programs (mostly drivers) that must work together, and yet the kernel source contains driver source for many things which won’t work together. Examples might be compiling for a driver that is architecture dependent when you are using a different architecture (e.g., it might contain assembler); or one driver which supersedes another driver and changes the API; plus drivers you simply cannot use, e.g., a 100Gb/s or faster fiber backbone NIC using a proprietary bus.

Of all of the above, the points to think about which are most relevant:

  • The build target tegra_defconfig is almost the exact configuration Jetsons ship with. The CONFIG_LOCALVERSION string would also have to be set to “-tegra” for this to be a shipping system’s configuration.
  • The running system produces a compressed copy of its configuration in this file, and except for CONFIG_LOCALVERSION, this would normally be the same as tegra_defconfig, but there are exceptions:
    (this isn’t a real file, it is a driver in RAM pretending to be a file, so you could copy it somewhere else and `gunzip it)
  • Many configuration items can be added as a module, which far simplifies installation and many details if and only if you have started with a fully matching configuration (including CONFIG_LOCALVERSION). Once you change anything integrated into the kernel itself (not module format) everything has to be installed.
  • You don’t have to remove the old kernel. You can create a second boot entry for backup. Your new entry could be the default first entry. Then you could pick the backup if things go wrong. This only matters if you’ve changed the main kernel Image; adding new modules is relatively low risk and won’t require a second boot entry. All of this can be done without flashing since the official docs revolve around changing the flash software with new content and then flashing.