Flash image file problem

After I flashed the image file to customed tx2 nx board, in the directory
/lib/modules/4.9.201$ ls -lt

total 1204
drwxrwxr-x 8 hebin hebin   4096 6月  28 15:51 kernel
-rw-r--r-- 1 hebin hebin 373098 6月  28 15:51 modules.alias
-rw-r--r-- 1 hebin hebin 368668 6月  28 15:51 modules.alias.bin
-rw-r--r-- 1 hebin hebin  24559 6月  28 15:51 modules.builtin.bin
-rw-r--r-- 1 hebin hebin  52052 6月  28 15:51 modules.dep
-rw-r--r-- 1 hebin hebin  82835 6月  28 15:51 modules.dep.bin
-rw-r--r-- 1 hebin hebin    138 6月  28 15:51 modules.devname
-rw-r--r-- 1 hebin hebin     85 6月  28 15:51 modules.softdep
-rw-r--r-- 1 hebin hebin 108007 6月  28 15:51 modules.symbols
-rw-r--r-- 1 hebin hebin 132549 6月  28 15:51 modules.symbols.bin
lrwxrwxrwx 1 hebin hebin     95 6月  28 15:51 build -> /home/zhou/Documents/jetson32_5_1/public_sources/Linux_for_Tegra/source/public/kernel_src/build
-rw-rw-r-- 1 hebin hebin  21870 6月  28 15:51 modules.builtin
-rw-rw-r-- 1 hebin hebin  27662 6月  28 15:51 modules.order
lrwxrwxrwx 1 hebin hebin    107 6月  28 15:51 source -> /home/zhou/Documents/jetson32_5_1/public_sources/Linux_for_Tegra/source/public/kernel_src/kernel/kernel-4.9

/lib/modules/4.9.201/build and /lib/modules/4.9.201/source in the board point to the host PC, how to solve it?

You might be interested in some kernel configuration and build information. FYI, there are some minor differences between building on the Jetson itself (native) and cross compile. The native compile documentation is still correct, but you’d add some cross compile setup to this if cross compiling.

The official documents have cross compile information. Here is some extra information you might find of interest, and you can always ask more questions:

FYI, the Image is a file which can be installed to “/boot” or via flash to a partition. It depends on the extlinux.conf setup. Anything in the “/lib/modules” will be “modules”, which are part of the kernel, but they are dynamically loadable. Check any description in the above URLs regarding:

  • CONFIG_LOCALVERSION
  • uname -r
  • /lib/modules/$(uname -r)/kernel

You’ll find a theme of most of the kernel compile instructions emphasize using a clean source tree, and then using options to place intermediate output elsewhere. There is an extension to that intermediate output, and that is to install modules to an empty subdirectory (versus directly installing). When cross compiling you must install to that empty subdirectory; when natively compiling it is still a good idea.

How to realize native compilation in host PC?

On a host PC this is “cross compile” (this is what the official documents describe). It uses “cross tools”. The architecture of a host PC is amd64/x86_64, whereas the architecture of the Jetson is arm64/aarch64. The code which is produced has to be arm64/aarch64, but if the tool operates on amd64/x86_64, then the program itself must be altered. That’s what a cross tool does: Run on one architecture, but output for a different architecture.

Native compile means building output for the same architecture as that which is producing the code. Compiling on a Jetson would be native compile.

Once you put the tools in place on the host PC the procedure is much the same for building software (install is of course quite different). There are some additional steps needed to tell the kernel build (or other software build) to use the cross tools and to create code for the other architecture, but that’s usually pretty simple.

For terminology, the actual software being flashed when a Jetson is installed is “L4T”. This is “Linux for Tegra”, and is Ubuntu plus the NVIDIA drivers. You can find your L4T release via:
head -n 1 /etc/nv_tegra_release

You can find documentation, including “kernel customization” (which is about cross compile) with your specific L4T release. This includes a mention of what tools to install on the host PC for cross compile.

Do be sure to ask about software installation before doing what the official docs say. Those docs are for installing during flash, but you can usually install either kernels or modules without flashing the whole Jetson.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.