The “/opt/FriendlyARM/s5p4418/android” is where Android source code package is located.
When you use this compiler please specify the option "CROSS_COMPILE=arm-eabi-".
2 Build U-Boot from sources
2.1 Download and Build U-Boot
Download the U-Boot source code and compile it. Please note the github's branch is s5p4418-nanopi2:
git clone https://github.com/friendlyarm/uboot_nanopi2.git
cd uboot_nanopi2
git checkout s5p4418-nanopi2
make s5p4418_nanopi2_config
makeCROSS_COMPILE=arm-eabi-
After your compilation succeeds a u-boot.bin will be generated. If you want to test it please flash it to your installation MicroSD card via fastboot. Warning: you cannot update this MicroSD card by commanding "dd". This command which will cause trouble when booting the NanoPi2.
2.2 Prepare mkimage
You need the mkimage utility to compile a U-Boot source code package. Please make sure this utility works well on your host before you start compiling a uImage.
You can install this utility by either commanding "sudo apt-get install u-boot-tools" or following the commands below:
cd uboot_nanopi2
make tools
mkdir-p/usr/local/sbin &&cp-v tools/mkimage /usr/local/sbin
3 Build Linux Kernel
3.1 Download and Build Linux kernel
Download Kernel Source Code
git clone https://github.com/friendlyarm/linux-3.4.y.git
cd linux-3.4.y
git checkout s5p4418-nanopi2
The NanoPi2's kernel source code lies in the "s5p4418-nanopi2" branch.
Compile Android Kernel
make nanopi2_android_defconfig
touch .scmversion
makeCROSS_COMPILE=arm-eabi- uImage
Compile Debian Kernel
make nanopi2_linux_defconfig
touch .scmversion
makeCROSS_COMPILE=arm-eabi- uImage
After your compilation succeeds a uImage will be generated in the "arch/arm/boot/" directory.
3.2 Compile Kernel Modules
Android contains kernel modules which are in the "/lib/modules" directory in the system section. If you want to add your own modules to the kernel or you changed your kernel configurations you need to recompile these new modules. Compile Original Kernel Modules:
cd linux-3.4.y
makeCROSS_COMPILE=arm-eabi- modules
Here we have two new modules and we can compile them by following the commands below:
The "/opt/FriendlyARM/s5p4418/android" directory points to the top directory of Android source code. You can get more details by specifying option "-h". After your compilation succeeds new modules will be generated
4 Compile Android
Install Cross Compiler
We recommend installing 64 bit Ubuntu 14.04 on your PC host.