From 2a1878a6b35ef8c88d1c348f74e196491174816c Mon Sep 17 00:00:00 2001 From: Ryan Eatmon Date: Thu, 12 Sep 2024 12:23:40 -0500 Subject: Revert "classes: Create uboot-fragments.bbclass" This reverts commit f39943db864b1c881369282f59071d6fabc4059c. --- meta-ti-bsp/classes/uboot-fragments.bbclass | 77 ---------------------- .../recipes-bsp/u-boot/u-boot-mergeconfig.inc | 7 ++ meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +- 3 files changed, 8 insertions(+), 80 deletions(-) delete mode 100644 meta-ti-bsp/classes/uboot-fragments.bbclass create mode 100644 meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc (limited to 'meta-ti-bsp') diff --git a/meta-ti-bsp/classes/uboot-fragments.bbclass b/meta-ti-bsp/classes/uboot-fragments.bbclass deleted file mode 100644 index 8db052fa..00000000 --- a/meta-ti-bsp/classes/uboot-fragments.bbclass +++ /dev/null @@ -1,77 +0,0 @@ -# Handle U-Boot config fragments for a machine -# -# This interacts with the UBOOT_CONFIG flow -# -# The format to specify it, in the machine, is: -# -# UBOOT_FRAGMENTS_CONFIG[foo] = "fragment[,fragment...]" -# -# or -# -# UBOOT_FRAGMENTS = "fragment[,fragment...]" -# -# Copyright 2024 (C) Texas Instruments, Inc. -# -# SPDX-License-Identifier: MIT - -python () { - loUbootConfig = (d.getVar('UBOOT_CONFIG') or "").split() - loUbootFragments = d.getVar('UBOOT_FRAGMENTS') - loUbootFragmentsConfigFlags = d.getVarFlags('UBOOT_FRAGMENTS_CONFIG') - - if loUbootFragmentsConfigFlags and loUbootFragments: - raise bb.parse.SkipRecipe("You cannot use UBOOT_FRAGMENTS and UBOOT_FRAGMENTS_CONFIG at the same time.") - - if loUbootFragmentsConfigFlags is not None and len(loUbootConfig) > 0: - for lpConfig in loUbootConfig: - loFound = False - for lpFlag, lpValue in loUbootFragmentsConfigFlags.items(): - if lpConfig == lpFlag: - loFound = True - if lpValue == "": - d.appendVar('UBOOT_FRAGMENTS', ' none') - else: - d.appendVar('UBOOT_FRAGMENTS', ' ' + lpValue) - - if not loFound: - raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (loUbootConfig, loUbootFragmentsConfigFlags.keys())) -} - -uboot_configure_config:append () { - if [ -n "${UBOOT_FRAGMENTS}" ] - then - unset loTypeIdx - for lpType in ${UBOOT_CONFIG}; do - loTypeIdx=$(expr $loTypeIdx + 1) - - if [ "${lpType}" == "${type}" ]; then - break - fi - done - - loApplyFragments="" - - for lpFragment in ${UBOOT_FRAGMENTS}; do - lpFragmentIdx=$(expr $lpFragmentIdx + 1) - if [ $y -eq $x ]; then - if [ "${lpFragment}" != "none" ]; then - loApplyFragments=`echo ${lpFragment} | tr "," " "` - fi - break - fi - done - - if [ -n "${loApplyFragments}" ]; then - oe_runmake -C ${S} O=${B}/${config} ${config} ${loApplyFragments} - oe_runmake -C ${S} O=${B}/${config} oldconfig - fi - fi -} - -uboot_configure:append () { - if [ -n "${UBOOT_FRAGMENTS}" ] && [ -n "${UBOOT_MACHINE}" ] - then - oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} `echo ${UBOOT_FRAGMENTS} | tr "," " "` - oe_runmake -C ${S} O=${B} oldconfig - fi -} diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc new file mode 100644 index 00000000..c7ce5047 --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc @@ -0,0 +1,7 @@ +do_configure:append () { + if [ -n "${UBOOT_CONFIG_FRAGMENTS}" ] && [ -n "${UBOOT_MACHINE}" ] + then + oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} ${UBOOT_CONFIG_FRAGMENTS} + oe_runmake -C ${S} O=${B} olddefconfig + fi +} diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc index 5521ecee..bb50e1e9 100644 --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc @@ -1,4 +1,3 @@ - do_compile:prepend () { scm_version=$(printf '%s%s' -ti-g $(git -C ${S} rev-parse --verify HEAD 2>/dev/null | cut -c1-12)) @@ -11,8 +10,7 @@ SPL_BINARY ?= "MLO" require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot-common.inc require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc - -inherit uboot-fragments +require u-boot-mergeconfig.inc FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:" -- cgit v1.2.3-54-g00ecf