Porting Omni To Your Device

From Omni
Jump to: navigation, search

Introduction

Omni is designed to use a basic AOSP device tree, with a few small modifications. This page will detail the necessary changes.

Firstly, Fork a already working device repo. Then you have to delete their makefiles and stuff like cm.mk & cm.dependencies.

Tip #1 - Never blindly edit anything that says full. If you do so, chances are your device won't boot.

First you need to add a new make file for omni. See the one below

  https://github.com/omnirom/android_device_samsung_n7100/blob/android-4.3/omni_n7100.mk

Then you to add the makefile into androidproducts.mk . See example below.

  https://github.com/omnirom/android_device_samsung_l900/commit/61045513d560fddf1bf8007002b67a8b730f3bb6

Then you have to create a new file named vendorsetup.sh in the device repo (see the above commit) In the file enter

  add_lunch_combo omni_device-userdebug

Then you have to add a json file named omni.dependencies to pull all necessary repos to build. See example below

  https://github.com/omnirom/android_device_htc_m7att/blob/android-4.3/omni.dependencies

Tip #2 - JSON files can be really annoying. Go to http://jsonlint.com/ . Paste in your json file and let it check for errors.

Then you have to TWRP-ify your device tree.

That's it. If you did everything correctly, then you should have a working build.

Common Gotchas

AOSP-ified CAF Frankendisplay Issues

A number of kernels are a hybrid of AOSP and CAF code, especially in CM. We are trying to keep our CAF and AOSP display trees more "pure". As a result, an AOSP commit needs to be removed from many kernels in order to work.

If you see errors in logcat like the following and you are stuck on the bootanimation:

   E/Fence   (  220): sync_fence_info returned NULL for fd 41
   E/Fence   (  220): sync_fence_info returned NULL for fd 43
   E/Fence   (  220): sync_fence_info returned NULL for fd 43
   E/Fence   (  220): sync_fence_info returned NULL for fd 43
   E/Fence   (  220): sync_fence_info returned NULL for fd 43
   E/Fence   (  220): sync_fence_info returned NULL for fd 43
   E/Fence   (  220): sync_fence_info returned NULL for fd 43

You need to revert a commit. Here's an example from the Sony fusion3 family of devices:

   https://github.com/omnirom/android_kernel_sony_apq8064/commit/4c5fbe5354eab42eaf33927d0c245bc9632a3cae

Nexus

General

Reference the Nexus 5X and Nexus 6 repositories for sample setup style. General practice is to keep as many changes as possible within Omni-specific files to reduce differences from AOSP. This allows seamless merging of upstream releases from Google.

Camera HAL

All Nexus devices that utilize hardware/qcom/camera must add this repository to their dependencies file, as it is not included by the default manifest. Reference Nexus 5X dependencies

GPS HAL

All Nexus devices that utilize hardware/qcom/gps must add this repository to their dependencies file, as it is not included by the default manifest. Reference Nexus 5X dependencies Note that many GPS libraries depend on closed-source, proprietary Qualcomm header files not available to the public. In this case, use prebuilt GPS blobs extracted from your device.

CAF Devices

Android 7.0

Basic QCOM Support

To enable basic QCOM hardware support, the following must be added to your device's BoardConfig.mk: BOARD_USES_QCOM_HARDWARE := true

Furthermore, QCOM_BSP support should be included in your device's BoardConfig.mk as follows: TARGET_USES_QCOM_BSP := true

Audio/Display/Media HAL

hardware/qcom/[audio/display/media] are separated on a per-platform basis. You must declare the HAL variant for your platform in your device's BoardConfig.mk via: TARGET_QCOM_[AUDIO/DISPLAY/MEDIA]_VARIANT := caf-msm89**

Enabling QCOM Audio/Video Enhancements

Include the following in your BoardConfig.mk: TARGET_ENABLE_QC_AV_ENHANCEMENTS := true