ubuntu_install_sgx.sh 1.73 KB
Newer Older
1
#!/bin/bash
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
18 19 20 21 22 23

set -e
set -u
set -o pipefail

apt-get update && apt-get install -y --no-install-recommends \
nhynes committed
24 25
    build-essential git cmake \
    wget python pkg-config software-properties-common \
26
    autoconf automake libtool ocaml \
27
    protobuf-compiler libprotobuf-dev \
28
    libssl-dev libcurl4-openssl-dev curl
nhynes committed
29

30
git clone --branch=sgx_2.2 --depth=1 https://github.com/intel/linux-sgx.git
nhynes committed
31
cd linux-sgx
32
curl -s -S -L 'https://gist.githubusercontent.com/nhynes/c770b0e91610f8c020a8d1a803a1e7cb/raw/8f5372d9cb88929b3cc49a384943bb363bc06827/intel-sgx.patch' | git apply
nhynes committed
33
./download_prebuilt.sh
34 35
make -j4 sdk && make -j4 sdk_install_pkg
./linux/installer/bin/sgx_linux_x64_sdk*.bin --prefix /opt
nhynes committed
36 37
cd -

38
git clone --branch=v1.0.5 --depth=1 https://github.com/baidu/rust-sgx-sdk.git /opt/rust-sgx-sdk
nhynes committed
39
cd /opt/rust-sgx-sdk
40
curl -s -S -L 'https://gist.githubusercontent.com/nhynes/37164039c5d3f33aa4f123e4ba720036/raw/b0de575fe937231799930764e76c664b92975163/rust-sgx-sdk.diff' | git apply
nhynes committed
41
cd -