kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Build using O=path
@ 2018-09-10  6:33 Tobin C. Harding
  2018-09-10  6:37 ` Dhiraj Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tobin C. Harding @ 2018-09-10  6:33 UTC (permalink / raw)
  To: kernelnewbies

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
$ 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.
/home/tobin/build/kernel/linux/Makefile:1091: recipe for target 'prepare3' failed
make[1]: *** [prepare3] Error 1
make[1]: Leaving directory '/home/tobin/build/kernel/output/master'
Makefile:146: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2


Same thing if I use KBUILD_OUTPUT instead of passing O=


thanks,
Tobin.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Build using O=path
  2018-09-10  6:33 Build using O=path Tobin C. Harding
@ 2018-09-10  6:37 ` Dhiraj Kumar
  2018-09-10  6:46 ` Joey Pabalinas
  2018-09-10  9:37 ` Luca Ceresoli
  2 siblings, 0 replies; 6+ messages in thread
From: Dhiraj Kumar @ 2018-09-10  6:37 UTC (permalink / raw)
  To: kernelnewbies

Hi,

Please try below steps,

$ cd $KERNEL
$ make mrproper
$ cp path/to/valid/config/file .config
$ make menuconfig
$ make O=/abs/path/to/output

Thanks!

On Mon, Sep 10, 2018 at 12:04 PM Tobin C. Harding <me@tobin.cc> 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
> $ 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.
> /home/tobin/build/kernel/linux/Makefile:1091: recipe for target 'prepare3'
> failed
> make[1]: *** [prepare3] Error 1
> make[1]: Leaving directory '/home/tobin/build/kernel/output/master'
> Makefile:146: recipe for target 'sub-make' failed
> make: *** [sub-make] Error 2
>
>
> Same thing if I use KBUILD_OUTPUT instead of passing O=
>
>
> thanks,
> Tobin.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180910/3f93354c/attachment.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Build using O=path
  2018-09-10  6:33 Build using O=path Tobin C. Harding
  2018-09-10  6:37 ` Dhiraj Kumar
@ 2018-09-10  6:46 ` Joey Pabalinas
  2018-09-10  6:52   ` Joey Pabalinas
  2018-09-10  9:37 ` Luca Ceresoli
  2 siblings, 1 reply; 6+ messages in thread
From: Joey Pabalinas @ 2018-09-10  6:46 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Sep 10, 2018 at 04:33:38PM +1000, Tobin C. Harding wrote:
> 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

All you are missing here is something like `make defconfig` (or
olddefconfig or nconfig etc.) and you should be set; nothing brain
dead here.

You can read Documentation/admin-guide/README.rst for more information
about these targets, but mostly the reason for this is because the
available configurations change just like the rest of the kernel.
Bad Things? would happen if .config wasn't updated to reflect these
changes.


-- 
Cheers,
Joey Pabalinas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180909/7a4742f7/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Build using O=path
  2018-09-10  6:46 ` Joey Pabalinas
@ 2018-09-10  6:52   ` Joey Pabalinas
  0 siblings, 0 replies; 6+ messages in thread
From: Joey Pabalinas @ 2018-09-10  6:52 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Sep 09, 2018 at 08:46:13PM -1000, Joey Pabalinas wrote:
> All you are missing here is something like `make defconfig` (or
> olddefconfig or nconfig etc.) and you should be set; nothing brain
> dead here.

Except for me of course... That should have been `make oldconfig` not
`make defconfig` which would overwrite your custom configuration file.

-- 
Cheers,
Joey Pabalinas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180909/d3a63bda/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Build using O=path
  2018-09-10  6:33 Build using O=path Tobin C. Harding
  2018-09-10  6:37 ` Dhiraj Kumar
  2018-09-10  6:46 ` Joey Pabalinas
@ 2018-09-10  9:37 ` Luca Ceresoli
  2018-09-10 22:46   ` Tobin C. Harding
  2 siblings, 1 reply; 6+ messages in thread
From: Luca Ceresoli @ 2018-09-10  9:37 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Build using O=path
  2018-09-10  9:37 ` Luca Ceresoli
@ 2018-09-10 22:46   ` Tobin C. Harding
  0 siblings, 0 replies; 6+ messages in thread
From: Tobin C. Harding @ 2018-09-10 22:46 UTC (permalink / raw)
  To: kernelnewbies

Thanks Luca, you had the winning entry!

On Mon, Sep 10, 2018 at 11:37:15AM +0200, Luca Ceresoli wrote:
> 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.

Well explained, I did not garner this from the error messages.  Thanks.

> 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

The key takeaway (for me) is that this invocation of make is expected to
fail (since we have not created the output directory or config file yet).

> cd /abs/path/to/output
> cp path/to/valid/config/file .config
> make olddefconfig # might be not needed, but harmless anyway
> make

I would not have realised that one can run make from the output
directory.

thanks,
Tobin.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-10 22:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-10  6:33 Build using O=path Tobin C. Harding
2018-09-10  6:37 ` Dhiraj Kumar
2018-09-10  6:46 ` Joey Pabalinas
2018-09-10  6:52   ` Joey Pabalinas
2018-09-10  9:37 ` Luca Ceresoli
2018-09-10 22:46   ` Tobin C. Harding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).