Skip to contentSkip to conversation

u-boot: backport merging .cfg files for UBOOT_CONFIG

PATCH In review ahussain 4 participants 7 messages Jun 29, 2020 – Jul 3, 2020

lore
Share & tools
lore

ahussain

author
#0 lore raw

cover u-boot: backport merging .cfg files for UBOOT_CONFIG

From: Ahsan Hussain <[email protected]>

The functionality for merging config fragment files has been available in the U-Boot tree (merge_config.sh) but this was not being used for oe-core's UBOOT_CONFIG flow. These commits would allow the distro maintainers to configure the bootloader using cfg files instead of patching the U-Boot tree

The following changes since commit 1a98936830ba468d63e2e49d766add9e9cb75998:

gstreamer1.0-plugins-bad: add support for vdpau (2020-06-23 04:33:47 -1000)

are available in the Git repository at:

git://github.com/ahsanhussain/openembedded-core u-boot-cfg-dunfell
https://github.com/ahsanhussain/openembedded-core/tree/u-boot-cfg-dunfell

Jens Rehsack (1):
u-boot: avoid blind merging all *.cfg

Ming Liu (1):
u-boot: support merging .cfg files for UBOOT_CONFIG

 meta/recipes-bsp/u-boot/u-boot.inc | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/2 u-boot: support merging .cfg files for UBOOT_CONFIG

From: Ming Liu <[email protected]>

U-boot recipe supports .cfg files in SRC_URI, but they would be merged to .config during do_configure only when UBOOT_MACHINE is set, we should also support merging .cfg files for UBOOT_CONFIG.

---
 meta/recipes-bsp/u-boot/u-boot.inc | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
meta/recipes-bsp/u-boot/u-boot.inc +17 -4
index 80f828df52..8cfd25020c 100644
@@ -77,7 +77,23 @@ def find_cfgs(d):
     return sources_list
 
 do_configure () {
-    if [ -z "${UBOOT_CONFIG}" ]; then
+    if [ -n "${UBOOT_CONFIG}" ]; then
+        unset i j
+        for config in ${UBOOT_MACHINE}; do
+            i=$(expr $i + 1);
+            for type in ${UBOOT_CONFIG}; do
+                j=$(expr $j + 1);
+                if [ $j -eq $i ]; then
+                    oe_runmake -C ${S} O=${B}/${config} ${config}
+                    merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
+                    oe_runmake -C ${S} O=${B}/${config} oldconfig
+                fi
+            done
+            unset j
+        done
+        unset i
+        DEVTOOL_DISABLE_MENUCONFIG=true
+    else
         if [ -n "${UBOOT_MACHINE}" ]; then
             oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
         else
@@ -85,8 +101,6 @@ do_configure () {
         fi
         merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
         cml1_do_configure
-    else
-        DEVTOOL_DISABLE_MENUCONFIG=true
     fi
 }
 
@@ -114,7 +128,6 @@ do_compile () {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]
                 then
-                    oe_runmake -C ${S} O=${B}/${config} ${config}
                     oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
                     for binary in ${UBOOT_BINARIES}; do
                         k=$(expr $k + 1);
Signature · 1 line
2.25.1
#2 lore raw

Re: [OE-core] [dunfell][PATCH 1/2] u-boot: support merging .cfg files for UBOOT_CONFIG

Hello Richard,

Can you merge this on Dunfell,

Noor

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hussain, Ahsan
Sent: Monday, June 29, 2020 2:16 PM
To: [email protected]
Subject: [OE-core] [dunfell][PATCH 1/2] u-boot: support merging .cfg files for UBOOT_CONFIG

From: Ming Liu <[email protected]>

U-boot recipe supports .cfg files in SRC_URI, but they would be merged to .config during do_configure only when UBOOT_MACHINE is set, we should also support merging .cfg files for UBOOT_CONFIG.

---
 meta/recipes-bsp/u-boot/u-boot.inc | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
meta/recipes-bsp/u-boot/u-boot.inc +17 -4
index 80f828df52..8cfd25020c 100644
@@ -77,7 +77,23 @@ def find_cfgs(d):
     return sources_list
 
 do_configure () {
-    if [ -z "${UBOOT_CONFIG}" ]; then
+    if [ -n "${UBOOT_CONFIG}" ]; then
+        unset i j
+        for config in ${UBOOT_MACHINE}; do
+            i=$(expr $i + 1);
+            for type in ${UBOOT_CONFIG}; do
+                j=$(expr $j + 1);
+                if [ $j -eq $i ]; then
+                    oe_runmake -C ${S} O=${B}/${config} ${config}
+                    merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
+                    oe_runmake -C ${S} O=${B}/${config} oldconfig
+                fi
+            done
+            unset j
+        done
+        unset i
+        DEVTOOL_DISABLE_MENUCONFIG=true
+    else
         if [ -n "${UBOOT_MACHINE}" ]; then
             oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
         else
@@ -85,8 +101,6 @@ do_configure () {
         fi
         merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
         cml1_do_configure
-    else
-        DEVTOOL_DISABLE_MENUCONFIG=true
     fi
 }
 
@@ -114,7 +128,6 @@ do_compile () {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]
                 then
-                    oe_runmake -C ${S} O=${B}/${config} ${config}
                     oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
                     for binary in ${UBOOT_BINARIES}; do
                         k=$(expr $k + 1);

--
2.25.1

#3 lore raw

Re: [OE-core] [dunfell][PATCH 1/2] u-boot: support merging .cfg files for UBOOT_CONFIG

Quoted 3 lines · Noor Ahsan

Hello Richard,

Can you merge this on Dunfell,

Steve (ccd) is the dunfell maintainer, not me...

Cheers,

Richard

#4 lore raw

Re: [OE-core] [dunfell][PATCH 1/2] u-boot: support merging .cfg files for UBOOT_CONFIG

In reply to Noor Ahsan
Quoted 1 line · Noor Ahsan

Can you merge this on Dunfell,

These two patches are in a group currently under test. If all goes well they should be in next week's pull request.

Steve

Quoted 67 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hussain, Ahsan
Sent: Monday, June 29, 2020 2:16 PM
To: [email protected]
Subject: [OE-core] [dunfell][PATCH 1/2] u-boot: support merging .cfg files for UBOOT_CONFIG

From: Ming Liu <[email protected]>

U-boot recipe supports .cfg files in SRC_URI, but they would be merged to .config during do_configure only when UBOOT_MACHINE is set, we should also support merging .cfg files for UBOOT_CONFIG.

---
 meta/recipes-bsp/u-boot/u-boot.inc | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
meta/recipes-bsp/u-boot/u-boot.inc +17 -5
index 80f828df52..8cfd25020c 100644
@@ -77,7 +77,23 @@ def find_cfgs(d):
     return sources_list
 
 do_configure () {
-    if [ -z "${UBOOT_CONFIG}" ]; then
+    if [ -n "${UBOOT_CONFIG}" ]; then
+        unset i j
+        for config in ${UBOOT_MACHINE}; do
+            i=$(expr $i + 1);
+            for type in ${UBOOT_CONFIG}; do
+                j=$(expr $j + 1);
+                if [ $j -eq $i ]; then
+                    oe_runmake -C ${S} O=${B}/${config} ${config}
+                    merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
+                    oe_runmake -C ${S} O=${B}/${config} oldconfig
+                fi
+            done
+            unset j
+        done
+        unset i
+        DEVTOOL_DISABLE_MENUCONFIG=true
+    else
         if [ -n "${UBOOT_MACHINE}" ]; then
             oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
         else
@@ -85,8 +101,6 @@ do_configure () {
         fi
         merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
         cml1_do_configure
-    else
-        DEVTOOL_DISABLE_MENUCONFIG=true
     fi
 }
 
@@ -114,7 +128,6 @@ do_compile () {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]
                 then
-                    oe_runmake -C ${S} O=${B}/${config} ${config}
                     oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
                     for binary in ${UBOOT_BINARIES}; do
                         k=$(expr $k + 1);
--

2.25.1

author
#5 lore raw

PATCH 2/2 u-boot: avoid blind merging all *.cfg

In reply to ahussain

From: Jens Rehsack <[email protected]>

This fixes u-boot-qoriq breakage of:

commit 4fde8c8f479f5acd24fb6e0d0b9b4dc94d6f560b
Author: Ming Liu <[email protected]>
Date: Wed Jun 3 13:56:01 2020 +0200

u-boot: support merging .cfg files for UBOOT_CONFIG

U-boot recipe supports .cfg files in SRC_URI, but they would be merged to .config during do_configure only when UBOOT_MACHINE is set, we should also support merging .cfg files for UBOOT_CONFIG.

The intension of 4fde8c8 looks more than append delta-config snippets to u-boot config and should probably be rewritten to express that much better than implicitely assume all "*.cfg" are for merging into .config.

---
 meta/recipes-bsp/u-boot/u-boot.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-bsp/u-boot/u-boot.inc +5 -3
index 8cfd25020c..7d241916eb 100644
@@ -85,8 +85,10 @@ do_configure () {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]; then
                     oe_runmake -C ${S} O=${B}/${config} ${config}
-                    merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
-                    oe_runmake -C ${S} O=${B}/${config} oldconfig
+                    if [ test -n "${@' '.join(find_cfgs(d))}" ]; then
+                        merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
+                        oe_runmake -C ${S} O=${B}/${config} oldconfig
+                    fi
                 fi
             done
             unset j
@@ -119,7 +121,7 @@ do_compile () {
 		echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
 	fi
 
-    if [ -n "${UBOOT_CONFIG}" ]
+    if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ]
     then
         unset i j k
         for config in ${UBOOT_MACHINE}; do
Signature · 1 line
2.25.1
#6 lore raw

Re: [OE-core] [dunfell][PATCH 2/2] u-boot: avoid blind merging all *.cfg

Hello Richard,

Can you merge this on Dunfell.

Noor
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hussain, Ahsan
Sent: Monday, June 29, 2020 2:16 PM
To: [email protected]
Subject: [OE-core] [dunfell][PATCH 2/2] u-boot: avoid blind merging all *.cfg

From: Jens Rehsack <[email protected]>

This fixes u-boot-qoriq breakage of:

commit 4fde8c8f479f5acd24fb6e0d0b9b4dc94d6f560b
Author: Ming Liu <[email protected]>
Date: Wed Jun 3 13:56:01 2020 +0200

u-boot: support merging .cfg files for UBOOT_CONFIG

U-boot recipe supports .cfg files in SRC_URI, but they would be merged to .config during do_configure only when UBOOT_MACHINE is set, we should also support merging .cfg files for UBOOT_CONFIG.

The intension of 4fde8c8 looks more than append delta-config snippets to u-boot config and should probably be rewritten to express that much better than implicitely assume all "*.cfg" are for merging into .config.

---
 meta/recipes-bsp/u-boot/u-boot.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-bsp/u-boot/u-boot.inc +5 -3
index 8cfd25020c..7d241916eb 100644
@@ -85,8 +85,10 @@ do_configure () {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]; then
                     oe_runmake -C ${S} O=${B}/${config} ${config}
-                    merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
-                    oe_runmake -C ${S} O=${B}/${config} oldconfig
+                    if [ test -n "${@' '.join(find_cfgs(d))}" ]; then
+                        merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
+                        oe_runmake -C ${S} O=${B}/${config} oldconfig
+                    fi
                 fi
             done
             unset j
@@ -119,7 +121,7 @@ do_compile () {
 		echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
 	fi
 
-    if [ -n "${UBOOT_CONFIG}" ]
+    if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ]
     then
         unset i j k
         for config in ${UBOOT_MACHINE}; do

--
2.25.1