Basic knowledge of Linux is required to be able to build the kernel. We will also need a modern Linux box (preferably).


Basic Setup

First, we need to setup a directory in which we will clone the kernel and initramfs repositories. In this guide, we will setup them in /tmp but you can do it in any directory you want.


In a terminal we run:


mkdir /tmp/semaphore
cd /tmp/semaphore


Then we clone the basic kernel repository:

git clone


Finally we clone the initramfs repository:

git clone


OK, first step done. We got the code. Now we have to do some preparation and compile it.



I prefer to use a mini ugly script to compile the kernel and pack it. It's located in the root of the kernel tree (/tmp/semaphore/samsung-kernel-aries/


We open this file with an editor of our choice (I prefer vi) and edit:

1) The two lines with the 'make' command, changing the CROSS_COMPILE= option. We need to set the path from the cross compiler toolchain. I use the one that it's included in CM9 repository.

2) The line starting with the 'find' command, changing the kernel source directory and destination directory of the modules location. This is into the initramfs directory. In our example it's /tmp/semaphore/ics-ramdisk/ics_combo/files/modules


The Semaphore's kernel configuration is located in the file config_sema in the root kernel directory. So, we need to copy this file as .config:


cp config_sema .config


Then we run this command to start the Linux kernel configuration utility (again change the CROSS_COMPILE according to your toolchain directory):

make CROSS_COMPILE=/kernels/semaphore_cap/android/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- ARCH=arm menuconfig


We go to 'General Setup' section and we change the 'Initramfs source files' option to /tmp/semaphore/ics-ramdisk/ics_combo/

We also need to change the next 2 options User ID and Group ID to whatever uid and gid we are logged in in the Linux box. In my case is 500,500. We exit and save the configuration.



Now we are ready to build the kernel!


We just run:



We wait few minutes (time depends on the machine) and hopefully the compilation will end.


The script will produce 2 files.

1) /tmp/semaphore/samsung-kernel-aries/arch/arm/boot/zImage 

2) /tmp/semaphore/ics-ramdisk/cwm/


These are the 2 known files that we can flash via Heimdal or CWM respectively.

Footej Camera

Footej Camera

The most simple yet powerful camera app to capture your best moments!

Get it on Google Play 

Drive Syncrypt app

Semaphore Manager

Use Drive Syncrypt to keep in sync your phone files with Google Drive.

Get it on Google Play 

Semaphore Manager app

Semaphore Manager

Semaphore Manager app helps you to easily full control all Semaphore kernel features.

Get it on Google Play