From 7772411378fa015eb1a12242f62a1e947e8a3953 Mon Sep 17 00:00:00 2001 From: "Hui, Chunyang" Date: Thu, 14 Apr 2022 07:45:32 +0000 Subject: [PATCH] Fix aesm check failure on SGX v1 machine --- tools/occlum | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/occlum b/tools/occlum index cc23ccba..c73d652a 100755 --- a/tools/occlum +++ b/tools/occlum @@ -1,5 +1,7 @@ #!/bin/bash +set -e + this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" occlum_dir="$( cd "$( dirname "$this_dir/../../../" )" >/dev/null 2>&1 && pwd )" build_makefile=$occlum_dir/build/bin/occlum_build.mk @@ -122,8 +124,8 @@ check_aesm_service() { fi # AESM is not necessary for SGX2 - lscpu | grep sgx_lc > /dev/null 2>&1 - if [ $? -eq 0 ]; then + lscpu | grep sgx_lc > /dev/null 2>&1 || ret=$? + if [[ $ret -eq 0 ]]; then return fi @@ -595,8 +597,6 @@ cmd_gen_image_key() { cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 32 | head -n 1 | sed -r 's/.{2}/&-/g; s/.$//' > $key_path } -set -e - if [[ ( "$#" < 1 ) ]] ; then report_arg_error "Error: no sub-command is given" exit 1