Error occurred while compiling the Jetson Linux R32.7.2 kernel

I have another question. In Jetson Linux R32.7.2, why does it prompt ‘Configuration file “.config” not found!’ when I run the command “nvbuild.sh -o $HOME/kernel_out/” without making any changes?

zmy@zmy-virtual-machine:~/kernel_src$ ./nvbuild.sh -o $HOME/kernel_out/
Building kernel-4.9 sources
make: Entering directory “/home/zmy/kernel_src/kernel/kernel-4.9”
scripts/kconfig/conf --silentoldconfig Kconfig


*** Configuration file “.config” not found!


*** Please run some configurator (e.g. “make oldconfig” or
*** “make menuconfig” or “make xconfig”).


scripts/kconfig/Makefile:37: recipe for target ‘silentoldconfig’ failed
make[3]: *** [silentoldconfig] Error 1
Makefile:575: recipe for target ‘silentoldconfig’ failed
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target ‘O’. Stop.
Makefile:554: recipe for target ‘__build_one_by_one’ failed
make: *** [__build_one_by_one] Error 2
make: Leaving directory “/home/zmy/kernel_src/kernel/kernel-4.9”

I don’t use that script so I can’t directly answer. However, if your output location is different from the source code location, then any .config in the source code top directory has to be copied to the output location for it to be seen. Thus, if you have this file (from what I see in logs):
/home/zmy/kernel_src/kernel/kernel-4.9/.config

And if you have this as your output location:
$HOME/kernel_out/

…it implies you need to do this:
cp /home/zmy/kernel_src/kernel/kernel-4.9/.config $HOME/kernel_out/

The above is for the case of when you already have a .config. I don’t use that script, and so I don’t know if it already has that.

For the case of not having $HOME/kernel_out/.config, then you must create it. When building to alternate locations (any location outside of the kernel source itself, which is highly recommended), then you must use the “O=/some/where” (this is no doubt inside the build script and derived from the “-o” option) during all steps (well, the exception exists when making the source code itself pristine via “make mrproper” since you’d be cleaning up the actual source code and not the temp output location).

Let’s say you start with some configuration, it would need to be in you $HOME/kernel_out/ with name “.config”. If you then edit this with something like “make menuconfig”, then it will not do as expected unless you also use the “O=/some/where”, e.g.,:
make O=$HOME/kernel/out/ menuconfig
(without the “O=/some/where” the .config would go back to the top of the source code and not to the temp output location)

I will emphasize that I don’t know what is in the script, I compile manually, but the script will do as above internally.

If you don’t know your starting configuration then we can talk about that. If it is just a case of the config being in the wrong place, then the above tells you how to deal with it, e.g., starting with the “O=/some/where tegra_defconfig” (which is a start, but insufficient by itself).

1 Like

Hi,There are no problems now. Thank you very much!

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