u-boot: support merging .cfg files for UBOOT_CONFIG
PATCH v2 1/1 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
@@ -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.26.2
Can this be ported/merged to dunfell also?
Noor
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ming Liu
Sent: Wednesday, June 3, 2020 4:56 PM
To: [email protected]
Cc: [email protected]; [email protected]; Ming Liu <[email protected]>
Subject: [OE-core] [PATCH V2] 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
@@ -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.26.2
This is a new feature (as opposed to a bug or cve fix) so we need to have some list discussion on why it should be taken.
I also see that this patch causes breakage and there is a follow-on fix patch (u-boot: avoid blind merging all *.cfg)
To get the discussion going please submit a patch series to the list (tagged with [dunfell]) including a cover letter that makes the case for adding the feature.
Thanks!
Steve
Quoted 72 lines · Noor Ahsan
Can this be ported/merged to dunfell also?
Noor
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ming Liu
Sent: Wednesday, June 3, 2020 4:56 PM
To: [email protected]
Cc: [email protected]; [email protected]; Ming Liu <[email protected]>
Subject: [OE-core] [PATCH V2] u-boot: support merging .cfg files forUBOOT_CONFIGFrom: Ming Liu <[email protected]>
U-boot recipe supports .cfg files in
SRC_URI, but they would be merged to .config duringdo_configureonly whenUBOOT_MACHINEis set, we should also support merging .cfg files forUBOOT_CONFIG.Signed-off-by Max Krummenacher <[email protected]>Signed-off-by Ming Liu <[email protected]>--- 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@@ -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.26.2