]> code.ossystems Code Review - meta-freescale.git/commitdiff
fsl-kernel-localversion.bbclass: Fix building using out-of-tree
authorOtavio Salvador <otavio@ossystems.com.br>
Sat, 20 Dec 2014 19:11:24 +0000 (17:11 -0200)
committerOtavio Salvador <otavio@ossystems.com.br>
Sun, 21 Dec 2014 18:59:58 +0000 (16:59 -0200)
Since OE-Core:df9975f4 (kernel: Fix non linux-yocto builds) the way
the build of kernel is done has change. Now the source code is moved
placed at STAGING_KERNEL_DIR and the build is done at ${WORKDIR}/build
which is B.

This patch adapts the configure task prepending to cope with those changes.

Change-Id: I9ea4254ffd56e4b7201daf9a90b52756a399c0f6
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/classes/fsl-kernel-localversion.bbclass

index bb4bdf5994c7634d3d1f13294aa91a3d2622d2ff..6f9eb51325c7a38199425832829d25b4d9bfc672 100644 (file)
@@ -16,24 +16,24 @@ kernel_conf_variable() {
        CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
        if test "$2" = "n"
        then
-               echo "# CONFIG_$1 is not set" >> ${S}/.config
+               echo "# CONFIG_$1 is not set" >> ${B}/.config
        else
-               echo "CONFIG_$1=$2" >> ${S}/.config
+               echo "CONFIG_$1=$2" >> ${B}/.config
        fi
 }
 
 do_configure_prepend() {
-       echo "" > ${S}/.config
+       echo "" > ${B}/.config
        CONF_SED_SCRIPT=""
 
        kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
        kernel_conf_variable LOCALVERSION_AUTO y
 
-       sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${S}/.config'
+       sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config'
 
        if [ "${SCMVERSION}" = "y" ]; then
                # Add GIT revision to the local version
-               head=`git rev-parse --verify --short HEAD 2> /dev/null`
-               printf "%s%s" +g $head > ${S}/.scmversion
+               head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null`
+               printf "%s%s" +g $head > ${B}/.scmversion
        fi
 }