-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.sh
executable file
·113 lines (106 loc) · 3.98 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
#;****************************************************************************;
# Intel-SA-00086 build script
#
# BSD LICENSE
#
# Copyright (C) 2003-2012, 2018 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#;****************************************************************************;
pushd Packages
#TSS
wget https://github.com/tpm2-software/tpm2-tss/releases/download/4.0.1/tpm2-tss-4.0.1.tar.gz
tar -xvzf tpm2-tss-4.0.1.tar.gz
pushd tpm2-tss-4.0.1
./configure --with-udevrulesdir=/etc/udev/rules.d/
if [ $? != 0 ];then
echo "ERROR: Missing package dependencies for tss installation."
echo "Please refer https://github.com/tpm2-software/tpm2-tss/blob/master/INSTALL.md"
exit 1
fi
make -j8
if [ $? != 0 ];then
echo "ERROR: Failed TSS build/install. Exiting."
exit 1
fi
sudo make install
sudo ldconfig
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo mkdir -p /var/lib/tpm
sudo groupadd tss && sudo useradd -M -d /var/lib/tpm -s /bin/false -g tss tss
sudo pkill -HUP dbus-daemon
popd
#ABRMD
wget https://github.com/tpm2-software/tpm2-abrmd/releases/download/3.0.0/tpm2-abrmd-3.0.0.tar.gz
tar -xvzf tpm2-abrmd-3.0.0.tar.gz
pushd tpm2-abrmd-3.0.0
./configure --with-dbuspolicydir=/etc/dbus-1/system.d
if [ $? != 0 ];then
echo "ERROR: Missing package dependencies for tpm2-abrmd installation."
echo "Please refer https://github.com/tpm2-software/tpm2-abrmd/blob/master/INSTALL.md"
exit 1
fi
make -j8
if [ $? != 0 ];then
echo "ERROR: Failed ABRMD build. Exiting."
exit 1
fi
sudo make install
sudo ldconfig
popd
#TOOLS
wget https://github.com/tpm2-software/tpm2-tools/releases/download/5.5/tpm2-tools-5.5.tar.gz
tar -xvzf tpm2-tools-5.5.tar.gz
pushd tpm2-tools-5.5
./configure
if [ $? != 0 ];then
echo "ERROR: Missing package dependencies for tpm2-tools installation."
echo "Please refer https://github.com/tpm2-software/tpm2-tools/blob/master/INSTALL.md"
exit 1
fi
make -j8
if [ $? != 0 ];then
echo "ERROR: Failed tpm2-tools build/install. Exiting."
exit 1
fi
sudo make install
sudo ldconfig
popd
popd
#iCLS
ARCH=$(uname -m)
echo "Please install the iCLS package from $ARCH folder with your package manager command"
echo "Example:"
echo "1. Verify package signature: rpm --import \"Intel(R) Trust Services.key\" && rpm -K iclsClient-<version>.<arch>.rpm"
echo "2. Install package: rpm -i -nodeps iclsClient.rpm"
#Pre-run instructions.
echo "Now run the resource manager daemon prior to running the tool/ script."
echo "sudo -u tss tpm2-abrmd --tcti=device"
echo "Please make sure the udev rules are installed as well."