[Android] RVR:
Making CM Device Tree Compatible With Your Rom For Compiling

​

Now has we know that how to download sources the next step is to compile the source for your mobile. But Some modification are needed to compile.

There are many devices with just CM.... but the cm device tree has to be modified to compile with other roms .. .

This guide will tell u specific to slimroms and will give u an idea in general ... i will be taking Galaxy Grand Duos as an example

IF YOU ARE BUILDING FOR ANOTHER DEVICE , SIMPLY RENAME i9082 to the name of your device AND SLIM TO WHICHEVER ROM YOU ARE BUILDING .

Ok Now lets start with it.

There are mainly 3 files in CM Tree Which Should Be Modified They are,

1) cm.mk

2) cm.dependencies

3) AndroidProducts.mk

The Image below shows the general device tree .... the 3 files marked in red are the files that have to be edited .

1) Rename cm.mk to slim.mk

The Image Below Shows The Differences Between The CM.MK AND SLIM.MK

As You can see That WE HAVE JUST REPLACED CM WITH SLIM AND ADDED THE BOOTANIMATION PATH ( THE BOOTANIMATION PATH IS NOT ReQUIRED IN ALL ROMS... ONLY SLIMROMS,VANIRAOSP,LIQUIDSMOOTH AND SOKP REQUIRE THIS)

The Boot Animation Values Have To Be Changed As Per YOUR DEVICE RESOLUTION

FOR EXAMPLE IF UR SCREEN IS HD (XHDPI) THEN IT SHOULD BE AS FOLLOWS

# Bootanimation

TARGET_SCREEN_HEIGHT := 1280

TARGET_SCREEN_WIDTH := 720

PRODUCT_COPY_FILES += \

vendor/slim/prebuilt/common/bootanimation/720.zip:system/media/bootanimation.zip

Now you all must be thinking why did we rename cm.mk to slim.mk.:rolleyes::confused:

A Simple Answer is we go to the vendor folder and check the name and replace it. ( SOME ROM's MIGHT GIVE AN ERROR)

...for example in vaniraosp if you rename cm.mk to vanir.mk

IN SUCH A CASE SIMPLY RENAME THE "cm.mk" to "vanir_i9082.mk" and your problem is sorted :D Simple isn't it:cool:

So now you must be wondering about the product name ...as in the above image only the "cm" changes to "slim" with the same logic of the vendor name

In this case we see that slim is the vendor ...so we rename the cm.mk to slim.mk

this same rule applies to the content inside the slim.mk too ... we first make sure that the files are available in that location .

As you can see the image above the files exist in the vendor/slim/config.. so that means we are moving on the right track

NOTHING ELSE NEEDS TO BE TOUCHED IN THIS FILE :D SO NOW 33.33% OF OUR DEVICE TREE IS READY FOR COMPILING WITH THE SLIMROM SOURCE :p:laugh:

2) Now we have to move second file "cm.dependencies"

This file will be simply renamed by Vendor Name ...

In This Case "slim" ....so we rename it to "slim.dependencies"

SO NOW 66.66% COMPLETED :p:D

3) The Last And The Final Change Required Is In The "AndroidProducts.mk"

In This File you Simply Rename The " device_i9082.mk" to whatever you renamed the "cm.mk" to . in this case it is "slim.mk" so "device_i9082.mk" will be renamed to "slim.mk" check the image below to understand better

Hurrrray :D:DNOW OUR DEVICE TREE IS FULLY COMPATIBLE WITH THE SLIMROM SOURCE.

ALL THE BEST!!!!!! :laugh::laugh:

CREDITS

A BIG THANX TO @k2wl and @xenon92 ...THE ONLY REASON I STARTED DEVELOPMENT :p:highfive:

​