populate_sdk_ext.bbclass 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. # Extensible SDK
  2. inherit populate_sdk_base
  3. # Used to override TOOLCHAIN_HOST_TASK in the eSDK case
  4. TOOLCHAIN_HOST_TASK_ESDK = " \
  5. meta-environment-extsdk-${MACHINE} \
  6. "
  7. SDK_RELOCATE_AFTER_INSTALL:task-populate-sdk-ext = "0"
  8. SDK_EXT = ""
  9. SDK_EXT:task-populate-sdk-ext = "-ext"
  10. # Options are full or minimal
  11. SDK_EXT_TYPE ?= "full"
  12. SDK_INCLUDE_PKGDATA ?= "0"
  13. SDK_INCLUDE_TOOLCHAIN ?= "${@'1' if d.getVar('SDK_EXT_TYPE') == 'full' else '0'}"
  14. SDK_INCLUDE_NATIVESDK ?= "0"
  15. SDK_INCLUDE_BUILDTOOLS ?= '1'
  16. SDK_RECRDEP_TASKS ?= ""
  17. SDK_CUSTOM_TEMPLATECONF ?= "0"
  18. SDK_LOCAL_CONF_WHITELIST ?= ""
  19. SDK_LOCAL_CONF_BLACKLIST ?= "CONF_VERSION \
  20. BB_NUMBER_THREADS \
  21. BB_NUMBER_PARSE_THREADS \
  22. PARALLEL_MAKE \
  23. PRSERV_HOST \
  24. SSTATE_MIRRORS \
  25. DL_DIR \
  26. SSTATE_DIR \
  27. TMPDIR \
  28. BB_SERVER_TIMEOUT \
  29. "
  30. SDK_INHERIT_BLACKLIST ?= "buildhistory icecc"
  31. SDK_UPDATE_URL ?= ""
  32. SDK_TARGETS ?= "${PN}"
  33. def get_sdk_install_targets(d, images_only=False):
  34. sdk_install_targets = ''
  35. if images_only or d.getVar('SDK_EXT_TYPE') != 'minimal':
  36. sdk_install_targets = d.getVar('SDK_TARGETS')
  37. depd = d.getVar('BB_TASKDEPDATA', False)
  38. tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d)
  39. tasklist.remove('do_build')
  40. for v in depd.values():
  41. if v[1] in tasklist:
  42. if v[0] not in sdk_install_targets:
  43. sdk_install_targets += ' {}'.format(v[0])
  44. if not images_only:
  45. if d.getVar('SDK_INCLUDE_PKGDATA') == '1':
  46. sdk_install_targets += ' meta-world-pkgdata:do_allpackagedata'
  47. if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1':
  48. sdk_install_targets += ' meta-extsdk-toolchain:do_populate_sysroot'
  49. return sdk_install_targets
  50. get_sdk_install_targets[vardepsexclude] = "BB_TASKDEPDATA"
  51. OE_INIT_ENV_SCRIPT ?= "oe-init-build-env"
  52. # The files from COREBASE that you want preserved in the COREBASE copied
  53. # into the sdk. This allows someone to have their own setup scripts in
  54. # COREBASE be preserved as well as untracked files.
  55. COREBASE_FILES ?= " \
  56. oe-init-build-env \
  57. scripts \
  58. LICENSE \
  59. .templateconf \
  60. "
  61. SDK_DIR:task-populate-sdk-ext = "${WORKDIR}/sdk-ext"
  62. B:task-populate-sdk-ext = "${SDK_DIR}"
  63. TOOLCHAINEXT_OUTPUTNAME ?= "${SDK_NAME}-toolchain-ext-${SDK_VERSION}"
  64. TOOLCHAIN_OUTPUTNAME:task-populate-sdk-ext = "${TOOLCHAINEXT_OUTPUTNAME}"
  65. SDK_EXT_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"
  66. SDK_EXT_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest"
  67. python write_target_sdk_ext_manifest () {
  68. from oe.sdk import get_extra_sdkinfo
  69. sstate_dir = d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')
  70. extra_info = get_extra_sdkinfo(sstate_dir)
  71. target = d.getVar('TARGET_SYS')
  72. target_multimach = d.getVar('MULTIMACH_TARGET_SYS')
  73. real_target_multimach = d.getVar('REAL_MULTIMACH_TARGET_SYS')
  74. pkgs = {}
  75. os.makedirs(os.path.dirname(d.getVar('SDK_EXT_TARGET_MANIFEST')), exist_ok=True)
  76. with open(d.getVar('SDK_EXT_TARGET_MANIFEST'), 'w') as f:
  77. for fn in extra_info['filesizes']:
  78. info = fn.split(':')
  79. if info[2] in (target, target_multimach, real_target_multimach) \
  80. or info[5] == 'allarch':
  81. if not info[1] in pkgs:
  82. f.write("%s %s %s\n" % (info[1], info[2], info[3]))
  83. pkgs[info[1]] = {}
  84. }
  85. python write_host_sdk_ext_manifest () {
  86. from oe.sdk import get_extra_sdkinfo
  87. sstate_dir = d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')
  88. extra_info = get_extra_sdkinfo(sstate_dir)
  89. host = d.getVar('BUILD_SYS')
  90. with open(d.getVar('SDK_EXT_HOST_MANIFEST'), 'w') as f:
  91. for fn in extra_info['filesizes']:
  92. info = fn.split(':')
  93. if info[2] == host:
  94. f.write("%s %s %s\n" % (info[1], info[2], info[3]))
  95. }
  96. SDK_POSTPROCESS_COMMAND:append:task-populate-sdk-ext = "write_target_sdk_ext_manifest; write_host_sdk_ext_manifest; "
  97. SDK_TITLE:task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} Extensible SDK"
  98. def clean_esdk_builddir(d, sdkbasepath):
  99. """Clean up traces of the fake build for create_filtered_tasklist()"""
  100. import shutil
  101. cleanpaths = ['cache', 'tmp']
  102. for pth in cleanpaths:
  103. fullpth = os.path.join(sdkbasepath, pth)
  104. if os.path.isdir(fullpth):
  105. shutil.rmtree(fullpth)
  106. elif os.path.isfile(fullpth):
  107. os.remove(fullpth)
  108. def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath):
  109. """
  110. Create a filtered list of tasks. Also double-checks that the build system
  111. within the SDK basically works and required sstate artifacts are available.
  112. """
  113. import tempfile
  114. import shutil
  115. import oe.copy_buildsystem
  116. # Create a temporary build directory that we can pass to the env setup script
  117. shutil.copyfile(sdkbasepath + '/conf/local.conf', sdkbasepath + '/conf/local.conf.bak')
  118. try:
  119. with open(sdkbasepath + '/conf/local.conf', 'a') as f:
  120. # Force the use of sstate from the build system
  121. f.write('\nSSTATE_DIR:forcevariable = "%s"\n' % d.getVar('SSTATE_DIR'))
  122. f.write('SSTATE_MIRRORS:forcevariable = "file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n')
  123. # Ensure TMPDIR is the default so that clean_esdk_builddir() can delete it
  124. f.write('TMPDIR:forcevariable = "${TOPDIR}/tmp"\n')
  125. f.write('TCLIBCAPPEND:forcevariable = ""\n')
  126. # Drop uninative if the build isn't using it (or else NATIVELSBSTRING will
  127. # be different and we won't be able to find our native sstate)
  128. if not bb.data.inherits_class('uninative', d):
  129. f.write('INHERIT:remove = "uninative"\n')
  130. # Unfortunately the default SDKPATH (or even a custom value) may contain characters that bitbake
  131. # will not allow in its COREBASE path, so we need to rename the directory temporarily
  132. temp_sdkbasepath = d.getVar('SDK_OUTPUT') + '/tmp-renamed-sdk'
  133. # Delete any existing temp dir
  134. try:
  135. shutil.rmtree(temp_sdkbasepath)
  136. except FileNotFoundError:
  137. pass
  138. bb.utils.rename(sdkbasepath, temp_sdkbasepath)
  139. cmdprefix = '. %s .; ' % conf_initpath
  140. logfile = d.getVar('WORKDIR') + '/tasklist_bb_log.txt'
  141. try:
  142. oe.copy_buildsystem.check_sstate_task_list(d, get_sdk_install_targets(d), tasklistfile, cmdprefix=cmdprefix, cwd=temp_sdkbasepath, logfile=logfile)
  143. except bb.process.ExecutionError as e:
  144. msg = 'Failed to generate filtered task list for extensible SDK:\n%s' % e.stdout.rstrip()
  145. if 'attempted to execute unexpectedly and should have been setscened' in e.stdout:
  146. msg += '\n----------\n\nNOTE: "attempted to execute unexpectedly and should have been setscened" errors indicate this may be caused by missing sstate artifacts that were likely produced in earlier builds, but have been subsequently deleted for some reason.\n'
  147. bb.fatal(msg)
  148. bb.utils.rename(temp_sdkbasepath, sdkbasepath)
  149. # Clean out residue of running bitbake, which check_sstate_task_list()
  150. # will effectively do
  151. clean_esdk_builddir(d, sdkbasepath)
  152. finally:
  153. localconf = sdkbasepath + '/conf/local.conf'
  154. if os.path.exists(localconf + '.bak'):
  155. os.replace(localconf + '.bak', localconf)
  156. python copy_buildsystem () {
  157. import re
  158. import shutil
  159. import glob
  160. import oe.copy_buildsystem
  161. oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT')
  162. conf_bbpath = ''
  163. conf_initpath = ''
  164. core_meta_subdir = ''
  165. # Copy in all metadata layers + bitbake (as repositories)
  166. buildsystem = oe.copy_buildsystem.BuildSystem('extensible SDK', d)
  167. baseoutpath = d.getVar('SDK_OUTPUT') + '/' + d.getVar('SDKPATH')
  168. #check if custome templateconf path is set
  169. use_custom_templateconf = d.getVar('SDK_CUSTOM_TEMPLATECONF')
  170. # Determine if we're building a derivative extensible SDK (from devtool build-sdk)
  171. derivative = (d.getVar('SDK_DERIVATIVE') or '') == '1'
  172. if derivative:
  173. workspace_name = 'orig-workspace'
  174. else:
  175. workspace_name = None
  176. corebase, sdkbblayers = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers', workspace_name)
  177. conf_bbpath = os.path.join('layers', corebase, 'bitbake')
  178. for path in os.listdir(baseoutpath + '/layers'):
  179. relpath = os.path.join('layers', path, oe_init_env_script)
  180. if os.path.exists(os.path.join(baseoutpath, relpath)):
  181. conf_initpath = relpath
  182. relpath = os.path.join('layers', path, 'scripts', 'devtool')
  183. if os.path.exists(os.path.join(baseoutpath, relpath)):
  184. scriptrelpath = os.path.dirname(relpath)
  185. relpath = os.path.join('layers', path, 'meta')
  186. if os.path.exists(os.path.join(baseoutpath, relpath, 'lib', 'oe')):
  187. core_meta_subdir = relpath
  188. d.setVar('oe_init_build_env_path', conf_initpath)
  189. d.setVar('scriptrelpath', scriptrelpath)
  190. # Write out config file for devtool
  191. import configparser
  192. config = configparser.SafeConfigParser()
  193. config.add_section('General')
  194. config.set('General', 'bitbake_subdir', conf_bbpath)
  195. config.set('General', 'init_path', conf_initpath)
  196. config.set('General', 'core_meta_subdir', core_meta_subdir)
  197. config.add_section('SDK')
  198. config.set('SDK', 'sdk_targets', d.getVar('SDK_TARGETS'))
  199. updateurl = d.getVar('SDK_UPDATE_URL')
  200. if updateurl:
  201. config.set('SDK', 'updateserver', updateurl)
  202. bb.utils.mkdirhier(os.path.join(baseoutpath, 'conf'))
  203. with open(os.path.join(baseoutpath, 'conf', 'devtool.conf'), 'w') as f:
  204. config.write(f)
  205. unlockedsigs = os.path.join(baseoutpath, 'conf', 'unlocked-sigs.inc')
  206. with open(unlockedsigs, 'w') as f:
  207. pass
  208. # Create a layer for new recipes / appends
  209. bbpath = d.getVar('BBPATH')
  210. env = os.environ.copy()
  211. env['PYTHONDONTWRITEBYTECODE'] = '1'
  212. bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')], env=env)
  213. # Create bblayers.conf
  214. bb.utils.mkdirhier(baseoutpath + '/conf')
  215. with open(baseoutpath + '/conf/bblayers.conf', 'w') as f:
  216. f.write('# WARNING: this configuration has been automatically generated and in\n')
  217. f.write('# most cases should not be edited. If you need more flexibility than\n')
  218. f.write('# this configuration provides, it is strongly suggested that you set\n')
  219. f.write('# up a proper instance of the full build system and use that instead.\n\n')
  220. # LCONF_VERSION may not be set, for example when using meta-poky
  221. # so don't error if it isn't found
  222. lconf_version = d.getVar('LCONF_VERSION', False)
  223. if lconf_version is not None:
  224. f.write('LCONF_VERSION = "%s"\n\n' % lconf_version)
  225. f.write('BBPATH = "$' + '{TOPDIR}"\n')
  226. f.write('SDKBASEMETAPATH = "$' + '{TOPDIR}"\n')
  227. f.write('BBLAYERS := " \\\n')
  228. for layerrelpath in sdkbblayers:
  229. f.write(' $' + '{SDKBASEMETAPATH}/layers/%s \\\n' % layerrelpath)
  230. f.write(' $' + '{SDKBASEMETAPATH}/workspace \\\n')
  231. f.write(' "\n')
  232. # Copy uninative tarball
  233. # For now this is where uninative.bbclass expects the tarball
  234. if bb.data.inherits_class('uninative', d):
  235. uninative_file = d.expand('${UNINATIVE_DLDIR}/' + d.getVarFlag("UNINATIVE_CHECKSUM", d.getVar("BUILD_ARCH")) + '/${UNINATIVE_TARBALL}')
  236. uninative_checksum = bb.utils.sha256_file(uninative_file)
  237. uninative_outdir = '%s/downloads/uninative/%s' % (baseoutpath, uninative_checksum)
  238. bb.utils.mkdirhier(uninative_outdir)
  239. shutil.copy(uninative_file, uninative_outdir)
  240. env_whitelist = (d.getVar('BB_ENV_EXTRAWHITE') or '').split()
  241. env_whitelist_values = {}
  242. # Create local.conf
  243. builddir = d.getVar('TOPDIR')
  244. if derivative and os.path.exists(builddir + '/conf/site.conf'):
  245. shutil.copyfile(builddir + '/conf/site.conf', baseoutpath + '/conf/site.conf')
  246. if derivative and os.path.exists(builddir + '/conf/auto.conf'):
  247. shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
  248. if derivative:
  249. shutil.copyfile(builddir + '/conf/local.conf', baseoutpath + '/conf/local.conf')
  250. else:
  251. local_conf_whitelist = (d.getVar('SDK_LOCAL_CONF_WHITELIST') or '').split()
  252. local_conf_blacklist = (d.getVar('SDK_LOCAL_CONF_BLACKLIST') or '').split()
  253. def handle_var(varname, origvalue, op, newlines):
  254. if varname in local_conf_blacklist or (origvalue.strip().startswith('/') and not varname in local_conf_whitelist):
  255. newlines.append('# Removed original setting of %s\n' % varname)
  256. return None, op, 0, True
  257. else:
  258. if varname in env_whitelist:
  259. env_whitelist_values[varname] = origvalue
  260. return origvalue, op, 0, True
  261. varlist = ['[^#=+ ]*']
  262. oldlines = []
  263. if os.path.exists(builddir + '/conf/site.conf'):
  264. with open(builddir + '/conf/site.conf', 'r') as f:
  265. oldlines += f.readlines()
  266. if os.path.exists(builddir + '/conf/auto.conf'):
  267. with open(builddir + '/conf/auto.conf', 'r') as f:
  268. oldlines += f.readlines()
  269. if os.path.exists(builddir + '/conf/local.conf'):
  270. with open(builddir + '/conf/local.conf', 'r') as f:
  271. oldlines += f.readlines()
  272. (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
  273. with open(baseoutpath + '/conf/local.conf', 'w') as f:
  274. f.write('# WARNING: this configuration has been automatically generated and in\n')
  275. f.write('# most cases should not be edited. If you need more flexibility than\n')
  276. f.write('# this configuration provides, it is strongly suggested that you set\n')
  277. f.write('# up a proper instance of the full build system and use that instead.\n\n')
  278. for line in newlines:
  279. if line.strip() and not line.startswith('#'):
  280. f.write(line)
  281. # Write a newline just in case there's none at the end of the original
  282. f.write('\n')
  283. f.write('TMPDIR = "${TOPDIR}/tmp"\n')
  284. f.write('TCLIBCAPPEND = ""\n')
  285. f.write('DL_DIR = "${TOPDIR}/downloads"\n')
  286. if bb.data.inherits_class('uninative', d):
  287. f.write('INHERIT += "%s"\n' % 'uninative')
  288. f.write('UNINATIVE_CHECKSUM[%s] = "%s"\n\n' % (d.getVar('BUILD_ARCH'), uninative_checksum))
  289. f.write('CONF_VERSION = "%s"\n\n' % d.getVar('CONF_VERSION', False))
  290. # Some classes are not suitable for SDK, remove them from INHERIT
  291. f.write('INHERIT:remove = "%s"\n' % d.getVar('SDK_INHERIT_BLACKLIST', False))
  292. # Bypass the default connectivity check if any
  293. f.write('CONNECTIVITY_CHECK_URIS = ""\n\n')
  294. # This warning will come out if reverse dependencies for a task
  295. # don't have sstate as well as the task itself. We already know
  296. # this will be the case for the extensible sdk, so turn off the
  297. # warning.
  298. f.write('SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK = "none"\n\n')
  299. # Warn if the sigs in the locked-signature file don't match
  300. # the sig computed from the metadata.
  301. f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n\n')
  302. # We want to be able to set this without a full reparse
  303. f.write('BB_HASHCONFIG_WHITELIST:append = " SIGGEN_UNLOCKED_RECIPES"\n\n')
  304. # Set up whitelist for run on install
  305. f.write('BB_SETSCENE_ENFORCE_WHITELIST = "%:* *:do_shared_workdir *:do_rm_work wic-tools:* *:do_addto_recipe_sysroot"\n\n')
  306. # Hide the config information from bitbake output (since it's fixed within the SDK)
  307. f.write('BUILDCFG_HEADER = ""\n\n')
  308. # Write METADATA_REVISION
  309. f.write('METADATA_REVISION = "%s"\n\n' % d.getVar('METADATA_REVISION'))
  310. f.write('# Provide a flag to indicate we are in the EXT_SDK Context\n')
  311. f.write('WITHIN_EXT_SDK = "1"\n\n')
  312. # Map gcc-dependent uninative sstate cache for installer usage
  313. f.write('SSTATE_MIRRORS += " file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n\n')
  314. if d.getVar("PRSERV_HOST"):
  315. # Override this, we now include PR data, so it should only point ot the local database
  316. f.write('PRSERV_HOST = "localhost:0"\n\n')
  317. # Allow additional config through sdk-extra.conf
  318. fn = bb.cookerdata.findConfigFile('sdk-extra.conf', d)
  319. if fn:
  320. with open(fn, 'r') as xf:
  321. for line in xf:
  322. f.write(line)
  323. # If you define a sdk_extraconf() function then it can contain additional config
  324. # (Though this is awkward; sdk-extra.conf should probably be used instead)
  325. extraconf = (d.getVar('sdk_extraconf') or '').strip()
  326. if extraconf:
  327. # Strip off any leading / trailing spaces
  328. for line in extraconf.splitlines():
  329. f.write(line.strip() + '\n')
  330. f.write('require conf/locked-sigs.inc\n')
  331. f.write('require conf/unlocked-sigs.inc\n')
  332. # Copy multiple configurations if they exist in the users config directory
  333. if d.getVar('BBMULTICONFIG') is not None:
  334. bb.utils.mkdirhier(os.path.join(baseoutpath, 'conf', 'multiconfig'))
  335. for mc in d.getVar('BBMULTICONFIG').split():
  336. dest_stub = "/conf/multiconfig/%s.conf" % (mc,)
  337. if os.path.exists(builddir + dest_stub):
  338. shutil.copyfile(builddir + dest_stub, baseoutpath + dest_stub)
  339. if os.path.exists(builddir + '/cache/bb_unihashes.dat'):
  340. bb.parse.siggen.save_unitaskhashes()
  341. bb.utils.mkdirhier(os.path.join(baseoutpath, 'cache'))
  342. shutil.copyfile(builddir + '/cache/bb_unihashes.dat', baseoutpath + '/cache/bb_unihashes.dat')
  343. # If PR Service is in use, we need to export this as well
  344. bb.note('Do we have a pr database?')
  345. if d.getVar("PRSERV_HOST"):
  346. bb.note('Writing PR database...')
  347. # Based on the code in classes/prexport.bbclass
  348. import oe.prservice
  349. #dump meta info of tables
  350. localdata = d.createCopy()
  351. localdata.setVar('PRSERV_DUMPOPT_COL', "1")
  352. localdata.setVar('PRSERV_DUMPDIR', os.path.join(baseoutpath, 'conf'))
  353. localdata.setVar('PRSERV_DUMPFILE', '${PRSERV_DUMPDIR}/prserv.inc')
  354. bb.note('PR Database write to %s' % (localdata.getVar('PRSERV_DUMPFILE')))
  355. retval = oe.prservice.prserv_dump_db(localdata)
  356. if not retval:
  357. bb.error("prexport_handler: export failed!")
  358. return
  359. (metainfo, datainfo) = retval
  360. oe.prservice.prserv_export_tofile(localdata, metainfo, datainfo, True)
  361. # Use templateconf.cfg file from builddir if exists
  362. if os.path.exists(builddir + '/conf/templateconf.cfg') and use_custom_templateconf == '1':
  363. shutil.copyfile(builddir + '/conf/templateconf.cfg', baseoutpath + '/conf/templateconf.cfg')
  364. else:
  365. # Write a templateconf.cfg
  366. with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
  367. f.write('meta/conf\n')
  368. # Ensure any variables set from the external environment (by way of
  369. # BB_ENV_EXTRAWHITE) are set in the SDK's configuration
  370. extralines = []
  371. for name, value in env_whitelist_values.items():
  372. actualvalue = d.getVar(name) or ''
  373. if value != actualvalue:
  374. extralines.append('%s = "%s"\n' % (name, actualvalue))
  375. if extralines:
  376. with open(baseoutpath + '/conf/local.conf', 'a') as f:
  377. f.write('\n')
  378. f.write('# Extra settings from environment:\n')
  379. for line in extralines:
  380. f.write(line)
  381. f.write('\n')
  382. # Filter the locked signatures file to just the sstate tasks we are interested in
  383. excluded_targets = get_sdk_install_targets(d, images_only=True)
  384. sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc'
  385. lockedsigs_pruned = baseoutpath + '/conf/locked-sigs.inc'
  386. #nativesdk-only sigfile to merge into locked-sigs.inc
  387. sdk_include_nativesdk = (d.getVar("SDK_INCLUDE_NATIVESDK") == '1')
  388. nativesigfile = d.getVar('WORKDIR') + '/locked-sigs_nativesdk.inc'
  389. nativesigfile_pruned = d.getVar('WORKDIR') + '/locked-sigs_nativesdk_pruned.inc'
  390. if sdk_include_nativesdk:
  391. oe.copy_buildsystem.prune_lockedsigs([],
  392. excluded_targets.split(),
  393. nativesigfile,
  394. True,
  395. nativesigfile_pruned)
  396. oe.copy_buildsystem.merge_lockedsigs([],
  397. sigfile,
  398. nativesigfile_pruned,
  399. sigfile)
  400. oe.copy_buildsystem.prune_lockedsigs([],
  401. excluded_targets.split(),
  402. sigfile,
  403. False,
  404. lockedsigs_pruned)
  405. sstate_out = baseoutpath + '/sstate-cache'
  406. bb.utils.remove(sstate_out, True)
  407. # uninative.bbclass sets NATIVELSBSTRING to 'universal%s' % oe.utils.host_gcc_version(d)
  408. fixedlsbstring = "universal%s" % oe.utils.host_gcc_version(d)
  409. sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1')
  410. sdk_ext_type = d.getVar('SDK_EXT_TYPE')
  411. if (sdk_ext_type != 'minimal' or sdk_include_toolchain or derivative) and not sdk_include_nativesdk:
  412. # Create the filtered task list used to generate the sstate cache shipped with the SDK
  413. tasklistfn = d.getVar('WORKDIR') + '/tasklist.txt'
  414. create_filtered_tasklist(d, baseoutpath, tasklistfn, conf_initpath)
  415. else:
  416. tasklistfn = None
  417. if os.path.exists(builddir + '/cache/bb_unihashes.dat'):
  418. bb.parse.siggen.save_unitaskhashes()
  419. bb.utils.mkdirhier(os.path.join(baseoutpath, 'cache'))
  420. shutil.copyfile(builddir + '/cache/bb_unihashes.dat', baseoutpath + '/cache/bb_unihashes.dat')
  421. # Add packagedata if enabled
  422. if d.getVar('SDK_INCLUDE_PKGDATA') == '1':
  423. lockedsigs_base = d.getVar('WORKDIR') + '/locked-sigs-base.inc'
  424. lockedsigs_copy = d.getVar('WORKDIR') + '/locked-sigs-copy.inc'
  425. shutil.move(lockedsigs_pruned, lockedsigs_base)
  426. oe.copy_buildsystem.merge_lockedsigs(['do_packagedata'],
  427. lockedsigs_base,
  428. d.getVar('STAGING_DIR_HOST') + '/world-pkgdata/locked-sigs-pkgdata.inc',
  429. lockedsigs_pruned,
  430. lockedsigs_copy)
  431. if sdk_include_toolchain:
  432. lockedsigs_base = d.getVar('WORKDIR') + '/locked-sigs-base2.inc'
  433. lockedsigs_toolchain = d.expand("${STAGING_DIR}/${TUNE_PKGARCH}/meta-extsdk-toolchain/locked-sigs/locked-sigs-extsdk-toolchain.inc")
  434. shutil.move(lockedsigs_pruned, lockedsigs_base)
  435. oe.copy_buildsystem.merge_lockedsigs([],
  436. lockedsigs_base,
  437. lockedsigs_toolchain,
  438. lockedsigs_pruned)
  439. oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_toolchain,
  440. d.getVar('SSTATE_DIR'),
  441. sstate_out, d,
  442. fixedlsbstring,
  443. filterfile=tasklistfn)
  444. if sdk_ext_type == 'minimal':
  445. if derivative:
  446. # Assume the user is not going to set up an additional sstate
  447. # mirror, thus we need to copy the additional artifacts (from
  448. # workspace recipes) into the derivative SDK
  449. lockedsigs_orig = d.getVar('TOPDIR') + '/conf/locked-sigs.inc'
  450. if os.path.exists(lockedsigs_orig):
  451. lockedsigs_extra = d.getVar('WORKDIR') + '/locked-sigs-extra.inc'
  452. oe.copy_buildsystem.merge_lockedsigs(None,
  453. lockedsigs_orig,
  454. lockedsigs_pruned,
  455. None,
  456. lockedsigs_extra)
  457. oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_extra,
  458. d.getVar('SSTATE_DIR'),
  459. sstate_out, d,
  460. fixedlsbstring,
  461. filterfile=tasklistfn)
  462. else:
  463. oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_pruned,
  464. d.getVar('SSTATE_DIR'),
  465. sstate_out, d,
  466. fixedlsbstring,
  467. filterfile=tasklistfn)
  468. # We don't need sstate do_package files
  469. for root, dirs, files in os.walk(sstate_out):
  470. for name in files:
  471. if name.endswith("_package.tar.zst"):
  472. f = os.path.join(root, name)
  473. os.remove(f)
  474. # Write manifest file
  475. # Note: at the moment we cannot include the env setup script here to keep
  476. # it updated, since it gets modified during SDK installation (see
  477. # sdk_ext_postinst() below) thus the checksum we take here would always
  478. # be different.
  479. manifest_file_list = ['conf/*']
  480. if d.getVar('BBMULTICONFIG') is not None:
  481. manifest_file_list.append('conf/multiconfig/*')
  482. esdk_manifest_excludes = (d.getVar('ESDK_MANIFEST_EXCLUDES') or '').split()
  483. esdk_manifest_excludes_list = []
  484. for exclude_item in esdk_manifest_excludes:
  485. esdk_manifest_excludes_list += glob.glob(os.path.join(baseoutpath, exclude_item))
  486. manifest_file = os.path.join(baseoutpath, 'conf', 'sdk-conf-manifest')
  487. with open(manifest_file, 'w') as f:
  488. for item in manifest_file_list:
  489. for fn in glob.glob(os.path.join(baseoutpath, item)):
  490. if fn == manifest_file or os.path.isdir(fn):
  491. continue
  492. if fn in esdk_manifest_excludes_list:
  493. continue
  494. chksum = bb.utils.sha256_file(fn)
  495. f.write('%s\t%s\n' % (chksum, os.path.relpath(fn, baseoutpath)))
  496. }
  497. def get_current_buildtools(d):
  498. """Get the file name of the current buildtools installer"""
  499. import glob
  500. btfiles = glob.glob(os.path.join(d.getVar('SDK_DEPLOY'), '*-buildtools-nativesdk-standalone-*.sh'))
  501. btfiles.sort(key=os.path.getctime)
  502. return os.path.basename(btfiles[-1])
  503. def get_sdk_required_utilities(buildtools_fn, d):
  504. """Find required utilities that aren't provided by the buildtools"""
  505. sanity_required_utilities = (d.getVar('SANITY_REQUIRED_UTILITIES') or '').split()
  506. sanity_required_utilities.append(d.expand('${BUILD_PREFIX}gcc'))
  507. sanity_required_utilities.append(d.expand('${BUILD_PREFIX}g++'))
  508. if buildtools_fn:
  509. buildtools_installer = os.path.join(d.getVar('SDK_DEPLOY'), buildtools_fn)
  510. filelist, _ = bb.process.run('%s -l' % buildtools_installer)
  511. else:
  512. buildtools_installer = None
  513. filelist = ""
  514. localdata = bb.data.createCopy(d)
  515. localdata.setVar('SDKPATH', '.')
  516. sdkpathnative = localdata.getVar('SDKPATHNATIVE')
  517. sdkbindirs = [localdata.getVar('bindir_nativesdk'),
  518. localdata.getVar('sbindir_nativesdk'),
  519. localdata.getVar('base_bindir_nativesdk'),
  520. localdata.getVar('base_sbindir_nativesdk')]
  521. for line in filelist.splitlines():
  522. splitline = line.split()
  523. if len(splitline) > 5:
  524. fn = splitline[5]
  525. if not fn.startswith('./'):
  526. fn = './%s' % fn
  527. if fn.startswith(sdkpathnative):
  528. relpth = '/' + os.path.relpath(fn, sdkpathnative)
  529. for bindir in sdkbindirs:
  530. if relpth.startswith(bindir):
  531. relpth = os.path.relpath(relpth, bindir)
  532. if relpth in sanity_required_utilities:
  533. sanity_required_utilities.remove(relpth)
  534. break
  535. return ' '.join(sanity_required_utilities)
  536. install_tools() {
  537. install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
  538. scripts="devtool recipetool oe-find-native-sysroot runqemu* wic"
  539. for script in $scripts; do
  540. for scriptfn in `find ${SDK_OUTPUT}/${SDKPATH}/${scriptrelpath} -maxdepth 1 -executable -name "$script"`; do
  541. targetscriptfn="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/$(basename $scriptfn)"
  542. test -e ${targetscriptfn} || lnr ${scriptfn} ${targetscriptfn}
  543. done
  544. done
  545. # We can't use the same method as above because files in the sysroot won't exist at this point
  546. # (they get populated from sstate on installation)
  547. unfsd_path="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/unfsd"
  548. if [ "${SDK_INCLUDE_TOOLCHAIN}" = "1" -a ! -e $unfsd_path ] ; then
  549. binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TMPDIR'))}
  550. lnr ${SDK_OUTPUT}/${SDKPATH}/tmp/$binrelpath/unfsd $unfsd_path
  551. fi
  552. touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
  553. # find latest buildtools-tarball and install it
  554. if [ -n "${SDK_BUILDTOOLS_INSTALLER}" ]; then
  555. install ${SDK_DEPLOY}/${SDK_BUILDTOOLS_INSTALLER} ${SDK_OUTPUT}/${SDKPATH}
  556. fi
  557. install -m 0644 ${COREBASE}/meta/files/ext-sdk-prepare.py ${SDK_OUTPUT}/${SDKPATH}
  558. }
  559. do_populate_sdk_ext[file-checksums] += "${COREBASE}/meta/files/ext-sdk-prepare.py:True"
  560. sdk_ext_preinst() {
  561. # Since bitbake won't run as root it doesn't make sense to try and install
  562. # the extensible sdk as root.
  563. if [ "`id -u`" = "0" ]; then
  564. echo "ERROR: The extensible sdk cannot be installed as root."
  565. exit 1
  566. fi
  567. if ! command -v locale > /dev/null; then
  568. echo "ERROR: The installer requires the locale command, please install it first"
  569. exit 1
  570. fi
  571. # Check setting of LC_ALL set above
  572. canonicalised_locale=`echo $LC_ALL | sed 's/UTF-8/utf8/'`
  573. if ! locale -a | grep -q $canonicalised_locale ; then
  574. echo "ERROR: the installer requires the $LC_ALL locale to be installed (but not selected), please install it first"
  575. exit 1
  576. fi
  577. # The relocation script used by buildtools installer requires python
  578. if ! command -v python3 > /dev/null; then
  579. echo "ERROR: The installer requires python3, please install it first"
  580. exit 1
  581. fi
  582. missing_utils=""
  583. for util in ${SDK_REQUIRED_UTILITIES}; do
  584. if ! command -v $util > /dev/null; then
  585. missing_utils="$missing_utils $util"
  586. fi
  587. done
  588. if [ -n "$missing_utils" ] ; then
  589. echo "ERROR: the SDK requires the following missing utilities, please install them: $missing_utils"
  590. exit 1
  591. fi
  592. SDK_EXTENSIBLE="1"
  593. if [ "$publish" = "1" ] && [ "${SDK_EXT_TYPE}" = "minimal" ] ; then
  594. EXTRA_TAR_OPTIONS="$EXTRA_TAR_OPTIONS --exclude=sstate-cache"
  595. fi
  596. }
  597. SDK_PRE_INSTALL_COMMAND:task-populate-sdk-ext = "${sdk_ext_preinst}"
  598. # FIXME this preparation should be done as part of the SDK construction
  599. sdk_ext_postinst() {
  600. printf "\nExtracting buildtools...\n"
  601. cd $target_sdk_dir
  602. env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"
  603. if [ -n "${SDK_BUILDTOOLS_INSTALLER}" ]; then
  604. printf "buildtools\ny" | ./${SDK_BUILDTOOLS_INSTALLER} > buildtools.log || { printf 'ERROR: buildtools installation failed:\n' ; cat buildtools.log ; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
  605. # Delete the buildtools tar file since it won't be used again
  606. rm -f ./${SDK_BUILDTOOLS_INSTALLER}
  607. # We don't need the log either since it succeeded
  608. rm -f buildtools.log
  609. # Make sure when the user sets up the environment, they also get
  610. # the buildtools-tarball tools in their path.
  611. echo "# Save and reset OECORE_NATIVE_SYSROOT as buildtools may change it" >> $env_setup_script
  612. echo "SAVED=\"\$OECORE_NATIVE_SYSROOT\"" >> $env_setup_script
  613. echo ". $target_sdk_dir/buildtools/environment-setup*" >> $env_setup_script
  614. echo "OECORE_NATIVE_SYSROOT=\"\$SAVED\"" >> $env_setup_script
  615. fi
  616. # Allow bitbake environment setup to be ran as part of this sdk.
  617. echo "export OE_SKIP_SDK_CHECK=1" >> $env_setup_script
  618. # Work around runqemu not knowing how to get this information within the eSDK
  619. echo "export DEPLOY_DIR_IMAGE=$target_sdk_dir/tmp/${@os.path.relpath(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('TMPDIR'))}" >> $env_setup_script
  620. # A bit of another hack, but we need this in the path only for devtool
  621. # so put it at the end of $PATH.
  622. echo "export PATH=$target_sdk_dir/sysroots/${SDK_SYS}${bindir_nativesdk}:\$PATH" >> $env_setup_script
  623. echo "printf 'SDK environment now set up; additionally you may now run devtool to perform development tasks.\nRun devtool --help for further details.\n'" >> $env_setup_script
  624. # Warn if trying to use external bitbake and the ext SDK together
  625. echo "(which bitbake > /dev/null 2>&1 && echo 'WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.') || true" >> $env_setup_script
  626. if [ "$prepare_buildsystem" != "no" -a -n "${SDK_BUILDTOOLS_INSTALLER}" ]; then
  627. printf "Preparing build system...\n"
  628. # dash which is /bin/sh on Ubuntu will not preserve the
  629. # current working directory when first ran, nor will it set $1 when
  630. # sourcing a script. That is why this has to look so ugly.
  631. LOGFILE="$target_sdk_dir/preparing_build_system.log"
  632. sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python3 $target_sdk_dir/ext-sdk-prepare.py $LOGFILE '${SDK_INSTALL_TARGETS}'" || { echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
  633. fi
  634. if [ -e $target_sdk_dir/ext-sdk-prepare.py ]; then
  635. rm $target_sdk_dir/ext-sdk-prepare.py
  636. fi
  637. echo done
  638. }
  639. SDK_POST_INSTALL_COMMAND:task-populate-sdk-ext = "${sdk_ext_postinst}"
  640. SDK_POSTPROCESS_COMMAND:prepend:task-populate-sdk-ext = "copy_buildsystem; install_tools; "
  641. SDK_INSTALL_TARGETS = ""
  642. fakeroot python do_populate_sdk_ext() {
  643. # FIXME hopefully we can remove this restriction at some point, but uninative
  644. # currently forces this upon us
  645. if d.getVar('SDK_ARCH') != d.getVar('BUILD_ARCH'):
  646. bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH'), d.getVar('BUILD_ARCH')))
  647. # FIXME hopefully we can remove this restriction at some point, but the eSDK
  648. # can only be built for the primary (default) multiconfig
  649. if d.getVar('BB_CURRENT_MC') != 'default':
  650. bb.fatal('The extensible SDK can currently only be built for the default multiconfig. Currently trying to build for %s.' % d.getVar('BB_CURRENT_MC'))
  651. # eSDK dependencies don't use the traditional variables and things don't work properly if they are set
  652. d.setVar("TOOLCHAIN_HOST_TASK", "${TOOLCHAIN_HOST_TASK_ESDK}")
  653. d.setVar("TOOLCHAIN_TARGET_TASK", "")
  654. d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
  655. if d.getVar('SDK_INCLUDE_BUILDTOOLS') == '1':
  656. buildtools_fn = get_current_buildtools(d)
  657. else:
  658. buildtools_fn = None
  659. d.setVar('SDK_REQUIRED_UTILITIES', get_sdk_required_utilities(buildtools_fn, d))
  660. d.setVar('SDK_BUILDTOOLS_INSTALLER', buildtools_fn)
  661. d.setVar('SDKDEPLOYDIR', '${SDKEXTDEPLOYDIR}')
  662. # ESDKs have a libc from the buildtools so ensure we don't ship linguas twice
  663. d.delVar('SDKIMAGE_LINGUAS')
  664. if d.getVar("SDK_INCLUDE_NATIVESDK") == '1':
  665. generate_nativesdk_lockedsigs(d)
  666. populate_sdk_common(d)
  667. }
  668. def generate_nativesdk_lockedsigs(d):
  669. import oe.copy_buildsystem
  670. sigfile = d.getVar('WORKDIR') + '/locked-sigs_nativesdk.inc'
  671. oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
  672. def get_ext_sdk_depends(d):
  673. # Note: the deps varflag is a list not a string, so we need to specify expand=False
  674. deps = d.getVarFlag('do_image_complete', 'deps', False)
  675. pn = d.getVar('PN')
  676. deplist = ['%s:%s' % (pn, dep) for dep in deps]
  677. tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d)
  678. tasklist.append('do_rootfs')
  679. for task in tasklist:
  680. deplist.extend((d.getVarFlag(task, 'depends') or '').split())
  681. return ' '.join(deplist)
  682. python do_sdk_depends() {
  683. # We have to do this separately in its own task so we avoid recursing into
  684. # dependencies we don't need to (e.g. buildtools-tarball) and bringing those
  685. # into the SDK's sstate-cache
  686. import oe.copy_buildsystem
  687. sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc'
  688. oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
  689. }
  690. addtask sdk_depends
  691. do_sdk_depends[dirs] = "${WORKDIR}"
  692. do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)} meta-extsdk-toolchain:do_populate_sysroot"
  693. do_sdk_depends[recrdeptask] = "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}"
  694. do_sdk_depends[recrdeptask] += "do_populate_lic do_package_qa do_populate_sysroot do_deploy ${SDK_RECRDEP_TASKS}"
  695. do_sdk_depends[rdepends] = "${@' '.join([x + ':do_package_write_${IMAGE_PKGTYPE} ' + x + ':do_packagedata' for x in d.getVar('TOOLCHAIN_HOST_TASK_ESDK').split()])}"
  696. do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"
  697. do_populate_sdk_ext[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends', False)} \
  698. ${@'buildtools-tarball:do_populate_sdk' if d.getVar('SDK_INCLUDE_BUILDTOOLS') == '1' else ''} \
  699. ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA') == '1' else ''} \
  700. ${@'meta-extsdk-toolchain:do_locked_sigs' if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1' else ''}"
  701. # We must avoid depending on do_build here if rm_work.bbclass is active,
  702. # because otherwise do_rm_work may run before do_populate_sdk_ext itself.
  703. # We can't mark do_populate_sdk_ext and do_sdk_depends as having to
  704. # run before do_rm_work, because then they would also run as part
  705. # of normal builds.
  706. do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':' + (d.getVar('RM_WORK_BUILD_WITHOUT') or 'do_build') for x in d.getVar('SDK_TARGETS').split()])}"
  707. # Make sure code changes can result in rebuild
  708. do_populate_sdk_ext[vardeps] += "copy_buildsystem \
  709. sdk_ext_postinst"
  710. # Since any change in the metadata of any layer should cause a rebuild of the
  711. # sdk(since the layers are put in the sdk) set the task to nostamp so it
  712. # always runs.
  713. do_populate_sdk_ext[nostamp] = "1"
  714. SDKEXTDEPLOYDIR = "${WORKDIR}/deploy-${PN}-populate-sdk-ext"
  715. SSTATETASKS += "do_populate_sdk_ext"
  716. SSTATE_SKIP_CREATION:task-populate-sdk-ext = '1'
  717. do_populate_sdk_ext[cleandirs] = "${SDKEXTDEPLOYDIR}"
  718. do_populate_sdk_ext[sstate-inputdirs] = "${SDKEXTDEPLOYDIR}"
  719. do_populate_sdk_ext[sstate-outputdirs] = "${SDK_DEPLOY}"
  720. do_populate_sdk_ext[stamp-extra-info] = "${MACHINE_ARCH}"
  721. addtask populate_sdk_ext after do_sdk_depends