[CM12.1] Build CyanogenMod 12.1 with device tree

Search This thread

alterbang

Member
Apr 16, 2011
46
42
Milan
Hello everybody,

I have finally completed version 1 of my device tree for our device.
You can find it at
https://github.com/alterbang/android_device_xiaomi_libra
If you have a working CM local source you can lunch && mka otapackage for the glory :)

A few details:
  • I forked from xiaomi-dev, xiaobai's testing repo
  • Copied include folder from https://github.com/CyanogenMod/android_device_xiaomi_cancro
  • Edited AndroidBoard.mk with an "#alterbang" section with dir creation and patched files copy
  • Edited BoardConfig.mk with TARGET_SPECIFIC_HEADER_PATH := $(LOCAL_PATH)/include
  • Added "#alterbang" section with missing files to proprietary-files.txt, and removed a couple files.
BONUS: i have added a script "extract-files-from-miui-zip" to extract files from a miui.zip file (like the roms over at xiaomi.eu) so you can extract them without having to flash miui to your phone :)

ANY COMMENT OR COLLABORATION IS WELCOME
It's the first time i work actively with CM, so have mercy on me :D
I created this project because i believe in collaboration and openness, so get your hands dirty!

Thank you!
alterbang

Build 20160129 DOWNLOAD LINK
https://mega.nz/#!wBVlUJ4D!E-TDy01wNqBuLQvbznNfOd6bfkpPvaAcSePWZdlDXbY
-works: everything
-bugs: wakeup is sometimes slow. if you know how to fix, please tell me :)
 
Last edited:

muff99

Senior Member
Jan 6, 2011
396
155
Wow, awesome work!!
I'm not a dev, but I build CM 12.1 for klimtlte and CM 13 for mako (before I got my shiny new Mi 4c ...).

Double thumbs-up for your work on the extract-files-from-miui-zip.sh. Have you thought about uploading the files to TheMuppets github? Would make it even easier to build, and aries and cancro are already there.

Also I like that you shared your findings and how you got it to work and what you used to get it to work, much appreciated!! This is the way to do it in my opinion!

I very much like the idea of running my own build on my phone, however I am not sure if I should put too much effort into 12.1 any more with all the nice CM13 roms getting better and better (Team Superluminals cm13 builds work great on my phone) ... I will keep an eye on your github, though, and might ask your for your local manifest in the future :p

Again, you did great work so far!

Oh, one mroe thing: Whats the state of SELinux with your build? Is it permissive? Or did you or xiobai have an enforcing SELinux working?
 
  • Like
Reactions: kevinkvothe

alterbang

Member
Apr 16, 2011
46
42
Milan
Thank you muff99!
As for your question: i saw SELinux permissive removed in the mk files, but i don't know if that's enough. I'll let you know!
For Marshmallow / CM13: the idea is to do the same thing also for that branch :)
 

DFurax

Senior Member
Nov 30, 2015
69
10
Hey !
Somebody could explain me what are the differences of this version between the Xiaobi one ?
Ty
 

dexxa05

Senior Member
May 5, 2007
504
66
Metz
Hi,

I'm new in building ROM, so i'm trying to build rom but it seems local_manifest.xml needed ?! Where i can found it?!

Thx in advance
 

muff99

Senior Member
Jan 6, 2011
396
155
I am trying to put together a cm 13 build, this is how my local manifest looks so far:
Code:
 <manifest>
  <remote name="ghub" fetch="git://github.com/"/>
<!-- <project name="thune-xiaobai/android_device_xiaomi_libra.git" path="device/xiaomi/libra" remote="ghub" revision="cm-13.0"/>-->
 <project name="xiaomi-dev/android_device_xiaomi_libra.git" path="device/xiaomi/libra" remote="ghub" revision="cm-13.0"/>
 <project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="ghub" revision="cm-13.0"/>
 <project name="AndropaX/proprietary_vendor_xiaomi_libra" path="vendor/xiaomi/libra" remote="ghub" reviSion="master"/>
...
</manifest>
It seems like Xiaobai is not using his thune-xiaobai Github any more, but he is contributing to xiaomi-dev, so I chose that device tree as did @alterbang.

@dexxa05:
Thnx! You sure the dev roms are a good source? After this locked-bootloader news I am hesitant to use dev rom files ...

Got until this one:
Code:
 make: *** No rule to make target `/home/freddi/android/system/out/target/product/libra/obj/KERNEL_OBJ/usr', needed by `/home/freddi/android/system/out/target/product/libra/dt.img'.  Stop.

Seems like @alterbang ran into this here:
http://xdaforums.com/mi-4c/developm...12-1-mi-4c-t3226541/post64204905#post64204905

Which dependencies did you add to fix this?

Oh btw, I dont wanna hijack your cm 12.1 thread to talk about cm 13 ... should I open another thread?

UPDATE: Oh I just saw all the stuff that you did to your device tree in /include, have to work through that ... cancro already has cm13, looks like there is even a kernel source.
 
Last edited:

alterbang

Member
Apr 16, 2011
46
42
Milan
that is just a missing dir, search my repo :) and yes please open a new thread! so we can start together on cm13
 

dexxa05

Senior Member
May 5, 2007
504
66
Metz
Hi Guys,

Small issues i'm trying to build 12.1 but the system try to build 13.0

Code:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
CM_VERSION=13.0-20160119-UNOFFICIAL-libra
TARGET_PRODUCT=cm_libra
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-4-amd64-x86_64-with-debian-7.9
HOST_BUILD_TYPE=release
BUILD_ID=MMB29T
OUT_DIR=/home/dexxa05/android/system/out
============================================

Do you know how to change that?!

Thx in advance
 

alterbang

Member
Apr 16, 2011
46
42
Milan
1090904a26079d15e6cf47cc17c6e028.jpg

sup :)
 
  • Like
Reactions: kevinkvothe

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    Hello everybody,

    I have finally completed version 1 of my device tree for our device.
    You can find it at
    https://github.com/alterbang/android_device_xiaomi_libra
    If you have a working CM local source you can lunch && mka otapackage for the glory :)

    A few details:
    • I forked from xiaomi-dev, xiaobai's testing repo
    • Copied include folder from https://github.com/CyanogenMod/android_device_xiaomi_cancro
    • Edited AndroidBoard.mk with an "#alterbang" section with dir creation and patched files copy
    • Edited BoardConfig.mk with TARGET_SPECIFIC_HEADER_PATH := $(LOCAL_PATH)/include
    • Added "#alterbang" section with missing files to proprietary-files.txt, and removed a couple files.
    BONUS: i have added a script "extract-files-from-miui-zip" to extract files from a miui.zip file (like the roms over at xiaomi.eu) so you can extract them without having to flash miui to your phone :)

    ANY COMMENT OR COLLABORATION IS WELCOME
    It's the first time i work actively with CM, so have mercy on me :D
    I created this project because i believe in collaboration and openness, so get your hands dirty!

    Thank you!
    alterbang

    Build 20160129 DOWNLOAD LINK
    https://mega.nz/#!wBVlUJ4D!E-TDy01wNqBuLQvbznNfOd6bfkpPvaAcSePWZdlDXbY
    -works: everything
    -bugs: wakeup is sometimes slow. if you know how to fix, please tell me :)
    2
    Thank you muff99!
    As for your question: i saw SELinux permissive removed in the mk files, but i don't know if that's enough. I'll let you know!
    For Marshmallow / CM13: the idea is to do the same thing also for that branch :)
    2
    Nowhere, i'm still using a prebuilt kernel...
    We're still waiting for Xiaomi to comply to GPL.
    And unfortunately nothing seems to indicate that's happening soon.
    1
    Wow, awesome work!!
    I'm not a dev, but I build CM 12.1 for klimtlte and CM 13 for mako (before I got my shiny new Mi 4c ...).

    Double thumbs-up for your work on the extract-files-from-miui-zip.sh. Have you thought about uploading the files to TheMuppets github? Would make it even easier to build, and aries and cancro are already there.

    Also I like that you shared your findings and how you got it to work and what you used to get it to work, much appreciated!! This is the way to do it in my opinion!

    I very much like the idea of running my own build on my phone, however I am not sure if I should put too much effort into 12.1 any more with all the nice CM13 roms getting better and better (Team Superluminals cm13 builds work great on my phone) ... I will keep an eye on your github, though, and might ask your for your local manifest in the future :p

    Again, you did great work so far!

    Oh, one mroe thing: Whats the state of SELinux with your build? Is it permissive? Or did you or xiobai have an enforcing SELinux working?
    1
    Ok, now updated to 16.1.14