[Android Software/Hacking General [Developers Only]] Adi Shakthi:
STEP 2: Adding device support to SOKP:​

Now, Lets add the device specific trees:

Add your own device tree in the local manifest. Here in sokp we use sokp_manifest.xml

For this, create a new file .repo/local_manifests/sokp_manifest.xml, & use something in similar terms:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
* <project name="device_samsun_trltexx" path="device/samsung/trltexx" remote="github" revision="sokp-l5.1" />
</manifest>

CAUTION: Your device tree, kernel source, vendor props etc WILL be different. Search & find out where your device specific sources are located.

After adding this do a

repo sync

so that device related trees are downloaded

After Downloading the device tree you need to add some files in order to compile SOKP. The files which are needed to add and modified are mentioned bellow.

1)sokp.mk*

Create a file called sokp.mk in device tree and add all informations related to your device as mentioned bellow.[I have taken Note-4[trltexx] as example so relpace it by your device. ]

The General templet of sokp.mk is follows*

#
# Copyright (C) 2015 The Sonic Open Kang Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# * * *http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

$(call inherit-product, device/samsung/trltexx/full_trltexx.mk)

# Enhanced NFC
$(call inherit-product, vendor/sokp/config/nfc_enhanced.mk)

# Inherit common SOKP phone.
$(call inherit-product, vendor/sokp/config/common_full_phone.mk)

PRODUCT_DEVICE := trltexx
PRODUCT_NAME := sokp_trltexx

Example*

2)sokp.dependencies*

This file will contain details of all discrepancy trees which required[kernel, vendor, etc] to compile the SOKP. This file will fetch required trees when build process starts so this must be filled with proper remote and branch details.

Create a file called sokp.dependencies *in device tree and add all informations trees which is needed by *your device as mentioned bellow

A Example of sokp.dependencies the contents of this file will change from device to device how ever templet is common.

[
* {
* * "repository": "device_samsung_trlte-common",
* * "target_path": "device/samsung/trlte-common",
"branch": * * *"sokp-l5.1"
* },
* {
* * "repository": "device_qcom_common",
* * "target_path": "device/qcom/common",
"branch": * * *"sokp-l5.1"
* },
* {
* * "repository": "device_samsung_qcom-common",
* * "target_path": "device/samsung/qcom-common",
"branch": * * *"sokp-l5.1"
* },
* {
* * "repository": "kernel_samsung_trlte",
* * "target_path": "kernel/samsung/trlte",
"branch": * * *"sokp-l5.1"
* },
* {
* * "repository": *"proprietary_vendor_samsung",
* * "target_path": "vendor/samsung",
* * "branch": * * *"sokp-l5.1"
* }
]

Here we take trltexx as device and added its kernel ,vendor and hardware dependencies in file which will fetch when you starts build process.*

So you need to mention trees of kernel, device common, vendor , and hardware in above file with proper branch name and remote .

Example

3)vendorsetup.sh

Create a vendorsetup.sh in your device tree and fill it with your device details as mentioned bellow

add_lunch_combo sokp_trltexx-eng

Example

4)BoardConfig.mk

TWRP Flags:

Since we use TWRP as boot able recovery in SOKP you need to add some flags related to TWRP in BoardConfig.mk in your device tree.

Add screen resolution of your device also here in BoardConfig.mk

Setting SELinux Permissive:

SOKP needs a SELinux Permissive state. so we should add this to BOARD_KERNEL_CMDLINE in BoardConfig.mk

androidboot.selinux=permissive

Example

5)Adding your device in Vendor SOKP :

Open the file sokp.devices in directory vendor/sokp/ of your source and your device name in sokp.devices file*

Example