diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-12-08 00:38:17 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-12-08 00:38:17 +0300 |
commit | 8d6ae7f2a817751fad151168fa10ce28ee0869d8 (patch) | |
tree | 281032f7ec07c41589aa094bd165cc2a98f2d3a7 /poky/meta/recipes-bsp/u-boot/u-boot.inc | |
parent | c16fb8893b19075db4bcf3b5bf33c1db8c3ca2bd (diff) | |
parent | 5da3c2284560a7e08ffafd03c5b5ba44a3242228 (diff) | |
download | openbmc-8d6ae7f2a817751fad151168fa10ce28ee0869d8.tar.xz |
Merge tag '0.26' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'poky/meta/recipes-bsp/u-boot/u-boot.inc')
-rw-r--r-- | poky/meta/recipes-bsp/u-boot/u-boot.inc | 134 |
1 files changed, 77 insertions, 57 deletions
diff --git a/poky/meta/recipes-bsp/u-boot/u-boot.inc b/poky/meta/recipes-bsp/u-boot/u-boot.inc index 80f828df5..251178db3 100644 --- a/poky/meta/recipes-bsp/u-boot/u-boot.inc +++ b/poky/meta/recipes-bsp/u-boot/u-boot.inc @@ -60,24 +60,36 @@ UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" +# Default name of u-boot initial env, but enable individual recipes to change +# this value. +UBOOT_INITIAL_ENV ?= "${PN}-initial-env" + # U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf # to find EXTLINUX conf file. UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}" -# returns all the elements from the src uri that are .cfg files -def find_cfgs(d): - sources=src_patches(d, True) - sources_list=[] - for s in sources: - if s.endswith('.cfg'): - sources_list.append(s) - - return sources_list - do_configure () { - if [ -z "${UBOOT_CONFIG}" ]; then + if [ -n "${UBOOT_CONFIG}" ]; then + unset i j + for config in ${UBOOT_MACHINE}; do + i=$(expr $i + 1); + for type in ${UBOOT_CONFIG}; do + j=$(expr $j + 1); + if [ $j -eq $i ]; then + oe_runmake -C ${S} O=${B}/${config} ${config} + if [ -n "${@' '.join(find_cfgs(d))}" ]; then + merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))} + oe_runmake -C ${S} O=${B}/${config} oldconfig + fi + fi + done + unset j + done + unset i + DEVTOOL_DISABLE_MENUCONFIG=true + else if [ -n "${UBOOT_MACHINE}" ]; then oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} else @@ -85,27 +97,25 @@ do_configure () { fi merge_config.sh -m .config ${@" ".join(find_cfgs(d))} cml1_do_configure - else - DEVTOOL_DISABLE_MENUCONFIG=true fi } do_compile () { - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then - sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk - fi + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then + sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk + fi - unset LDFLAGS - unset CFLAGS - unset CPPFLAGS + unset LDFLAGS + unset CFLAGS + unset CPPFLAGS - if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ] - then - echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion - echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion - fi + if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ] + then + echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion + echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion + fi - if [ -n "${UBOOT_CONFIG}" ] + if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ] then unset i j k for config in ${UBOOT_MACHINE}; do @@ -114,7 +124,6 @@ do_compile () { j=$(expr $j + 1); if [ $j -eq $i ] then - oe_runmake -C ${S} O=${B}/${config} ${config} oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET} for binary in ${UBOOT_BINARIES}; do k=$(expr $k + 1); @@ -124,22 +133,25 @@ do_compile () { done # Generate the uboot-initial-env - oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env - cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type} + if [ -n "${UBOOT_INITIAL_ENV}" ]; then + oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env + cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type} + fi unset k fi done - unset j + unset j done - unset i + unset i else oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} # Generate the uboot-initial-env - oe_runmake -C ${S} O=${B} u-boot-initial-env + if [ -n "${UBOOT_INITIAL_ENV}" ]; then + oe_runmake -C ${S} O=${B} u-boot-initial-env + fi fi - } do_install () { @@ -156,23 +168,27 @@ do_install () { ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} # Install the uboot-initial-env - install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${type} - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${type} - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env + if [ -n "${UBOOT_INITIAL_ENV}" ]; then + install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} + fi fi done - unset j + unset j done - unset i + unset i else install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE} ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} # Install the uboot-initial-env - install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${PV}-${PR} - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE} - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env + if [ -n "${UBOOT_INITIAL_ENV}" ]; then + install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} + fi fi if [ -n "${UBOOT_ELF}" ] @@ -219,9 +235,9 @@ do_install () { ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME} fi done - unset j + unset j done - unset i + unset i else install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME} @@ -238,14 +254,14 @@ do_install () { then install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME} fi - } PACKAGE_BEFORE_PN += "${PN}-env" RPROVIDES_${PN}-env += "u-boot-default-env" +ALLOW_EMPTY_${PN}-env = "1" FILES_${PN}-env = " \ - ${sysconfdir}/${PN}-initial-env* \ + ${@ '${sysconfdir}/${UBOOT_INITIAL_ENV}*' if d.getVar('UBOOT_INITIAL_ENV') else ''} \ ${sysconfdir}/fw_env.config \ " @@ -269,15 +285,17 @@ do_deploy () { ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} # Deploy the uboot-initial-env - install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} - cd ${DEPLOYDIR} - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${MACHINE}-${type} - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${type} + if [ -n "${UBOOT_INITIAL_ENV}" ]; then + install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} + cd ${DEPLOYDIR} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type} + fi fi done - unset j + unset j done - unset i + unset i else install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} @@ -287,10 +305,12 @@ do_deploy () { ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} # Deploy the uboot-initial-env - install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${PV}-${PR} - cd ${DEPLOYDIR} - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env-${MACHINE} - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env + if [ -n "${UBOOT_INITIAL_ENV}" ]; then + install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} + cd ${DEPLOYDIR} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE} + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV} + fi fi if [ -e ${WORKDIR}/fw_env.config ] ; then @@ -346,9 +366,9 @@ do_deploy () { ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK} fi done - unset j + unset j done - unset i + unset i else install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK} |