diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2011-01-18 16:18:42 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-25 12:25:46 +0000 |
commit | 7f41f1a8888a1f7f091101d19b9b0c4787f5a6fc (patch) | |
tree | ba2afa60ca17a84860545e0c871ffce34b57839a /meta/classes/sstate.bbclass | |
parent | b0df35f47fb79dc149504bd66d1186b3276f9510 (diff) | |
download | openembedded-core-7f41f1a8888a1f7f091101d19b9b0c4787f5a6fc.tar.gz openembedded-core-7f41f1a8888a1f7f091101d19b9b0c4787f5a6fc.tar.bz2 openembedded-core-7f41f1a8888a1f7f091101d19b9b0c4787f5a6fc.tar.xz openembedded-core-7f41f1a8888a1f7f091101d19b9b0c4787f5a6fc.zip |
bitbake: machine specific sysroots implementation
This commit changes the sysroots path to be machine specific.
Changes includes:
1) STAGING_DIR_TARGET and STRAGING_DIR_HOST points to machine specific
paths.
2) task stamp files. Adding ${MACHINE} info into stamp files for
do_populate_sysroots and do_package tasks. Add a BB_STAMPTASK_BLACKLIST
to keep native, nativesdk, crosssdk, and cross-canadian stamp unchanged.
3) siteconfig path. Separate the site config path for different machines
to avoid one machine adopting the cache file of another machine.
4) sstate. Add machine name to sstate manifest file.
Change relocation code for sstate paths since sysroot is machine.
Keep native, nativesdk, crosssdk, and cross-canadian unchanged.
5) toolchain scripts. Change the environment path to point to machine
specific sysroots in toolchain scripts bbclass.
6) Relocate la files when populating to a different machine of the same
architecture.
7) Exclude STAGING_DIR_TARGET and STAGING_DIR_HOST parameter from sstate
siginfo since they contain ${MACHINE} information.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r-- | meta/classes/sstate.bbclass | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 38f2bb99e..807e8e39a 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -1,7 +1,7 @@ SSTATE_VERSION = "1" SSTATE_MANIFESTS = "${TMPDIR}/sstate-control" -SSTATE_MANFILEBASE = "${SSTATE_MANIFESTS}/manifest-${SSTATE_PKGARCH}-" +SSTATE_MANFILEBASE = "${SSTATE_MANIFESTS}/manifest-${SSTATE_MANMACH}-" SSTATE_MANFILEPREFIX = "${SSTATE_MANFILEBASE}${PN}" @@ -14,15 +14,22 @@ SSTATE_SCAN_CMD ?= "find ${SSTATE_BUILDDIR} \( -name "*.la" -o -name "*-config" BB_HASHFILENAME = "${SSTATE_PKGNAME}" +SSTATE_MANMACH ?= "${SSTATE_PKGARCH}" + python () { if bb.data.inherits_class('native', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.getVar('BUILD_ARCH', d), d) - elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d): + elif bb.data.inherits_class('cross', d): + bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${BUILD_ARCH}_${BASE_PACKAGE_ARCH}", d), d) + bb.data.setVar('SSTATE_MANMACH', bb.data.expand("${BUILD_ARCH}_${MACHINE}", d), d) + elif bb.data.inherits_class('crosssdk', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${BUILD_ARCH}_${BASE_PACKAGE_ARCH}", d), d) elif bb.data.inherits_class('nativesdk', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${SDK_ARCH}", d), d) elif bb.data.inherits_class('cross-canadian', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${SDK_ARCH}_${BASE_PACKAGE_ARCH}", d), d) + else: + bb.data.setVar('SSTATE_MANMACH', bb.data.expand("${MACHINE}", d), d) # These classes encode staging paths into their scripts data so can only be # reused if we manipulate the paths @@ -147,10 +154,14 @@ def sstate_installpkg(ss, d): fixmefn = sstateinst + "fixmepath" if os.path.isfile(fixmefn): staging = bb.data.getVar('STAGING_DIR', d, True) + staging_target = bb.data.getVar('STAGING_DIR_TARGET', d, True) + staging_host = bb.data.getVar('STAGING_DIR_HOST', d, True) fixmefd = open(fixmefn, "r") fixmefiles = fixmefd.readlines() fixmefd.close() for file in fixmefiles: + os.system("sed -i -e s:FIXMESTAGINGDIRTARGET:%s:g %s" % (staging_target, sstateinst + file)) + os.system("sed -i -e s:FIXMESTAGINGDIRHOST:%s:g %s" % (staging_host, sstateinst + file)) os.system("sed -i -e s:FIXMESTAGINGDIR:%s:g %s" % (staging, sstateinst + file)) for state in ss['dirs']: @@ -248,6 +259,35 @@ python sstate_cleanall() { sstate_clean(shared_state, d) } +def sstate_hardcode_path(d): + # Need to remove hardcoded paths and fix these when we install the + # staging packages. + sstate_scan_cmd = bb.data.getVar('SSTATE_SCAN_CMD', d, True) + p = os.popen("%s" % sstate_scan_cmd) + file_list = p.read() + + if file_list == "": + p.close() + return + + staging = bb.data.getVar('STAGING_DIR', d, True) + staging_target = bb.data.getVar('STAGING_DIR_TARGET', d, True) + staging_host = bb.data.getVar('STAGING_DIR_HOST', d, True) + sstate_builddir = bb.data.getVar('SSTATE_BUILDDIR', d, True) + + for i in file_list.split('\n'): + if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d): + cmd = "sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging, i) + elif bb.data.inherits_class('cross', d): + cmd = "sed -i -e s:%s:FIXMESTAGINGDIRTARGET:g %s \ + sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging_target, i, staging, i) + else: + cmd = "sed -i -e s:%s:FIXMESTAGINGDIRHOST:g %s" % (staging_host, i) + + os.system(cmd) + os.system("echo %s | sed -e 's:%s::' >> %sfixmepath" % (i, sstate_builddir, sstate_builddir)) + p.close() + def sstate_package(ss, d): import oe.path @@ -273,6 +313,7 @@ def sstate_package(ss, d): bb.data.setVar('SSTATE_BUILDDIR', sstatebuild, d) bb.data.setVar('SSTATE_PKG', sstatepkg, d) + sstate_hardcode_path(d) bb.build.exec_func('sstate_create_package', d) bb.siggen.dump_this_task(sstatepkg + ".siginfo", d) @@ -337,13 +378,6 @@ python sstate_task_postfunc () { # set as SSTATE_BUILDDIR # sstate_create_package () { - # Need to remove hardcoded paths and fix these when we install the - # staging packages. - for i in `${SSTATE_SCAN_CMD}` ; do \ - sed -i -e s:${STAGING_DIR}:FIXMESTAGINGDIR:g $i - echo $i | sed -e 's:${SSTATE_BUILDDIR}::' >> ${SSTATE_BUILDDIR}fixmepath - done - cd ${SSTATE_BUILDDIR} tar -cvzf ${SSTATE_PKG} * |