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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: joelagnel/adeb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.99h
Choose a base ref
...
head repository: joelagnel/adeb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 13 commits
  • 14 files changed
  • 6 contributors

Commits on Jul 11, 2019

  1. Remove all code todo with kernel headers or sources

    BCC now can use headers from CONFIG_IKHEADERS so no need for adeb to
    package them.
    
    Signed-off-by: Joel Fernandes <[email protected]>
    Joel Fernandes committed Jul 11, 2019
    Copy the full SHA
    f638684 View commit details
  2. Remove more header related stuff

    Signed-off-by: Joel Fernandes <[email protected]>
    Joel Fernandes committed Jul 11, 2019
    Copy the full SHA
    b808c15 View commit details
  3. New release

    Signed-off-by: Joel Fernandes <[email protected]>
    Joel Fernandes committed Jul 11, 2019
    Copy the full SHA
    0cf0a15 View commit details

Commits on Sep 27, 2019

  1. Add xz-utils required for eBPF.

    Ayrx committed Sep 27, 2019
    Copy the full SHA
    8da34cd View commit details

Commits on Oct 3, 2019

  1. Add bcc for python 3.

    Ayrx committed Oct 3, 2019
    Copy the full SHA
    93adaae View commit details
  2. Merge pull request #31 from Ayrx/master

    Build bcc for Python 3
    joelagnel authored Oct 3, 2019
    Copy the full SHA
    ce42990 View commit details

Commits on Mar 30, 2020

  1. NOTICE not needed anymore

    Signed-off-by: Joel Fernandes (Google) <[email protected]>
    joelagnel committed Mar 30, 2020
    Copy the full SHA
    62e7435 View commit details

Commits on Jul 9, 2020

  1. Adding mount point for /dev/binderfs if needed

    Michael Specter committed Jul 9, 2020
    Copy the full SHA
    7f00570 View commit details

Commits on Jul 16, 2020

  1. Merge pull request #36 from mspecter/master

    Adding mount point for /dev/binderfs if needed
    mspecter authored Jul 16, 2020
    Copy the full SHA
    34ad477 View commit details

Commits on Jun 30, 2021

  1. Update README.md

    Correct some words.
    JellyBeans authored Jun 30, 2021
    Copy the full SHA
    895e7fd View commit details

Commits on Sep 24, 2021

  1. Merge pull request #42 from JellyBeans/patch-1

    Update README.md
    joelagnel authored Sep 24, 2021
    Copy the full SHA
    478ce20 View commit details

Commits on Feb 4, 2023

  1. Update README.md

    joelagnel authored Feb 4, 2023
    Copy the full SHA
    a2a67a8 View commit details
  2. Update README.md

    joelagnel authored Feb 4, 2023
    Copy the full SHA
    3671fa2 View commit details
Showing with 56 additions and 453 deletions.
  1. +19 −30 BCC.md
  2. +0 −202 NOTICE
  3. +15 −26 README.md
  4. +0 −32 addons/bashrc.common
  5. +6 −0 addons/run.common
  6. +1 −85 androdeb
  7. +6 −1 bcc/build-bcc.sh
  8. +0 −39 bcc/build-kheaders-targz.sh
  9. +1 −1 buildimage
  10. +4 −3 packages/bcc
  11. +1 −1 packages/compilers
  12. +3 −0 packages/others
  13. +0 −8 utils/banners
  14. +0 −25 utils/packheaders.sh
49 changes: 19 additions & 30 deletions BCC.md
Original file line number Diff line number Diff line change
@@ -13,63 +13,51 @@ documentation.

Quick Start
-----------
adeb is the primary vehicle for running BCC on Android. It supports
preparing the target Android device with necessary kernel headers, cloning and
building BCC on device, and other setup. Take a look a quick look at [adeb
README](https://github.com/joelagnel/adeb/blob/master/README.md) so that
you're familiar with what it is.
adeb is the primary vehicle for running BCC on Android. It supports preparing
the target Android device, cloning and building BCC on device, and other setup.
Take a look a quick look at [adeb
README](https://github.com/joelagnel/adeb/blob/master/README.md) so that you're
familiar with what it is.

To download a prebuilt filesystem with BCC already built/installed for an ARM64
device, you can just run:
To download a prebuilt filesystem with BCC already built/installed for an ARM
64-bit device, you can just run:
```
adeb prepare --full
```

This downloads the FS and also downloads prebuilt kernel headers after
detecting your device's kernel version. Running BCC this way may cause a warning
at startup since the headers may not be an *exact* match for your kernel's
sublevel (only version and patchlevel are matched), however it works well in
our testing and could be used, as long as you can tolerate the warning.
This downloads a prebuilt filesystem for ARM 64-bit and sets it up on your device.

If you would like to setup your own kernel headers and prevent the warning,
you can point adeb to the kernel sources which will extract headers from there:
```
adeb prepare --full --kernelsrc /path/to/kernel-source/
```
For targets other than ARM64, see the [Other Architectures
If your device is an architecture other than ARM64, see the [Other
Architectures
section](https://github.com/joelagnel/adeb/blob/master/BCC.md#other-architectures-other-than-arm64)

Now to run BCC, just start an adeb shell: `adeb shell`. This uses adb
as the backend to start a shell into your adeb environment. Try running
in the background to start a shell into your adeb environment. Try running
`opensnoop` or any of the other BCC tracers to confirm that the setup worked
correctly.

If building your own kernel, following are the kernel requirements:

You need kernel 4.9 or newer. Anything less needs backports. Your kernel needs
to be built with the following config options at the minimum:
You need kernel 4.9 or newer. Anything less needs backports. Your kernel also
needs to be built with the following config options at the minimum:
```
CONFIG_KPROBES=y
CONFIG_KPROBE_EVENT=y
CONFIG_BPF_SYSCALL=y
CONFIG_IKHEADERS=m
```
Optionally,
```
CONFIG_UPROBES=y
CONFIG_UPROBE_EVENT=y
```
Additionally, for the criticalsection BCC tracer to work, you need:
```
CONFIG_DEBUG_PREEMPT=y
CONFIG_PREEMPTIRQ_EVENTS=y
```

Build BCC during adeb install (Optional)
--------------------------------------------
If you would like the latest upstream BCC built and installed on your Android
device, you can run:
```
adeb prepare --build --bcc --kernelsrc /path/to/kernel-source/
adeb prepare --build --bcc
```
NOTE: This is a slow process and can take a long time. Since it not only builds
BCC but also installs all non-BCC debian packages onto the filesystem and configures them.
@@ -80,12 +68,13 @@ By default adeb assumes the target Android device is based on ARM64
processor architecture. For other architectures, use the --arch option. For
example for x86_64 architecture, run:
```
adeb prepare --arch amd64 --build --bcc --kernelsrc /path/to/kernel-source/
adeb prepare --arch amd64 --build --bcc
```
Note: The --download option ignores the --arch flag. This is because we only
provide pre-built filesystems for ARM64 at the moment.
Note: If you pass --arch, you have to pass --build, because prebuilt
filesystems are not available for non-arm64 devices.
Note: For arch other than 64-bit ARM, you have to pass --build, because
prebuilt filesystems are not available for other non-ARM64 architectures at the
moment.

Common Issues
-------------
202 changes: 0 additions & 202 deletions NOTICE

This file was deleted.

41 changes: 15 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
> Note: The project
is not maintained for new Android and Debian
releases, but likely works with little effort.
I suggest reaching out to me if you are
interested in maintaining it and I will decide.

adeb
--------

@@ -47,7 +53,7 @@ Other distributions may work but they are not tested.

Quick Start Instructions
------------------------
* First clone this repository into adb and cd into it.
* First clone this repository into adeb and cd into it.
```
cd adeb
@@ -108,19 +114,6 @@ to add it to your known_hosts.

More advanced usage instructions
--------------------------------
### Install kernel headers in addition to preparing adeb device:
```
adeb prepare --kernelsrc /path/to/kernel-source
```

### Update kernel headers onto an already prepared device:

If you need to put kernel sources for an existing install, run:
```
adeb prepare --kernelsrc /path/to/kernel-source --skip-install
```
Note: The kernel sources should have been built (atleast build should have started).

### Build and prepare device with a custom rootfs locally:

The adeb fs will be prepared locally by downloading packages as needed:
@@ -134,21 +127,15 @@ If you wish to do a full build (that is locally prepare a rootfs with all packag
adeb prepare --full --build
```

### Add kernel headers to device in addition to building locally:
```
adeb prepare --build --kernelsrc /path/to/kernel-source/
```

### Build/install a base image with BCC:
```
adeb prepare --build --bcc --kernelsrc /path/to/kernel-source/
adeb prepare --bcc --build
```
Note: BCC is built from source. Also `--kernelsrc` is recommended for tools to
function unless device has them already.
Note: BCC is built from source.

### Extract the FS from the device, after its prepared:
```
adeb prepare --buildtar /path/
adeb prepare --full --buildtar /path/
```
After device is prepared, it will extract the root fs from it
and store it as a tar archive at `/path/adeb-fs.tgz`. This
@@ -171,10 +158,12 @@ By default adeb assumes the target Android device is based on ARM64
processor architecture. For other architectures, use the --arch and --build option.
For example for x86_64 architecture, run:
```
adeb prepare --build --arch amd64 --bcc --kernelsrc /path/to/kernel-source/
adeb prepare --build --arch amd64
```
Note: The --download option ignores the --arch flag. This is because we only
provide pre-built filesystems for ARM64 at the moment.
Note: For arch other than ARM 64-bit, you have to pass the --build option to
adeb. Without this, adeb tries to download an ARM image and will not work.
TODO: We should auto detect this issue and provide an informative error. This
is because we only provide pre-built filesystems for ARM 64-bit at the moment.

Common Trouble shooting
-----------------
Loading