summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Woerner <twoerner@gmail.com>2018-07-09 12:29:16 -0400
committerJia Zhang <zhang.jia@linux.alibaba.com>2018-07-10 09:30:16 +0800
commit089dd7e8116c664f1f45e1b1a584260a7d331b98 (patch)
treef71c3732d525824e84140fd29a82824182de8566
parent4a357121bff4839cb481286f768550d58b36f29c (diff)
downloadmeta-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.bb8
-rw-r--r--meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb8
-rw-r--r--meta-tpm2/recipes-tpm/tpm2-tss/tpm2-tss_git.bb8
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
15SRCREV = "${AUTOREV}" 15def 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"
21SRCREV ?= '${@version_git(d)}'
16 22
17S = "${WORKDIR}/${BPN}" 23S = "${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
10SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}" 10SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}"
11 11
12SRCREV = "${AUTOREV}" 12def 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"
18SRCREV ?= '${@version_git(d)}'
13 19
14S = "${WORKDIR}/${BPN}" 20S = "${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
14SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}" 14SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}"
15 15
16SRCREV = "${AUTOREV}" 16def 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"
22SRCREV ?= '${@version_git(d)}'
17 23
18S = "${WORKDIR}/${BPN}" 24S = "${WORKDIR}/${BPN}"
19 25