adeb prepare advertises --distro flag but doesn't accept it
mhansen opened this issue · 7 comments
Hi there, a little error I got when I tried to upgrade from debian buster (now superseded by bullseye).
$ git clone https://github.com/joelagnel/adeb.git
$ cd adeb
$ ./adeb prepare
> ./adeb
15:09:33 - INFO : USAGE:
15:09:33 - INFO : adeb
15:09:33 - INFO : shell Enter the androdeb shell environment and get to work!
15:09:33 - INFO : remove Remove androdeb from the device
15:09:33 - INFO : git-pull Git pull androdeb to update it on your host
15:09:33 - INFO : pull Copy files from the androdeb filesystem in the device
15:09:33 - INFO : push Copy files to the androdeb filesystem in the device
15:09:33 - INFO :
15:09:33 - INFO : prepare Prepare the device (when running for the first time)
15:09:33 - INFO : By default, this will download and install a base image.
15:09:33 - INFO : ** Folowing are the prepare options **
15:09:33 - INFO : --full Pass this to prepare to download and install the full image which
15:09:33 - INFO : contains compilers, editors, tracers etc.
15:09:33 - INFO :
15:09:33 - INFO : --build Instead of download, build and install the image onto the device
15:09:33 - INFO :
15:09:33 - INFO : --archive Use archive for root fs (overrides all other prepare options)
15:09:33 - INFO :
15:09:33 - INFO : --buildtar While preparing, also build a tar.gz.zip file of the filesystem,
15:09:33 - INFO : this is how images that are downloaded by prepare are built
15:09:33 - INFO :
15:09:33 - INFO : --build-image Build an ext4 .img with the base image and BCC (useful for Qemu)
15:09:33 - INFO :
15:09:33 - INFO : ** Folowing are misc build options **
15:09:33 - INFO : --tempdir Use a specific temporary directory for build operation
15:09:33 - INFO : --arch Specify an ARCH to build for (default arm64)
15:09:33 - INFO : --distro Debian distro to base on (default is buster)
[snip]
$ ./adeb prepare --distro bullseye
15:09:06 - ERROR : Unknown option (--distro)
This was in order to get the latest version of bpftrace
which should contain a fix for bpftrace/bpftrace#515.
Looks like the DISTRO is hardcoded in androdeb
.
I think this patch should fix it?
> git diff
diff --git a/androdeb b/androdeb
index a2ee65b..60c5566 100755
--- a/androdeb
+++ b/androdeb
@@ -63,6 +63,7 @@ case $key in
--sshpass) SSHPASS="sshpass -p$2"; shift || true; shift || true; ;;
--build-image) BI=1; BUILD_IMAGEF=$2; SKIP_DEVICE=1; DOWNLOAD=0; shift || true; shift || true; ;;
--debug) set -x; shift || true; ;;
+ --distro) DISTRO="$2"; shift || true; shift || true; ;;
*) c_error "Unknown option ($1)"; usage; ;;
esac
done
I no longer maintain it but I'm happy to accept PRs. Could you send me a PR for this?
Before I send a bunch of PRs, I might ask: do you know of an easier way than this project to run bpftrace on Android? (I'm wondering/hoping if the lack of maintenance may be connected to a better way emerging that obsoletes this? e.g. can we copy a statically linked bpftrace to Android now?)
Just linking up some issues: bpftrace/bpftrace#342 (comment) discusses some constraints around statically linking bpftrace -- the problem seems to be that bpftrace compiles programs with LLVM and LLVM is huge.
I no longer maintain it but I'm happy to accept PRs. Could you send me a PR for this?
#48 Can you review this PR?
Before I send a bunch of PRs, I might ask: do you know of an easier way than this project to run bpftrace on Android? (I'm wondering/hoping if the lack of maintenance may be connected to a better way emerging that obsoletes this? e.g. can we copy a statically linked bpftrace to Android now?)
This project can run bpftrace directly on Android: https://github.com/facebookexperimental/ExtendedAndroidTools