archiver.bbclass 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. # ex:ts=4:sw=4:sts=4:et
  2. # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
  3. #
  4. # This bbclass is used for creating archive for:
  5. # 1) original (or unpacked) source: ARCHIVER_MODE[src] = "original"
  6. # 2) patched source: ARCHIVER_MODE[src] = "patched" (default)
  7. # 3) configured source: ARCHIVER_MODE[src] = "configured"
  8. # 4) The patches between do_unpack and do_patch:
  9. # ARCHIVER_MODE[diff] = "1"
  10. # And you can set the one that you'd like to exclude from the diff:
  11. # ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
  12. # 5) The environment data, similar to 'bitbake -e recipe':
  13. # ARCHIVER_MODE[dumpdata] = "1"
  14. # 6) The recipe (.bb and .inc): ARCHIVER_MODE[recipe] = "1"
  15. # 7) Whether output the .src.rpm package:
  16. # ARCHIVER_MODE[srpm] = "1"
  17. # 8) Filter the license, the recipe whose license in
  18. # COPYLEFT_LICENSE_INCLUDE will be included, and in
  19. # COPYLEFT_LICENSE_EXCLUDE will be excluded.
  20. # COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*'
  21. # COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary'
  22. # 9) The recipe type that will be archived:
  23. # COPYLEFT_RECIPE_TYPES = 'target'
  24. #
  25. # Don't filter the license by default
  26. COPYLEFT_LICENSE_INCLUDE ?= ''
  27. COPYLEFT_LICENSE_EXCLUDE ?= ''
  28. # Create archive for all the recipe types
  29. COPYLEFT_RECIPE_TYPES ?= 'target native nativesdk cross crosssdk cross-canadian'
  30. inherit copyleft_filter
  31. ARCHIVER_MODE[srpm] ?= "0"
  32. ARCHIVER_MODE[src] ?= "patched"
  33. ARCHIVER_MODE[diff] ?= "0"
  34. ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
  35. ARCHIVER_MODE[dumpdata] ?= "0"
  36. ARCHIVER_MODE[recipe] ?= "0"
  37. DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources"
  38. ARCHIVER_TOPDIR ?= "${WORKDIR}/deploy-sources"
  39. ARCHIVER_OUTDIR = "${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/"
  40. ARCHIVER_WORKDIR = "${WORKDIR}/archiver-work/"
  41. do_dumpdata[dirs] = "${ARCHIVER_OUTDIR}"
  42. do_ar_recipe[dirs] = "${ARCHIVER_OUTDIR}"
  43. do_ar_original[dirs] = "${ARCHIVER_OUTDIR} ${ARCHIVER_WORKDIR}"
  44. do_deploy_archives[dirs] = "${WORKDIR}"
  45. # This is a convenience for the shell script to use it
  46. python () {
  47. pn = d.getVar('PN')
  48. assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split()
  49. if pn in assume_provided:
  50. for p in d.getVar("PROVIDES").split():
  51. if p != pn:
  52. pn = p
  53. break
  54. included, reason = copyleft_should_include(d)
  55. if not included:
  56. bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
  57. return
  58. else:
  59. bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
  60. # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted,
  61. # so avoid archiving source here.
  62. if pn.startswith('glibc-locale'):
  63. return
  64. # We just archive gcc-source for all the gcc related recipes
  65. if d.getVar('BPN') in ['gcc', 'libgcc'] \
  66. and not pn.startswith('gcc-source'):
  67. bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn)
  68. return
  69. ar_src = d.getVarFlag('ARCHIVER_MODE', 'src')
  70. ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata')
  71. ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe')
  72. if ar_src == "original":
  73. d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_original' % pn)
  74. # 'patched' and 'configured' invoke do_unpack_and_patch because
  75. # do_ar_patched resp. do_ar_configured depend on it, but for 'original'
  76. # we have to add it explicitly.
  77. if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
  78. d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_unpack_and_patch' % pn)
  79. elif ar_src == "patched":
  80. d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_patched' % pn)
  81. elif ar_src == "configured":
  82. # We can't use "addtask do_ar_configured after do_configure" since it
  83. # will cause the deptask of do_populate_sysroot to run not matter what
  84. # archives we need, so we add the depends here.
  85. # There is a corner case with "gcc-source-${PV}" recipes, they don't have
  86. # the "do_configure" task, so we need to use "do_preconfigure"
  87. def hasTask(task):
  88. return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
  89. if hasTask("do_preconfigure"):
  90. d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_preconfigure' % pn)
  91. elif hasTask("do_configure"):
  92. d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_configure' % pn)
  93. d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_configured' % pn)
  94. elif ar_src:
  95. bb.fatal("Invalid ARCHIVER_MODE[src]: %s" % ar_src)
  96. if ar_dumpdata == "1":
  97. d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_dumpdata' % pn)
  98. if ar_recipe == "1":
  99. d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_recipe' % pn)
  100. # Output the SRPM package
  101. if d.getVarFlag('ARCHIVER_MODE', 'srpm') == "1" and d.getVar('PACKAGES'):
  102. if "package_rpm" in d.getVar('PACKAGE_CLASSES'):
  103. d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_package_write_rpm' % pn)
  104. if ar_dumpdata == "1":
  105. d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_dumpdata' % pn)
  106. if ar_recipe == "1":
  107. d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_recipe' % pn)
  108. if ar_src == "original":
  109. d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_original' % pn)
  110. elif ar_src == "patched":
  111. d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn)
  112. elif ar_src == "configured":
  113. d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn)
  114. else:
  115. bb.fatal("ARCHIVER_MODE[srpm] needs package_rpm in PACKAGE_CLASSES")
  116. }
  117. # Take all the sources for a recipe and puts them in WORKDIR/archiver-work/.
  118. # Files in SRC_URI are copied directly, anything that's a directory
  119. # (e.g. git repositories) is "unpacked" and then put into a tarball.
  120. python do_ar_original() {
  121. import shutil, tempfile
  122. if d.getVarFlag('ARCHIVER_MODE', 'src') != "original":
  123. return
  124. ar_outdir = d.getVar('ARCHIVER_OUTDIR')
  125. bb.note('Archiving the original source...')
  126. urls = d.getVar("SRC_URI").split()
  127. # destsuffix (git fetcher) and subdir (everything else) are allowed to be
  128. # absolute paths (for example, destsuffix=${S}/foobar).
  129. # That messes with unpacking inside our tmpdir below, because the fetchers
  130. # will then unpack in that directory and completely ignore the tmpdir.
  131. # That breaks parallel tasks relying on ${S}, like do_compile.
  132. #
  133. # To solve this, we remove these parameters from all URLs.
  134. # We do this even for relative paths because it makes the content of the
  135. # archives more useful (no extra paths that are only used during
  136. # compilation).
  137. for i, url in enumerate(urls):
  138. decoded = bb.fetch2.decodeurl(url)
  139. for param in ('destsuffix', 'subdir'):
  140. if param in decoded[5]:
  141. del decoded[5][param]
  142. encoded = bb.fetch2.encodeurl(decoded)
  143. urls[i] = encoded
  144. fetch = bb.fetch2.Fetch(urls, d)
  145. tarball_suffix = {}
  146. for url in fetch.urls:
  147. local = fetch.localpath(url).rstrip("/");
  148. if os.path.isfile(local):
  149. shutil.copy(local, ar_outdir)
  150. elif os.path.isdir(local):
  151. tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR'))
  152. fetch.unpack(tmpdir, (url,))
  153. # To handle recipes with more than one source, we add the "name"
  154. # URL parameter as suffix. We treat it as an error when
  155. # there's more than one URL without a name, or a name gets reused.
  156. # This is an additional safety net, in practice the name has
  157. # to be set when using the git fetcher, otherwise SRCREV cannot
  158. # be set separately for each URL.
  159. params = bb.fetch2.decodeurl(url)[5]
  160. type = bb.fetch2.decodeurl(url)[0]
  161. location = bb.fetch2.decodeurl(url)[2]
  162. name = params.get('name', '')
  163. if type.lower() == 'file':
  164. name_tmp = location.rstrip("*").rstrip("/")
  165. name = os.path.basename(name_tmp)
  166. else:
  167. if name in tarball_suffix:
  168. if not name:
  169. bb.fatal("Cannot determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: %s %s" % (tarball_suffix[name], url))
  170. else:
  171. bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url))
  172. tarball_suffix[name] = url
  173. create_tarball(d, tmpdir + '/.', name, ar_outdir)
  174. # Emit patch series files for 'original'
  175. bb.note('Writing patch series files...')
  176. for patch in src_patches(d):
  177. _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
  178. patchdir = parm.get('patchdir')
  179. if patchdir:
  180. series = os.path.join(ar_outdir, 'series.subdir.%s' % patchdir.replace('/', '_'))
  181. else:
  182. series = os.path.join(ar_outdir, 'series')
  183. with open(series, 'a') as s:
  184. s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel']))
  185. }
  186. python do_ar_patched() {
  187. if d.getVarFlag('ARCHIVER_MODE', 'src') != 'patched':
  188. return
  189. # Get the ARCHIVER_OUTDIR before we reset the WORKDIR
  190. ar_outdir = d.getVar('ARCHIVER_OUTDIR')
  191. ar_workdir = d.getVar('ARCHIVER_WORKDIR')
  192. bb.note('Archiving the patched source...')
  193. d.setVar('WORKDIR', ar_workdir)
  194. create_tarball(d, d.getVar('S'), 'patched', ar_outdir)
  195. }
  196. python do_ar_configured() {
  197. import shutil
  198. # Forcibly expand the sysroot paths as we're about to change WORKDIR
  199. d.setVar('STAGING_DIR_HOST', d.getVar('STAGING_DIR_HOST'))
  200. d.setVar('STAGING_DIR_TARGET', d.getVar('STAGING_DIR_TARGET'))
  201. d.setVar('RECIPE_SYSROOT', d.getVar('RECIPE_SYSROOT'))
  202. d.setVar('RECIPE_SYSROOT_NATIVE', d.getVar('RECIPE_SYSROOT_NATIVE'))
  203. ar_outdir = d.getVar('ARCHIVER_OUTDIR')
  204. if d.getVarFlag('ARCHIVER_MODE', 'src') == 'configured':
  205. bb.note('Archiving the configured source...')
  206. pn = d.getVar('PN')
  207. # "gcc-source-${PV}" recipes don't have "do_configure"
  208. # task, so we need to run "do_preconfigure" instead
  209. if pn.startswith("gcc-source-"):
  210. d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
  211. bb.build.exec_func('do_preconfigure', d)
  212. # The libtool-native's do_configure will remove the
  213. # ${STAGING_DATADIR}/aclocal/libtool.m4, so we can't re-run the
  214. # do_configure, we archive the already configured ${S} to
  215. # instead of.
  216. elif pn != 'libtool-native':
  217. def runTask(task):
  218. prefuncs = d.getVarFlag(task, 'prefuncs') or ''
  219. for func in prefuncs.split():
  220. if func != "sysroot_cleansstate":
  221. bb.build.exec_func(func, d)
  222. bb.build.exec_func(task, d)
  223. postfuncs = d.getVarFlag(task, 'postfuncs') or ''
  224. for func in postfuncs.split():
  225. if func != 'do_qa_configure':
  226. bb.build.exec_func(func, d)
  227. # Change the WORKDIR to make do_configure run in another dir.
  228. d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
  229. preceeds = bb.build.preceedtask('do_configure', False, d)
  230. for task in preceeds:
  231. if task != 'do_patch' and task != 'do_prepare_recipe_sysroot':
  232. runTask(task)
  233. runTask('do_configure')
  234. srcdir = d.getVar('S')
  235. builddir = d.getVar('B')
  236. if srcdir != builddir:
  237. if os.path.exists(builddir):
  238. oe.path.copytree(builddir, os.path.join(srcdir, \
  239. 'build.%s.ar_configured' % d.getVar('PF')))
  240. create_tarball(d, srcdir, 'configured', ar_outdir)
  241. }
  242. def exclude_useless_paths(tarinfo):
  243. if tarinfo.isdir():
  244. if tarinfo.name.endswith('/temp') or tarinfo.name.endswith('/patches') or tarinfo.name.endswith('/.pc'):
  245. return None
  246. elif tarinfo.name == 'temp' or tarinfo.name == 'patches' or tarinfo.name == '.pc':
  247. return None
  248. return tarinfo
  249. def create_tarball(d, srcdir, suffix, ar_outdir):
  250. """
  251. create the tarball from srcdir
  252. """
  253. import tarfile
  254. # Make sure we are only creating a single tarball for gcc sources
  255. if (d.getVar('SRC_URI') == ""):
  256. return
  257. # For the kernel archive, srcdir may just be a link to the
  258. # work-shared location. Use os.path.realpath to make sure
  259. # that we archive the actual directory and not just the link.
  260. srcdir = os.path.realpath(srcdir)
  261. bb.utils.mkdirhier(ar_outdir)
  262. if suffix:
  263. filename = '%s-%s.tar.gz' % (d.getVar('PF'), suffix)
  264. else:
  265. filename = '%s.tar.gz' % d.getVar('PF')
  266. tarname = os.path.join(ar_outdir, filename)
  267. bb.note('Creating %s' % tarname)
  268. tar = tarfile.open(tarname, 'w:gz')
  269. tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths)
  270. tar.close()
  271. # creating .diff.gz between source.orig and source
  272. def create_diff_gz(d, src_orig, src, ar_outdir):
  273. import subprocess
  274. if not os.path.isdir(src) or not os.path.isdir(src_orig):
  275. return
  276. # The diff --exclude can't exclude the file with path, so we copy
  277. # the patched source, and remove the files that we'd like to
  278. # exclude.
  279. src_patched = src + '.patched'
  280. oe.path.copyhardlinktree(src, src_patched)
  281. for i in d.getVarFlag('ARCHIVER_MODE', 'diff-exclude').split():
  282. bb.utils.remove(os.path.join(src_orig, i), recurse=True)
  283. bb.utils.remove(os.path.join(src_patched, i), recurse=True)
  284. dirname = os.path.dirname(src)
  285. basename = os.path.basename(src)
  286. bb.utils.mkdirhier(ar_outdir)
  287. cwd = os.getcwd()
  288. try:
  289. os.chdir(dirname)
  290. out_file = os.path.join(ar_outdir, '%s-diff.gz' % d.getVar('PF'))
  291. diff_cmd = 'diff -Naur %s.orig %s.patched | gzip -c > %s' % (basename, basename, out_file)
  292. subprocess.check_call(diff_cmd, shell=True)
  293. bb.utils.remove(src_patched, recurse=True)
  294. finally:
  295. os.chdir(cwd)
  296. def is_work_shared(d):
  297. pn = d.getVar('PN')
  298. return bb.data.inherits_class('kernel', d) or pn.startswith('gcc-source')
  299. # Run do_unpack and do_patch
  300. python do_unpack_and_patch() {
  301. if d.getVarFlag('ARCHIVER_MODE', 'src') not in \
  302. [ 'patched', 'configured'] and \
  303. d.getVarFlag('ARCHIVER_MODE', 'diff') != '1':
  304. return
  305. ar_outdir = d.getVar('ARCHIVER_OUTDIR')
  306. ar_workdir = d.getVar('ARCHIVER_WORKDIR')
  307. ar_sysroot_native = d.getVar('STAGING_DIR_NATIVE')
  308. pn = d.getVar('PN')
  309. # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
  310. if not is_work_shared(d):
  311. # Change the WORKDIR to make do_unpack do_patch run in another dir.
  312. d.setVar('WORKDIR', ar_workdir)
  313. # Restore the original path to recipe's native sysroot (it's relative to WORKDIR).
  314. d.setVar('STAGING_DIR_NATIVE', ar_sysroot_native)
  315. # The changed 'WORKDIR' also caused 'B' changed, create dir 'B' for the
  316. # possibly requiring of the following tasks (such as some recipes's
  317. # do_patch required 'B' existed).
  318. bb.utils.mkdirhier(d.getVar('B'))
  319. bb.build.exec_func('do_unpack', d)
  320. # Save the original source for creating the patches
  321. if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
  322. src = d.getVar('S').rstrip('/')
  323. src_orig = '%s.orig' % src
  324. oe.path.copytree(src, src_orig)
  325. # Make sure gcc and kernel sources are patched only once
  326. if not (d.getVar('SRC_URI') == "" or is_work_shared(d)):
  327. bb.build.exec_func('do_patch', d)
  328. # Create the patches
  329. if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
  330. bb.note('Creating diff gz...')
  331. create_diff_gz(d, src_orig, src, ar_outdir)
  332. bb.utils.remove(src_orig, recurse=True)
  333. }
  334. # BBINCLUDED is special (excluded from basehash signature
  335. # calculation). Using it in a task signature can cause "basehash
  336. # changed" errors.
  337. #
  338. # Depending on BBINCLUDED also causes do_ar_recipe to run again
  339. # for unrelated changes, like adding or removing buildhistory.bbclass.
  340. #
  341. # For these reasons we ignore the dependency completely. The versioning
  342. # of the output file ensures that we create it each time the recipe
  343. # gets rebuilt, at least as long as a PR server is used. We also rely
  344. # on that mechanism to catch changes in the file content, because the
  345. # file content is not part of of the task signature either.
  346. do_ar_recipe[vardepsexclude] += "BBINCLUDED"
  347. python do_ar_recipe () {
  348. """
  349. archive the recipe, including .bb and .inc.
  350. """
  351. import re
  352. import shutil
  353. require_re = re.compile( r"require\s+(.+)" )
  354. include_re = re.compile( r"include\s+(.+)" )
  355. bbfile = d.getVar('FILE')
  356. outdir = os.path.join(d.getVar('WORKDIR'), \
  357. '%s-recipe' % d.getVar('PF'))
  358. bb.utils.mkdirhier(outdir)
  359. shutil.copy(bbfile, outdir)
  360. pn = d.getVar('PN')
  361. bbappend_files = d.getVar('BBINCLUDED').split()
  362. # If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend
  363. # Files like aa1.bbappend or aa1_1.1.bbappend must be excluded.
  364. bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn))
  365. bbappend_re1 = re.compile( r".*/%s\.bbappend$" % re.escape(pn))
  366. for file in bbappend_files:
  367. if bbappend_re.match(file) or bbappend_re1.match(file):
  368. shutil.copy(file, outdir)
  369. dirname = os.path.dirname(bbfile)
  370. bbpath = '%s:%s' % (dirname, d.getVar('BBPATH'))
  371. f = open(bbfile, 'r')
  372. for line in f.readlines():
  373. incfile = None
  374. if require_re.match(line):
  375. incfile = require_re.match(line).group(1)
  376. elif include_re.match(line):
  377. incfile = include_re.match(line).group(1)
  378. if incfile:
  379. incfile = d.expand(incfile)
  380. incfile = bb.utils.which(bbpath, incfile)
  381. if incfile:
  382. shutil.copy(incfile, outdir)
  383. create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR'))
  384. bb.utils.remove(outdir, recurse=True)
  385. }
  386. python do_dumpdata () {
  387. """
  388. dump environment data to ${PF}-showdata.dump
  389. """
  390. dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR'), \
  391. '%s-showdata.dump' % d.getVar('PF'))
  392. bb.note('Dumping metadata into %s' % dumpfile)
  393. with open(dumpfile, "w") as f:
  394. # emit variables and shell functions
  395. bb.data.emit_env(f, d, True)
  396. # emit the metadata which isn't valid shell
  397. for e in d.keys():
  398. if d.getVarFlag(e, "python", False):
  399. f.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, False)))
  400. }
  401. SSTATETASKS += "do_deploy_archives"
  402. do_deploy_archives () {
  403. echo "Deploying source archive files from ${ARCHIVER_TOPDIR} to ${DEPLOY_DIR_SRC}."
  404. }
  405. python do_deploy_archives_setscene () {
  406. sstate_setscene(d)
  407. }
  408. do_deploy_archives[dirs] = "${ARCHIVER_TOPDIR}"
  409. do_deploy_archives[sstate-inputdirs] = "${ARCHIVER_TOPDIR}"
  410. do_deploy_archives[sstate-outputdirs] = "${DEPLOY_DIR_SRC}"
  411. addtask do_deploy_archives_setscene
  412. addtask do_ar_original after do_unpack
  413. addtask do_unpack_and_patch after do_patch
  414. addtask do_ar_patched after do_unpack_and_patch
  415. addtask do_ar_configured after do_unpack_and_patch
  416. addtask do_dumpdata
  417. addtask do_ar_recipe
  418. addtask do_deploy_archives before do_build
  419. python () {
  420. # Add tasks in the correct order, specifically for linux-yocto to avoid race condition.
  421. # sstatesig.py:sstate_rundepfilter has special support that excludes this dependency
  422. # so that do_kernel_configme does not need to run again when do_unpack_and_patch
  423. # gets added or removed (by adding or removing archiver.bbclass).
  424. if bb.data.inherits_class('kernel-yocto', d):
  425. bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d)
  426. }