sgx环境搭建

Linux平台 SGX 技术包括:SGX 驱动程序、SGX SDK 以及 SGX 平台软件 (PSW) ,其 SDK 和 PSW 均托管在 linux-sgx 项目中。

搭建 SGX 环境步骤如下:

1、安装相关依赖

  $ sudo apt-get install build-essential ocaml ocamlbuild automake autoconf libtool wget python-is-python3 libssl-dev git cmake perl

2、下载 linux-sgx 代码:

$ git clone https://github.com/intel/linux-sgx.git
$ cd linux-sgx && make preparation

这里,make preparation 中会执行 ./download_prebuilt.sh 脚本,下载 external/toolset 目录下的相关工具。

3、编译 sdk 及 sdk 安装器

$ make sdk
$ make sdk_install_pkg

之后,会在 linux/installer/bin/ 目录下看到 sgx_linux_x64_sdk_${version}.bin 类似的文件,执行该文件即可安装 SGX sdk

4、编译 psw 及 psw 安装器

$ make psw
$ make deb_psw_pkg

完成之后,就可以在 linux/installer/deb/libsgx-urts, linux/installer/deb/libsgx-enclave-common, linux/installer/deb/libsgx-uae-service, linux/installer/deb/libsgx-epid, linux/installer/deb/libsgx-launch, linux/installer/deb/libsgx-quote-ex and linux/installer/deb/sgx-aesm-service 目录下找到安装文件

5、编译 debian 安装包

$ make deb_local_repo

这样即可在类似 linux/installer/deb/sgx_debian_local_repo 的目录下找到 deb 文件

6、更新软件源,修改 /etc/apt/sources.list 文件

对于 ubuntu 21.04 版本,添加:

deb [trusted=yes arch=amd64] file:/PATH_TO_LOCAL_REPO hirsute main

保存后,再执行 apt-get update 命令,之后即可安装:

原文地址:https://www.cnblogs.com/caidi/p/15424546.html