Skip to content

Instantly share code, notes, and snippets.

@m3lixir
Created February 3, 2020 18:23
Show Gist options
  • Save m3lixir/8ec7fbb75549fa58260722c6996c2b51 to your computer and use it in GitHub Desktop.
Save m3lixir/8ec7fbb75549fa58260722c6996c2b51 to your computer and use it in GitHub Desktop.
Directions on setting up Avatar2 for Ubuntu 16.04.

I've found that the following pairing of Git commits works without errors:

avatar2      @ f39943c Oct 19, 2018
avatar-qemu  @ 32062b1 Jan  3, 2018
avatar-panda @ 28f718b Jul 13, 2018
openocd      @ 0.9.0-1+deb8u1build0.16.04.1
  1. Install avatar2 dependencies.

    $ sudo apt-get install -y autoconf binutils-dev build-essential cmake gdb-multiarch libboost-all-dev libglib2.0-dev libhidapi-hidraw0 libjim0.76 libpixman-1-dev libpython-dev libssl-dev libtool openocd pkg-config python-capstone python3-dev python3-pip python3-setuptools virtualenv zlib1g-dev
    $ pip3 install configparser keystone-engine
    $ sudo cp /home/mksavic/.local/lib/python3.5/site-packages/usr/lib/python3/dist-packages/keystone/libkeystone.so /home/mksavic/.local/lib/python3.5/site-packages/keystone/
  2. Clone avatar2 and avatar2-examples.

    $ git clone https://github.com/avatartwo/avatar2.git
    $ git clone https://github.com/avatartwo/avatar2-examples.git
  3. Install avatar2.

    $ cd avatar2/
    $ sudo python3 setup.py install
  4. Build QEMU.

    $ cd avatar2/targets/
    $ ./build_qemu.sh
  5. Build PANDA.

    $ cd avatar2/targets/
    $ ./build_panda.sh

    If you receive the following error:

    Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
    Cloning into 'dtc'...
    fatal: unable to connect to git.qemu-project.org:
    git.qemu-project.org[0: 172.99.69.163]: errno=Connection timed out
    
    fatal: clone of 'git://git.qemu-project.org/dtc.git' into submodule path 'dtc' failed
    
    ERROR: DTC (libfdt) version >= 1.4.2 not present. Your options:
             (1) Preferred: Install the DTC (libfdt) devel package
             (2) Fetch the DTC submodule, using:
                 git submodule update --init dtc
    
    make: *** No targets specified and no makefile found.  Stop.
    

    Resolve it by:

    $ cd src/avatar-panda/
    $ git clone https://git.qemu.org/git/dtc.git
    $ cd dtc/
    $ git checkout ec02b34

    Then complete the remaining steps of the script:

    $ mkdir -p ../../build/panda/panda
    $ cd ../../build/panda/panda
    $ ../../../src/avatar-panda/configure --disable-sdl --target-list=arm-softmmu
    $ make -j4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment