This guide assumes your phone has a S5PC110/Exynos 3110 SoC
Before doing anything, you will need to know the codename of the device. You can find it out on CyanogenMod Wiki or on CyanogenMod download page.
For instance, the Nexus S codename is: crespo
.
First thing to consider before starting a port, when all of the above is assumed, is to see how many non-free components are required by CyanogenMod.
The easiest way to do this is to spot the device repository in CyanogenMod repos and look for the extract-files.sh
or proprietary-blobs.txt
file.
For instance, the list of non-free components for the Nexus S is extract-files.sh
From that list, spot what is related to what hardware component (audio, camera, sensors, gps, modem, etc): that gives an idea of the amount of work required to add support for the phone.
During the port, you might need to find precise infos about the hardware that is in the phone. A good to do this is by looking at the kernel defconfig for the device, another way is to download the Service Manual for the device.
android_device_vendor_device
.android_device_vendor_devices-common
.android_kernel_samsung_devices
.Clone these repos in the correct locations and remove the prefix (e.g. android_device_samsung_crespo
must be cloned in device/samsung/
and renamed to crespo
).
Once you have the kernel sources, read the instructions to find out which defconfig to use.
Since manufacturers usually don't release the git history along with the files, you'll need to recreate a git repo:git add -A
) and commit (git commit
) with a message explaining what you just imported (e.g. "GT-I9000 GB Opensource Update 2")Now that you have a git repo, you can move it to the Replicant code tree, under the name: kernel/vendor/devices
(e.g. kernel/samsung/aries
).
Make sure to make the devices
name match the devices
in android_device_vendor_devices-common
if the kernel is shared across these devices or to match the device
in android_device_vendor_device
.
Now that the repos are cloned, you need to modify some makefiles to cope with Replicant paths.
In the device repository (device/vendor/device
), modify the file called cm.mk
and replace the vendor/cm/
occurrences by vendor/replicant/
. Other makefiles may need that as well (in any case, build will fail very early if you missed one). In that same cm.mk
file, change the PRODUCT_NAME variable by repalcing the cm
prefix with replicant
(e.g. change PRODUCT_NAME := cm_crespo to PRODUCT_NAME := replicant_crespo).
Now that your device files are ready, you can declare a new build target: these are held in vendor/replicant/jenkins-build-targets
.
Modify that file and add a line (at the end) with the PRODUCT_NAME you set and the -eng
suffix (e.g. replicant_crespo-eng
).
From now on, everything should be ready to start a build. To check for errors or missed occurrences, start a terminal in the Replicant tree root and lunch:
source build/envsetup.sh lunch replicant_device-eng
Adapt replicant_device-eng from what you added to the jenkins-build-target
(e.g. replicant_crespo-eng
).
If an error occurs, it will explicitly report it and you'll need to fix it before doing anything.
If everything works correctly, you should see something like:
============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=4.0.4 TARGET_PRODUCT=replicant_crespo TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a HOST_ARCH=x86 HOST_OS=linux HOST_BUILD_TYPE=release BUILD_ID=IMM76L ============================================
Now that the devices repos are in place,
For doing that, you need to sport where the kernel source is held. CyanogenMod