Compilation guide

Initialize your local repository & sync:

To maintain the quality of device sources we recommend using device Tree, device-common, kernel source, vendor from LineageOS/TheMuppets ORG thus this guide will be based on how to compile Arrow OS after adapting LineageOS Device sources to our platform.

mkdir arrow
cd arrow
repo init -u https://github.com/ArrowOS/android_manifest.git -b arrow-11.0
repo sync

Adapting tree to compile ArrowOS

lineage_device-codename.mk -> arrow_device-codename.mk

Now inside arrow_device.mk

  • Change “lineage” to “arrow” & “common_full_phone.mk” to “common.mk”

For example:

  • $(call inherit-product, vendor/arrow/config/common.mk)
  • Change PRODUCT_NAME value “lineage_device-codename”
    • ( “lineage_beryllium” ) to arrow_device-codename ( i.e, arrow_beryllium )

Adjusting dependencies:

Rename “lineage.dependencies” to “arrow.dependencies”. Add all your device dependencies in here (mainly common device repo, kernel repo, vendor repo and more others like toolchain, library, app etc).

Note: The dependencies file is to be only placed in a device repo that follows the following naming structure android_device_<<manufacturer>>_<<codename>> as the roomservice tool will only be looking into it.

Here is a sample of the dependencies file:

[
{
"repository": "android_vendor_zuk_z2_plus",
"target_path": "vendor/zuk"
},
{
"repository": "android_device_zuk_msm8996-common",
"target_path": "device/zuk/msm8996-common"
},
{
"repository": "android_kernel_zuk_msm8996",
"target_path": "kernel/zuk/msm8996"
}
]

It is necessary to clean up any specific files from LineageOS as these features depend on Los SDK which won’t be available on AOSP and results in build failures. eg: LiveDisplay, LineageParts, LineageOverlays, Lineage touch HAL etc.

From the root of your device tree/Common device tree remove the following folders/files:

  • lineagehw
  • livedisplay
  • touch

Simillarly from BoardConfig.mk/BoardConfigCommon.mk:

# Lineage Hardware
BOARD_HARDWARE_CLASS += \
$(VENDOR_PATH)/lineagehw

From manifest.xml remove livedisplay HAL:

    <hal format="hidl">
        <name>vendor.lineage.livedisplay</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>IColor</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl">
        <name>vendor.lineage.touch</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>ITouchscreenGesture</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl">
        <name>vendor.lineage.trust</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>IUsbRestrict</name>
            <instance>default</instance>
        </interface>
    </hal>

From device.mk(also named as your SOC codename like: msm8996.mk) OR common.mk incase of common trees:

DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay-lineage

# LiveDisplay native
PRODUCT_PACKAGES += \
    vendor.lineage.livedisplay*

# Touch
PRODUCT_PACKAGES += \
    vendor.lineage.touch*

# Trust HAL
PRODUCT_PACKAGES += \
    vendor.lineage.trust*

Note: There is the possibility that some custom packages such as doze etc may have a dependency on lineageSDK, it is necessary to fix them to avoid compile errors. Rename overlay-lineage with overlay-arrow and remove any overlay not valid to ArrowOS

And set an overlay in overlay/packages/apps/Settings/res/values/config.xml inside your device/common device tree

    <!-- Device specific doze package -->
    <string name="config_customDozePackage">org.lineageos.settings/org.lineageos.settings.doze.DozeSettingsActivity</string>

NOTE: Package name has to match to whatever your devices uses!

Additional sets for a device with FOD: Lineage devices with FOD uses a feature permission XML to advertise that that device uses FOD feature

If you closely look at the device.mk/common.mk etc, you may find this:

PRODUCT_COPY_FILES += \
    vendor/lineage/config/permissions/vendor.lineage.biometrics.fingerprint.inscreen.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/vendor.lineage.biometrics.fingerprint.inscreen.xml

This will cause a build error, so remove it.

As of arrow-10.0 and above, you can implement FOD in case your device supports it by setting an overlay inside your device tree: /overlay/frameworks/base/core/res/res/values/config.xml

    <!-- Shows the required view for in-display fingerprint -->
    <bool name="config_supportsInDisplayFingerprint">true</bool>
To start the rom compilation:

From the root of your source directory run the following commands

. build/envsetup.sh
lunch arrow_devicecodename-buildtype
m otapackage

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *