Building the NVIDIA Kernel

I’m following the reference manual to build the NVIDIA kernel, and when I execute "sudo make ARCH=arm64 CROSS_COMPILE=/home/yongle/plug-in/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- O=/home/yongle/software/kernel_TX2 -j2 “, I keep getting the error:

DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-as-0006-p2822-0000.dtb
make[2]: *** No rule to make target ‘arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/galen-industrial/kernel-dts/tegra194-p2888-0008-e3366-1199.dts’, needed by ‘arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen-industrial/kernel-dts/tegra194-p2888-0008-e3366-1199.dtb’. Stop.
make[2]: *** Waiting for unfinished jobs…
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-as-p3668-p2822-0000.dtb
CC drivers/base/firmware_class.o
arch/arm64/Makefile:154: recipe for target ‘dtbs’ failed
make[1]: *** [dtbs] Error 2
make[1]: *** Waiting for unfinished jobs…
LD drivers/base/built-in.o
DTC drivers/misc/mods/mods.dtb

Before this, the commands I have executed are as follows :
$ TEGRA_KERNEL_OUT=/home/yongle/software/kernel_TX2
$ export CROSS_COMPILE=/home/yongle/plug-in/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
$ export LOCALVERSION=-tegra
~/nvidia/nvidia_sdk/JetPack_4.6.1_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/sources/kernel/kernel-4.9$ mkdir -p $TEGRA_KERNEL_OUT
~/nvidia/nvidia_sdk/JetPack_4.6.1_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/sources/kernel/kernel-4.9$ make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig

I checked the t19x directory, there is no galen-industrial folder:
~/software/kernel_TX2/arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x$ ls
galen jakku

Looking forward to your reply, thanks !

Did you follow below document?

https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3261/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/kernel_custom.html#

Yes, it is done by referring to this document

Did you build it on TX2 or x86 host machine?
What’s the version to build.

I am a self-made TX2 development board, the USB cannot be used, and the USB device tree needs to be reconfigured; so build L4T-r32.6.1 on the host ubuntu18.04 ;

Personally, I feel that it is a Makefile problem, but I don’t know how to change it

Did you download the source from download center or sync by source_sync.sh?

I use sync by source_sync.sh

Remove the sudo from your command line.

How did you configure prior to building? If not configured, then failure is guaranteed.

Also, can you try building just Image? And if that works, the modules? Not naming a target is probably building things you don’t need. Example, rather than building everything:

# Image target:
make ARCH=arm64 CROSS_COMPILE=/home/yongle/plug-in/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- O=/home/yongle/software/kernel_TX2 -j2 Image

# modules target (works because building Image first propagated configuration):
make ARCH=arm64 CROSS_COMPILE=/home/yongle/plug-in/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- O=/home/yongle/software/kernel_TX2 -j2 modules

Also, since you used sudo, then your temporary output location should be completely erased before building again without sudo. This includes adding config back in prior to a non-sudo build.

Do you mean the .config file in the /home/yongle/software/kernel_TX2 folder?
Use the command uname -r to display 5.4.0-84-generic, so you need to set the following items in the .config file:
CONFIG_LOCALVERSION=“-generic”
CONFIG_CROSS_COMPILE=“/home/yongle/plug-in/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-”
Do I need to set anything else?

If sudo is not used, the error “Permission denied” is reported

Then you should enter supervisor mode to do all things. Like below

sudo su
export CROSS_COMPILE=/home/yongle/plug-in/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export LOCALVERSION=-tegra
make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j2

[quote="Yolomei, post:11, topic:208919"]
If sudo is not used, the error “Permission denied” is reported
[/quote]

Use administrator privileges as you said, the problem is still not solved;
I would like to ask, what do I need to configure before building the kernel

For me I just follow the document without problem for it.
What different with you is I don’t need sudo to make it. Maybe you can try to change those directories mode by chmod command to try. Or try resync the code at $HOME directory to try again.

I have no problem building Image and modules separately, but dtbs reports an error

make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j2 modules
make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j2 Image

Did you checkout by below command for r32.6.1?
On my source there’s no …/hardware/nvidia/platform/t19x/galen-industrial folder in my tree.

git tag –l tegra-l4t*

Yes, I don’t have this folder either, so don’t know where I’m going wrong;

linuxdev said that it needs to be configured first and then built, but I don’t know what to configure

Suppose below command for configure.

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig

Have grep the tegra194-p2888-0008-e3366-1199 in your sources if any like below to find the Makefile

snchen@snchen-HP:~/data/JEP/J4.6/JetPack_4.6_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/sources/hardware$ grep -ir tegra194-p2888-as-0006-p2822-0000 .
./nvidia/platform/t19x/galen/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_19x_SOC) += tegra194-p2888-as-0006-p2822-0000.dtb

I found that the Makefile compile path in the folder ”/home/yongle/nvidia/nvidia_sdk/JetPack_4.6.1_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/sources/hardware/nvidia/platform/t19x/galen-industrial-dts/kernel-dts“ is wrong;

After I changed “makefile-path := platform/t19x/galen-industrial/kernel-dts” to “makefile-path := platform/t19x/galen-industrial-dts/kernel-dts”, recompiled and passed;

Why is the Makefile wrong?

Suppose you may sync to wrong tag. The folder /home/yongle/nvidia/nvidia_sdk/JetPack_4.6.1_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/sources/hardware/nvidia/platform/t19x/galen-industrial-dts should not present for r32.6.1

Try to download the source from download center to confirm it.

In the source file I downloaded from the link https://developer.nvidia.com/embedded/dlc/r32-3-1_Release_v1.0/Sources/T186/public_sources.tbz2, there are only two folders (common galen) and I have five folders in the source file now (common galen galen-industrial-dts jakku mccoy),Are the extra folders generated later?

I only found the L4T32.3.1 version, can you provide links to other versions?