summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD23
-rw-r--r--opensgx-bin-paths.patch53
-rwxr-xr-xsgx-compile4
4 files changed, 34 insertions, 54 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5ef51c473ec..4ca6b92bc47 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,8 @@
+# Generated by mksrcinfo v8
+# Mon Jan 11 18:46:17 UTC 2016
pkgbase = opensgx-git
pkgdesc = an open platform for Intel SGX
- pkgver = r52.57cb88f
+ pkgver = r92.08cbf4a
pkgrel = 1
url = https://github.com/sslab-gatech/opensgx/
arch = x86_64
@@ -13,11 +15,11 @@ pkgbase = opensgx-git
source = test-sh.patch
source = sgx-compile
md5sums = SKIP
- md5sums = 4caf85f42c36ff31994539ad64e9ec26
+ md5sums = 3c79950a441f1ef7f39015345ceed58c
md5sums = e862b28b09581142af78369c6c65ce66
md5sums = 9ac0fa0ddae6d0e70f18992894bd1205
md5sums = 48523504a8c9c6b4fc9175d143d87bf1
- md5sums = 1ff291421c523bacf735d1aa69a56661
+ md5sums = 1043db8fc0a62624653c482a968ce093
pkgname = opensgx-git
diff --git a/PKGBUILD b/PKGBUILD
index 0d50a8ca908..61de91eb204 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Jon Gjengset <jon@thesquareplanet.com>
pkgname=opensgx-git
-pkgver=r52.57cb88f
+pkgver=r92.08cbf4a
pkgrel=1
pkgdesc="an open platform for Intel SGX"
arch=('x86_64')
@@ -19,11 +19,11 @@ source=(
'sgx-compile'
)
md5sums=('SKIP'
- '4caf85f42c36ff31994539ad64e9ec26'
+ '3c79950a441f1ef7f39015345ceed58c'
'e862b28b09581142af78369c6c65ce66'
'9ac0fa0ddae6d0e70f18992894bd1205'
'48523504a8c9c6b4fc9175d143d87bf1'
- '1ff291421c523bacf735d1aa69a56661')
+ '1043db8fc0a62624653c482a968ce093')
pkgver() {
cd "$srcdir/$pkgname"
@@ -45,6 +45,9 @@ prepare() {
msg2 "Make test.sh use system sgx"
patch -Np1 -i '../test-sh.patch'
+ msg2 "Fixing hard-coded paths"
+ sed -i '/#define KEY_PATH1/ s@".*"@"/etc/sgx/device.key"@' qemu/target-i386/sgx_helper.c
+
msg2 "Configure QEMU"
cd qemu && ./configure-arch
}
@@ -66,6 +69,7 @@ package() {
cd "$srcdir/$pkgname"
# Binaries
+ msg2 "Installing binaries"
install -d "$pkgdir/usr/bin"
install -m755 ./{sgx,sgx-dbg,opensgx} -t "$pkgdir/usr/bin/"
install -m755 user/{sgx-tool,sgx-runtime} -t "$pkgdir/usr/bin/"
@@ -73,9 +77,10 @@ package() {
install -m755 "$srcdir/sgx-compile" -t "$pkgdir/usr/bin/"
# Libraries
+ msg2 "Installing library files"
cd user
install -d "$pkgdir/usr/lib/sgx"
- all=$(make -dn demo/hello.sgx | grep 'Considering target file' | awk '{print $4}' | sed -e "s/'//g" -e 's/\.$//' | grep '\.a' | grep -v demo)
+ all=$(make -dn demo/hello.sgx | grep 'Considering target file' | awk '{print $4}' | sed -e "s/'//g" -e 's/\.$//' | grep -E '\.a|\.o' | grep -v demo)
for f in $all; do
install -Dm644 "$f" "$pkgdir/usr/lib/sgx/$(basename "$f")"
done
@@ -83,16 +88,24 @@ package() {
install -Dm644 "user/sgx.lds" "$pkgdir/usr/lib/sgx"
# Headers
+ msg2 "Installing headers"
install -d "$pkgdir/usr/include/sgx"
install -m644 libsgx/include/*.h -t "$pkgdir/usr/include/sgx"
install -m644 user/share/include/*.h -t "$pkgdir/usr/include/sgx"
# Fix header prefixes
+ msg2 "Fixing headers"
for f in "$pkgdir/usr/include/sgx"/*.h; do
sed -i -e 's@#include <sgx-@#include <sgx/@g' "$f"
b="$(basename "$f")"
- mv "$f" "$(dirname "$f")"/"${b#sgx-}"
+ if [ "$f" != "$(dirname "$f")"/"${b#sgx-}" ]; then
+ mv "$f" "$(dirname "$f")"/"${b#sgx-}"
+ fi
done
+
+ msg2 "Adding device key"
+ install -d "$pkgdir/etc/sgx"
+ install -m644 user/conf/device.key -t "$pkgdir/etc/sgx"
}
# vim:set ts=2 sw=2 et:
diff --git a/opensgx-bin-paths.patch b/opensgx-bin-paths.patch
index a01cad79a1c..5cf5dbe1338 100644
--- a/opensgx-bin-paths.patch
+++ b/opensgx-bin-paths.patch
@@ -1,53 +1,18 @@
diff --git a/opensgx b/opensgx
-index b90ff87..b28d02d 100755
+index 404c2a8..a6b6b7d 100755
--- a/opensgx
+++ b/opensgx
-@@ -1,13 +1,7 @@
+@@ -1,9 +1,9 @@
#! /bin/bash
--ROOT=$(dirname "$0")
+ ROOT=$(dirname "$0")
-SGXTOOL=$ROOT/user/sgx-tool
-SGX=$ROOT/sgx
-DEVICEKEY=$ROOT/user/conf/device.key
-SGXRUNTIME=$ROOT/user/sgx-runtime
--
- key_gen() {
- FILENAME=sign.key
-- $SGXTOOL -k 3072 > $FILENAME
-+ sgx-tool -k 3072 > $FILENAME
- }
-
- compile_code() {
-@@ -21,15 +15,15 @@ compile_code() {
- }
-
- run_enclave() {
-- $SGX $SGXRUNTIME $1 $2
-+ sgx "$(which sgx-runtime)" $1 $2
- }
-
- run_enclave_with_icount() {
-- $SGX -i $SGXRUNTIME $1 $2
-+ sgx -i "$(which sgx-runtime)" $1 $2
- }
++SGXTOOL=sgx-tool
++SGX=sgx
++DEVICEKEY=/etc/sgx/device.key
++SGXRUNTIME=/usr/bin/sgx-runtime
+ GDBPORT=-1
- measure() {
-- $SGXTOOL -m $1
-+ sgx-tool -m $1
- }
-
- sign() {
-@@ -44,10 +38,10 @@ sign() {
- touch $CONF
- measure $1 > $MEASURE
-
-- $SGXTOOL -S $MEASURE > $SIG
-- $SGXTOOL -s $SIG --key=$2 > $CONF
-- $SGXTOOL -E $CONF > $TOKEN
-- $SGXTOOL -M $TOKEN --key=$DEVICEKEY >> $CONF
-+ sgx-tool -S $MEASURE > $SIG
-+ sgx-tool -s $SIG --key=$2 > $CONF
-+ sgx-tool -E $CONF > $TOKEN
-+ sgx-tool -M $TOKEN --key=conf/device.key >> $CONF
-
- rm $MEASURE $SIG $TOKEN
- }
+ key_gen() {
diff --git a/sgx-compile b/sgx-compile
index 2d83389dcff..b239d5b010f 100755
--- a/sgx-compile
+++ b/sgx-compile
@@ -21,9 +21,9 @@ for a in "$@"; do
done
# Now link (with the .os in the current directory)
-find /usr/lib/sgx/ -type f -iname '*.a' -print0 \
+find /usr/lib/sgx/ -type f \( -iname '*.a' -o -iname '*.o' \) -print0 \
| xargs -0 \
cc \
-g -Wall -pedantic -Wno-unused-function -std=gnu11 \
-fno-stack-protector -static -fPIC -fvisibility=hidden \
- -static -nostdlib "-Wl,-T,/usr/lib/sgx/sgx.lds" "${args[@]}"
+ -static -nostdlib -nostartfiles "-Wl,-T,/usr/lib/sgx/sgx.lds" "${args[@]}"