All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file
@ 2017-07-25  9:28 vr roriz
  2017-07-25 14:13 ` Jonathan Neuschäfer
  0 siblings, 1 reply; 6+ messages in thread
From: vr roriz @ 2017-07-25  9:28 UTC (permalink / raw)
  To: buildroot

Dear all,

I'd like to know what is the best approach to generate a buildroot-like
.config file (Using BR2) from an existent linux-like .config file. By
linux-like I mean, the .config files with the native syntax, generated by
make menuconfig in the Linux Source Tree, like the ones that are generated
in the output dir of buildroot after building.

Thanks!

BR,
Vitor Roriz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170725/4f19ef54/attachment.html>

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

* [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file
  2017-07-25  9:28 [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file vr roriz
@ 2017-07-25 14:13 ` Jonathan Neuschäfer
  2017-07-25 14:30   ` vr roriz
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Neuschäfer @ 2017-07-25 14:13 UTC (permalink / raw)
  To: buildroot

On Tue, Jul 25, 2017 at 11:28:08AM +0200, vr roriz wrote:
> Dear all,
> 
> I'd like to know what is the best approach to generate a buildroot-like
> .config file (Using BR2) from an existent linux-like .config file. By
> linux-like I mean, the .config files with the native syntax, generated by
> make menuconfig in the Linux Source Tree, like the ones that are generated
> in the output dir of buildroot after building.

Buildroot .config files and Linux .config files are not compatible
because they refer to completely different settings, but if you want to
convert the *syntax*, a simple sed command should do (in both directions):

  $ sed -e 's/CONFIG_/BR2_/' .config
  #
  # Automatically generated file; DO NOT EDIT.
  # Linux/powerpc 4.11.8 Kernel Configuration
  #
  # BR2_PPC64 is not set
  
  #
  # Processor support
  #
  BR2_PPC_BOOK3S_32=y
  # BR2_PPC_85xx is not set
  # BR2_PPC_8xx is not set
  # BR2_40x is not set
  # BR2_44x is not set
  # BR2_E200 is not set
  ...


I hope that helps,
Jonathan Neusch?fer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170725/6dce0e52/attachment.asc>

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

* [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file
  2017-07-25 14:13 ` Jonathan Neuschäfer
@ 2017-07-25 14:30   ` vr roriz
  2017-07-25 15:03     ` vr roriz
  0 siblings, 1 reply; 6+ messages in thread
From: vr roriz @ 2017-07-25 14:30 UTC (permalink / raw)
  To: buildroot

Thanks for answering Mr. Neusch?fer,

I've got your point. Then, I would add to my original issue: Would you have
a suggestion about the best approach to mirror an existent .config file
(from Linux source tree), without having to keep scanning strings in "make
linux-menuconfig" and editing it manually? How do buildroot users usually
do that? I know I can redefine the defconfig file for the target board
after creating a .config file, but I am referring to the first-time process.

BR,
Vitor Roriz

2017-07-25 16:13 GMT+02:00 Jonathan Neusch?fer <j.neuschaefer@gmx.net>:

> On Tue, Jul 25, 2017 at 11:28:08AM +0200, vr roriz wrote:
> > Dear all,
> >
> > I'd like to know what is the best approach to generate a buildroot-like
> > .config file (Using BR2) from an existent linux-like .config file. By
> > linux-like I mean, the .config files with the native syntax, generated by
> > make menuconfig in the Linux Source Tree, like the ones that are
> generated
> > in the output dir of buildroot after building.
>
> Buildroot .config files and Linux .config files are not compatible
> because they refer to completely different settings, but if you want to
> convert the *syntax*, a simple sed command should do (in both directions):
>
>   $ sed -e 's/CONFIG_/BR2_/' .config
>   #
>   # Automatically generated file; DO NOT EDIT.
>   # Linux/powerpc 4.11.8 Kernel Configuration
>   #
>   # BR2_PPC64 is not set
>
>   #
>   # Processor support
>   #
>   BR2_PPC_BOOK3S_32=y
>   # BR2_PPC_85xx is not set
>   # BR2_PPC_8xx is not set
>   # BR2_40x is not set
>   # BR2_44x is not set
>   # BR2_E200 is not set
>   ...
>
>
> I hope that helps,
> Jonathan Neusch?fer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170725/bec8ea4e/attachment.html>

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

* [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file
  2017-07-25 14:30   ` vr roriz
@ 2017-07-25 15:03     ` vr roriz
  2017-07-25 19:55       ` Jonathan Neuschäfer
  0 siblings, 1 reply; 6+ messages in thread
From: vr roriz @ 2017-07-25 15:03 UTC (permalink / raw)
  To: buildroot

I found a possible path for this procedure. On menuconfig, under Kernel
config, I can define a custom config file (for the Kernel). Then I can save
this "mirroring" with a savedefconfig. I will test.

Source:
https://stackoverflow.com/questions/1414968/how-do-i-configure-the-linux-kernel-within-buildroot

Is that the way people usually do that?

BR,

Vitor Roriz

2017-07-25 16:30 GMT+02:00 vr roriz <v.r.roriz@gmail.com>:

> Thanks for answering Mr. Neusch?fer,
>
> I've got your point. Then, I would add to my original issue: Would you
> have a suggestion about the best approach to mirror an existent .config
> file (from Linux source tree), without having to keep scanning strings in
> "make linux-menuconfig" and editing it manually? How do buildroot users
> usually do that? I know I can redefine the defconfig file for the target
> board after creating a .config file, but I am referring to the first-time
> process.
>
> BR,
> Vitor Roriz
>
> 2017-07-25 16:13 GMT+02:00 Jonathan Neusch?fer <j.neuschaefer@gmx.net>:
>
>> On Tue, Jul 25, 2017 at 11:28:08AM +0200, vr roriz wrote:
>> > Dear all,
>> >
>> > I'd like to know what is the best approach to generate a buildroot-like
>> > .config file (Using BR2) from an existent linux-like .config file. By
>> > linux-like I mean, the .config files with the native syntax, generated
>> by
>> > make menuconfig in the Linux Source Tree, like the ones that are
>> generated
>> > in the output dir of buildroot after building.
>>
>> Buildroot .config files and Linux .config files are not compatible
>> because they refer to completely different settings, but if you want to
>> convert the *syntax*, a simple sed command should do (in both directions):
>>
>>   $ sed -e 's/CONFIG_/BR2_/' .config
>>   #
>>   # Automatically generated file; DO NOT EDIT.
>>   # Linux/powerpc 4.11.8 Kernel Configuration
>>   #
>>   # BR2_PPC64 is not set
>>
>>   #
>>   # Processor support
>>   #
>>   BR2_PPC_BOOK3S_32=y
>>   # BR2_PPC_85xx is not set
>>   # BR2_PPC_8xx is not set
>>   # BR2_40x is not set
>>   # BR2_44x is not set
>>   # BR2_E200 is not set
>>   ...
>>
>>
>> I hope that helps,
>> Jonathan Neusch?fer
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170725/25adec72/attachment.html>

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

* [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file
  2017-07-25 15:03     ` vr roriz
@ 2017-07-25 19:55       ` Jonathan Neuschäfer
  2017-07-25 20:51         ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Neuschäfer @ 2017-07-25 19:55 UTC (permalink / raw)
  To: buildroot

On Tue, Jul 25, 2017 at 05:03:03PM +0200, vr roriz wrote:
> I found a possible path for this procedure. On menuconfig, under Kernel
> config, I can define a custom config file (for the Kernel). Then I can save
> this "mirroring" with a savedefconfig. I will test.
> 
> Source:
> https://stackoverflow.com/questions/1414968/how-do-i-configure-the-linux-kernel-within-buildroot
> 
> Is that the way people usually do that?

I think it usually works in the following way:

1) You create a Linux defconfig, and store it under
   arch/<architecture>/configs/<board>_defconfig, if it doesn't exist
   already.
2) You use a kernel branch or patch that contains this Linux defconfig.
3) You let BR2_LINUX_KERNEL_DEFCONFIG point to this defconfig.
4) Optionally, you create a *buildroot* defconfig that contains the
   relevant BR2_LINUX_KERNEL_DEFCONFIG line.

It's important to know which defconfig is a kernel defconfig and which
one is a buildroot defconfig.

For project specific modifications of the kernel config, there are also
some other mechanisms, like BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES and
those listed at http://nightly.buildroot.org/manual.html#outside-br-custom.


Jonathan Neusch?fer

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

* [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file
  2017-07-25 19:55       ` Jonathan Neuschäfer
@ 2017-07-25 20:51         ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2017-07-25 20:51 UTC (permalink / raw)
  To: buildroot



On 25-07-17 21:55, Jonathan Neusch?fer wrote:
> On Tue, Jul 25, 2017 at 05:03:03PM +0200, vr roriz wrote:
>> I found a possible path for this procedure. On menuconfig, under Kernel
>> config, I can define a custom config file (for the Kernel). Then I can save
>> this "mirroring" with a savedefconfig. I will test.
>>
>> Source:
>> https://stackoverflow.com/questions/1414968/how-do-i-configure-the-linux-kernel-within-buildroot
>>
>> Is that the way people usually do that?
> 
> I think it usually works in the following way:
> 
> 1) You create a Linux defconfig, and store it under
>    arch/<architecture>/configs/<board>_defconfig, if it doesn't exist
>    already.
> 2) You use a kernel branch or patch that contains this Linux defconfig.
> 3) You let BR2_LINUX_KERNEL_DEFCONFIG point to this defconfig.
> 4) Optionally, you create a *buildroot* defconfig that contains the
>    relevant BR2_LINUX_KERNEL_DEFCONFIG line.

 If you already have a custom linux .config file, the procedure is more like this:

1) Copy your linux .config to some safe place (i.e. which will be put under
version control), e.g. my_ext_dir/board/myboard/linux.config

2) In Buildroot's config, set BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y and
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="/.../my_ext_dir/board/myboard/linux.config"
(or better yet, define my_ext_dir as an external and use
$(BR2_EXTERNAL_MY_EXT_PATH)/board/myboard/linux.config)

3) If you need to change something in the kernel config, run (from Buildroot)
"make linux-menuconfig", then (if it is OK) "make linux-update-defconfig".


> It's important to know which defconfig is a kernel defconfig and which
> one is a buildroot defconfig.

 Absolutely!


> For project specific modifications of the kernel config, there are also
> some other mechanisms, like BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES and
> those listed at http://nightly.buildroot.org/manual.html#outside-br-custom.

 Yes, if you can start from an existing in-kernel defconfig, that can be handy.
The problem with the fragment files, unfortunately, is that it is not easy to
update them. You have to run "make linux-update-defconfig" and split the changes
over the different fragments... AFAIK no Kconfig fragment extractor tool exists.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

end of thread, other threads:[~2017-07-25 20:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25  9:28 [Buildroot] [.config file] Generating buildroot-like .config file from "linux-like" .config file vr roriz
2017-07-25 14:13 ` Jonathan Neuschäfer
2017-07-25 14:30   ` vr roriz
2017-07-25 15:03     ` vr roriz
2017-07-25 19:55       ` Jonathan Neuschäfer
2017-07-25 20:51         ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.