Git repository to make it easier to build certain command line utilities provided by android-tools.
Many Linux distributions have a package called android-tools which ships convenient android command line tools like mkbootimg or simg2img. Sadly the upstream build system for those tools is rather complex and doesn't allow building the command line tools only.
Linux Distribution therefore mostly ship their own build systems for building the command line utilities. This repository aims to make building of android command utilities easier by providing a simple CMake based build system and a ready-to-use tarball which doesn't require cloning all of the required git repositories manually. Besides this makes it easy to collect all patches required to build standalone android command line utilities in a central place.
This repository is a fork of android-tools, which only focus on the command line utilites useful for manipulating various android images.
This fork does not depend on googletest (aka gtest) or Go compiler. It also does not build adb
and fastboot
.
Currently the following tools are supported:
adbfastboot- e2fsdroid, mke2fs.android, make_f2fs (required by fastboot)
- simg2img, img2simg, append2simg, ext2simg
- lpdump, lpmake, lpadd, lpflash, lpunpack
- mkbootimg, unpack_bootimg, repack_bootimg, avbtool
- mkdtboimg
The build system is originally took from android-tools,
patches adding support for new tools in a clean way are
welcome. Additionally, patches needed to make the software compile on
other Linux distributions are welcome as well. Please create new patches
using git format-patch --no-numbered --no-signature …
.
The following libraries are required by android-tools:
Python 3 is optionally needed as a run-time dependency in order to use
the mkbootimg
, unpack_bootimg
, and repack_bootimg
scripts which
are all written in Python.
Additionally the following software is required at compile-time:
- A C and C++ compiler (either GCC >= 10.X or clang)
The Go compiler- CMake
- Perl
Currently the build system doesn't check whether all of these are installed.
Source tarballs containing an already patched version of all vendored dependencies are available on the GitHub Release Page.
These tarballs should be used for packaging and general installation. After the tarball was downloaded and extracted android-tools can be build and installed as follows:
$ mkdir build && cd build
$ cmake ..
$ make
$ make install
To build a statically linked binary (optional), pass
-DPREFER_STATIC_LINKING=ON
to CMake.
Note that you will need to install the static versions of the depended
libraries, otherwise you may see a configure / link error to occur.
New source tarballs can be created from the Git repository using:
$ mkdir build && cd build
$ cmake ..
$ make package_source
Before a new release is uploaded a new git-tag(1)
should be created
for the release. Afterwards the tarball can be uploaded to the GitHub
Release Page.
The build script for android platform tools by Anatol Pomozov
which inspired this project. Most definitions in the CMakeLists.txt
have been copied from Anatol's ruby script.