Hacking on Minijail

Dependencies

You'll need these to build the source:

You'll need to install the relevant packages from your distro.

Building

For local experimentation (using Minijail libraries from the source directory):

$ make LIBDIR=/lib64
$ sudo ./minijail0.sh -u ${USER} -g 5000 -- /usr/bin/id

For system-wide usage, install libminijail.so and libminijailpreload.so to /lib64 and minijail0 to a directory in your PATH (e.g. /usr/bin).

Testing

We use Google Test (i.e. gtest & gmock) for unit tests. You can download a suitable copy of Google Test using the get_googletest.sh script.

$ ./get_googletest.sh
googletest-release-1.8.0/
...
$ make tests

Building the tests will automatically execute them.

Code Review

We use Android Review for Minijail code review. The easiest way to submit changes for review is using repo upload on a ChromiumOS or Android checkout. Go to Android Review HTTP Credentials to obtain credentials to push code. For more detailed instructions see the Android source documentation or the ChromiumOS documentation.

Source Style

Documentation

Markdown

Minijail uses markdown for general/source documentation. We follow the Google Markdown style guide.

Man Pages

For users of Minijail (e.g. minijail0), we use man pages. For style guides, check out the [Linux man-pages project] for general guidance. It has a number of useful references for syntax and such.

minijail0.1 documents the command line interface. Please keep it in sync with minijail0_cli.c.

minijail0.5 documents the syntax of config files (e.g. seccomp filters).