From 28ea2336550f639878aacdfe872dea6d4893ce53 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Sun, 24 Mar 2019 14:46:15 -0700 Subject: [PATCH] update installer to warn about non linux --- docker/Dockerfile | 9 ++++----- install.sh | 19 +++++++++++++------ run_tests.sh | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a6bdc472..b7d3dacf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,19 +1,18 @@ FROM ubuntu:16.04 -# minimal system basics +# system basics RUN apt-get update -RUN apt-get -y install git curl python +RUN apt-get -y install build-essential git curl python python-virtualenv python-dev # fetch qira -RUN git clone https://github.com/geohot/qira.git +RUN git clone https://github.com/geohot/qira.git --depth=1 WORKDIR /qira # build qemu -RUN apt-get -y install build-essential pkg-config zlib1g-dev libglib2.0-dev libpixman-1-dev +RUN apt-get -y install pkg-config zlib1g-dev libglib2.0-dev libpixman-1-dev RUN cd tracers && ./qemu_build.sh # install python packages and link qira -RUN apt-get -y install python python-virtualenv python-dev RUN virtualenv venv RUN bash -c 'source venv/bin/activate && pip install --upgrade pip' RUN bash -c 'source venv/bin/activate && pip install --upgrade -r requirements.txt' diff --git a/install.sh b/install.sh index 426b1e05..8d1a313f 100755 --- a/install.sh +++ b/install.sh @@ -9,13 +9,20 @@ else fi # build qemu -if [ $(tracers/qemu/qira-i386 > /dev/null; echo $?) == 1 ]; then - echo "QIRA QEMU appears to run okay" +if [[ "$(uname)" == 'Linux' ]]; then + if [ $(tracers/qemu/qira-i386 > /dev/null; echo $?) == 1 ]; then + echo "QIRA QEMU appears to run okay" + else + echo "building QEMU" + cd tracers + ./qemu_build.sh + cd ../ + fi else - echo "building QEMU" - cd tracers - ./qemu_build.sh - cd ../ + echo "QEMU user only works on Linux." + echo "While the rest of QIRA will run, you cannot run binaries." + echo "This is due to QEMU user forwarding the syscalls to the kernel." + echo "See other backends in qira/tracers, PIN may work on Windows and OS X" fi echo "building python venv" diff --git a/run_tests.sh b/run_tests.sh index 4b6ee8e6..a961d477 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -13,7 +13,7 @@ source venv/bin/activate nosetests -v -s # integration test -qira qira_tests/bin/loop & +./qira qira_tests/bin/loop & QIRA_PID=$! trap "kill $QIRA_PID" EXIT echo "qira pid is $QIRA_PID"