-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Allow global overlay config files #14740
Comments
Perhaps |
IMHO, proliferation of config vars isn't a good thing. What would really help is to have "overlay config path", like ".:${ZEPHYR_BASE}/.../overlays". |
I agree with @pfalcon, it is just very confusing for the user if there are multiple config variables to select the overlay config file. |
This introduces the possibility of namespace conflicts, of course. Perhaps a Note also having a separate |
I have an opposite need for evaluating sensor samples, which is "local" DTS overlays. For example, I need to add overlay files for every board into HTS221 sensor sample, like this:
But they are the same, if boards support "arduino_i2c" alias. For more detail please refer to "samples\sensor\sht3xd", which sample already included six overlay files in one folder. Alternative, I can use "-DDTC_OVERLAY_FILE" parameter, but it ask for full path, like this:
It's also not convenient for user. A little wired proposing two things in one thread, but I think they are related. I can open another thread if you consider it's necessary.
Please take into account this need. Thanks. |
@overheat I believe you are referring to a "shield" setup such as: https://github.com/zephyrproject-rtos/zephyr/tree/master/boards/shields/x_nucleo_iks01a2 This is enabled via You can setup your shield similarly. |
@mike-scott Yes, looks it's more convenient. Thanks!
works fine. |
Sure, why not. We can of course name the files as we like here, perhaps we could even name the files without the "overlay" string as that seems to be a bit redundant, so something like |
IMHO, this superfluous and precludes some interesting usecases. Instead, I'd like to draw attention again to "overlay config path" idea, like |
If OVERLAY_CONFIG_DIRS environment variable is specified, then search it if the file in OVERLAY_CONFIG is not found. Example: $ cd samples/net/ipv4_autoconf $ OVERLAY_CONFIG_DIRS=../sockets/echo_server \ cmake -B build -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-e1000.conf . Zephyr version: 1.14.99 -- Selected BOARD qemu_x86 -- Found west: west (found version "0.5.6", minimum required is "0.5.6") -- Loading zephyr/boards/x86/qemu_x86/qemu_x86.dts as base -- Overlaying zephyr/dts/common/common.dts -- Overlaying ../sockets/echo_server/overlay-e1000.conf Parsing Kconfig tree in zephyr/Kconfig So in this example the samples/net/ipv4_autoconf directory does not contain overlay-e1000.conf, but it is found in ../sockets/echo_server/ directory which is mentioned in OVERLAY_CONFIG_DIRS variable. Fixes zephyrproject-rtos#14740 Signed-off-by: Jukka Rissanen <[email protected]>
Although I do see the value in the proposal, I would like to point out that we should be very careful on such approach. And why are we doing this ?
To end-users, the current solution is clean in the sense that a user can look at: and know this kconfig fragment works with this sample. But if moving such fragment to a common folder, then such relationship is lost, and instead we would need to carefully document when a fragment can be applied. The Zephyr build system is already quite complex with Kconfig and devicetree files being picked up from a number of different places. There is a learning curve for new developers starting out with Zephyr. That said, the I would personally like to see if some of this could improves by better default scheme. |
This is already possible using snippets. |
We should have a way to have "global" config overlays. For example when using networking in qemu_x86 it would be nice to use overlay-e1000.conf when compiling zephyr. This overlay is found only in couple of networking samples which is quite annoying actually. The same overlay-e1000.conf could be used in all the samples as it only contains generic options.
I am proposing following:
If user tries to configure the sample like this
but if the overlay-e1000.conf would not be found in local sample directory, a global directory would be searched and the overlay would be used if found there.
The text was updated successfully, but these errors were encountered: