Add a build tag to turn off TPM12 support and avoid tspi dependency (#232)

* Add build tag to turn off TPM12 support and avoid tspi dependency

* Add notspi build flag related information in README.md
This commit is contained in:
tracefinder 2021-07-30 22:26:45 +03:00 committed by GitHub
parent 9ff0d31d3c
commit 5df8a8e979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -24,7 +24,12 @@ Please note that this is not an official Google product.
The go-attestation package is installable using go get: `go get github.com/google/go-attestation/attest`
Linux users must install `libtspi` and its headers. This can be installed on debian-based systems using: `sudo apt-get install libtspi-dev`.
Linux users must install `libtspi` and its headers if they need TPM 1.2 support. This can be installed on debian-based systems using: `sudo apt-get install libtspi-dev`.
In case Linux users need only TPM 2.0 support, they can:
* still install `libtspi`
* or turn off cgo completely, e.g., `CGO_ENABLED=0 go build`
* or use `notspi` build tag if cgo is needed for some reasons, e.g., `go build --tags=notspi`
## Example: device identity

View File

@ -12,7 +12,7 @@
// License for the specific language governing permissions and limitations under
// the License.
// +build linux,!gofuzz,cgo
// +build linux,!gofuzz,cgo,!notspi
package attest

View File

@ -12,7 +12,7 @@
// License for the specific language governing permissions and limitations under
// the License.
// +build linux,!gofuzz,cgo
// +build linux,!gofuzz,cgo,!notspi
package attest