diff options
author | Trevor Woerner <twoerner@gmail.com> | 2018-07-09 12:29:16 -0400 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2018-07-10 09:30:16 +0800 |
commit | 089dd7e8116c664f1f45e1b1a584260a7d331b98 (patch) | |
tree | f71c3732d525824e84140fd29a82824182de8566 | |
parent | 4a357121bff4839cb481286f768550d58b36f29c (diff) | |
download | meta-secure-core-089dd7e8116c664f1f45e1b1a584260a7d331b98.tar.gz |
tpm2 git AUTOREV fix for BB_NO_NETWORK
Bitbake will try an ls-remote for any recipe whose SRCREV is AUTOREV,
even if that recipe will not ultimately be used for a particular build.
Therefore if the user specifies 'BB_NO_NETWORK = "1"', the _git versions of
the tpm2 recipes will cause the build to fail even if the _git versions are
not going to be built (which they won't be by default on account of their
DEFAULT_PREFERENCE being set to "-1").
This fix follows the same pattern as
https://github.com/sbabic/meta-swupdate/commit/721fcc89c53debcd6582bd1aa972f75297cf12e9
With this fix, the user can disable networking and successfully build the
non-_git versions of the tpm2 recipes. If the user wants to build the _git
versions, networking must be enabled. The build is expected to fail if the
user asks for the _git versions, but disables networking.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
-rw-r--r-- | meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb | 8 | ||||
-rw-r--r-- | meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb | 8 | ||||
-rw-r--r-- | meta-tpm2/recipes-tpm/tpm2-tss/tpm2-tss_git.bb | 8 |
3 files changed, 21 insertions, 3 deletions
diff --git a/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb b/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb index 22d1d45..ccb655a 100644 --- a/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb | |||
@@ -12,7 +12,13 @@ SRC_URI += " \ | |||
12 | file://tpm2-abrmd_git.default \ | 12 | file://tpm2-abrmd_git.default \ |
13 | " | 13 | " |
14 | 14 | ||
15 | SRCREV = "${AUTOREV}" | 15 | def version_git(d): |
16 | version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN')) | ||
17 | if version is not None and "git" in version: | ||
18 | return d.getVar("AUTOREV") | ||
19 | else: | ||
20 | return "cceb6c12ebb335aacb49207ee13d2f2fc833580a" | ||
21 | SRCREV ?= '${@version_git(d)}' | ||
16 | 22 | ||
17 | S = "${WORKDIR}/${BPN}" | 23 | S = "${WORKDIR}/${BPN}" |
18 | 24 | ||
diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb index c566526..7661623 100644 --- a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb | |||
@@ -9,7 +9,13 @@ PV = "${PVBASE}.${SRCPV}" | |||
9 | 9 | ||
10 | SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}" | 10 | SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}" |
11 | 11 | ||
12 | SRCREV = "${AUTOREV}" | 12 | def version_git(d): |
13 | version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN')) | ||
14 | if version is not None and "git" in version: | ||
15 | return d.getVar("AUTOREV") | ||
16 | else: | ||
17 | return "e105149f07c9b944f69599ab67cd8b018ad880d2" | ||
18 | SRCREV ?= '${@version_git(d)}' | ||
13 | 19 | ||
14 | S = "${WORKDIR}/${BPN}" | 20 | S = "${WORKDIR}/${BPN}" |
15 | 21 | ||
diff --git a/meta-tpm2/recipes-tpm/tpm2-tss/tpm2-tss_git.bb b/meta-tpm2/recipes-tpm/tpm2-tss/tpm2-tss_git.bb index eaeaec2..75683a4 100644 --- a/meta-tpm2/recipes-tpm/tpm2-tss/tpm2-tss_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2-tss/tpm2-tss_git.bb | |||
@@ -13,7 +13,13 @@ PV = "${PVBASE}.${SRCPV}" | |||
13 | 13 | ||
14 | SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}" | 14 | SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}" |
15 | 15 | ||
16 | SRCREV = "${AUTOREV}" | 16 | def version_git(d): |
17 | version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN')) | ||
18 | if version is not None and "git" in version: | ||
19 | return d.getVar("AUTOREV") | ||
20 | else: | ||
21 | return "35ab16e1d328f709d6146221a371b7341b84b670" | ||
22 | SRCREV ?= '${@version_git(d)}' | ||
17 | 23 | ||
18 | S = "${WORKDIR}/${BPN}" | 24 | S = "${WORKDIR}/${BPN}" |
19 | 25 | ||