Skip to content

Commit

Permalink
update install guide and now my CI should work
Browse files Browse the repository at this point in the history
  • Loading branch information
HighW4y2H3ll authored and AndrewQuijano committed Jul 11, 2024
1 parent 7d030c6 commit cbefa22
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 19 deletions.
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ ARG BASE_IMAGE
ENV DEBIAN_FRONTEND=noninteractive
ENV LLVM_DIR=/usr/lib/llvm-11
ENV PATH="/scripts:${PATH}"
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python

# Copy dependencies lists into container. We copy them all and then do a mv because
# we need to transform base_image into a windows compatible filename which we can't
# do in a COPY command.
COPY ./dependencies/* /tmp
COPY ./requirements.txt /tmp

RUN mv /tmp/$(echo "$BASE_IMAGE" | sed 's/:/_/g')_build.txt /tmp/build_dep.txt && \
mv /tmp/$(echo "$BASE_IMAGE" | sed 's/:/_/g')_base.txt /tmp/base_dep.txt

Expand All @@ -22,9 +25,9 @@ RUN [ -e /tmp/base_dep.txt ] && \
apt-get clean

# Finally: Install panda debian package, you need a version that has the Dwarf2 Plugin
RUN wget https://github.com/panda-re/panda/releases/download/v1.8.23/pandare_20.04.deb
RUN command apt install -qq -y ./pandare_20.04.deb
RUN pip install pandare
RUN curl -LJO https://github.com/panda-re/panda/releases/download/v1.8.23/pandare_22.04.deb
RUN apt install -qq -y ./pandare_22.04.deb
RUN pip install -r /tmp/requirements.txt

### BUILD IMAGE - STAGE 2
FROM base AS builder
Expand All @@ -40,6 +43,15 @@ FROM builder as developer

COPY ./tools/ /tools
COPY ./scripts /scripts
COPY setup_container.py /setup_container.py

RUN python3 setup_container.py
# Essentially same as setup_container.sh
RUN cd /tools/btrace && ./compile.sh

RUN rm -rf /tools/build
RUN mkdir -p /tools/build
RUN mkdir -p /tools/install

RUN cmake -B"/tools/build" -H"/tools" -DCMAKE_INSTALL_PREFIX="/tools/install"
RUN make --no-print-directory -j4 install -C "/tools/build/lavaTool"

RUN make --no-print-directory -j4 install -C "/tools/build/fbi"
24 changes: 24 additions & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Setup LAVA

## Ubuntu 64-bit 16.04.4
The following install steps worked on 6/29/2019 with LAVA commit [c55bf1826ef9855a621f2652b30f16ac75b19cb6](https://github.com/panda-re/lava/commit/c55bf1826ef9855a621f2652b30f16ac75b19cb6).

- Download and install [Ubuntu 64-bit 16.04.6](http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso) (SHA1 A09607901183AB25C675626024AA402663FA2558, MD5: 5416371CC0E990871746DDAAC89F1A5E).
- `sudo add-apt-repository ppa:phulin/panda`
- `sudo cp /etc/apt/sources.list /etc/apt/sources.list~`
- `sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list`
- `sudo apt-get update`
- `sudo apt-get install python-pip git protobuf-compiler protobuf-c-compiler libprotobuf-c0-dev libprotoc-dev python-protobuf libelf-dev libcapstone-dev libdwarf-dev python-pycparser llvm-3.3 clang-3.3 libc++-dev libwiretap-dev libwireshark-dev odb`
- `sudo apt-get build-dep qemu`
- `pip install colorama`
- `cd ~/Desktop`
- `git clone https://github.com/panda-re/lava.git`
- `cd ~/Desktop/lava`
- `python2 setup.py`

## Updated

- build Docker container with `docker/Dockerfile`
- use `scripts/docker-shell.sh` to enter docker container
- inside Docker container, run `python setup_container.py` to build lavaTools
- exit Docker container, and run `python setup_postgres.py` and `init-host.py`
17 changes: 3 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ progress() {
echo -e "\e[32m[lava_install]\e[0m \e[1m$1\e[0m"
}

# Step 1: Install panda debian package
wget https://github.com/panda-re/panda/releases/download/v1.8.23/pandare_22.04.deb
$SUDO apt install ./pandare_22.04.deb

# Remove the comment to update all debian stuff from sources.list
$SUDO cp /etc/apt/sources.list /etc/apt/sources.list~
$SUDO sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
$SUDO apt-get update

progress "Updates complete"

# This was originally in the docs/setup.md, I removed things starting with 'python-' as that should be installed via pip
Expand Down Expand Up @@ -53,12 +44,10 @@ $SUDO apt install ./pandare_22.04.deb

progress "Installed build dependencies"

$SUDO pip3 install --upgrade pip

# This seems to be the better replacement to have all python packages
$SUDO pip3 install -r requirements.txt
pip3 install --upgrade pip
pip3 install -r requirements.txt
progress "Installed Python requirements"

./setup_container.sh
$SUDO bash ./setup_container.sh

progress "Installed LAVA"

0 comments on commit cbefa22

Please sign in to comment.