Skip to content

[RFC] use kconfig for configuration#6581

Open
lrusak wants to merge 2 commits into
LibreELEC:masterfrom
lrusak:kconfig
Open

[RFC] use kconfig for configuration#6581
lrusak wants to merge 2 commits into
LibreELEC:masterfrom
lrusak:kconfig

Conversation

@lrusak

@lrusak lrusak commented Jun 8, 2022

Copy link
Copy Markdown
Member

This allows tracking the LibreELEC configuration options through kconfig.

For this purpose I have been testing with Kconfiglib. It can be easily installed with pip.

pip3 install kconfiglib

The main reason I wanted to do this was to have a uniform and central location for all configuration options. This allows us to have better help, and dependency tracking for config options. Options will be able to depend on other options instead of having to handle that in shell scripts.

This also allow one to use menuconfig (and other kconfig utilities) to configure the options. This is quite nice.
This can be invoked with

$ PROJECT=RPi ARCH=arm DEVICE=RPi4 make menuconfig

or similar.
I have created a helper script that is also available to call directly (for other kconfig utilities).

$ PROJECT=RPi ARCH=arm DEVICE=RPi4 ./scripts/make_config olddefconfig

Basically all options files are merged into a single file during the build and olddefconfig is used to create a final config file which is then sourced by the shell scripts. This is nice because it tells you if options are wrong or specified multiple times.

I've made this PR just to get some feedback if people like this idea or not. I didn't want to commit a bunch of time to writing a bunch of documentation and changing all the current shell logic to use y instead of yes. I have also (ab)used the use of strings in kconfig when a lot of them should really be booleans. This can be improved if we decide we like this direction.

I've only built for Generic-gbm and RPI4, I haven't tested the other projects/devices.

Projects that use kconfig (of some kind)

  • linux
  • u-boot
  • busybox
  • crosstool-ng

some screenshots

Screen Shot 2022-06-07 at 8 02 59 PM

Screen Shot 2022-06-07 at 8 03 42 PM

Screen Shot 2022-06-07 at 8 03 57 PM

Screen Shot 2022-06-07 at 8 04 03 PM

Screen Shot 2022-06-07 at 8 04 13 PM

Thanks for reading.

@vpeter4

vpeter4 commented Jun 8, 2022

Copy link
Copy Markdown
Contributor

In my opinion not needed at all.

@lrusak

lrusak commented Jun 9, 2022

Copy link
Copy Markdown
Member Author

In my opinion not needed at all.

Thank you sooooo much for your helpful insight! 👍

@vpeter4

vpeter4 commented Jun 9, 2022

Copy link
Copy Markdown
Contributor

You asked for a feedback.

What exactly this PR solves and what you are trying to achieve? To be some generic buildsystem? Then why not use some other buildsystem which already supports this feature and much more.

@lrusak

lrusak commented Jun 9, 2022

Copy link
Copy Markdown
Member Author

You asked for a feedback.

What exactly this PR solves and what you are trying to achieve? To be some generic buildsystem? Then why not use some other buildsystem which already supports this feature and much more.

Did you read the OP?

@vpeter4

vpeter4 commented Jun 10, 2022

Copy link
Copy Markdown
Contributor

Did you read the OP?

I read. And see nothing useful.
Wondering how OE/LE had survived over all this years without this feature ...

@heitbaum heitbaum added LE 12.0 and removed LE 11.0 labels Jan 18, 2023
@CvH CvH added LE 13.0 and removed LE 12.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants