Skip to content

Commit 5a760fc

Browse files
author
BELOUARGA Mohamed
committed
u-boot: add support of *.cfg files
Resolve the problem of support of .cfg configuration fragments. When a user adds a fragment.cfg to SRC_URI, it is expecetd that configuration is added to the final image, but it is not done. Signed-off-by: BELOUARGA Mohamed <m.belouarga@technologyandstrategy.com>
1 parent 128bf04 commit 5a760fc

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -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-atmel.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+
}

recipes-bsp/u-boot/u-boot-atmel.inc

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ SPL_BINARY ?= ""
3030
SPL_IMAGE ?= "${SPL_BINARY}-${MACHINE}-${PV}-${PR}"
3131
SPL_SYMLINK ?= "${SPL_BINARY}-${MACHINE}"
3232

33+
require u-boot-atmel-configure.inc
34+
3335
do_compile () {
3436
if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then
3537
sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' config.mk
@@ -45,7 +47,6 @@ do_compile () {
4547
echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
4648
fi
4749

48-
oe_runmake ${UBOOT_MACHINE}
4950
oe_runmake ${UBOOT_MAKE_TARGET}
5051
}
5152

0 commit comments

Comments
 (0)