xref: /aosp_15_r20/external/ms-tpm-20-ref/Samples/TPMCmd-DeviceID/build-tpmsimulator-deviceid (revision 5c591343844d1f9da7da26467c4bf7efc8a7a413)
1*5c591343SA. Cody Schuffelen#!/usr/bin/env sh
2*5c591343SA. Cody Schuffelen# The copyright in this software is being made available under the BSD License,
3*5c591343SA. Cody Schuffelen# included below. This software may be subject to other third party and
4*5c591343SA. Cody Schuffelen# contributor rights, including patent rights, and no such rights are granted
5*5c591343SA. Cody Schuffelen# under this license.
6*5c591343SA. Cody Schuffelen#
7*5c591343SA. Cody Schuffelen# Copyright (c) Intel Corporation
8*5c591343SA. Cody Schuffelen#
9*5c591343SA. Cody Schuffelen# All rights reserved.
10*5c591343SA. Cody Schuffelen#
11*5c591343SA. Cody Schuffelen# BSD License
12*5c591343SA. Cody Schuffelen#
13*5c591343SA. Cody Schuffelen# Redistribution and use in source and binary forms, with or without modification,
14*5c591343SA. Cody Schuffelen# are permitted provided that the following conditions are met:
15*5c591343SA. Cody Schuffelen#
16*5c591343SA. Cody Schuffelen# Redistributions of source code must retain the above copyright notice, this list
17*5c591343SA. Cody Schuffelen# of conditions and the following disclaimer.
18*5c591343SA. Cody Schuffelen#
19*5c591343SA. Cody Schuffelen# Redistributions in binary form must reproduce the above copyright notice, this
20*5c591343SA. Cody Schuffelen# list of conditions and the following disclaimer in the documentation and/or
21*5c591343SA. Cody Schuffelen# other materials provided with the distribution.
22*5c591343SA. Cody Schuffelen#
23*5c591343SA. Cody Schuffelen# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS""
24*5c591343SA. Cody Schuffelen# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25*5c591343SA. Cody Schuffelen# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26*5c591343SA. Cody Schuffelen# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27*5c591343SA. Cody Schuffelen# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28*5c591343SA. Cody Schuffelen# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29*5c591343SA. Cody Schuffelen# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30*5c591343SA. Cody Schuffelen# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31*5c591343SA. Cody Schuffelen# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32*5c591343SA. Cody Schuffelen# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33*5c591343SA. Cody Schuffelen
34*5c591343SA. Cody Schuffelen# Script will build tpm2-simulator by using DeviceID.
35*5c591343SA. Cody Schuffelen# CAUTION: Endorsement seed derived from device unique IDs are guaranteed to remain the same as long as the reference
36*5c591343SA. Cody Schuffelen#   implementation manufactures its NV state on the same device. It relies on publicly accessible values
37*5c591343SA. Cody Schuffelen#   storage device serial numbers and networking card MAC address), it can only be used for the simulation purposes,
38*5c591343SA. Cody Schuffelen#   as it cannot be used to produce a secret value.
39*5c591343SA. Cody Schuffelen
40*5c591343SA. Cody Schuffelenbasedir=$1
41*5c591343SA. Cody Schuffelen
42*5c591343SA. Cody Schuffelen# Copy needed tpm simulator reference implementation source code files.
43*5c591343SA. Cody Schuffelencp -r -n -v $basedir/TPMCmd/* $basedir/Samples/TPMCmd-DeviceID
44*5c591343SA. Cody Schuffelen
45*5c591343SA. Cody Schuffelencd $basedir/Samples/TPMCmd-DeviceID
46*5c591343SA. Cody Schuffelen
47*5c591343SA. Cody Schuffelen./bootstrap
48*5c591343SA. Cody Schuffelen./configure --enable-usedeviceid=yes
49*5c591343SA. Cody Schuffelenmake -j2
50*5c591343SA. Cody Schuffelen
51*5c591343SA. Cody Schuffelencd $basedir
52*5c591343SA. Cody Schuffelen
53