Skip to content

Commit

Permalink
fix the version generation in u-boot
Browse files Browse the repository at this point in the history
Summary:
u-boot has its copy to get the OpenBMC version and put it to
.scmversion. That logic is broken after OpenBMC restructuring. The diff
removes the dup copy and use the newly introduced OPENBMC_VERSION
variable for that.

Test Plan:
bitbake u-boot
and then verify .scmversion is updated correctly.

Reviewed By: benwei13

fbshipit-source-id: 3f325d8
  • Loading branch information
amithash authored and facebook-github-bot committed Mar 7, 2018
1 parent c919622 commit d431e77
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions meta-aspeed/recipes-bsp/u-boot/u-boot_2016.07.bb
Original file line number Diff line number Diff line change
Expand Up @@ -92,36 +92,12 @@ do_compile () {
unset CFLAGS
unset CPPFLAGS

# found out the source dir
dir=$(pwd)
while [ -n "$dir" -a "$dir" != "/" -a ! -d "$dir/meta-openbmc/.git" ]; do
dir=$(dirname $dir)
done

if [ -d "$dir/meta-openbmc/.git" ]; then
srcdir="$dir/meta-openbmc"
srcdir_git="${srcdir}/.git"
version=$(git --git-dir=${srcdir_git} --work-tree=${srcdir} describe --tags --dirty --always 2> /dev/null)
else
version=""
fi

print_version="${MACHINE}"
if [[ $version == ${MACHINE}-v* ]]; then
print_version=" ${version} "
elif [[ $version == "" ]]; then
print_version=" ${MACHINE}-v0.0 "
else
sha=$(git --git-dir=${srcdir_git} --work-tree=${srcdir} rev-parse --short HEAD 2> /dev/null)
print_version=" ${MACHINE}-${sha} "
fi

if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
then
echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
echo ${print_version} >> ${B}/.scmversion
echo ${OPENBMC_VERSION} >> ${B}/.scmversion
echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
echo ${print_version} >> ${S}/.scmversion
echo ${OPENBMC_VERSION} >> ${S}/.scmversion
fi

if [ "x${UBOOT_CONFIG}" != "x" ]
Expand Down

0 comments on commit d431e77

Please sign in to comment.