How to update customized out-of-tree modules directly in the Jetson Orin Nano Dev. Kit

Hi there,

I am currently reading the documentation on Building the NVIDIA Out-of-Tree Modules for Kernel Customization and was wondering how to update the initramfs directly on the Jetson Orin Nano Developer Kit target.

I tried compiling the source code directly on the Jetson Orin Nano without setting the CROSS_COMPILE environment variable. However, the compilation failed, citing that the OpenSSL library was not found, even though openssl is installed.

  • OS: L4T 36.4
  • gcc/g++: version 12

Is there anything I might have overlooked?

Thanks in advance!

I don’t know about your specific case. My notes from yesterday are a mess, that last path on the page is for building dtbs. I did build the kernel and dtb, might have been some other stuff that is not in the notes.

Also assumed it was the bootlin toolchain that is approved since that is on the download list.


./kernel_src_build_env.sh


export CROSS_COMPILE=/home/fred/yocto/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-

$CROSS_COMPILE"gcc" --version


sudo make -C kernel ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE

export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src



export srctree=/home/fred/yocto/nvidia-orin/nvidia_sdk/JetPack_6.1_Linux_JETSON_ORIN_NANO_8GB_DEVKIT/Linux_for_Tegra/source/kernel
export objtree=$srctree
sudo make dtbs DTC=/usr/bin/dtc


export CROSS_COMPILE_AARCH64_PATH=/home/fred/yocto/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-

The paths have to be explicitly stated or it breaks. Lines after make kernel are for dtbs.

The result is

x86_64-binfmt-P: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

Cross-compilation is only necessary when using an x86-64 host computer to compile for an arm64 target.

The reason I’m asking this question is that I want to build and update the customized kernel, out-of-tree modules, and DTBs directly on the Jetson without flashing from the host OS. Flashing the entire OS is inconvenient and time-consuming for me.

I know how to directly update the customized kernel image and the DTBs, but I’m unsure about updating out-of-tree modules. I’m very interested in learning how to do that.

Okay, I am now on the same page as you.

make[1]: Leaving directory '/home/fred/orin-bsp/public_sources/Linux_for_Tegra/source/public/kernel_out'
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/treesource.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  HOSTCC  scripts/dtc/srcpos.o
  YACC    scripts/dtc/dtc-parser.tab.[ch]
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/checks.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/selinux/genheaders/genheaders
  HOSTCC  scripts/selinux/mdp/mdp
  HOSTCC  scripts/sign-file
/home/fred/orin-bsp/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or directory
   25 | #include <openssl/opensslv.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:95: scripts/sign-file] Error 1
make[2]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/extract-cert
/home/fred/orin-bsp/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
   21 | #include <openssl/bio.h>
      |          ^~~~~~~~~~~~~~~

This is even missing, however its not good to update the source after you start on a project.

$ ./source_sync.sh

Downloaded the exact file that is stated.

public_sources.tbz2

This will get you going, it is building as I am typing.
native build.

$ sudo apt install libssl-dev

Next, since they don’t have a “clean” with the script just restart it.

cd /home/fred/orin-bsp/public_sources/Linux_for_Tegra/source/public
./nvbuild.sh 

Update:

  LD [M]  sound/soc/tegra/snd-soc-tegra210-sfc.ko
  LD [M]  sound/tegra-safety-audio/safety-i2s.ko
Kernel sources compiled successfully.
fred@orin1:~/orin-bsp/public_sources/Linux_for_Tegra/source/public$ 

Hi foxsquirrel1,

Thank you for the information! This command resolved my issue.

I’m moving on to the next topic: update customized DTBs directly.

Thank you.

If you figure out how to get those 3 files from the pinmux spreadsheet to install/load please ping me and post. I have spent almost a week on this and it all runs into a dead end. All I get is use the pinmux spreadsheet, well then what…

Hi foxsquirrel1,

The pinmux spreadsheet is used to create DTSI files, and I know how to generate them. What I want to know is how to update the compiled DTB and DTBO files directly, without flashing from the host OS.

I have another thread running and one of the mods is live, maybe jump in on that.Where do those device tree files actually go that are from pinmux - #16 by foxsquirrel1

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