Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

adeb prepare advertises --distro flag but doesn't accept it #43

Open
mhansen opened this issue Sep 24, 2021 · 7 comments · May be fixed by #45
Open

adeb prepare advertises --distro flag but doesn't accept it #43

mhansen opened this issue Sep 24, 2021 · 7 comments · May be fixed by #45

Comments

@mhansen
Copy link

mhansen commented Sep 24, 2021

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.

@mhansen
Copy link
Author

mhansen commented Sep 24, 2021

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

@joelagnel
Copy link
Owner

I no longer maintain it but I'm happy to accept PRs. Could you send me a PR for this?

@mhansen
Copy link
Author

mhansen commented Sep 24, 2021 via email

mhansen added a commit to mhansen/adeb that referenced this issue Sep 27, 2021
This flag is advertised but was previously not accepted.

Fixes joelagnel#43
@mhansen
Copy link
Author

mhansen commented Sep 27, 2021

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?)

@mhansen
Copy link
Author

mhansen commented Sep 27, 2021

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.

@mhansen mhansen linked a pull request Sep 27, 2021 that will close this issue
@tiann
Copy link

tiann commented Jun 10, 2022

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?

@tiann
Copy link

tiann commented Jun 10, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants