]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sdktool.py: Remove hardcoded bitbake path. rewitt/newsdk
authorRandy Witt <randy.e.witt@intel.com>
Wed, 27 Aug 2014 22:51:09 +0000 (15:51 -0700)
committerRandy Witt <randy.e.witt@intel.com>
Fri, 29 Aug 2014 18:52:39 +0000 (11:52 -0700)
The layer that contains bitbake and the environment setup files is now
injected during sdk creation using sed.

meta/recipes-core/meta/meta-newsdk.bb
meta/recipes-core/meta/meta-newsdk/sdktool.py

index f45341044704b0f20abd9ba1b8eba396e06d6844..ea58e3a2a5eeed9dc887ba4de8d72d1fb9ffb94f 100644 (file)
@@ -97,6 +97,8 @@ python copy_buildsystem () {
         if layer != bitbakepath:
             layerrelpath = os.path.relpath(layer, os.path.dirname(toplevel))
             sdkbblayers.append(layerrelpath)
+        else:
+           d.setVar('BITBAKE_LAYER', os.path.basename(toplevel))
 
     # Create a layer for new recipes / appends
     bb.utils.mkdirhier(baseoutpath + '/workspace/conf')
@@ -173,6 +175,7 @@ python copy_buildsystem () {
 install_sdktool() {
        install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
        install -m 0755 ${WORKDIR}/sdktool.py ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/sdktool
+       sed -i -e 's#BITBAKE_LAYER#${BITBAKE_LAYER}#g' ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/sdktool
 }
 
 toolchain_create_sdk_env_script () {
@@ -194,7 +197,7 @@ sdk_postinst() {
        echo done
        printf "Preparing build system..."
        cd $target_sdk_dir
-       sh -c ". layers/poky/oe-init-build-env . > /dev/null && bitbake ${SDK_TARGETS} > /dev/null"
+       sh -c ". layers/${BITBAKE_LAYER}/oe-init-build-env . > /dev/null && bitbake ${SDK_TARGETS} > /dev/null"
 }
 
 SDK_POST_INSTALL_COMMAND = "${sdk_postinst}"
index 8ed48c6346b0298db0a9328ea4c4ef475db78b95..6c31e3e8666351d5a1f970f0f992222f388e6270 100644 (file)
@@ -10,9 +10,8 @@ import sys
 import os
 import argparse
 
-# FIXME these should be written out when producing the SDK
-bitbake_subdir = 'layers/poky/bitbake'
-init_subdir = 'layers/poky'
+bitbake_subdir = 'layers/BITBAKE_LAYER/bitbake'
+init_subdir = 'layers/BITBAKE_LAYER'
 init_script = 'oe-init-build-env'
 
 basepath = os.path.abspath(__file__)