-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Fasano
committed
Dec 15, 2023
1 parent
98b9da2
commit 0eadd64
Showing
5 changed files
with
71 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ build | |
venv | ||
local | ||
Dockerfile | ||
panda/debian | ||
.*sw* | ||
.dockerignore | ||
.github | ||
|
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 @@ | ||
panda.deb |
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,12 @@ | ||
Package: pandare | ||
Version: 3.1.0 | ||
Architecture: all | ||
BUILD_DEPENDS_LIST | ||
DEPENDS_LIST | ||
Maintainer: Andrew Fasano <[email protected]> | ||
Description: dynamic analysis platform | ||
Platform for Architecture Neutral Dynamic Analysis (PANDA) is a processor | ||
emulator designed to support analyses of guest code. PANDA supports record- | ||
and-replay based analyses as well as analyses on live systems. PANDA is forked | ||
from the QEMU emulator. | ||
Panda currently supports i386, x86_64, ARM, MIPS, and PPC. |
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,52 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# Function to get the current Ubuntu version | ||
get_ubuntu_version() { | ||
lsb_release -i -s 2>/dev/null | ||
} | ||
|
||
if [[ $# -eq 0 ]]; then | ||
# No argument given, try building a package for current Ubuntu version | ||
|
||
# Check if we're running Ubuntu, exit otherwise | ||
OS=$(get_ubuntu_version) | ||
else | ||
OS=$1 | ||
fi | ||
|
||
if [[ $(get_ubuntu_version) != "Ubuntu" ]]; then | ||
echo "ERROR: OS of $OS is not Ubuntu and unsupported" | ||
exit 1 | ||
fi | ||
|
||
if [[ $# -eq 1 ]]; then | ||
echo "USAGE:" | ||
echo " To build a package for current Ubuntu version:" | ||
echo " $0" | ||
echo " To build a package for a specific OS/version (only Ubuntu supported for now):" | ||
echo " $0 <OS> <version>" | ||
exit 1 | ||
fi | ||
|
||
if [[ $# -eq 2 ]]; then | ||
version=$2 | ||
|
||
else | ||
version=$(lsb_release -r | awk '{print $2}') | ||
fi | ||
|
||
# Check if the given version is supported | ||
if [[ ! -f "../dependencies/ubuntu_${version}_base.txt" ]]; then | ||
echo "ERROR: Ubuntu ${version} is not supported, no dependencies file found" | ||
exit 1 | ||
fi | ||
|
||
# First build main panda container for the target ubuntu version | ||
DOCKER_BUILDKIT=1 docker build --target panda -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../.. | ||
|
||
# Now build the packager container from that | ||
docker build -t packager . | ||
|
||
# Copy deb file out of container to host | ||
docker run --rm -v $(pwd):/out packager bash -c "cp /pandare.deb /out" |