Preparing the host system

To successfully compile our custom kernel, we need a properly configured host system. The requirements are similar to those we satisfied to build the whole Android system in the previous chapter:

  • Ubuntu
  • Linux kernel source code
  • Toolchain
  • Fastboot

Ubuntu needs a bit of love to accomplish this task: we need to install the ncurses-dev package:

$ sudo apt-get install ncurses-dev

Once we have all the required tools installed, we can start configuring the environment variables we need. These variables are used during the cross-compilation and can be set via the console. Fire up your trusted Terminal and launch the following commands:

$ export PATH=<toolchain-path>/arm-eabi-4.8/bin:$PATH
$ export ARCH=arm
$ export SUBARCH=arm
$ export ...

Get Learning Embedded Android N Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.