Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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: |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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) source mirror: ARCHIVE_MODE[src] = "mirror" |
| 9 | # 5) The patches between do_unpack and do_patch: |
| 10 | # ARCHIVER_MODE[diff] = "1" |
| 11 | # And you can set the one that you'd like to exclude from the diff: |
| 12 | # ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches" |
| 13 | # 6) The environment data, similar to 'bitbake -e recipe': |
| 14 | # ARCHIVER_MODE[dumpdata] = "1" |
| 15 | # 7) The recipe (.bb and .inc): ARCHIVER_MODE[recipe] = "1" |
| 16 | # 8) Whether output the .src.rpm package: |
| 17 | # ARCHIVER_MODE[srpm] = "1" |
| 18 | # 9) Filter the license, the recipe whose license in |
| 19 | # COPYLEFT_LICENSE_INCLUDE will be included, and in |
| 20 | # COPYLEFT_LICENSE_EXCLUDE will be excluded. |
| 21 | # COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*' |
| 22 | # COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary' |
| 23 | # 10) The recipe type that will be archived: |
| 24 | # COPYLEFT_RECIPE_TYPES = 'target' |
| 25 | # 11) The source mirror mode: |
| 26 | # ARCHIVER_MODE[mirror] = "split" (default): Sources are split into |
| 27 | # per-recipe directories in a similar way to other archiver modes. |
| 28 | # Post-processing may be required to produce a single mirror directory. |
| 29 | # This does however allow inspection of duplicate sources and more |
| 30 | # intelligent handling. |
| 31 | # ARCHIVER_MODE[mirror] = "combined": All sources are placed into a single |
| 32 | # directory suitable for direct use as a mirror. Duplicate sources are |
| 33 | # ignored. |
| 34 | # 12) Source mirror exclusions: |
| 35 | # ARCHIVER_MIRROR_EXCLUDE is a list of prefixes to exclude from the mirror. |
| 36 | # This may be used for sources which you are already publishing yourself |
| 37 | # (e.g. if the URI starts with 'https://mysite.com/' and your mirror is |
| 38 | # going to be published to the same site). It may also be used to exclude |
| 39 | # local files (with the prefix 'file://') if these will be provided as part |
| 40 | # of an archive of the layers themselves. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | # |
| 42 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | # Create archive for all the recipe types |
| 44 | COPYLEFT_RECIPE_TYPES ?= 'target native nativesdk cross crosssdk cross-canadian' |
| 45 | inherit copyleft_filter |
| 46 | |
| 47 | ARCHIVER_MODE[srpm] ?= "0" |
| 48 | ARCHIVER_MODE[src] ?= "patched" |
| 49 | ARCHIVER_MODE[diff] ?= "0" |
| 50 | ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches" |
| 51 | ARCHIVER_MODE[dumpdata] ?= "0" |
| 52 | ARCHIVER_MODE[recipe] ?= "0" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 53 | ARCHIVER_MODE[mirror] ?= "split" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | |
| 55 | DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources" |
| 56 | ARCHIVER_TOPDIR ?= "${WORKDIR}/deploy-sources" |
| 57 | ARCHIVER_OUTDIR = "${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 58 | ARCHIVER_RPMTOPDIR ?= "${WORKDIR}/deploy-sources-rpm" |
| 59 | ARCHIVER_RPMOUTDIR = "${ARCHIVER_RPMTOPDIR}/${TARGET_SYS}/${PF}/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | ARCHIVER_WORKDIR = "${WORKDIR}/archiver-work/" |
| 61 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 62 | # When producing a combined mirror directory, allow duplicates for the case |
| 63 | # where multiple recipes use the same SRC_URI. |
| 64 | ARCHIVER_COMBINED_MIRRORDIR = "${ARCHIVER_TOPDIR}/mirror" |
| 65 | SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}/mirror" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 66 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | do_dumpdata[dirs] = "${ARCHIVER_OUTDIR}" |
| 68 | do_ar_recipe[dirs] = "${ARCHIVER_OUTDIR}" |
| 69 | do_ar_original[dirs] = "${ARCHIVER_OUTDIR} ${ARCHIVER_WORKDIR}" |
| 70 | do_deploy_archives[dirs] = "${WORKDIR}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | |
| 72 | # This is a convenience for the shell script to use it |
| 73 | |
| 74 | |
| 75 | python () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 76 | pn = d.getVar('PN') |
| 77 | assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split() |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 78 | if pn in assume_provided: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 79 | for p in d.getVar("PROVIDES").split(): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 80 | if p != pn: |
| 81 | pn = p |
| 82 | break |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 83 | |
| 84 | included, reason = copyleft_should_include(d) |
| 85 | if not included: |
| 86 | bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason)) |
| 87 | return |
| 88 | else: |
| 89 | bb.debug(1, 'archiver: %s is included: %s' % (pn, reason)) |
| 90 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 91 | |
| 92 | # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted, |
| 93 | # so avoid archiving source here. |
| 94 | if pn.startswith('glibc-locale'): |
| 95 | return |
| 96 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 97 | # We just archive gcc-source for all the gcc related recipes |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 98 | if d.getVar('BPN') in ['gcc', 'libgcc'] \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 99 | and not pn.startswith('gcc-source'): |
| 100 | bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn) |
| 101 | return |
| 102 | |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 103 | def hasTask(task): |
| 104 | return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False)) |
| 105 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 106 | ar_src = d.getVarFlag('ARCHIVER_MODE', 'src') |
| 107 | ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata') |
| 108 | ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | |
| 110 | if ar_src == "original": |
| 111 | d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_original' % pn) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 112 | # 'patched' and 'configured' invoke do_unpack_and_patch because |
| 113 | # do_ar_patched resp. do_ar_configured depend on it, but for 'original' |
| 114 | # we have to add it explicitly. |
| 115 | if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1': |
| 116 | d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_unpack_and_patch' % pn) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 117 | elif ar_src == "patched": |
| 118 | d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_patched' % pn) |
| 119 | elif ar_src == "configured": |
| 120 | # We can't use "addtask do_ar_configured after do_configure" since it |
| 121 | # will cause the deptask of do_populate_sysroot to run not matter what |
| 122 | # archives we need, so we add the depends here. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 123 | |
| 124 | # There is a corner case with "gcc-source-${PV}" recipes, they don't have |
| 125 | # the "do_configure" task, so we need to use "do_preconfigure" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 126 | if hasTask("do_preconfigure"): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 127 | d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_preconfigure' % pn) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 128 | elif hasTask("do_configure"): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 129 | d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_configure' % pn) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 130 | d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_configured' % pn) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 131 | elif ar_src == "mirror": |
| 132 | d.appendVarFlag('do_deploy_archives', 'depends', '%s:do_ar_mirror' % pn) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 133 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 134 | elif ar_src: |
| 135 | bb.fatal("Invalid ARCHIVER_MODE[src]: %s" % ar_src) |
| 136 | |
| 137 | if ar_dumpdata == "1": |
| 138 | d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_dumpdata' % pn) |
| 139 | |
| 140 | if ar_recipe == "1": |
| 141 | d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_recipe' % pn) |
| 142 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 143 | # Output the SRPM package |
| 144 | if d.getVarFlag('ARCHIVER_MODE', 'srpm') == "1" and d.getVar('PACKAGES'): |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 145 | if "package_rpm" not in d.getVar('PACKAGE_CLASSES'): |
| 146 | bb.fatal("ARCHIVER_MODE[srpm] needs package_rpm in PACKAGE_CLASSES") |
| 147 | |
| 148 | # Some recipes do not have any packaging tasks |
| 149 | if hasTask("do_package_write_rpm"): |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 150 | d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_package_write_rpm' % pn) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 151 | d.appendVarFlag('do_package_write_rpm', 'dirs', ' ${ARCHIVER_RPMTOPDIR}') |
| 152 | d.appendVarFlag('do_package_write_rpm', 'sstate-inputdirs', ' ${ARCHIVER_RPMTOPDIR}') |
| 153 | d.appendVarFlag('do_package_write_rpm', 'sstate-outputdirs', ' ${DEPLOY_DIR_SRC}') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 154 | if ar_dumpdata == "1": |
| 155 | d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_dumpdata' % pn) |
| 156 | if ar_recipe == "1": |
| 157 | d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_recipe' % pn) |
| 158 | if ar_src == "original": |
| 159 | d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_original' % pn) |
| 160 | elif ar_src == "patched": |
| 161 | d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn) |
| 162 | elif ar_src == "configured": |
| 163 | d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | # Take all the sources for a recipe and puts them in WORKDIR/archiver-work/. |
| 167 | # Files in SRC_URI are copied directly, anything that's a directory |
| 168 | # (e.g. git repositories) is "unpacked" and then put into a tarball. |
| 169 | python do_ar_original() { |
| 170 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 171 | import shutil, tempfile |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 172 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 173 | if d.getVarFlag('ARCHIVER_MODE', 'src') != "original": |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 174 | return |
| 175 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 176 | ar_outdir = d.getVar('ARCHIVER_OUTDIR') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 177 | bb.note('Archiving the original source...') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 178 | urls = d.getVar("SRC_URI").split() |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 179 | # destsuffix (git fetcher) and subdir (everything else) are allowed to be |
| 180 | # absolute paths (for example, destsuffix=${S}/foobar). |
| 181 | # That messes with unpacking inside our tmpdir below, because the fetchers |
| 182 | # will then unpack in that directory and completely ignore the tmpdir. |
| 183 | # That breaks parallel tasks relying on ${S}, like do_compile. |
| 184 | # |
| 185 | # To solve this, we remove these parameters from all URLs. |
| 186 | # We do this even for relative paths because it makes the content of the |
| 187 | # archives more useful (no extra paths that are only used during |
| 188 | # compilation). |
| 189 | for i, url in enumerate(urls): |
| 190 | decoded = bb.fetch2.decodeurl(url) |
| 191 | for param in ('destsuffix', 'subdir'): |
| 192 | if param in decoded[5]: |
| 193 | del decoded[5][param] |
| 194 | encoded = bb.fetch2.encodeurl(decoded) |
| 195 | urls[i] = encoded |
| 196 | fetch = bb.fetch2.Fetch(urls, d) |
| 197 | tarball_suffix = {} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 198 | for url in fetch.urls: |
| 199 | local = fetch.localpath(url).rstrip("/"); |
| 200 | if os.path.isfile(local): |
| 201 | shutil.copy(local, ar_outdir) |
| 202 | elif os.path.isdir(local): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 203 | tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 204 | fetch.unpack(tmpdir, (url,)) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 205 | # To handle recipes with more than one source, we add the "name" |
| 206 | # URL parameter as suffix. We treat it as an error when |
| 207 | # there's more than one URL without a name, or a name gets reused. |
| 208 | # This is an additional safety net, in practice the name has |
| 209 | # to be set when using the git fetcher, otherwise SRCREV cannot |
| 210 | # be set separately for each URL. |
| 211 | params = bb.fetch2.decodeurl(url)[5] |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 212 | type = bb.fetch2.decodeurl(url)[0] |
| 213 | location = bb.fetch2.decodeurl(url)[2] |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 214 | name = params.get('name', '') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 215 | if type.lower() == 'file': |
| 216 | name_tmp = location.rstrip("*").rstrip("/") |
| 217 | name = os.path.basename(name_tmp) |
| 218 | else: |
| 219 | if name in tarball_suffix: |
| 220 | if not name: |
| 221 | 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)) |
| 222 | else: |
| 223 | 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)) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 224 | tarball_suffix[name] = url |
| 225 | create_tarball(d, tmpdir + '/.', name, ar_outdir) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 226 | |
| 227 | # Emit patch series files for 'original' |
| 228 | bb.note('Writing patch series files...') |
| 229 | for patch in src_patches(d): |
| 230 | _, _, local, _, _, parm = bb.fetch.decodeurl(patch) |
| 231 | patchdir = parm.get('patchdir') |
| 232 | if patchdir: |
| 233 | series = os.path.join(ar_outdir, 'series.subdir.%s' % patchdir.replace('/', '_')) |
| 234 | else: |
| 235 | series = os.path.join(ar_outdir, 'series') |
| 236 | |
| 237 | with open(series, 'a') as s: |
| 238 | s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel'])) |
| 239 | } |
| 240 | |
| 241 | python do_ar_patched() { |
| 242 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 243 | if d.getVarFlag('ARCHIVER_MODE', 'src') != 'patched': |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 244 | return |
| 245 | |
| 246 | # Get the ARCHIVER_OUTDIR before we reset the WORKDIR |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 247 | ar_outdir = d.getVar('ARCHIVER_OUTDIR') |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 248 | if not is_work_shared(d): |
| 249 | ar_workdir = d.getVar('ARCHIVER_WORKDIR') |
| 250 | d.setVar('WORKDIR', ar_workdir) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 251 | bb.note('Archiving the patched source...') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 252 | create_tarball(d, d.getVar('S'), 'patched', ar_outdir) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | python do_ar_configured() { |
| 256 | import shutil |
| 257 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 258 | # Forcibly expand the sysroot paths as we're about to change WORKDIR |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 259 | d.setVar('STAGING_DIR_HOST', d.getVar('STAGING_DIR_HOST')) |
| 260 | d.setVar('STAGING_DIR_TARGET', d.getVar('STAGING_DIR_TARGET')) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 261 | d.setVar('RECIPE_SYSROOT', d.getVar('RECIPE_SYSROOT')) |
| 262 | d.setVar('RECIPE_SYSROOT_NATIVE', d.getVar('RECIPE_SYSROOT_NATIVE')) |
| 263 | |
| 264 | ar_outdir = d.getVar('ARCHIVER_OUTDIR') |
| 265 | if d.getVarFlag('ARCHIVER_MODE', 'src') == 'configured': |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 266 | bb.note('Archiving the configured source...') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 267 | pn = d.getVar('PN') |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 268 | # "gcc-source-${PV}" recipes don't have "do_configure" |
| 269 | # task, so we need to run "do_preconfigure" instead |
| 270 | if pn.startswith("gcc-source-"): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 271 | d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR')) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 272 | bb.build.exec_func('do_preconfigure', d) |
| 273 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 274 | # The libtool-native's do_configure will remove the |
| 275 | # ${STAGING_DATADIR}/aclocal/libtool.m4, so we can't re-run the |
| 276 | # do_configure, we archive the already configured ${S} to |
| 277 | # instead of. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 278 | elif pn != 'libtool-native': |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 279 | def runTask(task): |
| 280 | prefuncs = d.getVarFlag(task, 'prefuncs') or '' |
| 281 | for func in prefuncs.split(): |
| 282 | if func != "sysroot_cleansstate": |
| 283 | bb.build.exec_func(func, d) |
| 284 | bb.build.exec_func(task, d) |
| 285 | postfuncs = d.getVarFlag(task, 'postfuncs') or '' |
| 286 | for func in postfuncs.split(): |
| 287 | if func != 'do_qa_configure': |
| 288 | bb.build.exec_func(func, d) |
| 289 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 290 | # Change the WORKDIR to make do_configure run in another dir. |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 291 | d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR')) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 292 | |
| 293 | preceeds = bb.build.preceedtask('do_configure', False, d) |
| 294 | for task in preceeds: |
| 295 | if task != 'do_patch' and task != 'do_prepare_recipe_sysroot': |
| 296 | runTask(task) |
| 297 | runTask('do_configure') |
| 298 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 299 | srcdir = d.getVar('S') |
| 300 | builddir = d.getVar('B') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 301 | if srcdir != builddir: |
| 302 | if os.path.exists(builddir): |
| 303 | oe.path.copytree(builddir, os.path.join(srcdir, \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 304 | 'build.%s.ar_configured' % d.getVar('PF'))) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 305 | create_tarball(d, srcdir, 'configured', ar_outdir) |
| 306 | } |
| 307 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 308 | python do_ar_mirror() { |
| 309 | import subprocess |
| 310 | |
| 311 | src_uri = (d.getVar('SRC_URI') or '').split() |
| 312 | if len(src_uri) == 0: |
| 313 | return |
| 314 | |
| 315 | dl_dir = d.getVar('DL_DIR') |
| 316 | mirror_exclusions = (d.getVar('ARCHIVER_MIRROR_EXCLUDE') or '').split() |
| 317 | mirror_mode = d.getVarFlag('ARCHIVER_MODE', 'mirror') |
| 318 | have_mirror_tarballs = d.getVar('BB_GENERATE_MIRROR_TARBALLS') |
| 319 | |
| 320 | if mirror_mode == 'combined': |
| 321 | destdir = d.getVar('ARCHIVER_COMBINED_MIRRORDIR') |
| 322 | elif mirror_mode == 'split': |
| 323 | destdir = d.getVar('ARCHIVER_OUTDIR') |
| 324 | else: |
| 325 | bb.fatal('Invalid ARCHIVER_MODE[mirror]: %s' % (mirror_mode)) |
| 326 | |
| 327 | if not have_mirror_tarballs: |
| 328 | bb.fatal('Using `ARCHIVER_MODE[src] = "mirror"` depends on setting `BB_GENERATE_MIRROR_TARBALLS = "1"`') |
| 329 | |
| 330 | def is_excluded(url): |
| 331 | for prefix in mirror_exclusions: |
| 332 | if url.startswith(prefix): |
| 333 | return True |
| 334 | return False |
| 335 | |
| 336 | bb.note('Archiving the source as a mirror...') |
| 337 | |
| 338 | bb.utils.mkdirhier(destdir) |
| 339 | |
| 340 | fetcher = bb.fetch2.Fetch(src_uri, d) |
| 341 | |
| 342 | for url in fetcher.urls: |
| 343 | if is_excluded(url): |
| 344 | bb.note('Skipping excluded url: %s' % (url)) |
| 345 | continue |
| 346 | |
| 347 | bb.note('Archiving url: %s' % (url)) |
| 348 | ud = fetcher.ud[url] |
| 349 | ud.setup_localpath(d) |
| 350 | localpath = None |
| 351 | |
| 352 | # Check for mirror tarballs first. We will archive the first mirror |
| 353 | # tarball that we find as it's assumed that we just need one. |
| 354 | for mirror_fname in ud.mirrortarballs: |
| 355 | mirror_path = os.path.join(dl_dir, mirror_fname) |
| 356 | if os.path.exists(mirror_path): |
| 357 | bb.note('Found mirror tarball: %s' % (mirror_path)) |
| 358 | localpath = mirror_path |
| 359 | break |
| 360 | |
| 361 | if len(ud.mirrortarballs) and not localpath: |
| 362 | bb.warn('Mirror tarballs are listed for a source but none are present. ' \ |
| 363 | 'Falling back to original download.\n' \ |
| 364 | 'SRC_URI = %s' % (url)) |
| 365 | |
| 366 | # Check original download |
| 367 | if not localpath: |
| 368 | bb.note('Using original download: %s' % (ud.localpath)) |
| 369 | localpath = ud.localpath |
| 370 | |
| 371 | if not localpath or not os.path.exists(localpath): |
| 372 | bb.fatal('Original download is missing for a source.\n' \ |
| 373 | 'SRC_URI = %s' % (url)) |
| 374 | |
| 375 | # We now have an appropriate localpath |
| 376 | bb.note('Copying source mirror') |
| 377 | cmd = 'cp -fpPRH %s %s' % (localpath, destdir) |
| 378 | subprocess.check_call(cmd, shell=True) |
| 379 | } |
| 380 | |
Brad Bishop | c4ea075 | 2018-11-15 14:30:15 -0800 | [diff] [blame] | 381 | def exclude_useless_paths(tarinfo): |
| 382 | if tarinfo.isdir(): |
| 383 | if tarinfo.name.endswith('/temp') or tarinfo.name.endswith('/patches') or tarinfo.name.endswith('/.pc'): |
| 384 | return None |
| 385 | elif tarinfo.name == 'temp' or tarinfo.name == 'patches' or tarinfo.name == '.pc': |
| 386 | return None |
| 387 | return tarinfo |
| 388 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 389 | def create_tarball(d, srcdir, suffix, ar_outdir): |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 390 | """ |
| 391 | create the tarball from srcdir |
| 392 | """ |
| 393 | import tarfile |
| 394 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 395 | # Make sure we are only creating a single tarball for gcc sources |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 396 | if (d.getVar('SRC_URI') == ""): |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 397 | return |
| 398 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 399 | # For the kernel archive, srcdir may just be a link to the |
| 400 | # work-shared location. Use os.path.realpath to make sure |
| 401 | # that we archive the actual directory and not just the link. |
| 402 | srcdir = os.path.realpath(srcdir) |
| 403 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 404 | bb.utils.mkdirhier(ar_outdir) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 405 | if suffix: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 406 | filename = '%s-%s.tar.gz' % (d.getVar('PF'), suffix) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 407 | else: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 408 | filename = '%s.tar.gz' % d.getVar('PF') |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 409 | tarname = os.path.join(ar_outdir, filename) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 410 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 411 | bb.note('Creating %s' % tarname) |
| 412 | tar = tarfile.open(tarname, 'w:gz') |
Brad Bishop | c4ea075 | 2018-11-15 14:30:15 -0800 | [diff] [blame] | 413 | tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 414 | tar.close() |
| 415 | |
| 416 | # creating .diff.gz between source.orig and source |
| 417 | def create_diff_gz(d, src_orig, src, ar_outdir): |
| 418 | |
| 419 | import subprocess |
| 420 | |
| 421 | if not os.path.isdir(src) or not os.path.isdir(src_orig): |
| 422 | return |
| 423 | |
| 424 | # The diff --exclude can't exclude the file with path, so we copy |
| 425 | # the patched source, and remove the files that we'd like to |
| 426 | # exclude. |
| 427 | src_patched = src + '.patched' |
| 428 | oe.path.copyhardlinktree(src, src_patched) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 429 | for i in d.getVarFlag('ARCHIVER_MODE', 'diff-exclude').split(): |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 430 | bb.utils.remove(os.path.join(src_orig, i), recurse=True) |
| 431 | bb.utils.remove(os.path.join(src_patched, i), recurse=True) |
| 432 | |
| 433 | dirname = os.path.dirname(src) |
| 434 | basename = os.path.basename(src) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 435 | bb.utils.mkdirhier(ar_outdir) |
| 436 | cwd = os.getcwd() |
| 437 | try: |
| 438 | os.chdir(dirname) |
| 439 | out_file = os.path.join(ar_outdir, '%s-diff.gz' % d.getVar('PF')) |
| 440 | diff_cmd = 'diff -Naur %s.orig %s.patched | gzip -c > %s' % (basename, basename, out_file) |
| 441 | subprocess.check_call(diff_cmd, shell=True) |
| 442 | bb.utils.remove(src_patched, recurse=True) |
| 443 | finally: |
| 444 | os.chdir(cwd) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 445 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 446 | def is_work_shared(d): |
| 447 | pn = d.getVar('PN') |
| 448 | return bb.data.inherits_class('kernel', d) or pn.startswith('gcc-source') |
| 449 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 450 | # Run do_unpack and do_patch |
| 451 | python do_unpack_and_patch() { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 452 | if d.getVarFlag('ARCHIVER_MODE', 'src') not in \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 453 | [ 'patched', 'configured'] and \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 454 | d.getVarFlag('ARCHIVER_MODE', 'diff') != '1': |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 455 | return |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 456 | ar_outdir = d.getVar('ARCHIVER_OUTDIR') |
| 457 | ar_workdir = d.getVar('ARCHIVER_WORKDIR') |
| 458 | ar_sysroot_native = d.getVar('STAGING_DIR_NATIVE') |
| 459 | pn = d.getVar('PN') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 460 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 461 | # The kernel class functions require it to be on work-shared, so we dont change WORKDIR |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 462 | if not is_work_shared(d): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 463 | # Change the WORKDIR to make do_unpack do_patch run in another dir. |
| 464 | d.setVar('WORKDIR', ar_workdir) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 465 | # Restore the original path to recipe's native sysroot (it's relative to WORKDIR). |
| 466 | d.setVar('STAGING_DIR_NATIVE', ar_sysroot_native) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 467 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 468 | # The changed 'WORKDIR' also caused 'B' changed, create dir 'B' for the |
| 469 | # possibly requiring of the following tasks (such as some recipes's |
| 470 | # do_patch required 'B' existed). |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 471 | bb.utils.mkdirhier(d.getVar('B')) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 472 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 473 | bb.build.exec_func('do_unpack', d) |
| 474 | |
| 475 | # Save the original source for creating the patches |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 476 | if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1': |
| 477 | src = d.getVar('S').rstrip('/') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 478 | src_orig = '%s.orig' % src |
| 479 | oe.path.copytree(src, src_orig) |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 480 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 481 | # Make sure gcc and kernel sources are patched only once |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 482 | if not (d.getVar('SRC_URI') == "" or is_work_shared(d)): |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 483 | bb.build.exec_func('do_patch', d) |
| 484 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 485 | # Create the patches |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 486 | if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1': |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 487 | bb.note('Creating diff gz...') |
| 488 | create_diff_gz(d, src_orig, src, ar_outdir) |
| 489 | bb.utils.remove(src_orig, recurse=True) |
| 490 | } |
| 491 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 492 | # BBINCLUDED is special (excluded from basehash signature |
| 493 | # calculation). Using it in a task signature can cause "basehash |
| 494 | # changed" errors. |
| 495 | # |
| 496 | # Depending on BBINCLUDED also causes do_ar_recipe to run again |
| 497 | # for unrelated changes, like adding or removing buildhistory.bbclass. |
| 498 | # |
| 499 | # For these reasons we ignore the dependency completely. The versioning |
| 500 | # of the output file ensures that we create it each time the recipe |
| 501 | # gets rebuilt, at least as long as a PR server is used. We also rely |
| 502 | # on that mechanism to catch changes in the file content, because the |
| 503 | # file content is not part of of the task signature either. |
| 504 | do_ar_recipe[vardepsexclude] += "BBINCLUDED" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 505 | python do_ar_recipe () { |
| 506 | """ |
| 507 | archive the recipe, including .bb and .inc. |
| 508 | """ |
| 509 | import re |
| 510 | import shutil |
| 511 | |
| 512 | require_re = re.compile( r"require\s+(.+)" ) |
| 513 | include_re = re.compile( r"include\s+(.+)" ) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 514 | bbfile = d.getVar('FILE') |
| 515 | outdir = os.path.join(d.getVar('WORKDIR'), \ |
| 516 | '%s-recipe' % d.getVar('PF')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 517 | bb.utils.mkdirhier(outdir) |
| 518 | shutil.copy(bbfile, outdir) |
| 519 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 520 | pn = d.getVar('PN') |
| 521 | bbappend_files = d.getVar('BBINCLUDED').split() |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 522 | # If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend |
| 523 | # Files like aa1.bbappend or aa1_1.1.bbappend must be excluded. |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 524 | bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn)) |
| 525 | bbappend_re1 = re.compile( r".*/%s\.bbappend$" % re.escape(pn)) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 526 | for file in bbappend_files: |
| 527 | if bbappend_re.match(file) or bbappend_re1.match(file): |
| 528 | shutil.copy(file, outdir) |
| 529 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 530 | dirname = os.path.dirname(bbfile) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 531 | bbpath = '%s:%s' % (dirname, d.getVar('BBPATH')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 532 | f = open(bbfile, 'r') |
| 533 | for line in f.readlines(): |
| 534 | incfile = None |
| 535 | if require_re.match(line): |
| 536 | incfile = require_re.match(line).group(1) |
| 537 | elif include_re.match(line): |
| 538 | incfile = include_re.match(line).group(1) |
| 539 | if incfile: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 540 | incfile = d.expand(incfile) |
Brad Bishop | 1d80a2e | 2019-11-15 16:35:03 -0500 | [diff] [blame] | 541 | if incfile: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 542 | incfile = bb.utils.which(bbpath, incfile) |
Brad Bishop | 1d80a2e | 2019-11-15 16:35:03 -0500 | [diff] [blame] | 543 | if incfile: |
| 544 | shutil.copy(incfile, outdir) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 545 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 546 | create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 547 | bb.utils.remove(outdir, recurse=True) |
| 548 | } |
| 549 | |
| 550 | python do_dumpdata () { |
| 551 | """ |
| 552 | dump environment data to ${PF}-showdata.dump |
| 553 | """ |
| 554 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 555 | dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR'), \ |
| 556 | '%s-showdata.dump' % d.getVar('PF')) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 557 | bb.note('Dumping metadata into %s' % dumpfile) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 558 | with open(dumpfile, "w") as f: |
| 559 | # emit variables and shell functions |
| 560 | bb.data.emit_env(f, d, True) |
| 561 | # emit the metadata which isn't valid shell |
| 562 | for e in d.keys(): |
| 563 | if d.getVarFlag(e, "python", False): |
| 564 | f.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, False))) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 565 | } |
| 566 | |
| 567 | SSTATETASKS += "do_deploy_archives" |
| 568 | do_deploy_archives () { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 569 | echo "Deploying source archive files from ${ARCHIVER_TOPDIR} to ${DEPLOY_DIR_SRC}." |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 570 | } |
| 571 | python do_deploy_archives_setscene () { |
| 572 | sstate_setscene(d) |
| 573 | } |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 574 | do_deploy_archives[dirs] = "${ARCHIVER_TOPDIR}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 575 | do_deploy_archives[sstate-inputdirs] = "${ARCHIVER_TOPDIR}" |
| 576 | do_deploy_archives[sstate-outputdirs] = "${DEPLOY_DIR_SRC}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 577 | addtask do_deploy_archives_setscene |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 578 | |
| 579 | addtask do_ar_original after do_unpack |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 580 | addtask do_unpack_and_patch after do_patch |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 581 | addtask do_ar_patched after do_unpack_and_patch |
| 582 | addtask do_ar_configured after do_unpack_and_patch |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 583 | addtask do_ar_mirror after do_fetch |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 584 | addtask do_dumpdata |
| 585 | addtask do_ar_recipe |
| 586 | addtask do_deploy_archives before do_build |
| 587 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 588 | python () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 589 | # Add tasks in the correct order, specifically for linux-yocto to avoid race condition. |
| 590 | # sstatesig.py:sstate_rundepfilter has special support that excludes this dependency |
| 591 | # so that do_kernel_configme does not need to run again when do_unpack_and_patch |
| 592 | # gets added or removed (by adding or removing archiver.bbclass). |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 593 | if bb.data.inherits_class('kernel-yocto', d): |
| 594 | bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d) |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 595 | } |