diff options
| author | Ryan Eatmon <reatmon@ti.com> | 2025-10-07 17:43:49 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-13 18:01:03 +0100 |
| commit | 91f50b7c55968b0857818cf05c03488cd19452d4 (patch) | |
| tree | 8c72dac291c1c0ecd06491984ab622fc5fff39d9 | |
| parent | 47941252215ffb46a24ed820dd6e94d9c1f6bafe (diff) | |
| download | poky-91f50b7c55968b0857818cf05c03488cd19452d4.tar.gz | |
u-boot: Make sure the build dir is unique for each UBOOT_CONFIG
Each UBOOT_CONFIG entry is run in a different directory under ${B} so
that the files can be generated, compiled, and installed differently
from each other. Currently that unique directory name was just the
defconfig used for each UBOOT_CONFIG.
One potential conflict arises when you want build the same defconfig
twice, but pass in different make options. Then we get directory
collision. Simple fix is to include both the defconfig name and the
UBOOT_CONFIG type in the directory name.
This change has the potential to be backwards breaking if a layer is
using the UBOOT_CONFIG flow and overriding/appending any of the do_*
shell functions. Each of those will either need to change to using:
${B}/${config} -> ${B}/${config}-${type}
or for append functions they can use the new variable in the parent
function:
${B}/${config} -> ${B}/${builddir}
(From OE-Core rev: 22e96b32b0be02ec0971c9334d4b1df7c9ef8d84)
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes-recipe/uboot-sign.bbclass | 7 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/u-boot-configure.inc | 8 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/u-boot.inc | 40 |
3 files changed, 38 insertions, 17 deletions
diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index 0f387a3a3e..66b9698c1d 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass | |||
| @@ -528,6 +528,8 @@ do_uboot_assemble_fitimage() { | |||
| 528 | fi | 528 | fi |
| 529 | done | 529 | done |
| 530 | 530 | ||
| 531 | builddir="${config}-${type}" | ||
| 532 | |||
| 531 | for binary in ${UBOOT_BINARIES}; do | 533 | for binary in ${UBOOT_BINARIES}; do |
| 532 | k=$(expr $k + 1); | 534 | k=$(expr $k + 1); |
| 533 | if [ $k -eq $i ]; then | 535 | if [ $k -eq $i ]; then |
| @@ -535,7 +537,7 @@ do_uboot_assemble_fitimage() { | |||
| 535 | fi | 537 | fi |
| 536 | done | 538 | done |
| 537 | 539 | ||
| 538 | cd ${B}/${config} | 540 | cd ${B}/${builddir} |
| 539 | uboot_assemble_fitimage_helper ${type} ${binary} | 541 | uboot_assemble_fitimage_helper ${type} ${binary} |
| 540 | done | 542 | done |
| 541 | else | 543 | else |
| @@ -584,7 +586,8 @@ do_deploy:prepend() { | |||
| 584 | for type in ${UBOOT_CONFIG}; do | 586 | for type in ${UBOOT_CONFIG}; do |
| 585 | j=$(expr $j + 1); | 587 | j=$(expr $j + 1); |
| 586 | if [ $j -eq $i ]; then | 588 | if [ $j -eq $i ]; then |
| 587 | cd ${B}/${config} | 589 | builddir="${config}-${type}" |
| 590 | cd ${B}/${builddir} | ||
| 588 | deploy_helper ${type} | 591 | deploy_helper ${type} |
| 589 | fi | 592 | fi |
| 590 | done | 593 | done |
diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc index bada506b66..f3d9e55105 100644 --- a/meta/recipes-bsp/u-boot/u-boot-configure.inc +++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc | |||
| @@ -33,6 +33,8 @@ uboot_configure_config () { | |||
| 33 | config=$1 | 33 | config=$1 |
| 34 | type=$2 | 34 | type=$2 |
| 35 | 35 | ||
| 36 | builddir="${config}-${type}" | ||
| 37 | |||
| 36 | unset k | 38 | unset k |
| 37 | IFS="?" | 39 | IFS="?" |
| 38 | uboot_config_make_opts="${UBOOT_CONFIG_MAKE_OPTS}" | 40 | uboot_config_make_opts="${UBOOT_CONFIG_MAKE_OPTS}" |
| @@ -45,10 +47,10 @@ uboot_configure_config () { | |||
| 45 | unset IFS | 47 | unset IFS |
| 46 | unset k | 48 | unset k |
| 47 | 49 | ||
| 48 | oe_runmake -C ${S} O=${B}/${config} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${config} | 50 | oe_runmake -C ${S} O=${B}/${builddir} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${config} |
| 49 | if [ -n "${@' '.join(find_cfgs(d))}" ]; then | 51 | if [ -n "${@' '.join(find_cfgs(d))}" ]; then |
| 50 | merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))} | 52 | merge_config.sh -m -O ${B}/${builddir} ${B}/${builddir}/.config ${@" ".join(find_cfgs(d))} |
| 51 | oe_runmake -C ${S} O=${B}/${config} oldconfig | 53 | oe_runmake -C ${S} O=${B}/${builddir} oldconfig |
| 52 | fi | 54 | fi |
| 53 | } | 55 | } |
| 54 | 56 | ||
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index e0a69e740e..16c9836508 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc | |||
| @@ -75,6 +75,8 @@ uboot_compile_config () { | |||
| 75 | config=$2 | 75 | config=$2 |
| 76 | type=$3 | 76 | type=$3 |
| 77 | 77 | ||
| 78 | builddir="${config}-${type}" | ||
| 79 | |||
| 78 | unset k | 80 | unset k |
| 79 | IFS="?" | 81 | IFS="?" |
| 80 | uboot_config_make_opts="${UBOOT_CONFIG_MAKE_OPTS}" | 82 | uboot_config_make_opts="${UBOOT_CONFIG_MAKE_OPTS}" |
| @@ -87,7 +89,7 @@ uboot_compile_config () { | |||
| 87 | unset IFS | 89 | unset IFS |
| 88 | unset k | 90 | unset k |
| 89 | 91 | ||
| 90 | oe_runmake -C ${S} O=${B}/${config} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${UBOOT_MAKE_TARGET} | 92 | oe_runmake -C ${S} O=${B}/${builddir} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${UBOOT_MAKE_TARGET} |
| 91 | 93 | ||
| 92 | unset k | 94 | unset k |
| 93 | for binary in ${UBOOT_BINARIES}; do | 95 | for binary in ${UBOOT_BINARIES}; do |
| @@ -100,8 +102,8 @@ uboot_compile_config () { | |||
| 100 | 102 | ||
| 101 | # Generate the uboot-initial-env | 103 | # Generate the uboot-initial-env |
| 102 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | 104 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then |
| 103 | oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env | 105 | oe_runmake -C ${S} O=${B}/${builddir} u-boot-initial-env |
| 104 | cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type} | 106 | cp ${B}/${builddir}/u-boot-initial-env ${B}/${builddir}/u-boot-initial-env-${type} |
| 105 | fi | 107 | fi |
| 106 | } | 108 | } |
| 107 | 109 | ||
| @@ -110,7 +112,9 @@ uboot_compile_config_copy_binary () { | |||
| 110 | type=$2 | 112 | type=$2 |
| 111 | binary=$3 | 113 | binary=$3 |
| 112 | 114 | ||
| 113 | cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} | 115 | builddir="${config}-${type}" |
| 116 | |||
| 117 | cp ${B}/${builddir}/${binary} ${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} | ||
| 114 | } | 118 | } |
| 115 | 119 | ||
| 116 | uboot_compile () { | 120 | uboot_compile () { |
| @@ -204,13 +208,15 @@ uboot_install_config () { | |||
| 204 | config=$1 | 208 | config=$1 |
| 205 | type=$2 | 209 | type=$2 |
| 206 | 210 | ||
| 207 | install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} | 211 | builddir="${config}-${type}" |
| 212 | |||
| 213 | install -D -m 644 ${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} | ||
| 208 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} | 214 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} |
| 209 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} | 215 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} |
| 210 | 216 | ||
| 211 | # Install the uboot-initial-env | 217 | # Install the uboot-initial-env |
| 212 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | 218 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then |
| 213 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} | 219 | install -D -m 644 ${B}/${builddir}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} |
| 214 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type} | 220 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type} |
| 215 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type} | 221 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type} |
| 216 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} | 222 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} |
| @@ -233,7 +239,9 @@ uboot_install_elf_config () { | |||
| 233 | config=$1 | 239 | config=$1 |
| 234 | type=$2 | 240 | type=$2 |
| 235 | 241 | ||
| 236 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} | 242 | builddir="${config}-${type}" |
| 243 | |||
| 244 | install -m 644 ${B}/${builddir}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} | ||
| 237 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} | 245 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} |
| 238 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY} | 246 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY} |
| 239 | } | 247 | } |
| @@ -247,7 +255,9 @@ uboot_install_spl_config () { | |||
| 247 | config=$1 | 255 | config=$1 |
| 248 | type=$2 | 256 | type=$2 |
| 249 | 257 | ||
| 250 | install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} | 258 | builddir="${config}-${type}" |
| 259 | |||
| 260 | install -m 644 ${B}/${builddir}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} | ||
| 251 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type} | 261 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type} |
| 252 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE} | 262 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE} |
| 253 | } | 263 | } |
| @@ -366,7 +376,9 @@ uboot_deploy_config () { | |||
| 366 | config=$1 | 376 | config=$1 |
| 367 | type=$2 | 377 | type=$2 |
| 368 | 378 | ||
| 369 | install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} | 379 | builddir="${config}-${type}" |
| 380 | |||
| 381 | install -D -m 644 ${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} | ||
| 370 | cd ${DEPLOYDIR} | 382 | cd ${DEPLOYDIR} |
| 371 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} | 383 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} |
| 372 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} | 384 | ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} |
| @@ -375,7 +387,7 @@ uboot_deploy_config () { | |||
| 375 | 387 | ||
| 376 | # Deploy the uboot-initial-env | 388 | # Deploy the uboot-initial-env |
| 377 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | 389 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then |
| 378 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} | 390 | install -D -m 644 ${B}/${builddir}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} |
| 379 | cd ${DEPLOYDIR} | 391 | cd ${DEPLOYDIR} |
| 380 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type} | 392 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type} |
| 381 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}-${type} | 393 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}-${type} |
| @@ -403,7 +415,9 @@ uboot_deploy_elf_config () { | |||
| 403 | config=$1 | 415 | config=$1 |
| 404 | type=$2 | 416 | type=$2 |
| 405 | 417 | ||
| 406 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} | 418 | builddir="${config}-${type}" |
| 419 | |||
| 420 | install -m 644 ${B}/${builddir}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} | ||
| 407 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type} | 421 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type} |
| 408 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} | 422 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} |
| 409 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type} | 423 | ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type} |
| @@ -420,7 +434,9 @@ uboot_deploy_spl_config () { | |||
| 420 | config=$1 | 434 | config=$1 |
| 421 | type=$2 | 435 | type=$2 |
| 422 | 436 | ||
| 423 | install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} | 437 | builddir="${config}-${type}" |
| 438 | |||
| 439 | install -m 644 ${B}/${builddir}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} | ||
| 424 | rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK} | 440 | rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK} |
| 425 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type} | 441 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type} |
| 426 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE} | 442 | ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE} |
