From 34c9bd4ad5b15ac69bc8cb941038f6681657b6e1 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 10 Apr 2019 11:07:50 -0500 Subject: Put the PR into the U-Boot image --- recipes-bsp/u-boot/u-boot.inc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/u-boot/u-boot.inc b/recipes-bsp/u-boot/u-boot.inc index 7e6ad74..d4fa04a 100644 --- a/recipes-bsp/u-boot/u-boot.inc +++ b/recipes-bsp/u-boot/u-boot.inc @@ -67,6 +67,24 @@ UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" FILES_${PN}-dev += "${includedir}/u-boot/* ${includedir}/u-boot/configs/* ${includedir}/u-boot/asm/*" +# Put the PR into the U-Boot image. If you can think of a better way, be my guest. +# Why must it be written in python? +do_patch_append () { + try: + S = d.getVar("S",True) + except TypeError: + bb.fatal("S is missing from recipe") + + f = open(S + "/localversion.mt","w") + + try: + PR = d.getVar("PR",True) + except TypeError: + bb.fatal("PR is missing from recipe") + f.write(PR + os.linesep) +} + + do_compile () { if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' config.mk @@ -90,7 +108,8 @@ do_compile () { j=`expr $j + 1`; if [ $j -eq $i ] then - oe_runmake O=${config} ${config} --defconfig mtconfig + echo 'JAK was here' + oe_runmake PATCHLEVEL=${PR} O=${config} ${config} --defconfig mtconfig oe_runmake O=${config} ${UBOOT_MAKE_TARGET} cp ${S}/${config}/${UBOOT_BINARY} ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} fi @@ -99,7 +118,8 @@ do_compile () { done unset i else - oe_runmake ${UBOOT_MACHINE} + echo 'JAK 2 was here' + oe_runmake PATCHLEVEL=${PR} ${UBOOT_MACHINE} oe_runmake ${UBOOT_MAKE_TARGET} fi -- cgit v1.2.3