Skip to content

Instantly share code, notes, and snippets.

@kimmoli
Last active April 16, 2018 10:31
Show Gist options
  • Save kimmoli/56edb0c8d975ffa22b0487279db68788 to your computer and use it in GitHub Desktop.
Save kimmoli/56edb0c8d975ffa22b0487279db68788 to your computer and use it in GitHub Desktop.
onyx-sfdroid

sfdroid for onyx

pre-requisities

We are using ubuntu chroot from Sailfish HADK, so build your sailfish for starters. https://gist.github.com/kimmoli/90ddf7540222b27fd4f0ca9ec1214d45

setup build env for CM

Create directories and init repo

mkdir -p ~/android/system
cd ~/android/system/
repo init -u https://github.com/CyanogenMod/android.git -b stable/cm-12.1-YOG7D
cd .repo/local_manifests
curl -O https://gist.githubusercontent.com/kimmoli/56edb0c8d975ffa22b0487279db68788/raw/onyx.xml

onyx.xml is the other file in this gist

Change aosp revision to r35

~/android/system/.repo/manifest.xml

-           revision="refs/tags/android-5.1.1_r26" />
+           revision="refs/tags/android-5.1.1_r35" />

Download sources

This takes some time, about 25GBytes

cd ~/android/system
repo sync

Remove duplicate configpanel, keyhandler and TapToWake

rm -rI ~/android/system/device/oppo/common/configpanel/
rm -rI ~/android/system/device/oppo/common/keyhandler/
rm -rI ~/android/system/device/oppo/common/cmhw/

Comment out config_speed_up_audio_on_mt_calls

~/android/system/device/oneplus/onyx/overlay/packages/services/Telecomm/res/values/config.xml

-    <bool name="config_speed_up_audio_on_mt_calls">true</bool>
+<!--    <bool name="config_speed_up_audio_on_mt_calls">true</bool> -->

Enter ubuntu chroot

sdk
ubu-chroot -r $MER_ROOT/sdks/ubuntu
cd ~/android/system

Install unzip

This might be needed or not (ref bountycastle errors)

sudo apt-get install unzip

Build

hadk
cd ~/android/system
source build/envsetup.sh
export USE_CCACHE=1
breakfast $DEVICE
croot
brunch $DEVICE

Build time was roughly 4 hours with i3

Current status: make completed successfully

Copy zip to device

scp /home/kimmoli/android/system/out/target/product/onyx/cm-12.1-20160723-UNOFFICIAL-onyx.zip nemo@....:/media/sdcard/nnnn-nnnn/

Flash with twrp

Wipe, factory reset

Install zip

reboot system

Other stuff

If you get some BountyCastle error with file keys, run this commend (change paths) from outside ubuntu chroot

java -jar \
/home/$USER/android/system/out/host/linux-x86/framework/dumpkey.jar \
build/target/product/security/testkey.x509.pem \
build/target/product/security/cm.x509.pem \
build/target/product/security/cm-devkey.x509.pem > \
/home/$USER/android/system/out/target/product/scorpion/obj/PACKAGING/ota_keys_intermediates/keys
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_oppo_common" path="device/oppo/common" remote="github" revision="ec34d17cd81afd459071e2f6e663b1d65338257e" />
<project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github" revision="d51a421eb303a7eb4917902cb133a662e71f3916" />
<project name="MasterAwesome/android_vendor_oneplus_onyx" path="vendor/oneplus/onyx" remote="github" revision="cb13df5d523058a8233a3201c2fe2404c6d6ddfb" />
<project name="MasterAwesome/android_device_oneplus_onyx" path="device/oneplus/onyx" remote="github" revision="5d4e83e58f8701cb4715e4f4aac5b8b184ab00a5"/>
<project name="MasterAwesome/android_kernel_oneplus_msm8974" path="kernel/oneplus/msm8974" remote="github" revision="22abce3b57f08c5947d1270875e2dd7a19eae60e" />
</manifest>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment