summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/u-boot/u-boot-configure.inc
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2024-08-07 09:44:55 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-09 22:33:38 +0100
commit469c371e5509399ae0abd991981935be44ec8f39 (patch)
treed3d21af1ce6058db6cbac9fdc4c139d5ed44fc99 /meta/recipes-bsp/u-boot/u-boot-configure.inc
parentea471cf48c80cee728d97c57292c90d2dda4ac6d (diff)
downloadpoky-469c371e5509399ae0abd991981935be44ec8f39.tar.gz
u-boot.inc: Refactor do_* steps into functions that can be overridden
The looping logic for handling (and not handling) UBOOT_CONFIG has led to the various do_* functions to be large and unwieldy. In order to modify one of the functional blocks inside of a loop (or in the else condition) means you either have to replace the function entirely, or append the function and undo something it did and then do what you need for your change. This refactor breaks out all of the inner loops and else clauses into new functions that themselves can be overridden without needing to worry about the bulk of the looping logic. It should not break any existing recipes doing prepends, appends, or overrides. None of the functional blocks were changed, just refactored out into new functions. (From OE-Core rev: 937bcc229502fcc154cc676b4fcc93c561873def) Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/u-boot/u-boot-configure.inc')
-rw-r--r--meta/recipes-bsp/u-boot/u-boot-configure.inc36
1 files changed, 24 insertions, 12 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc
index 378d675364..a15511f8b2 100644
--- a/meta/recipes-bsp/u-boot/u-boot-configure.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc
@@ -18,23 +18,35 @@ do_configure () {
18 for type in ${UBOOT_CONFIG}; do 18 for type in ${UBOOT_CONFIG}; do
19 j=$(expr $j + 1); 19 j=$(expr $j + 1);
20 if [ $j -eq $i ]; then 20 if [ $j -eq $i ]; then
21 oe_runmake -C ${S} O=${B}/${config} ${config} 21 uboot_configure_config $config $type
22 if [ -n "${@' '.join(find_cfgs(d))}" ]; then
23 merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
24 oe_runmake -C ${S} O=${B}/${config} oldconfig
25 fi
26 fi 22 fi
27 done 23 done
28 unset j 24 unset j
29 done 25 done
30 unset i 26 unset i
31 else 27 else
32 if [ -n "${UBOOT_MACHINE}" ]; then 28 uboot_configure
33 oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
34 else
35 oe_runmake -C ${S} O=${B} oldconfig
36 fi
37 merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
38 cml1_do_configure
39 fi 29 fi
40} 30}
31
32uboot_configure_config () {
33 config=$1
34 type=$2
35
36 oe_runmake -C ${S} O=${B}/${config} ${config}
37 if [ -n "${@' '.join(find_cfgs(d))}" ]; then
38 merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
39 oe_runmake -C ${S} O=${B}/${config} oldconfig
40 fi
41}
42
43uboot_configure () {
44 if [ -n "${UBOOT_MACHINE}" ]; then
45 oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
46 else
47 oe_runmake -C ${S} O=${B} oldconfig
48 fi
49 merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
50 cml1_do_configure
51}
52