diff options
author | Zev Weiss <zev@bewilderbeest.net> | 2022-01-18 22:48:12 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-20 11:57:29 +0000 |
commit | fc9a17ad386cef166c40b8da7511604ede83fb61 (patch) | |
tree | 96d68f2ff5ed1b376fca1eadd7658b93ebafda6d /meta/recipes-bsp | |
parent | 18e35543012e0285a1193e4d566cb56dc9975be4 (diff) | |
download | poky-fc9a17ad386cef166c40b8da7511604ede83fb61.tar.gz |
u-boot: Split do_configure logic into separate file
Some auxiliary u-boot recipes may need u-boot properly configured
(including *.cfg additions via bbappends) but aren't necessarily
building u-boot itself; to support such situations, here we split the
u-boot do_configure() out of u-boot.inc and into its own
u-boot-configure.inc.
(From OE-Core rev: e55e6fb4983a41f74c0e457bf54bd8dfa5608daa)
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot-configure.inc | 39 | ||||
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot.inc | 31 |
2 files changed, 40 insertions, 30 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc new file mode 100644 index 0000000000..04e0894752 --- /dev/null +++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc | |||
@@ -0,0 +1,39 @@ | |||
1 | # This provides the logic for creating the desired u-boot config, | ||
2 | # accounting for any *.cfg files added to SRC_URI. It's separated | ||
3 | # from u-boot.inc for use by recipes that need u-boot properly | ||
4 | # configured but aren't doing a full build of u-boot itself (such as | ||
5 | # its companion tools). | ||
6 | |||
7 | inherit uboot-config cml1 | ||
8 | |||
9 | DEPENDS += "kern-tools-native" | ||
10 | |||
11 | do_configure () { | ||
12 | if [ -n "${UBOOT_CONFIG}" ]; then | ||
13 | unset i j | ||
14 | for config in ${UBOOT_MACHINE}; do | ||
15 | i=$(expr $i + 1); | ||
16 | for type in ${UBOOT_CONFIG}; do | ||
17 | j=$(expr $j + 1); | ||
18 | if [ $j -eq $i ]; then | ||
19 | oe_runmake -C ${S} O=${B}/${config} ${config} | ||
20 | if [ -n "${@' '.join(find_cfgs(d))}" ]; then | ||
21 | merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))} | ||
22 | oe_runmake -C ${S} O=${B}/${config} oldconfig | ||
23 | fi | ||
24 | fi | ||
25 | done | ||
26 | unset j | ||
27 | done | ||
28 | unset i | ||
29 | DEVTOOL_DISABLE_MENUCONFIG=true | ||
30 | else | ||
31 | if [ -n "${UBOOT_MACHINE}" ]; then | ||
32 | oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} | ||
33 | else | ||
34 | oe_runmake -C ${S} O=${B} oldconfig | ||
35 | fi | ||
36 | merge_config.sh -m .config ${@" ".join(find_cfgs(d))} | ||
37 | cml1_do_configure | ||
38 | fi | ||
39 | } | ||
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index 2d5e46f4ef..f022aed732 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc | |||
@@ -3,7 +3,6 @@ PROVIDES = "virtual/bootloader" | |||
3 | 3 | ||
4 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 4 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
5 | 5 | ||
6 | DEPENDS += "kern-tools-native" | ||
7 | DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}" | 6 | DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}" |
8 | 7 | ||
9 | inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native kernel-arch | 8 | inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native kernel-arch |
@@ -25,35 +24,7 @@ PACKAGECONFIG[openssl] = ",,openssl-native" | |||
25 | # file already exists it will not be overwritten. | 24 | # file already exists it will not be overwritten. |
26 | UBOOT_LOCALVERSION ?= "" | 25 | UBOOT_LOCALVERSION ?= "" |
27 | 26 | ||
28 | do_configure () { | 27 | require u-boot-configure.inc |
29 | if [ -n "${UBOOT_CONFIG}" ]; then | ||
30 | unset i j | ||
31 | for config in ${UBOOT_MACHINE}; do | ||
32 | i=$(expr $i + 1); | ||
33 | for type in ${UBOOT_CONFIG}; do | ||
34 | j=$(expr $j + 1); | ||
35 | if [ $j -eq $i ]; then | ||
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 | fi | ||
42 | done | ||
43 | unset j | ||
44 | done | ||
45 | unset i | ||
46 | DEVTOOL_DISABLE_MENUCONFIG=true | ||
47 | else | ||
48 | if [ -n "${UBOOT_MACHINE}" ]; then | ||
49 | oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} | ||
50 | else | ||
51 | oe_runmake -C ${S} O=${B} oldconfig | ||
52 | fi | ||
53 | merge_config.sh -m .config ${@" ".join(find_cfgs(d))} | ||
54 | cml1_do_configure | ||
55 | fi | ||
56 | } | ||
57 | 28 | ||
58 | do_compile () { | 29 | do_compile () { |
59 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then | 30 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then |