error when compiling kernel src

I’m trying to recompile the Linux kernel for jetson nano, the step is :

  1. Download and unzip <Jetson-Nano-Tegra210_Linux_R32.1.0_aarch64.tbz2>

  2. excute:
    ./source_sync.sh
    to check code from git repo.

  3. Check out a tag :
    git checkout tegra-l4t-r32.1

  4. Compile Linux kernel:
    make -j6 ARCH=arm64 CROSS_COMPILE=$CROSS-COMPILE-PREFIX-DIR/gcc-linaro-6.4.1-2017.08-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- tegra_defconfig

But, It throws out an error:
drivers/net/ethernet/nvidia/Kconfig:30: can’t open file “drivers/net/ethernet/nvidia/eqos/Kconfig”
scripts/kconfig/Makefile:113: recipe for target ‘tegra_defconfig’ failed
make[1]: *** [tegra_defconfig] Error 1
Makefile:565: recipe for target ‘tegra_defconfig’ failed
make: *** [tegra_defconfig] Error 2

For solving this problem, I tried :

  1. switch to another tag.
  2. copy the <tegra_defconfig> to src tree root dir, rename it to .config.
  3. try to compile with the instruction below:
    make -j6 ARCH=arm64 O=make_result CROSS_COMPILE=$CROSS-COMPILE-PREFIX-DIR/gcc-linaro-6.4.1-2017.08-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- tegra_defconfig

But, they all didn’t work.

And, according to the error message, I can’t find drivers/net/ethernet/nvidia/eqos/Kconfig indeed.

Is there anyone offer some help? thx a loooooooooooooot.!

Could you share what you’ve downloaded from source_sync.sh? C

emmmmmm…

In fact, I don’t know much detail about source_sync.sh, and I just execute this script.

After executed, there are a bunch of files generated in Linux_for_Tegra/sources, it contains :

  1. hardware

  2. kernel

  3. u-boot

I thought that the <$PREFIX/Linux_for_Tegra/sources/kernel/kernel-4.9/*> is the kernel src.

and I checkout the tag : <tegra-l4t-r32.1>

then compile the kernel src with :

make -j6 ARCH=arm64 CROSS_COMPILE=$CROSS-COMPILE-PREFIX-DIR/gcc-linaro-6.4.1-2017.08-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- tegra_defconfig

Suggestion: source_sync.sh should default to the latest release.

But…the question remains…which command line arguments were used with source_sync.sh? Different release versions can be specified.

Yes, this confused me as I’m not sure why anybody would ever want to do that, but I assume somebody needs the feature.

There should be a folder named “nvidia” under “kernel” and Kconfig path should be under it.
Could you check if you have that file…?

Thanks for all your replies!!!

There is a “nvidia” folder under “kernel” indeed.

I Check out it to tag : tegra-l4t-r32.1.update-1(The same to kernel)

So I can start configuring the kernel with the directive below:

make -j6 ARCH=arm64 CROSS_COMPILE=$PREFIX/gcc-linaro-6.4.1-2017.08-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- tegra_defconfig

Then, I try to compile kernel source with the directive below:

make -j6 ARCH=arm64 CROSS_COMPILE=$PREFIX/gcc-linaro-6.4.1-2017.08-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

another problem occurred:

cp -u arch/arm64/boot/dts/
cp: missing destination file operand after ‘arch/arm64/boot/dts/’
Try ‘cp --help’ for more information.
arch/arm64/boot/dts/Makefile:136: recipe for target ‘dtbs’ failed
make[1]: *** [dtbs] Error 1
arch/arm64/Makefile:154: recipe for target ‘dtbs’ failed
make: *** [dtbs] Error 2

I’m a novice of the linux kernel, for now, I can not figure out what does the kbuild system works.(I’m trying to work on it, But, it will take me a lot of time. This problem is urgent.)

So, I hope to get your reply.

Thx.

Looking at this (which I recognize as being inside the kernel source tree):

cp -u arch/arm64/boot/dts/
cp: missing destination file operand after 'arch/arm64/boot/dts/'

The file copy command requires naming a file to copy to the destination. Example:

cp -u arch/arm64/boot/dts/SomeInterestingDeviceTree.dtb /where/ever/it/is/Linux_for_Tegra/kernel/dtb/

Most basic form:

cp <startfile> <new location>

I don’t know which particular file name, and you could copy everything, but it is better to find the correct file and copy just that. You might even want to first save a backup of the original unmodified file for reference. Your original comand is to copy an entire directory, which probably isn’t what you want.

See “man cp”.

I did what linuxdev suggested. Something like:

mv $L4T_HOME/kernel/dtb $L4T_HOME/kernel/dtb.bak
cp -r $KERNEL_OUT_PATH/.../boot/dts $L4T_HOME/kernel/dtb

cp --help will give you usage on cp. Unfortunately cp has no manpage but online documentation is available here.

The option you are probably most interested in is -R / -r which recursively copies all the contents of the folder and all it’s subfolders and so on.

The man page from the PC host will work as well, but I forgot about the missing man pages on the Jetson. There is a way to restore man pages on the Jetson:

<b>sudo</b> /usr/local/sbin/<b>unminimize</b>

(You don’t need the full path, but I included it for information)

You might need to use “–fix-missing” during unminimize:
https://devtalk.nvidia.com/default/topic/1052585/jetson-nano/where-are-the-man-pages-/post/5343563/#5343563

If you want to restore man pages to specific packages:
https://devtalk.nvidia.com/default/topic/1039546/jetson-agx-xavier/tip-man-pages-and-docs-on-xaviers-r31-0-1-l4t-ubuntu-18-04-/

Neat. It appears cp has a manpage, just not on Nano. Yay surprises.

Suggestion to Nvidia: don’t exclude the manpages especially since the board is targeted towards people who may be new to *nix.

There is no useful feedback when a manpage isn’t found as to why. Some work while others don’t, as linuxdev notes. It’s unexpected behavior when one is expecting stock Ubuntu.