I have a Jetson AGX ORIN developer kit and I want to rebuild the kernel and root file system. I followed the “Kernel Customization” section in the DeveloperGuide and proceeded to the next step, which is building the kernel using the following command:
$ ./nvbuild.sh -o $PWD/kernel_out
However, searching through all of the source code. I did find a file named nvbuild.sh in Linux_for_Tegra/sources/tegra/optee-src/atf/ but when I tried to execute the command, it didn’t work.
Is there a more detailed tutorial on how to rebuild the kernel？
In terms of “rebuild the…root filesystem”, what are you actually changing? On the host PC most of the rootfs is generated verbatim from the host PC’s “Linux_for_Tegra/rootfs/” content. The kernel, device tree, and extlinux.conf are updated into that location first, and then a partition image is generated. The particular kernel/device tree/extlinux.conf depends on the chosen target board. If you were to flash on command line, then you would use a command something like this for a dev kit: sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1
The target always corresponds to a “.conf” file. For example, “jetson-agx-orin-devkit” is provided by “jetson-agx-orin-devkit.conf”. This is human-readable, and might include other human-readable files. Usually it is a symbolic link (alias) pointing at the same file which is named after the part number of the module and carrier board. You can copy those files to a new name, and edit to have your own custom flash target if you wish. From there you can find out what kernel and other content is copied into “rootfs/” before the image is generated. An example to flash on command line which also saves a log of the flash is this: sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1 2>&1 | tee log_flash.txt
If you flash and save a log, then you can go over that log to see which files are copied from where prior to the rootfs being generated.
Of course, I have been assuming that you want to know how to create a rootfs image based on some modification of “rootfs/”, and not generating an entirely new rootfs. If you want something like the latter, then you will probably need to state your use-case (there won’t be many people who have used alternate rootfs other than minor changes, but some have made more extensive changes and could possibly help).
Most of the rootfs is purely Ubuntu. You’d have to find Ubuntu instructions to build those parts from source. So far as the rest goes, including the parts of boot which are available as source, each will have its own documentation. Kernel and boot content are “bare metal”, and so they are easier procedure-wise, but perhaps require specific tools. All I can suggest is to look up the documentation for the specific release. Kernel cross compile is described well. You’ll probably end up having to make a separate topic for different parts, e.g., one thread for UEFI build, another one for building NVIDIA-provided software (e.g., multimedia, although the sample applications are in general the way to do this and they do get cross compiled on the host PC).