-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.sh
More file actions
executable file
·131 lines (108 loc) · 3.18 KB
/
configure.sh
File metadata and controls
executable file
·131 lines (108 loc) · 3.18 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash -e
#=======================================
#SEAL SQ 2024
#Zero Touch Provisioning Demo with INeS
#IoT / Tools / Provisioning / Firmware Team
#=======================================
#SPDX-License-Identifier: Apache-2.0*/
############################################################
# Help #
############################################################
FIRST_CONFIG_FILE=.firstconfig.txt
Help()
{
# Display Help
echo "This script allow you to run instalation and working SealSQ Software Signing Demo"
echo "If you want to reexecute first install, remove .firstconfig.txt files"
echo
}
copyVaultic()
{
cp include/vaultic_tls_config_292.h lib/Seal_SQ_Ines_SDK/lib/libVaultIC/292/DEVKIT_VIC292_TLS_RPI/VaultIC-TLS/vaultic_tls/vaultic_tls-2xx/src/vaultic_tls_config.h
}
install()
{
sudo apt-get update
sudo apt-get --yes --force-yes install cmake
sudo apt-get --yes --force-yes install python3
copyVaultic
configurelib
echo done, remove this file if you want to do first setup again > ${FIRST_CONFIG_FILE}
}
configurelib()
{
echo "---Software Signing: Configure ZTP lib START---"
pushd lib/Seal_SQ_Ines_SDK/
chmod +x build.sh
./build.sh
popd
echo "---Software Signing: Configure ZTP lib END---"
}
buildapp()
{
echo "---Software Signing: Build APP START---"
source lib/Seal_SQ_Ines_SDK/config.cfg
CMAKE_OPTS="-DVAULTIC_PRODUCT=${VAULTIC_PRODUCT}"
CMAKE_OPTS+=" -DWOLFSSL_USER_SETTINGS=yes -DWOLFSSL_EXAMPLES=no -DWOLFSSL_CRYPT_TESTS=no"
if([ ! -z ${COMPILATION_MODE} ] ); then
CMAKE_OPTS+=" -DCOMPILATION_MODE=${COMPILATION_MODE}"
fi
if([ ! -z ${INTERFACE} ] ); then
CMAKE_OPTS+=" -DVAULTIC_COMM=${INTERFACE}"
fi
echo "Running CMAKE"
rm -rf build/
mkdir build
cd build/
cmake ${CMAKE_OPTS} ..
echo "Cleaning"
make clean
echo "Building"
make all
if [ -f "./softwareSigning_demo" ];then
echo "Software Signing_demo App in C build";
else
exit
fi
}
############################################################
############################################################
# Main program #
############################################################
############################################################
############################################################
# Process the input options. Add options as needed. #
############################################################
# Get the options
while getopts ":hbizg" option; do
case $option in
h) # display Help
Help
exit;;
b) # Force building
echo "force building"
buildapp
exit;;
i) # Install Prerequities
echo "Install Requierment"
install
exit;;
g) # Git checkouts
echo "Install Requierment"
checkoutLibs
exit;;
\?) # Invalid option
echo "Error: Invalid option"
Help
exit;;
esac
done
echo "Software Signing Demo Configuration and Building"
if [ -e ${FIRST_CONFIG_FILE} ]
then
echo "First config Already done"
else
echo "Do first config"
install
fi
buildapp