toolchain-script.bbclass: Collected cached site config in runtime.
[YOCTO #892] Modify the function toolchain_create_sdk_siteconfig to collect the cached site config files which are specified by TOOLCHAIN_NEED_CONFIGSITE_CACHE in runtime. Also added task dependency to ensure the cached site config files are generated. (From OE-Core rev: 9e87f1347788beed181476dc4563085db14a4729) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
4c2baa237f
commit
c6b808413d
|
@ -118,7 +118,7 @@ python () {
|
|||
bb.fatal("Please add your architecture to siteinfo.bbclass")
|
||||
}
|
||||
|
||||
def siteinfo_get_files(d):
|
||||
def siteinfo_get_files(d, no_cache = False):
|
||||
sitedata = siteinfo_data(d)
|
||||
sitefiles = ""
|
||||
for path in d.getVar("BBPATH", True).split(":"):
|
||||
|
@ -127,6 +127,8 @@ def siteinfo_get_files(d):
|
|||
if os.path.exists(filename):
|
||||
sitefiles += filename + " "
|
||||
|
||||
if no_cache: return sitefiles
|
||||
|
||||
# Now check for siteconfig cache files
|
||||
path_siteconfig = bb.data.getVar('SITECONFIG_SYSROOTCACHE', d, 1)
|
||||
if os.path.isdir(path_siteconfig):
|
||||
|
|
|
@ -101,17 +101,28 @@ toolchain_create_sdk_env_script_for_installer () {
|
|||
echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
|
||||
}
|
||||
|
||||
#we get the cached site config in the runtime
|
||||
TOOLCHAIN_CONFIGSITE_NOCACHE := "${@siteinfo_get_files(d, True)}"
|
||||
TOOLCHAIN_CONFIGSITE_SYSROOTCACHE := "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d"
|
||||
TOOLCHAIN_NEED_CONFIGSITE_CACHE = "eglibc ncurses"
|
||||
|
||||
#This function create a site config file
|
||||
toolchain_create_sdk_siteconfig () {
|
||||
local siteconfig=$1
|
||||
shift
|
||||
local files=$@
|
||||
|
||||
rm -f $siteconfig
|
||||
touch $siteconfig
|
||||
for sitefile in ${files} ; do
|
||||
|
||||
for sitefile in ${TOOLCHAIN_CONFIGSITE_NOCACHE} ; do
|
||||
cat $sitefile >> $siteconfig
|
||||
done
|
||||
|
||||
#get cached site config
|
||||
for sitefile in ${TOOLCHAIN_NEED_CONFIGSITE_CACHE}; do
|
||||
if [ -r ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config ]; then
|
||||
cat ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config >> $siteconfig
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#This function create a version information file
|
||||
|
@ -124,3 +135,10 @@ toolchain_create_sdk_version () {
|
|||
echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
|
||||
echo 'Timestamp: ${DATETIME}' >> $versionfile
|
||||
}
|
||||
|
||||
python __anonymous () {
|
||||
deps = bb.data.getVarFlag('do_configure', 'depends', d) or ""
|
||||
for dep in (bb.data.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', d, True) or "").split():
|
||||
deps += " %s:do_populate_sysroot" % dep
|
||||
bb.data.setVarFlag('do_configure', 'depends', deps, d)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue