-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert setup_container and setup_postgres to bash scripts, and
CI/Docker builds work!
- Loading branch information
1 parent
2c62463
commit a4b41a8
Showing
14 changed files
with
84 additions
and
612 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
colorama | ||
db | ||
ipython | ||
lockfile | ||
numpy | ||
pandare | ||
PyYAML | ||
SQLAlchemy | ||
tabulate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
PGPASS="${HOME}/.pgpass" | ||
|
||
if [ ! -f "${PGPASS}" ]; then | ||
postgres_depends=$(dpkg-query -W -f='${depends}' 'postgresql') | ||
postgres_pkg=$(echo "${postgres_depends}" | grep -oP 'postgresql-[0-9]+.?[0-9]+') | ||
postgres_version=${postgres_pkg/postgresql-/} | ||
pg_hba="/etc/postgresql/${postgres_version}/main/pg_hba.conf" | ||
postgres_password='postgrespostgres' | ||
|
||
sudo sed -i.bak -E 's/^(local\s+all\s+postgres\s+)md5$/\1peer/' "${pg_hba}" | ||
sudo service postgresql reload | ||
|
||
password_sql="ALTER USER postgres WITH PASSWORD '${postgres_password}';" | ||
sudo -u postgres psql -c "${password_sql}" | ||
|
||
echo "*:*:*:postgres:${postgres_password}" > "${PGPASS}" | ||
chmod 600 "${PGPASS}" | ||
|
||
sudo sed -i.bak -E 's/^(local\s+all\s+postgres\s+)peer$/\1md5/' "${pg_hba}" | ||
sudo service postgresql reload | ||
fi |
Oops, something went wrong.