diff options
author | Hiago De Franco <hiago.franco@toradex.com> | 2023-09-27 17:22:40 -0300 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2023-11-29 16:30:38 +0100 |
commit | 163ed7654cea8164767b34818b5d57dec1eadc72 (patch) | |
tree | c60fbb64ceafb66239543073a859c6340a50c704 /classes | |
parent | 6529fce1f85a670c87ba84bfda49414a4cbc714f (diff) |
classes: toradex-kernel-config: Add general config variable function
Add a general-purpose configuration variable handling function within the
toradex-kernel-config classe. This function can be used for various software
configurations, including U-Boot. By doing so, we reduce code duplication
in other layers that dynamically modify configurations, such as
meta-toradex-tezi.
Related-to: ELB-5409
Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
(cherry picked from commit 6e86c264494d0309ac76c1bc3fc1246a7ac96180)
Diffstat (limited to 'classes')
-rw-r--r-- | classes/toradex-kernel-config.bbclass | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/classes/toradex-kernel-config.bbclass b/classes/toradex-kernel-config.bbclass index 9c0cd32..4b7aa13 100644 --- a/classes/toradex-kernel-config.bbclass +++ b/classes/toradex-kernel-config.bbclass @@ -1,17 +1,26 @@ -# Assign a config variable in ${B}/.config. -# Should be called in do_configure:append only. -# +# Assign/change a config variable # $1 - config variable to be set # $2 - value [n/y/value] +# $3 - config file # -kernel_configure_variable() { +kconfig_configure_variable() { # Remove the original config, to avoid reassigning it. - sed -i -e "/CONFIG_$1[ =]/d" ${B}/.config + sed -i -e "/CONFIG_$1[ =]/d" $3 # Assign the config value if [ "$2" = "n" ]; then - echo "# CONFIG_$1 is not set" >> ${B}/.config + echo "# CONFIG_$1 is not set" >> $3 else - echo "CONFIG_$1=$2" >> ${B}/.config + echo "CONFIG_$1=$2" >> $3 fi } + +# Assign a config variable in ${B}/.config. +# Should be called in do_configure:append only. +# +# $1 - config variable to be set +# $2 - value [n/y/value] +# +kernel_configure_variable() { + kconfig_configure_variable $1 $2 ${B}/.config +} |