Build using O=path

Luca Ceresoli luca at lucaceresoli.net
Mon Sep 10 05:37:15 EDT 2018


Hi,

On 10/09/2018 08:33, Tobin C. Harding wrote:
> Hi,
> 
> I'm unable to build the kernel using the O=path/to/out option.  Am I
> doing something brain dead?
> 
> $ cd $KERNEL
> $ make mrproper
> $ cp path/to/valid/config/file .config

Here you are copying a file in the source directory...

> $ make O=/abs/path/to/output
> ...
> scripts/kconfig/conf  --syncconfig Kconfig
> ***
> *** Configuration file ".config" not found!
> ***
> *** Please run some configurator (e.g. "make oldconfig" or
> *** "make menuconfig" or "make xconfig").
> ...
> 
> So I tried copying the .config file to the output directory
> 
> $ cp .config /abs/path/to/output
> $ make O=/abs/path/to/output
> ...
>   Using /home/tobin/build/kernel/linux as source for kernel
>   /home/tobin/build/kernel/linux is not clean, please run 'make mrproper'
>   in the '/home/tobin/build/kernel/linux' directory.

...and here's where the kernel complains about it.

You have to put your .config file in the out-of-tree build dir, not the
source dir. BTW this also allows you to have multiple builds woth
different configs in different directories, all from the same set of
sources -- how would it be possible if the config were in the source dir?

So, fix it as:

cd $KERNEL
make mrproper
make O=/abs/path/to/output # BTW: can be also relative
cd /abs/path/to/output
cp path/to/valid/config/file .config
make olddefconfig # might be not needed, but harmless anyway
make

-- 
Luca



More information about the Kernelnewbies mailing list