-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
34 lines (26 loc) · 1.17 KB
/
install.sh
File metadata and controls
34 lines (26 loc) · 1.17 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
#!/bin/bash
BASHRC_PATH="/home/ivan/.bashrc"
CURR_DIR=$(pwd)
SGX_BIN="sgx_linux_x64_sdk_2.15.100.3.bin"
SGX_INSTALLER_URL="https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin"
ENVIRONMENT_PATH="$CURR_DIR/sgxsdk/environment"
SSL_URL="http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb"
SSL_DEB="libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb"
wget $SSL_URL
sudo dpkg -i $SSL_DEB
sudo apt update
sudo apt install build-essential python2
if [ ! -f "$SGX_BIN" ]; then
wget "$SGX_INSTALLER_URL"
chmod +x "$SGX_BIN"
fi
echo "Installing SGX SDK..."
# echo yes to automatically install in current folder
yes yes | ./"$SGX_BIN" 2>&1 >/dev/null
echo "Installation complete!"
# This may leave some garbage lines at the end of your ~/.bashrc file if you install the SDK in different folders
# If you are getting a "bash: [..]/sgxsdk/environment: No such file or directory", this is likely the cause
# You will need to remove them manually
grep "source $ENVIRONMENT_PATH" "$BASHRC_PATH" || echo "source $ENVIRONMENT_PATH" >> $BASHRC_PATH
# Load the newly added environment variables
source $BASHRC_PATH