Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor defconfigs to have a generic base #457

Open
ruscur opened this issue May 2, 2016 · 7 comments
Open

Refactor defconfigs to have a generic base #457

ruscur opened this issue May 2, 2016 · 7 comments

Comments

@ruscur
Copy link

ruscur commented May 2, 2016

We have a defconfig for every machine with a lot of shared content, with any changes across the board needing to be made to each file. This becomes more of a hassle to update as more and more machines get added, it'd be pretty easy to have a generic defconfig for every OpenPOWER machine type, and just have machine-specific details in each machine defconfig.

That helps people to understand specific nuances about each machine, as well as being more maintainable.

@williamspatrick
Copy link
Contributor

Agreed it would be desirable. I've previously looked into it myself and I don't see it as possible without a change to buildroot. Buildroot doesn't support config fragments and it doesn't have a mechanism for the "external" layer (op-build in this case) to add make recipes at defconfig time.

Someone would need to propose changes to buildroot to support this and get them accepted upstream.

@shenki
Copy link
Member

shenki commented May 3, 2016

I did some googling and found this:

http://elinux.org/Buildroot:DeveloperDaysFOSDEM2014#How_to_handle_.27target.27_defconfigs_versus_.27development.27_defconfigs

Also, from http://free-electrons.com/doc/training/buildroot/buildroot-slides.pdf

Build a release system for platform1
$ ./support/kconfig/merge_config.sh platform1.frag packages.frag > .config
$ make olddefconfig
$ make

Build a debug system for platform2
$ ./support/kconfig/merge_config.sh platform2.frag packages.frag debug.frag > .config
$ make olddefconfig
$ make

It would be nice if buildroot let us put something like this in $BR2_EXTERNAL/external.mk:

%_defconfig: $(BR2_EXTERNAL)/config/%_frag $(BR2_EXTERNAL)/config/common_frag
        $(TOPDIR)/support/kconfig/merge_config.sh $^ > $@

but as Patrick said this does not work.

We could chose to do this at commit time and have both the fragments and the combined defconfigs checked into the tree. That way developers get the benefit of having easy to maintain configurations, and users don't have to perform any extra steps at build time.

@shenki
Copy link
Member

shenki commented May 4, 2016

The work to be done:

  1. Generate .configs for all of our platforms
  2. Work out a common subset from all the defconfigs
  3. Create a common_frag with that subset
  4. Remove those options from all the defconfigs
  5. Generate merged defconfigs (They should be the same as before?)
  6. Generate .configs with the merged defconfigs, and compare them to step 1

@sammj
Copy link
Contributor

sammj commented May 9, 2016

Sam Bobroff has a buildroot patch that allows defconfigs to be specified as the combination of several partial defconfigs which suits our usecase very well.

http://lists.busybox.net/pipermail/buildroot/2016-May/160745.html

@sammj
Copy link
Contributor

sammj commented May 11, 2016

I've put a first-shot at splitting up the platform defconfigs up over here, based on the above patch: sammj@6a334b8
Bikeshed away :)

@sammj
Copy link
Contributor

sammj commented Jun 29, 2016

Sam has submitted an improved version of his mergeconfig changes as part of this patchset - http://patchwork.ozlabs.org/patch/638448/
A V2 is incoming, if we like the look of that perhaps we should consider including it in our tree (the buildroot list is pretty busy so it will probably be a while before it is merged)

@sammj
Copy link
Contributor

sammj commented Aug 8, 2018

This didn't end up making it upstream as Buildroot decided that building configs is something that should be done by the user; Buildroot just consumes them.
For context: http://lists.busybox.net/pipermail/buildroot/2016-July/165623.html

We can still look into making a generic base somehow, but it's going to mean having our own mechanism to build defconfigs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants