Skip to content

Commit

Permalink
Revert "Restructured Enclave Build Process (introducing vault.sh) (#96)"
Browse files Browse the repository at this point in the history
This reverts commit 6708b22.
  • Loading branch information
dkohlbre authored Jul 17, 2019
1 parent 638cf4b commit 6d85f1b
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 33 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ git:
depth: 1

env:
- RISCV=$TRAVIS_BUILD_DIR/riscv PATH=$PATH:$RISCV/bin KEYSTONE_SDK_DIR=$TRAVIS_BUILD_DIR/sdk
- RISCV=$TRAVIS_BUILD_DIR/riscv PATH=$PATH:$RISCV/bin

addons:
apt:
Expand Down Expand Up @@ -52,7 +52,6 @@ addons:
- libglib2.0-dev
- libpixman-1-dev
- libssl-dev
- makeself

branches:
only:
Expand Down Expand Up @@ -80,6 +79,10 @@ jobs:
- source ./source.sh
- travis_wait 120 make -j2
- travis_wait 10 ./scripts/travis.sh
- cd sdk; make clean; OPTIONS_FLAGS="" make
- cd ..
- make
- travis_wait 10 ./scripts/travis.sh
- cd riscv-qemu; git clean -fxd > /dev/null;git reset --hard > /dev/null;rm -rf .git;mv ../riscv-qemu-git .git;cd ..
- cd riscv-linux;git clean -fxd > /dev/null;git reset --hard > /dev/null;rm -rf .git;mv ../riscv-linux-git .git;cd ..
after_failure:
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
BOOTROM_DIR=bootrom
SDK_DIR=sdk
QEMU_DIR=riscv-qemu

BOOTROM=$(BOOTROM_DIR)/bootrom.elf
Expand All @@ -12,12 +13,17 @@ all: hifive
qemu:
./scripts/run-qemu.sh


.PHONY: hifive
hifive: $(QEMU) $(BOOTROM)
hifive: sdk $(QEMU) $(BOOTROM)
$(MAKE) -f hifive.mk
$(MAKE) -C hifive-work/buildroot_initramfs
$(MAKE) -f hifive.mk

.PHONY: sdk
sdk:
$(MAKE) -C $(SDK_DIR)

$(QEMU):
./scripts/apply-patch.sh
cd $(QEMU_DIR); ./configure --target-list=riscv64-softmmu,riscv32-softmmu;
Expand Down
6 changes: 0 additions & 6 deletions fast-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,4 @@ else
fi

git config --global submodule.riscv-gnu-toolchain.update none
git submodule sync --recursive
git submodule update --init --recursive

# build tests in SDK
make -C sdk
./sdk/scripts/init.sh --runtime eyrie --force
./sdk/examples/tests/vault.sh
2 changes: 1 addition & 1 deletion hifive-conf/buildroot_initramfs_config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BR2_RISCV_64=y
BR2_RISCV_g=y
BR2_RISCV_ABI_LP64D=y
BR2_JLEVEL=2
BR2_ROOTFS_POST_BUILD_SCRIPT="board/keystone/br_copy_bins.sh"
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_PATH="$(RISCV)"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu"
Expand Down Expand Up @@ -41,4 +42,3 @@ BR2_PACKAGE_PCIUTILS=y
BR2_PACKAGE_DROPBEAR=y
BR2_PACKAGE_SCREEN=y
BR2_PACKAGE_HTOP=y
BR2_ROOTFS_OVERLAY="../buildroot_overlay"
13 changes: 3 additions & 10 deletions hifive.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ buildroot_initramfs_sysroot := $(wrkdir)/buildroot_initramfs_sysroot
buildroot_rootfs_wrkdir := $(wrkdir)/buildroot_rootfs
buildroot_rootfs_ext := $(buildroot_rootfs_wrkdir)/images/rootfs.ext4
buildroot_rootfs_config := $(confdir)/buildroot_rootfs_config
buildroot_rootfs_overlay_dir := $(srcdir)/buildroot_overlay

linux_srcdir := $(srcdir)/riscv-linux
linux_wrkdir := $(wrkdir)/hifive-linux
Expand Down Expand Up @@ -66,8 +65,7 @@ all: $(hex) $(vmlinux) $(linux_module)
@echo " ... you will need gdisk and e2fsprogs installed"
@echo


$(buildroot_initramfs_wrkdir)/.config: $(buildroot_srcdir) $(buildroot_rootfs_overlay_dir)/.dirstamp
$(buildroot_initramfs_wrkdir)/.config: $(buildroot_srcdir)
rm -rf $(dir $@)
mkdir -p $(dir $@)
cp $(buildroot_initramfs_config) $@
Expand All @@ -82,7 +80,7 @@ buildroot_initramfs-menuconfig: $(buildroot_initramfs_wrkdir)/.config $(buildroo
$(MAKE) -C $(dir $<) O=$(buildroot_initramfs_wrkdir) savedefconfig
cp $(dir $<)/defconfig $(confdir)/buildroot_initramfs_config

$(buildroot_rootfs_wrkdir)/.config: $(buildroot_srcdir) $(buildroot_rootfs_overlay_dir)/.dirstamp
$(buildroot_rootfs_wrkdir)/.config: $(buildroot_srcdir)
rm -rf $(dir $@)
mkdir -p $(dir $@)
cp $(buildroot_rootfs_config) $@
Expand Down Expand Up @@ -128,10 +126,6 @@ $(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(buildroot_initramfs_sysroo
ARCH=riscv \
vmlinux

$(buildroot_rootfs_overlay_dir)/.dirstamp:
mkdir -p $(buildroot_rootfs_overlay_dir)
touch $@

$(linux_module): $(vmlinux)
rm -rf $(linux_module_wrkdir)
mkdir -p $(linux_module_wrkdir)
Expand All @@ -141,8 +135,7 @@ $(linux_module): $(vmlinux)
ARCH=riscv \
M=$(linux_module_wrkdir) \
modules
mkdir -p $(buildroot_rootfs_overlay_dir)/root
cp $(linux_module) $(buildroot_rootfs_overlay_dir)/root
cp $(linux_module) $(buildroot_initramfs_wrkdir)/target/root/

$(vmlinux_stripped): $(vmlinux)
$(target)-strip -o $@ $<
Expand Down
2 changes: 1 addition & 1 deletion linux-keystone-driver
2 changes: 1 addition & 1 deletion scripts/test-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ expect "yes/no" {
log_file -noappend output.log

expect "# " { send "insmod keystone-driver.ko\r" }
expect "# " { send "cd tests; ./tests.ke\r" }
expect "# " { send "./test\r" }
expect "# " { send "poweroff\r" }
expect eof
2 changes: 1 addition & 1 deletion sdk
Submodule sdk updated 64 files
+3 −0 .gitmodules
+27 −0 Makefile
+0 −29 examples/hello-native/eapp/Makefile
+0 −25 examples/hello-native/eapp/eapp_native.c
+0 −25 examples/hello-native/host/Makefile
+0 −81 examples/hello-native/host/host_native.cpp
+0 −78 examples/hello-native/vault.sh
+0 −4 examples/hello/eapp/Makefile
+0 −7 examples/hello/eapp/hello.c
+0 −9 examples/hello/host/Makefile
+0 −24 examples/hello/host/host.cpp
+0 −78 examples/hello/vault.sh
+0 −4,107 examples/tests/long-nop/add_long.s
+0 −85 examples/tests/vault.sh
+1 −1 lib/edge/Makefile
+0 −1 rts/eyrie.version
+1 −0 runtime
+5 −0 samples/Makefile
+3 −0 samples/tiny-AES-c/.gitignore
+25 −0 samples/tiny-AES-c/Makefile
+23 −0 samples/tiny-AES-c/aes.cpp
+24 −0 samples/tiny-AES-c/app.lds
+65 −0 samples/tiny-AES-c/app/Makefile
+80 −0 samples/tiny-AES-c/app/README.md
+570 −0 samples/tiny-AES-c/app/aes.c
+90 −0 samples/tiny-AES-c/app/aes.h
+12 −0 samples/tiny-AES-c/app/aes.hpp
+13 −0 samples/tiny-AES-c/app/library.json
+320 −0 samples/tiny-AES-c/app/test.c
+24 −0 samples/tiny-AES-c/app/unlicense.txt
+0 −425 scripts/common
+0 −102 scripts/init.sh
+0 −35 scripts/vault-sample.sh
+0 −0 tests/.gitignore
+1 −1 tests/Makefile
+0 −0 tests/app.lds
+1 −1 tests/app.mk
+2 −2 tests/attestation/Makefile
+0 −0 tests/attestation/attestation.c
+0 −0 tests/attestation/edge_wrapper.c
+0 −0 tests/attestation/edge_wrapper.h
+0 −0 tests/edge_wrapper.cpp
+0 −0 tests/edge_wrapper.h
+0 −0 tests/fib-bench/Makefile
+0 −0 tests/fib-bench/fib-bench.c
+0 −0 tests/fibonacci/Makefile
+0 −0 tests/fibonacci/fibonacci.c
+0 −0 tests/long-nop/Makefile
+0 −0 tests/long-nop/func_base.s
+0 −0 tests/long-nop/func_long.s
+0 −0 tests/long-nop/generate_func.sh
+0 −0 tests/long-nop/long-nop.s
+0 −0 tests/long-nop/nop.s
+0 −0 tests/loop/Makefile
+0 −0 tests/loop/loop.s
+0 −0 tests/malloc/Makefile
+0 −0 tests/malloc/malloc.c
+0 −0 tests/stack/Makefile
+0 −0 tests/stack/stack.s
+1 −0 tests/test-runner.cpp
+2 −2 tests/untrusted/Makefile
+0 −0 tests/untrusted/edge_wrapper.c
+0 −0 tests/untrusted/edge_wrapper.h
+0 −0 tests/untrusted/untrusted.c
6 changes: 0 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

git submodule sync --recursive
git submodule update --init --recursive

mkdir riscv
Expand All @@ -10,8 +9,3 @@ cd riscv-gnu-toolchain
./configure --prefix=$RISCV
make && make linux
cd ..

# build tests in SDK
make -C sdk
./sdk/scripts/init.sh --runtime eyrie --force
./sdk/examples/tests/vault.sh
4 changes: 1 addition & 3 deletions tests/test-qemu.expected.log
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

# insmod keystone-driver.ko
# cd tests; ./tests.ke
Verifying archive integrity... All good.
Uncompressing Keystone vault archive
# ./test
testing stack
testing fibonacci
testing long-nop
Expand Down

0 comments on commit 6d85f1b

Please sign in to comment.