diff mbox series

[meta-ti,master/kirkstone,v4,1/2] recipes-bsp: u-boot: Add u-boot-mergeconfig.inc to handle fragment u-boot config

Message ID 20230915111523.2274146-1-c-shilwant@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master/kirkstone,v4,1/2] recipes-bsp: u-boot: Add u-boot-mergeconfig.inc to handle fragment u-boot config | expand

Commit Message

Chirag Shilwant Sept. 15, 2023, 11:15 a.m. UTC
- U-boot recipe in OE-Core supports out-of-tree config fragments that are passed via 
SRC_URI and automatically merges all *.cfg files as fragments. This makes specifying
config fragments in the machine configuration a bit difficult. Hence, add a logic which
will ensure we handle u-boot config fragments using a new variable UBOOT_CONFIG_FRAGMENTS.

- The u-boot-mergeconfig.inc will allow us to build u-boot with list of config fragments
specified in UBOOT_CONFIG_FRAGMENTS along with the base defconfig mentioned in UBOOT_MACHINE.

- Include u-boot-mergeconfig.inc in u-boot-ti.inc

Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
---
v4: 
  - Added an extra check for UBOOT_MACHINE being set
  - Commit Message Formatting
v3:
  - s/UBOOT_CONFIG_FRAGMENT/UBOOT_CONFIG_FRAGMENTS
  - Use do_configure:append instead of do_compile:append
v2:
  - Split a single patch into 2 seperate patches
  - Add detail commit message

 meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc | 7 +++++++
 meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc          | 1 +
 2 files changed, 8 insertions(+)
 create mode 100644 meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc

Comments

Denys Dmytriyenko Sept. 15, 2023, 2:43 p.m. UTC | #1
On Fri, Sep 15, 2023 at 04:45:22PM +0530, Chirag Shilwant wrote:
> - U-boot recipe in OE-Core supports out-of-tree config fragments that are passed via 
> SRC_URI and automatically merges all *.cfg files as fragments. This makes specifying
> config fragments in the machine configuration a bit difficult. Hence, add a logic which
> will ensure we handle u-boot config fragments using a new variable UBOOT_CONFIG_FRAGMENTS.
> 
> - The u-boot-mergeconfig.inc will allow us to build u-boot with list of config fragments
> specified in UBOOT_CONFIG_FRAGMENTS along with the base defconfig mentioned in UBOOT_MACHINE.
> 
> - Include u-boot-mergeconfig.inc in u-boot-ti.inc

Thanks! Looks good to me.


> Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>

Reviewed-by: Denys Dmytriyenko <denys@konsulko.com>


> ---
> v4: 
>   - Added an extra check for UBOOT_MACHINE being set
>   - Commit Message Formatting
> v3:
>   - s/UBOOT_CONFIG_FRAGMENT/UBOOT_CONFIG_FRAGMENTS
>   - Use do_configure:append instead of do_compile:append
> v2:
>   - Split a single patch into 2 seperate patches
>   - Add detail commit message
> 
>  meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc | 7 +++++++
>  meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc          | 1 +
>  2 files changed, 8 insertions(+)
>  create mode 100644 meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
> 
> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
> new file mode 100644
> index 00000000..c7ce5047
> --- /dev/null
> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
> @@ -0,0 +1,7 @@
> +do_configure:append () {
> +   if [ -n "${UBOOT_CONFIG_FRAGMENTS}" ] && [ -n "${UBOOT_MACHINE}" ]
> +   then
> +       oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} ${UBOOT_CONFIG_FRAGMENTS}
> +       oe_runmake -C ${S} O=${B} olddefconfig
> +   fi
> +}
> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
> index f3285c23..5292517b 100644
> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
> @@ -7,6 +7,7 @@ SPL_BINARY ?= "MLO"
>  
>  require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot-common.inc
>  require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc
> +require u-boot-mergeconfig.inc
>  
>  FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"
>  
> -- 
> 2.34.1
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
new file mode 100644
index 00000000..c7ce5047
--- /dev/null
+++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
@@ -0,0 +1,7 @@ 
+do_configure:append () {
+   if [ -n "${UBOOT_CONFIG_FRAGMENTS}" ] && [ -n "${UBOOT_MACHINE}" ]
+   then
+       oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} ${UBOOT_CONFIG_FRAGMENTS}
+       oe_runmake -C ${S} O=${B} olddefconfig
+   fi
+}
diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
index f3285c23..5292517b 100644
--- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
+++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
@@ -7,6 +7,7 @@  SPL_BINARY ?= "MLO"
 
 require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot-common.inc
 require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc
+require u-boot-mergeconfig.inc
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"