Please help me with fetching github projects - Android Q&A, Help & Troubleshooting

Dear xda members,
I am trying to build my own cyanogenmod 11, so android kitkat 4.4.4 for my smartphone -> LG G2 (Verizon)
I am able to build from source thanks to many guides here in forum. But I need to merge some changes from JackpotClavin on github.
Reading many guides about how to work with github, most, if not every guide presume the author was creating projects that I will be able to fetch. But there are no projects from JackpotClavin. So I don't get it to work like I wish
How do I merge changes from github to my source the easy way?
Prerequisites:
Ubuntu x64
Source downloaded from cm11
I am able to build from source

Okay I managed to clone the repo I need locally in dir named TESTcm.
So how do I tell 'brunch' command, that he should use for example
'TESTcm/android_device_lge_vs980' instead of 'device/lge/vs980'
and
'TESTcm/proprietary_vendor_lge' instead of 'vendor/lge/vs980/proprietary' ?
If I use roomservice.xml in local_manifests (and change the corresponding paths), I am not able to repo sync anymore
Edit: And if I create other xml files with new remotes, the changes won't get merged

koboltzz said:
Okay I managed to clone the repo I need locally in dir named TESTcm.
So how do I tell 'brunch' command, that he should use for example
'TESTcm/android_device_lge_vs980' instead of 'device/lge/vs980'
and
'TESTcm/proprietary_vendor_lge' instead of 'vendor/lge/vs980/proprietary' ?
If I use roomservice.xml in local_manifests (and change the corresponding paths), I am not able to repo sync anymore
Edit: And if I create other xml files with new remotes, the changes won't get merged
Click to expand...
Click to collapse
I have very minimal experience in this, but from what I do know, you have to point the link in room_service.xml that fetches the directory to what you want to clone, not change the local directory. This avoids having to clone the repo as well. Here is an example:
you would change:
<project name="CyanogenMod/android_kernel_samsung_msm8660-common" path="kernel/samsung/msm8660-common" remote="github" revision="cm-11.0" />
to:
<project name="Cl3Kener/HERC-KERNELS" path="kernel/samsung/msm8660-common" remote="github" revision="uber-kk44" />
then you just repo sync and everything will automatically sync and update.
There is an EXCELLENT explanation and tutorial for this in this thread:
http://forum.xda-developers.com/showthread.php?t=2355078
This is where I learn myself and I got the example.

Related

Questions about Android source code for N1

Hi,
Followed cyanogen's instruction in his wiki, I could build and flash my own ROM to N1, and it is working. Thanks cyanogen so much for everything he has done with Android.
However, the instruction is based on cyanogen's source code. Now, I am trying to figure out how to build a new ROM from pure Android source code (i.e. the one from AOSD).
I obtained the eclair branch as follows:
Code:
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair
repo sync
My questions are:
1. There is not any directory under ./vendor for N1 (i.e. passion). I can see only directories for Dream & Sapphire. Does it mean I can build only ROM for Dream/Sapphire? The following result seems support that point. Did I misunderstand some points?
Code:
$ sed -n -e "s/^add_lunch_combo//gp" vendor/*/vendorsetup.sh
aosp_emulator_us-eng
aosp_emulator_eu-eng
aosp_dream_us-userdebug
aosp_dream_eu-userdebug
aosp_dream_us-eng
aosp_dream_eu-eng
aosp_sapphire_us-userdebug
aosp_sapphire_eu-userdebug
aosp_sapphire_us-eng
aosp_sapphire_eu-eng
2. There is not extract-files.sh there. So I suppose I need to use the file from cyanogen. But what else should I do to be able build a new ROM?
Any help is really appreciated!
I'm just as clueless as you are to this--but when I compiled for the HTC Touch, all I did was pull down the stock AOSP build (repo sync) and simply ran "make" from the root directory, which produced a blank System image.
From there, I either copy & pasted the compiled library .so files into the image (to provide driver support), or if necessary to have the source compiled for the version, I included the source into the repo sync directory and ran the "make" which would also produce a compiled library.so that functioned.
Not sure any of this will help, but I figured I'd offer what I could.
Shidell said:
I'm just as clueless as you are to this--but when I compiled for the HTC Touch, all I did was pull down the stock AOSP build (repo sync) and simply ran "make" from the root directory, which produced a blank System image.
From there, I either copy & pasted the compiled library .so files into the image (to provide driver support), or if necessary to have the source compiled for the version, I included the source into the repo sync directory and ran the "make" which would also produce a compiled library.so that functioned.
Not sure any of this will help, but I figured I'd offer what I could.
Click to expand...
Click to collapse
Thanks Shidell. So you meant that it worked for your HTC Touch?
How do you copy & paste library files into image?
How do you include the source into the repo sync directory?

[Firmware][SGH-I777][JB][4.1.1] CyanogenMod 10 | DEV THREAD

DEVELOPMENT ONLY. USER DISCUSSION IS IN THE USER THREAD IN SGH-I777 GENERAL
Have you noticed how angry Cid looks after the white burst? Don't make us tell him YOU are the cause of all the problems in his life!​CyanogenMod is a free, community built, aftermarket firmware distribution of Android 4.1 (JB), which is designed to increase performance and reliability over stock Android for your device.
Code:
#include
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*
* Submitting bug reports on nightly builds is the leading
* cause of male impotence.
*/
CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.
All the source code for CyanogenMod is available in the CyanogenMod Github repo. And if you would like to contribute to CyanogenMod, please visit out Gerrit Code Review. You can also view the Changelog for a full list of changes & features.
Device: https://github.com/teamhacksung/android_device_samsung_i777
Common: https://github.com/teamhacksung/android_device_samsung_galaxys2-common
Kernel: https://github.com/teamhacksung/android_kernel_samsung_smdk4210
CyanogenMod: http://github.com/CyanogenMod
http://teamhacksung.org/wiki/index.php/CyanogenMod10:How_to_build
If you're going to reuse our work, which we're doing for free, be fair and give proper credits.
This is the only payment we're really demanding and we deserve it to be mentioned because of the countless hours we've put into this project.
Open-Source doesn't meant Out-of-Respect!!!
USER DISCUSSION THREAD: http://forum.xda-developers.com/showthread.php?t=1796733 - Unless it is discussing patches or how to build from source, it almost surely belongs there.
To be clear, posts without detailed instructions on how to reproduce a problem and without attached logs will be ignored.
Always provide android (adb logcat) and kernel logs (adb shell dmesg).
If it's a RIL problem we would need a radio log (adb logcat -b radio), too.
Now, how were any of the above posts development-related?
Looks like we're gonna have to send Cid on a little hunting trip.
Entropy512 said:
Now, how were any of the above posts development-related?
Looks like we're gonna have to send Cid on a little hunting trip.
Click to expand...
Click to collapse
They were not.
Reminder to people - this is a development thread. Useless comments like "Sweet!" and "Thanks" are not dev related. From here on out, Red and I will delete ANY non dev related posts, without warning or notice. Entropy has mentioned the general discussion thread - USE IT.
I'd like to give building from source a shot in order to learn something. I'm looking at the instructions posted here:
http://teamhacksung.org/wiki/index.php/CyanogenMod10:How_to_build
But that specifies the build target as the i9100. Should I be doing that, and then pulling your kernel git, building that, and replacing the i9100 kernel with the i777 binary?
Is this an appropriate question for this thread?
sjwaste said:
I'd like to give building from source a shot in order to learn something. I'm looking at the instructions posted here:
http://teamhacksung.org/wiki/index.php/CyanogenMod10:How_to_build
But that specifies the build target as the i9100. Should I be doing that, and then pulling your kernel git, building that, and replacing the i9100 kernel with the i777 binary?
Is this an appropriate question for this thread?
Click to expand...
Click to collapse
Use
Code:
./build.sh i777
and you should be fine. :good:
A general and very hastily made guide if you want to compile CM10 for i777 yourself:
The easy but experimental way will be all good for JB, follow it up to the point where it asks you
Do you want us to get android sources for you? (y/n)
Click to expand...
Click to collapse
Say n. Why? Because it has not been updated to use the jellybean branch. It will only display GB and ICS. We do not want that.
Then do this manually:
Code:
mkdir ~/bin
export PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
After that, go to your working dir (~/android/system as default), initialize the repo and sync.
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync
After it's done (it will take a long while), you need to copy the propietary binaries from your device (make sure it has a CM9-10 build installed!).
With the android-sdk and platform-tools installed (we need adb for this to work, refer to Teamhacksung's and CM's wiki), run:
Code:
cd ~/android/system/device/samsung/i777/
./proprietary-files.sh
Go back to your working dir (~/android/system/) and then you can start the build with ./build.sh i777
After xy minutes you'll have your own kang of CM10. :highfive:
Hope it helps getting your build going.
Remember: if you kang don't forget the guys who made it possible in the first place. Give CM team some credit.
Edit: Added on 27 Jul, IFyou have issues building, such as the ones reported below regarding missing repos or such.
Create a file inside .repo of your working dir (~/android/system/.repo/) called local_manifest.xml
Paste the following inside:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="jellybean">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
<project name="teamhacksung/android_device_samsung_i777" path="device/samsung/i777" remote="github" revision="jellybean" />
<project name="teamhacksung/android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="github" revision="jellybean" />
<project name="teamhacksung/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="jellybean" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_hardware_samsung" path="hardware/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="ics" />
</manifest>
This only applies while the SGS2 family device trees have not been added to the CM mainline repo. Once it's there, DO NOT use these. They will be outdated by then.
Im on Mac OS X so Ive basically gone through the Cyanogen wikis instructions for setting up the workspace and compiling, and Im just substituting your commands where I need to.
So far all is well but Im still syncing the repo and it says its going to take awhile..
Now on the Team Hacksung wiki instructions, where I initially started, I got as far as downloading and chmoding the build.sh file, but couldnt run the 'prepare' step because it looks like its only for Ubuntu or Arch Linux. Since you didnt make any mention of it, am I safe to assume I can skip this step?
Im guessing the prepare flag just runs the steps that setup and install the repo which I did manually??
Let me tell ya this sure aint as easy as compiling MAME!!
Slavestate said:
Im on Mac OS X so Ive basically gone through the Cyanogen wikis instructions for setting up the workspace and compiling, and Im just substituting your commands where I need to.
So far all is well but Im still syncing the repo and it says its going to take awhile..
Now on the Team Hacksung wiki instructions, where I initially started, I got as far as downloading and chmoding the build.sh file, but couldnt run the 'prepare' step because it looks like its only for Ubuntu or Arch Linux. Since you didnt make any mention of it, am I safe to assume I can skip this step?
Im guessing the prepare flag just runs the steps that setup and install the repo which I did manually??
Let me tell ya this sure aint as easy as compiling MAME!!
Click to expand...
Click to collapse
You are correct. The prepare just does all the environment setup for Ubuntu/Mint and Arch (running Mint myself, I'm a casual).
Best of luck mate! :highfive:
Slavestate said:
Im on Mac OS X so Ive basically gone through the Cyanogen wikis instructions for setting up the workspace and compiling, and Im just substituting your commands where I need to.
So far all is well but Im still syncing the repo and it says its going to take awhile..
Now on the Team Hacksung wiki instructions, where I initially started, I got as far as downloading and chmoding the build.sh file, but couldnt run the 'prepare' step because it looks like its only for Ubuntu or Arch Linux. Since you didnt make any mention of it, am I safe to assume I can skip this step?
Im guessing the prepare flag just runs the steps that setup and install the repo which I did manually??
Let me tell ya this sure aint as easy as compiling MAME!!
Click to expand...
Click to collapse
I've had issues compiling AOSP on OSX. Are you on 10.6 or 10.7? If on Lion, make sure and comment out those QEMU targets like the Wiki says. On 10.6, I've had other issues, having more to do with getting a working version of GCC. For some reason I had GCC 4.2 on this machine under 10.6.8 and the latest XCode, so I had to use Ports to install something newer AND THEN MAKE SURE it either had priority in the PATH or the symlink pointing at 4.2 was repurposed to the correct one.
FWIW, this was for CM9 and the Nook Color - not sure how CM10 and the i777 will behave, but to be honest, I've just decided not to hassle with OSX again and I set up a Ubuntu VM.
I'm logged into my Ubuntu machine through citrix from work. Is there a way to get the prop files from windows?
drakester09 said:
... snip!
Click to expand...
Click to collapse
Thanks for the help. I'll be giving that a shot. No kanging intended, you guys will build a better ROM than I will, so I don't really even intend to modify anything aesthetically. I have a bluetooth issue very specific to the head unit in my car, so I'm hoping to fix that and submit a patch. That and curiosity are about as much as is motivating me right now.
Step 1 is to reproduce it in JB, and beyond that, figure out how to fix it. Off hand, is the bluetooth stack in JB significantly different than ICS, or just a newer version of BlueZ?
---------- Post added at 09:17 AM ---------- Previous post was at 09:12 AM ----------
kool2zero said:
I'm logged into my Ubuntu machine through citrix from work. Is there a way to get the prop files from windows?
Click to expand...
Click to collapse
Not easily, but here is the shell script that extracts them:
https://github.com/teamhacksung/android_device_samsung_i777/blob/jellybean/proprietary-files.sh
You can have a look through and do some of the steps manually, but it looks like a pain. Maybe with cygwin? I don't think I'd try it.
Entropy, I'm from Colombia, I have successfully translated several ROMS to Spanish, I have free time on holiday from college, I want to help translate the Spanish ROM. thanks
mac isnt going to be very fun to work with. if you had the option id suggest dual booting. but to each his own.
the environment in linux is very easy to set up, certainly easier then with ICS, there were a few flags that needed to be set and werent well advertised bc they were bugs. generally if you look for john BQ at google for bug reports he makes it very clear what is broken in the aosp tree. granted this is CM and the CM team often implements fixes and maintains their own code and ensure it is compileable.
Well I let the repo download and sync all night last night, ran the envsetup.sh just a few minutes ago, then moved onto the 'lunch cm_i777-userdebug' command. It attempted to retrieve the device repo from the Github and after downloading some stuff, I get this:
error: revision jellybean in CyanogenMod/android_device_samsung_i777 not found
Repository synced!
Looking for dependencies
Dependencies file not found, bailing out.
Done
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/i777/cm.mk]]: "device/*/i777/cm.mk" does not exist. Stop.
** Don't have a product spec for: 'cm_i777'
** Do you have the right repo manifest?
I know I ran all the right commands cause I just copy/pasted direct from both drakesters post as well as Team Hacksungs wiki but Im stuck here.
Any ideas?? Should I redo the whole repo init/sync again?? Wipe it all out and start over??
Im on 10.6.8 by the way if that matters.. Lion aint going anywhere near my Mac Pro..
Ensure that you have the proprietary files downloaded. That is key. They also need to be from cm9 or cm10. Also on a lunch command it shouldn't be dl anything. Try using the build.sh instead. Lunch combines both brunch and make into one command. Aka it sets environment variables then builds. And it seems to be having problems with that. You can try brunch then make. Or go back a page and use the build command
Sent from my SGH-I777 using xda app-developers app
I'll post my local manifest.xml when I get home. You need to add teamhacksung's sgs2 jb repos. They haven't been added to the CM main repo.
Sent from my SGH-I777 using Tapatalk 2
I was just about to say that now that I reread the problem. Sorry. You can ignore my other post...
Sent from my SGH-I777 using xda app-developers app
Yeah I was wondering if I had to add something to pull them from elsewhere hehehe.
Cool thanks Drakester! Im off to work til 9pm so no hurry post the xml whenever you get a chance!
Heres whats in mine currently (taken from the pastebin link posted on Team Hacksungs wiki):
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="jellybean">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
</manifest>
drakester09 said:
I'll post my local manifest.xml when I get home. You need to add teamhacksung's sgs2 jb repos. They haven't been added to the CM main repo.
Sent from my SGH-I777 using Tapatalk 2
Click to expand...
Click to collapse
Thanks for the info! I was pulling my hair last night and thought I missed something - that was my next step that I was thinking of trying when I get to it next time.
Here you go.
I grabbed the template from Pier in the i9100 forums and changed a bit. Thanks to him.:good:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="jellybean">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
<project name="teamhacksung/android_device_samsung_i777" path="device/samsung/i777" remote="github" revision="jellybean" />
<project name="teamhacksung/android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="github" revision="jellybean" />
<project name="teamhacksung/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="jellybean" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_hardware_samsung" path="hardware/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="ics" />
</manifest>
These repos are good only while they have not been added to CM mainline. When they get integrated to the main CM repo, change to those ones.
Wow holy crap that's a lot more then they give you the Hacksung wiki. Go figure I spend all night setting it up and now Entropys back in business haha.
Sent from my SGH-I777 using Tapatalk 2

[GIT][REPO][WIP][MEGA GUIDE] How to create your first CM based ROM

How to create your first CM based ROM ​
Introduction​
In this mega thread guys i will show you basically how to create your own custom CM based ROM, i will take CM in consideration because it is the most used here, but the native sources could be from Omni, or to be based on AOSP. But be aware that not all the things said here will be able to be applied to the ROM because some CM things may not be present in other ROM sources. So before jumping to the guides make sure to check out the first part of the thread from the Index.
Usually there are 4 kind of ROM developers:
Those who Create ROMs
Those who port a created ROM for an other device (device which is not supported officially) by adapting kernel sources, propietary files and vendors....
Those who maintain a ROM for a specific device which is not officially supported but the device sources in use are already prepared by an other developer in order to succeed the compilation process
Those who maintain a ROM for a device that is officially supported by the team or organization but the user also has the goal to help the users and know what he is publishing on the forum
We all know that the Bosses of all are Cyanogenmod, OmniROM and so on and after them there are the secondary ROMs which can be: PAC-MAN,Slim,AICP etc... Which they are all based on an already ROM sources (Could be CM or AOSP for example).
So why they can and you not?
That's because your are thinking from a different perspective.
Let me show you:
For sure you are thinking that "Oh my god there is too much coding for me i can't do all these stuff alone"
Exactly you can't do all these stuff alone, for sure you will need at least one more person to work on it but belive me i was also thinking in the same way but looking here and there i learned how to do many things that for example 2 years ago was something unknown for me coming from a different planet.Trust here i will explain you all you need to know about how to create a custom based ROM or at least show you the basics and then learn for your own.(Not necessary an organization for many devices but a small one just to get familiar and to help you starting from there)
So in this guide i will not show you how to compile a new ROM because i assume that you already know that, instead i will show all the common things that can be changed and even also added in the custom ROM sources by eliminating also the CM or the native ROM name from you're taking the sources as much as possible by including your ROM name instead and also showing you strategies which may help you.
Note.
When you fork the repos make sure to always work on the cm-12.1 branch because some changes which we will gonna make in the guide may not exists in cm-12.
For the fact that the guide will be very big, if you will need help, just write it on the thread but in this way:
Make sure that the post title start in this way:
Section of the thread: Settings, Repo part ....
Part of the section (If we talking about the CM Removable part in Settings for example)
Requirements​
Knowledge and experience in compiling ROMs
Github knowledge (Usually you should know this if you compiled a ROM for a device)
Basic knowledge about XML, Java, C (At least know how to work on it not NOOBS on this OK?)
Good computer running Ubuntu (14.04/14.10/15.04/15.10) or a custom Distro based on the specified ones
High quantity of storage for all the file which you will gonna use.
SmartGit which it will help you very much
Index​
Disclaimer and ROM specifications
Environment
Environment Setup
Linux Distribution Part
SmartGit Part
Repo Part
Android Build part
Extra features to be added to the Android Build files
Android Venodr files
Extra features to be added to the Android Vendor files
Settings && Packages part
Extra Features
*******************************************WIP**********************************************
For the fact that the Guide will be very long and it will take some time to complete it all,so please be patient
In the main time will leave here the staus for every part of the guide:
1- Introduction (First post) (Completed! )
2- Linux Distribution Part (Completed!)
3- Environment Setup Part (Completed!)
2- SmartGit Part (Completed! )
3- Repo part (Needs revisions )
4- android_build (Needs revisions )
5- Packages (Working on it!)
6- vendor (Needs revisions )
7- Extra features (Working on it )
8- ROM Description Part (Completed! )
Repo Part​
Ok so let's begin with the Repo part.
In order to have multiple Projects (I mean repo) you need to create an Organization in Github:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now just follow the Github instructions and you should now have this screen:
Now before doing something you need to think and choose what repo to fork and what repo to create manually.
Remember that i will not help you with the Repo created manually those are created by you and only you know what to include there.
By default the repo which need to be forked first are these:
platform_mainfest
android_vendor_files
These usually should be always present in your Github organization, so i recommend you at the begining to fork these repo from Cyanogenmod if you want that your ROM should be based on CM.
So go and fork the these repositories and then go back to your ROM Project.
For the platform_manifest you can fork it here: https://github.com/SlimRoms/platform_manifest/tree/lp5.1
(We will modify it later)
Remember that when you fork the repositories to fork them in your Organization and not in your Github profile.
You should have this screen:
Now you need to think about what Apps or things you are gonna change i mean, there are plenty of things that you can modify before the compilation process like Java files, create new Preference headers in Settings, modify the framework and so go on....
Once you choosed what repo to include in your Organization then you can start to modify your platform manifest.
But what is platform manifest actually?
Platform manifest is that repo that include a file called default.xml which includes all the Projects that should be fetched by the organization. And represent the most important part of a ROM Project followed after by the android_vendor_files.
Once you cloned platform manifest
Go and open the default.xml file.
So let's the modifications begin!
As you can see the default.xml is composed entirely by these sort of strings:
Code:
<project path="android" name="XOSP/platform_manifest" remote="github" revision="lollipop" />
(For example)
So let me explain you what is this:
project path=means the path used from where the files will be stored in your ROM folder
name: reffer to the path used in Github like https://github.com/CyanogenMod/.....
remote=The Origin of the files (Sort of) it can also be bitbucket or Sourceforge but mainly Github is used always
revision= The branch that you want to checkout
So now you know how the default .xml works go and add your repo that should be fetched!
Tip!
Because the default.xml includes all the projects to be fetched, some of them are not required in most of the cases so some strings can be deleted:
Code:
<project path="device/generic/mini-emulator-arm64" name="device/generic/mini-emulator-arm64" groups="pdk" remote="aosp" />
<project path="device/generic/mini-emulator-armv7-a-neon" name="device/generic/mini-emulator-armv7-a-neon" groups="pdk" remote="aosp" />
<project path="device/generic/mini-emulator-mips" name="device/generic/mini-emulator-mips" groups="pdk" remote="aosp" />
<project path="device/generic/mini-emulator-x86" name="device/generic/mini-emulator-x86" groups="pdk" remote="aosp" />
<project path="device/generic/mini-emulator-x86_64" name="device/generic/mini-emulator-x86_64" groups="pdk" remote="aosp" />
<project path="hardware/intel/audio_media" name="platform/hardware/intel/audio_media" groups="intel" remote="aosp" />
<project path="hardware/intel/bootstub" name="platform/hardware/intel/bootstub" groups="intel" remote="aosp" />
<project path="hardware/intel/common/bd_prov" name="platform/hardware/intel/common/bd_prov" groups="intel" remote="aosp" />
<project path="hardware/intel/common/libmix" name="platform/hardware/intel/common/libmix" groups="intel" remote="aosp" />
<project path="hardware/intel/common/libstagefrighthw" name="platform/hardware/intel/common/libstagefrighthw" groups="intel" remote="aosp" />
<project path="hardware/intel/common/libva" name="platform/hardware/intel/common/libva" groups="intel" remote="aosp" />
<project path="hardware/intel/common/libwsbm" name="platform/hardware/intel/common/libwsbm" groups="intel" remote="aosp" />
<project path="hardware/intel/common/omx-components" name="platform/hardware/intel/common/omx-components" groups="intel" remote="aosp" />
<project path="hardware/intel/common/utils" name="platform/hardware/intel/common/utils" groups="intel" remote="aosp" />
<project path="hardware/intel/common/wrs_omxil_core" name="platform/hardware/intel/common/wrs_omxil_core" groups="intel" remote="aosp" />
<project path="hardware/intel/img/hwcomposer" name="platform/hardware/intel/img/hwcomposer" groups="intel" remote="aosp" />
<project path="hardware/intel/img/libdrm" name="platform/hardware/intel/img/libdrm" groups="intel" remote="aosp" />
<project path="hardware/intel/img/psb_headers" name="platform/hardware/intel/img/psb_headers" groups="intel" remote="aosp" />
<project path="hardware/intel/img/psb_video" name="platform/hardware/intel/img/psb_video" groups="intel" remote="aosp" />
<project path="hardware/nvidia/audio" name="CyanogenMod/android_hardware_nvidia_audio" groups="nvidia_audio" />
<project path="hardware/nvidia/tegra124" name="CyanogenMod/android_hardware_nvidia_tegra124" groups="tegra124" />
Usually are these, so now when you will make repo sync to your ROM path those projects won't be fetched by the manifest.
Don't forget to commit the changes made to default.xml with SmartGit (Check this post about how to configure it
More tips about platform_manifest:
If you want to simpify the work for the other users who will want to build your ROM (If they are new comers) you can use this script written originally by the Resurrection Team and then adapted by me:
Code:
#!/bin/bash
#Based on the original one from Resurrection Remix
clear
echo ____ ___________ ___________________ __________ __ __
echo \ \/ /\_____ \ / _____/\______ \ \______ \_______ ____ |__| ____ _____/ |_
echo \ / / | \ \_____ \ | ___/ | ___/\_ __ \/ _ \ | |/ __ \_/ ___\ __\
echo / \ / | \/ \ | | | | | | \( <_> ) | \ ___/\ \___| |
echo /___/\ \\_______ /_______ / |____| |____| |__| \____/\__| |\___ >\___ >__|
echo \_/ \/ \/ \______| \/ \/
echo Installing Dependencies in 5 Seconds...
sleep 1
echo Installing Dependencies in 4 Seconds...
sleep 1
echo Installing Dependencies in 3 Seconds...
sleep 1
echo Installing Dependencies in 2 Seconds...
sleep 1
echo Installing Dependencies in 1 Seconds...
sleep 1
echo Insert your User Password
sudo apt-get update
sudo apt-get install openjdk-7-jdk
y
sudo apt-get update && sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jre openjdk-6-jdk pngcrush schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib
y
clear
echo Dependencies have been installed!
sleep 4
clear
echo Installing REPO in 5 Seconds...
sleep 1
echo Installing REPO in 4 Seconds...
sleep 1
echo Installing REPO in 3 Seconds...
sleep 1
echo Installing REPO in 2 Seconds...
sleep 1
echo Installing REPO in 1 Seconds...
sleep 1
mkdir ~/bin
PATH=~/bin:$PATH
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
clear
echo REPO has been Downloaded!
sleep 4
clear
cd ..
mkdir XOSP
echo Creating and Initializing XOSP Source at $XOSPpath in 5...
sleep 1
echo Creating and Initializing XOSP Source at $XOSPpath in 4...
sleep 1
echo Creating and Initializing XOSP Source at $XOSPpath in 3...
sleep 1
echo Creating and Initializing XOSP Source at $XOSPpath in 2...
sleep 1
echo Creating and Initializing XOSP Source at $XOSPpath in 1...
sleep 1
cd XOSP
repo init -u https://github.com/XOSP-Project/platform_manifest.git -b lollipop
clear
echo XOSP Source Code has been initialized!
sleep 4
clear
echo Enter 1 to repo sync now, anything else to do it later
read ch
if [ $ch -eq 1 ] ; then
echo Enter number of jobs to repo sync with. If you\'re not sure, enter 4
read jobs
echo Syncing/Downloading in 5 seconds...
sleep 1
echo Syncing/Downloading in 4 seconds...
sleep 1
echo Syncing/Downloading in 3 Seconds...
sleep 1
echo Syncing/Downloading in 2 Seconds...
sleep 1
echo Syncing/Downloading in 1 Seconds...
repo sync -j$jobs
clear
echo Source code has been Set-Up Succesfully.
else
echo repo has been initialized in $XOSPpath
echo To sync the source, cd to $XOSPpath and run the following command
echo "repo sync"
fi
Just change the XOSP name with your ROM name in all the cases (Just make CTRL F and write XOSP, it will find all the names)
Save it as .sh file, give it a name and then make the commit.
To run it on the computer just open a terminal window and write ./filename.sh
Once you done all these things it's time to repo init your ROM path:
If you done the script then the commands will be less:
Code:
git clone https://github.com/Your Project/platform_manifest.git
cd ~/platform_manifest
./scriptname.sh
Now just sit and relax because it will take a while..
Repo-synched, your ROM path should look like this:
If you made some mistakes into the default.xml files please write it in the Thread.
If it's all good now your brain maybe is gonna to explode because you don't know what are those folders but you don't even to know all these folders, why?
Because is not necessary.
Usually folders like external, developers, bootable are not modified only but the main source which usually is CM or of course Android (AOSP)
So calm down because we will not gonna modify files from each of these folders but just a part of them:
build (Many things to do here)
Framework (Customization most of it)
Packages (Settings for sure + some other ones)
vendor (Many things also here)
So mainly these are the projects which they will be modified.
If you didn't forked framework base on Github or you don't want now to modify framework stuff it's ok but remember that when you want to modfify files in a Project repo to be yours in order to commit the changes after.
Before to proceed i want to add something you should absolutely need to know:
In order to work on the different Projects you can't work in the ROM Path because it's always better to clone that specific repo in an other folder and commit the changes.
SmartGit
Intro and Installation​
In order to commit the changes that you are going to do on the different Repositories i recommend you to use SmrtGit which is a free tool and it will help very much in the work that we will gonna do.
1) First of all if you didn't downloaded the link is situated in the first post
2) Once you downloaded unpack the tar package and unpacked it to your Desktop or /home
3) Now open the folder and go to the bin one.
Now go to the smartgit file proprieties and check if the file is executable, if it's not check the check box and open it.
g
4) Once you opneed a window will be prompted to configure SmartGit, choose the non-commercial use only and click next
5) Now choose to use SmartGit as SSH Client
6) Configure a new hosting provider which it will be Github in our case.
Insert your e-mail and after click the Generate API token button
7) Insert your master password which it will be useed for the commits
8) Insert your Github password
9) Now the that the token is generated click next
10) Now SmartGit will search if you got already repositories in your home folder, if you want to include some of yours go ahead.
11) Now next and finish. Hurray! You finished to configure SmartGit
How to use SmartGit​
Now in order to apply the incoming commits that we will gonna do, first you need to understand some concepts:
In the early post about Repo we were talked about the fact that we could have 2 kind of repositories, the forked ones and the created ones in that organization.
If you want to add a forked repo from SmartGit you will have an origin branch which is yours then it comes the upstream one.
Upstream is corresponding to the original repo that includes the branches from the Original forked repo. So when you want to add a new forked repo from your organization to Smart Git make sure that you clone it with SmartGit in order to include also the upstream tracking one because we will work and commit our changes but in the main time maybe CM will also push new commits so these commits should also be included in your forked repo.
If you want to add a created repo from your organization instead, and you also want to include the upstream changes from the native repo from where you taking the code then you will need to add the upstream for your own. So just follow my commands:
For example i will be taking Settings (The package) and i will add the upstream in order to have in my local repo also the original sources (In my case from crDroid):
Just adapt the link to your repo one.
The upstream should now be visible as it here and also in SmartGit.
It's not mandatory to include every single commit that for example Cyanogenmod make but most of them should absolutely be included. Yup,so upstream it's very important guys but it will also create difficult situations because now we will talking about the conflicts problem.
But what are exactly the conflicts?
The conflicts are generated when you want to include upstream commits to your own Repo no matter if it's created or forked, so the thing to do is only to adapt them and here once again SmartGit will save our "lives"
Why it will save our lives ?
Because SmartGit includes an inbuilt file compare which is very useful when resolving conflicts.
So to show you let's take in consideration still Settings. In my case the repo is not forked but it's created and the upstream is created for myself. So let's include some commits and see how it goes. In the major part of the cases you will not get conflicts errors. But if you do get then follow up this procedure:
As we know here is the Origin remote which is mine an the upstream remote which is crDroid one:
So what you need to do in order to include a commit made in the upstream one?
Well there are a few methods to do it.:
There is the cherry-pick method and usually is the most used to pick up two or three commits.
The merge method which allows you to merge all the missing commits from a based branch into your current one. (Here the possibility to find out conflicts are bigger)
The rebase method, which basically rebase your current branch to a specified one.
In my case i will use the merge method, and i will sync up my remote with the original crDroid one by including the missing commits.
For me everything went good, so i'm just gonna push now the new changes
Now if something go bad which means you end up with conflicts here is how you need to solve them.
Basically conflicts are appearing most of the cases because you for example modified a file and the commit which you want to apply go modifying the same file but for the fact that the file is not the same as the upstream on conflicts appear, so you need to find out a solution in order to keep your changes made to that file but in the same way including the specific commit.
When you will rebase, cherry-pick or merge the conflicted files will be the first ones to appear so to solve them here is what you need to do:
Double click the conflicted file
Now a new window will be displayed:
You will see that the file compare will be split in three parts, i mean three columns.
So let me explain you what are the three columns:
By starting from the left the first one indicates our branch the origin one.
The second one represent the Working Tree *
The third one represent the upstream branch from where we are cherry-picking or merging the commit
Working three*
The working three basically represents a detached branch,where you are working.
On local the branch is still the same (name etc..) but is being considered in a different way till you push up the changes.
If you will get familiar with this then you will not have problems with other minor issues.
So this is it, if you got questions or errors just write them on the Thread
Android Build​
So guys are you ready for the modifications?
Well, let's begin...
If you understood the last posts then you should be ready because now we will gonna work on the android_build files.
But what is android_build?
Android build is that Repo that includes all the files necessary in order to make the compilation, don't get me wrong i mean it doesn't include all the files for the compilation but includes the files which includes all the commands and strings necessary for the compilation.
So first thing to do is to fork this repo.
As in the previous post you need to go on the CM repo and to fork the android_build to your ROM organization.
And finally clone it to your computer.
So what you can modify here?
Well quite a lot of things because you can eliminate the CM name almost completely and to include your ROM name instead.
So the first file we will gonna take is the Makefile which is situated in the core folder.
So what we gonna need to modify here?
Here we will gonna modify the Target Device name + some more ones...
So first search this line:
Code:
CM_DEVICE
And change it with YourROMname_DEVICE
Done !
Now the second one is:
Code:
CM_BUILD
In the same way change the CM with your ROM name.
Now go and find these lines:
Code:
CM_TARGET_PACKAGE
CM_VERSION
In the same way change the CM with your ROM name.
On the same line which is this:
Code:
CM_TARGET_PACKAGE := $(PRODUCT_OUT)/cm-$(CM_VERSION).zip
Change also the red marked cm with your ROM name.
Now, go and find these lines:
Code:
.PHONY: otapackage bacon
CM_TARGET_PACKAGE
Ok so bacon agaain to be changed with your ROM name, and the same also for the Target Package
Tip!
That's only if want to....
If you want to include a cool banner with ascii art when the ROM has finished the compilation you can include one:
To generate strings with ascii art go HERE
Choose your prefered one and copy it.
Now go to this line:
Code:
@echo -e ${CL_CYN}"Package Complete:
Right after the line paste the generated ascii string.
But make sure to add also this little entry in order to print it in terminal:
Code:
@echo -e $(CL_CYN)
And add it for each line.
If you want to change the color of the line (cause now the color is the Cyano one)
You can choose from these ones:
Code:
@echo -e $ (CL_RED)
@echo -e $ (CL_GRN)
@echo -e $ (CL_YLW)
@echo -e $ (CL_BLU)
@echo -e $ (CL_MAG)
@echo -e $ (CL_CYN)
@echo -e $ (CL_RST)
This is just for personalize a bit your build environment
So this is it!
The Makefile is now modified and ready to be commited.
Now let's move to: config.mk which is situated still in the core folder.
Here we only need to modify one string:
Code:
ifneq ($(CM_BUILD),)
In the same way change the CM name with your ROM name.
Done !
Now let's move on dumpvar.mk which is also situated in the core folder.
If you are a maintainer you will for sure asking that i seen these lines before,
Yes you are correct!
Those lines are used to display the Compiling Info before the start process.
And those are displayed when you lunch the command: breakfast or of course brunch.
So why we are here?
We are here to change the ROM Version which it will be displayed so because in the Makefile we changed the CM_VERSION with our ROM name we need to change it also here.
Tip!
These lines are not necessary, so they can be deleted
Code:
ifeq ($(CYNGN_TARGET),true)
$(info CYNGN_TARGET=$(CYNGN_TARGET))
$(info CYNGN_FEATURES=$(CYNGN_FEATURES))
endif
So we are also done here. Now let's move on product_config.mk and envsetup.sh
Here we will change the mode about how the Compilation environment will recognize your device.
If you are a maintainer and you compiled Slim ROM or OmniROM, you will for sure notice that you need to change the cm.mk file from your device propper files with the name of the ROM for example if you want to compile SlimRom you need to change the cm.mk to slim.mk and so go on...
Soooo that's what we will gonna do.
First take the product_config.mk file located in teh core folder :
And now find these lines:
Code:
# A CM build needs only the CM product makefiles.
ifneq ($(CM_BUILD),)
all_product_configs := $(shell ls device/*/$(CM_BUILD)/cm.mk)
Now change the CM name with your ROM name (as always)
Now find this string:
Code:
CM_BUILD
And change it with your ROM name.
The same also for the next line.
Ok, so now we are done with the product_config.mk file so let's witch now on the envsetup.sh one:
Find this line:
Code:
if (echo -n $1 | grep -q -e "^cm_") ; then
Ok, now change the all the cm names with your ROM Name (as usual), after go and find this line:
Code:
CM_BUILD=
Change it as usual, the same also for the next one.
Now find this line:
Code:
if [ "z${CM_DEVICES_ONLY}" != "z" ]; then
And change it as usual. The same also for the upcoming one after 10 strings.
Again, find the bacon string and change it with your ROM Name.
Now find this line:
Code:
CM_DEVICES_ONLY
And change it as usual.
Now, go and find this line:
Code:
lunch cm_$target-$variant
And also this one change it as usual.
Now, find these lines:
Code:
MODVERSION=$(get_build_var CM_VERSION)
ZIPFILE=cm-$MODVERSION.zip
And change them as usual.
Don't worry we are nearly to the end.
The last strings which need to be modify at least are:
Code:
ro.cm.device=$CM_BUILD
CM_BUILD
So make CTRL F and search for those lines and change them with your ROM name.
So boom! Now when you will gonna compile for your device you will no longer see the CM name on it, of course that now you will need to change also the cm.mk name with your ROMName.mk situated in your Device common files.
Another thing which you can do is to add the dependencies which are an extra part and they will be explained in the Extra Part post.
Now close the two files and go and open buildinfo.sh which is situated in tools folder.
Now go and find this string:
Code:
echo "ro.cm.device=$CM_DEVICE"
Also here change it as we did in the lasts two files.
Close it, and now the last file which we will gonna modify is: roomservice.py which is situated in the tools folder.
So what this file do actually?
This file together with some others are responsible with the device build. I mean if for some reasons the device which you want to build for, isn't present in your local repo the build environment will automatically go and search in your ROM Organization (fetch) if there is such a device, so because we don't want that the build environment search in the CM Repo we need to change this file in order to search in your ROM Repo.
So first find this line:
Code:
githubreq = urllib.request.Request("https://api.github.com/search/repositories?q=%s+user:CyanogenMod+in:name+fork:true" % device)
And change the user with the ROM of the Organization from Github (exactly)
Now search for this line:
Code:
dependencies_path = repo_path + '/cm.dependencies'
And change the cm name with your ROM name (please make the ROM Name all lowercase to avoid confusion)
Now for the rest just search:
Code:
CM
CyanogenMod
And change it as we did earlier (your ROM Name)
So we finally done !
The build files are now modified and ready to be commited on Github, now when you will compile the ROM for your device you will not see anymore the CM Name
Extra features to add in Android Build files​
So this post mainly will gather user's proposed features and also mine which aren't included in the principal one.
This idea came up while i was writing the vendor part were i said that if users want to add some features to be added in the files which is not listed in the OP to write it and i will decide if is good enough to include it.
So because this thread is still WIP i will be the first to start this
Autoremove build.prop, .zip and .md5 files after each compilation​
I find a commit on the Euphoria git where a developer " Cl3Kener" (Github name) added some new features which should be included by default in my opinion..
So we know that when we make a compilation process a .md5 file will be created a .zip file will be created and also a build.prop .
Basically these files are created every time we make a new build and, to don't go and remove the build.prop every time for the new compilation or even for the zip and md5 files ,
These strings will autoremove these files every time you make a new build:
Code:
ifeq ($(MAKECMDGOALS),dirty)
+dont_bother := true
+endif
And this one also:
Code:
# Clears out zip and build.prop
.PHONY: dirty
dirty:
@rm -rf $(OUT_DIR)/target/product/*/system/build.prop
@rm -rf $(OUT_DIR)/target/product/*/*.zip
@rm -rf $(OUT_DIR)/target/product/*/*.md5sum
@rm -rf $(OUT_DIR)/target/product/*/*.txt
@echo -e ${CL_GRN}"build.prop, changelog and zip files erased"${CL_RST}
The first block of code needs to be putted here:
And the second block instead here:
Basically the end of file
Vendor files (First part)​
Now guys let's contimue the modifications also with the vendor files shaw we?
Make sure that you forked and cloned the repo to your computer with SmartGit by including also the upstream branches.
Before continue obviously we need to explain what this repo means, well exactly as from the title vendor we can assume that these vendors files are the propietary ones which every ROM have.
For example, each phone got propietary files (vendor) so the same is also here, so every ROM differ from each other.
Ok so now, for the fact that there will gonna be more things to do here i will split the vendor part in two.
In the first one we will remove all the CM stuff as in the android build.
In the second one instead we will talk about features or modifications that can be made on it.
So let's begin with the CM removable modifications:
Open the config folder.
Now here you will find multiple xml files, each of them will need to be modified.
But first let's take cm_audio.mk
The first thing to do is to remove this little cm and rename it with your ROM name (in lower case)
Now open it, and make CTRL F and search:
Code:
cm
And change it with your ROM name, do it for all of the search results.
Now you will need to do the exactly same thing also with the others located in the config folder except for the common.mk which is for later.
Now the last thing about this part is this:
Take the default.xml from platform manifest and change this line:
Code:
<project path="vendor/cm"
And change the path by changing the cm with your ROM name instead.
Now commit it and let's move on to the second part.
Vendor files (Second part)​
**Attention**
Before continue make sure to have commited the changes made earlier...
*************
Now, let's continue with the second part where we will add new features and make the latest changes....
Earlier i said that the common.mk is left for later, but i had reasons to do so.
That's because the common.mk is the most of important one (I think in my opinion).
So what we are waiting for let's open it!
The first thing you may see is : "Mooore Cyanogen stuff", yes you right bro mooore cyanogen stuff but here will be a bit different because we will not change everything at the moment because some of the strings will be left as their are.
A proper guide will be made to the Extra section where these strings will be able to be modified.
So let's go on:
The first thing to do is to change the vendor path exactly as we did in the previous files so for example:
Code:
vendor/cm/prebuilt/common/bin/backuptool.sh:install/bin/backuptool.sh \
The cm name change it with your ROM name just as you did in the previous files (lowercase)
Now go to the first string::
So change the Product Brand name with yours.
Now remove this entire ifndef because is not necessary:
Code:
ifdef CM_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
ro.rommanager.developerid=cyanogenmodnightly
else
PRODUCT_PROPERTY_OVERRIDES += \
ro.rommanager.developerid=cyanogenmod
endif
Now remove also this entire block:
Code:
ifndef CM_BUILDTYPE
ifdef RELEASE_TYPE
# Starting with "CM_" is optional
RELEASE_TYPE := $(shell echo $(RELEASE_TYPE) | sed -e 's|^CM_||g')
CM_BUILDTYPE := $(RELEASE_TYPE)
endif
endif
Also for this one:
Code:
ifeq ($(filter RELEASE NIGHTLY SNAPSHOT EXPERIMENTAL,$(CM_BUILDTYPE)),)
CM_BUILDTYPE :=
endif
Now remove this block and sobstitute it with this one provided by me
(To Remove)
Code:
ifdef CM_BUILDTYPE
ifneq ($(CM_BUILDTYPE), SNAPSHOT)
ifdef CM_EXTRAVERSION
# Force build type to EXPERIMENTAL
CM_BUILDTYPE := EXPERIMENTAL
# Remove leading dash from CM_EXTRAVERSION
CM_EXTRAVERSION := $(shell echo $(CM_EXTRAVERSION) | sed 's/-//')
# Add leading dash to CM_EXTRAVERSION
CM_EXTRAVERSION := -$(CM_EXTRAVERSION)
endif
else
ifndef CM_EXTRAVERSION
# Force build type to EXPERIMENTAL, SNAPSHOT mandates a tag
CM_BUILDTYPE := EXPERIMENTAL
else
# Remove leading dash from CM_EXTRAVERSION
CM_EXTRAVERSION := $(shell echo $(CM_EXTRAVERSION) | sed 's/-//')
# Add leading dash to CM_EXTRAVERSION
CM_EXTRAVERSION := -$(CM_EXTRAVERSION)
endif
endif
else
# If CM_BUILDTYPE is not defined, set to UNOFFICIAL
CM_BUILDTYPE := Release_1_Revision_1
CM_EXTRAVERSION :=
(To Add)
Code:
ifdef ROMNAME_BUILDTYPE
# If ROMNAME_BUILDTYPE is not defined, set to UNOFFICIAL
ROMNAME_BUILDTYPE := YOUR RELEASE
Now change these names:
Code:
CM_BUILDTYPE
CM_EXTRAVERSION
CM_VERSION
CM_BUILD
CM_DISPLAY_VERSION (Except for the ro.cm.display.version=$(CM_DISPLAY_VERSION) don't modify this one)
So now that the common.mk file is completed and modified, let's move on by telling you the basics things to know:
- The first thing to know is that the bootanimation is situated here in this repo in prebuilt/common/bootanimation so if you want to add a bootanimation for your own this is the place where you can store (Make sure to include different screensize for each type of device i mean the Resolution of every bootaimation)
- The default wallpaper is situated here: overlay/common/frameworks/base/core/res/res so if you want to change the wallpaper of the ROM here you will need to put it (Also here, make sure to include the wallpaper with the exact same name of the stock one and also change the wallpaper for all the drawable folders (to be sure))
- You can also add files for your own and add it to your out folder in order to be included in your ROM.
Just follow this syntax:
Code:
PRODUCT_COPY_FILES += \
Full origin path of the file / File(zip,apk it doesn't matter what type of file is) :Full destination path including also the file name\
When you finished to add your files at the last file don't put the:
Code:
/
Because at the last file to copy you don't need to put it because it means that this the last file to add and after there is nothing more to add .
Now for example this syntax:
Code:
PRODUCT_PROPERTY_OVERRIDES += \
Will be explained in the Settings section because you need also to modify some files inside the Settings sources.
Basically these are the main changes which you can made.
If you got something some new stuff which could be added just write it on the thread and i will add it on the Guide
As always after making the changes make sure to commit the changes, and if you got problems regarding this section just write it on the thread and i will answer you
Now let's move on the Settings part….
Extra fearures to add in the Android Vendor files ​
Packages​
As i stated in the OP i will make also a little part about the Packages which are included in the ROM sources before going to the Settings sources.
Well first of all let's take the packages folder from the ROM dir:
So we've got these folders.
In these folders there are several packages which you don't need it (most of it)
So these packages can be easily removed, but remember to remove also the entru from the default.xml from platform manifest in order to don't fetch the project again.
In apps
You can easily remove these projects:
CMBugReport
HTML Viewer
Speech recorder
TVSettings (Optional)
In experimental
Here i suggest you to maintain all the projects because you need them all
The same also for the providers
In screensavers
The screensavers folder instead can be entirely removed because they are also outdated and i think you don't need it for your sources.
The same also for the wallpapers folder.
Add apps to the sources
Now if you have an app and want to include it to your ROM you can add the app sources to the apps folder including in the app folder the Android.mk file.
But wait what is it?
Android.mk can be found in almost every folder of the ROM sources and represent an identity for the build environment in order know what to do with files located inside that folder.
So basically the Android.mk just tell to the build environment what to do with the files contained in that folder.
So how you can make an Android.mk ?
Simply, usually if you include basic apps, i mean apps which not require special build process by including special flags then the basic Android.mk used for the compilation of an app is this:
Code:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := YourApp name
include $(BUILD_PACKAGE)
So if you want to include an app made for your own to the ROM sources and as i said is a basic app which not requires special flags for the compilation this is the Android.mk schema to use
Before jumping and going to work on the Settings sources, another thing which in my opinion can be easily added is an OTA Updater app.
Don't worry you don't need to make an app for this but i can suggest you one made by an XDA User , it's tested by and i can asure you that is working very well, but you need to follow a bit some instructions which i think aren't so difficult to follow.
Once you red the instructions, you can fork the repo to your repo organization and start working on the sources files. I'm not going to make a guide of this but i will just tell you to be careful with the sources and to don't modify the Android.mk contained in the app sources.
And the link is this: https://github.com/Kryten2k35/OTAUpdates
That's it!
Now we can proceed with the Settings part
Settings Part​
So here we are guys, finally we arrived to the Settings sources part, which in my opinion is one of the most featured part of all.
As usual we will split the post in two parts:
CM Removable Part
Features part
But before we continue, make sure to have forked and cloned the repo to your PC.
CM Removable part​
Ok so let's begin with the CM removable stuff part.
Open the sources and go and find Android Manifest , open it, now find this activity :
Code:
<activity android:name="SettingsCMLicenseActivity"
Now delete the etire activity.
After, find also these activities, and remove them all:
Code:
<activity android:name="Settings$AnonymousStatsActivity"
<activity android:name=".cyanogenmod.ChangeLog" />
<activity android:name=".cyanogenmod.ContributorsCloud" />
Now go to res/values/cm_strings
And remove all these lines:
Code:
<!-- Anonymous Statistics #CM -->
<!-- About device screen, list item title. Takes the user to the screen about opting in or out of anonymous statistics. -->
<string name="anonymous_statistics_title">CyanogenMod statistics</string>
<string name="anonymous_statistics_summary">Help make CyanogenMod better by opting into anonymous statistics reporting</string>
<string name="anonymous_statistics_warning_title">About</string>
<string name="anonymous_statistics_warning">Opting into CyanogenMod Statistics will allow non-personal data to be submitted to the
developers of CyanogenMod to track unique installations across devices. The information submitted includes an unique identifier,
which does not compromise your privacy or personal data. The data is submitted during each boot.\n\nFor an example of the data that is submitted, tap on Preview Data.</string>
<string name="enable_reporting_title">Enable reporting</string>
<string name="preview_data_title">Preview data</string>
<string name="view_stats_title">View stats</string>
<string name="anonymous_learn_more">Learn more</string>
Now go to res/drawable-hdpi
And remove this png:
Code:
ic_cm_stats_notif.png
Now go to res/drawable-mdpi
And remove the same png also here.
And finally the same also for drawable/xhdpi
After go to res/xml/device_info_settings
And delete this whole preference screen:
Code:
<!-- System update settings - launches activity -->
<PreferenceScreen android:key="system_update_settings"
android:title="@string/system_update_settings_list_item_title"
android:summary="@string/system_update_settings_list_item_summary">
<intent android:action="android.settings.SYSTEM_UPDATE_SETTINGS"
android:targetPackage="com.cyngn.fota"
android:targetClass="com.cyngn.fota.SystemUpdateActivity" />
</PreferenceScreen>
<PreferenceScreen android:key="additional_system_update_settings"
android:title="@string/additional_system_update_settings_list_item_title">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="@string/additional_system_update"
android:targetClass="@string/additional_system_update_menu" />
</PreferenceScreen>
<!-- CyanogenMod Updates -->
<PreferenceScreen android:key="cm_updates"
android:title="@string/cmupdate_settings_title"
android:summary="@string/system_update_settings_list_item_summary">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.cyanogenmod.updater"
android:targetClass="com.cyanogenmod.updater.UpdatesSettings" />
</PreferenceScreen>
This one also:
Code:
<!-- Contributors cloud -->
<PreferenceScreen android:key="contributor_cloud"
android:title="@string/contributor_cloud_title"
android:fragment="com.android.settings.cyanogenmod.ContributorsCloud" >
</PreferenceScreen>
This one also:
Code:
<!-- CM License information -->
<PreferenceScreen
android:key="cmlicense"
android:title="@string/cmlicense_title">
<intent android:action="android.settings.CMLICENSE" />
</PreferenceScreen>
And also this one:
Code:
<!-- Change Log -->
<PreferenceScreen android:key="changelog"
android:title="@string/changelog_title"
android:fragment="com.android.settings.cyanogenmod.ChangeLog" >
</PreferenceScreen>
Now find also these xml files: which are located in the same folder:
Code:
anonymous_stats.xml
preview_data.xml
And delete them.
Now return to the main directory of settings and go to src/com/android/settings/Settings
Find:
Code:
CMLicenseActivity.java
And delete it.
Now go here: src/com/android/settings/cyanogenmod/
Find:
Code:
ContributorsCloud.java
And delete it.
Now go here: src/com/android/settings
Open:
Code:
DeviceInfoSettings.java
And delete the following lines (in order):
Code:
import android.content.pm.PackageManager.NameNotFoundException;
private static final String KEY_CM_UPDATES = "cm_updates";
Code:
// Only the owner should see the Updater settings, if it exists
if (UserHandle.myUserId() == UserHandle.USER_OWNER) {
removePreferenceIfPackageNotInstalled(findPreference(KEY_CM_UPDATES));
} else {
getPreferenceScreen().removePreference(findPreference(KEY_CM_UPDATES));
}
Code:
private boolean removePreferenceIfPackageNotInstalled(Preference preference) {
String intentUri=((PreferenceScreen) preference).getIntent().toUri(1);
Pattern pattern = Pattern.compile("component=([^/]+)/");
Matcher matcher = pattern.matcher(intentUri);
String packageName=matcher.find()?matcher.group(1):null;
if(packageName != null) {
try {
PackageInfo pi = getPackageManager().getPackageInfo(packageName,
PackageManager.GET_ACTIVITIES);
if (!pi.applicationInfo.enabled) {
Log.e(LOG_TAG,"package "+packageName+" is disabled, hiding preference.");
getPreferenceScreen().removePreference(preference);
return true;
}
} catch (NameNotFoundException e) {
Log.e(LOG_TAG,"package "+packageName+" not installed, hiding preference.");
getPreferenceScreen().removePreference(preference);
return true;
}
}
return false;
}
Now save and close it.
After that go here: src/com/android/settings/
Open
Code:
Settings.java
And delete this line:
Code:
public static class AnonymousStatsActivity extends Settings { /* empty */ }
Save and close it.
Now the last part delete these java files:
Code:
src/com/android/settings/cmstats/AnonymousStats.java
src/com/android/settings/cmstats/PreviewData.java
src/com/android/settings/cmstats/ReportingService.java
src/com/android/settings/cmstats/ReportingServiceManager.java
src/com/android/settings/cmstats/Utilities.java
Now the very last part of these modifications....
Go here: src/com/android/settings/cyanogenmod/
And cut the ChangeLog.java file because we will need it to your Desktop.
So that's it.
Mostly these are the files to be deleted but as always if you consider that some other CM stuff needs to be deleted just write it on the Thread and i will add them
Now let's move on to the second part!
Features part​
Ok so finally we can talk about the features in Settings.
Here you can add plenty of things, and i will try now to include now to most important ones but as always if you got some new ones that you consider that can be added to the Guide just write it on the thread and i will looking forward to add them
I will add also here a difficulty level exactly as i did in the Extra Features part.
So let's start guys
Add more info about phone like Hardware etc...​
Difficulty level:
Difficulty level: (*°°°°)
This is optionally but if you want to include more hardware informations just follow this mini guide .
First go to res/values
Now create a new strings xml fine starting in this way:
Code:
romname_strings.xml (all lowercase)
Ok, now open it and include the following strings:
Code:
<!-- About device screen, Hardware info -->
<string name="hardware_info">Hardware info</string>
<!-- About device Screen, hardware info, rear camera -->
<string name="device_rear_camera">Rear camera</string>
<!-- About device Screen, hardware info, front camera -->
<string name="device_front_camera">Front facing camera</string>
<!-- About device Screen, hardware info, screen res -->
<string name="device_screen_resolution">Screen resolution</string>
<!-- About device Screen, hardware info, GPU info -->
<string name="gpu_info">GPU</string>
<!-- About device screen, Cpu info. -->
<string name="cpu_info">CPU</string>
<!-- About phone screen, Free memory info -->
<string name="mem_info">Memory</string>
Ok, now save and close it.
Now go to the xml folder
And open:
Code:
device_info_settings.xml
And add the following lines at the bottom:
Code:
<PreferenceScreen
android:key="hardware_info"
android:title="@string/hardware_info">
<!-- Device cpu info -->
<Preference android:key="device_cpu"
style="?android:preferenceInformationStyle"
android:title="@string/cpu_info"
android:summary="@string/device_info_default"/>
<!-- Device gpu info -->
<Preference android:key="device_gpu"
style="?android:preferenceInformationStyle"
android:title="@string/gpu_info"
android:summary="@string/device_info_default"/>
<!-- Device mem info -->
<Preference android:key="device_memory"
style="?android:preferenceInformationStyle"
android:title="@string/mem_info"
android:summary="@string/device_info_default"/>
<!-- Device rear camera -->
<Preference android:key="device_rear_camera"
style="?android:preferenceInformationStyle"
android:title="@string/device_rear_camera"/>
<!-- Device front camera -->
<Preference android:key="device_front_camera"
style="?android:preferenceInformationStyle"
android:title="@string/device_front_camera"/>
<!-- Device screen resolution -->
<Preference android:key="device_screen_resolution"
style="?android:preferenceInformationStyle"
android:title="@string/device_screen_resolution"/>
</PreferenceScreen>
And remove the following lines:
Code:
<!-- Device cpu info -->
<Preference android:key="device_cpu"
style="?android:preferenceInformationStyle"
android:title="@string/cpu_info"
android:summary="@string/device_info_default"/>
<!-- Device mem info -->
<Preference android:key="device_memory"
style="?android:preferenceInformationStyle"
android:title="@string/mem_info"
android:summary="@string/device_info_default"/>
Ok now save and close it.
Now go to the main dir of Settings and go to src/com/android/settings
And open:
Code:
DeviceInfoSettings.java
Now remove the following lines:
Code:
private static final String KEY_DEVICE_CPU = "device_cpu";
private static final String KEY_DEVICE_MEMORY = "device_memory";
And instead add these ones:
Code:
private static final String KEY_DEVICE_CPU = "device_cpu";
private static final String KEY_DEVICE_GPU = "device_gpu";
private static final String KEY_DEVICE_MEMORY = "device_memory";
private static final String KEY_DEVICE_REAR_CAMERA = "device_rear_camera";
private static final String KEY_DEVICE_FRONT_CAMERA = "device_front_camera";
private static final String KEY_DEVICE_SCREEN_RESOLUTION = "device_screen_resolution";
Now add these lines after this one:
Code:
setValueSummary(KEY_MOD_BUILD_DATE, "ro.build.date");
Code:
addStringPreference(KEY_DEVICE_CPU,
SystemProperties.get("ro.device.cpu", getCPUInfo()));
addStringPreference(KEY_DEVICE_GPU,
SystemProperties.get("ro.device.gpu", null));
addStringPreference(KEY_DEVICE_MEMORY, getMemInfo());
addStringPreference(KEY_DEVICE_FRONT_CAMERA,
SystemProperties.get("ro.device.front_cam", null));
addStringPreference(KEY_DEVICE_REAR_CAMERA,
SystemProperties.get("ro.device.rear_cam", null));
addStringPreference(KEY_DEVICE_SCREEN_RESOLUTION,
SystemProperties.get("ro.device.screen_res", null));
Then the last ones need to be added at the end of file:
Code:
private void addStringPreference(String key, String value) {
if (value != null) {
setStringSummary(key, value);
} else {
getPreferenceScreen().removePreference(findPreference(key));
}
}
}
That's it! Now you will be able to see more info about your phon in device info settings.
Just make sure that you add also these lines to your build.prop:
Code:
ro.device.cpu
re.device.gpu
ro.device.front_cam
ro.device.rear_cam
ro.device.screen_res
Add your own ROM banner in Settings​
Difficulty level: (*°°°°)
This one is very simple to follow and i think in my opinion everyone should add a banner to their Settings app
So first take the res folder and go to the layout folder.
And create a new xml file by adding these lines into it:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/banner" />
</LinearLayout>
And save it as banner for example.
Now for the banner size, in my opinion you should resize you banner to a size like a : 480x180
This should fit perfectly.
Then after you prepared your banner copy it to the drawable folder and make sure that the image is saved with the "banner" name.
Now the last thing to do is to display it in Settings.
So now go to res/xml
And open:
Code:
device_info_settings.xml
And copy this line after the third line:
Code:
<PreferenceScreen android:layout="@layout/banner" android:key="od_logo" />
That's it now your logo is added in Settings!
Extra features to add in the Settings sources​
Extra Features​
This last part of the guide will be dedicated to the..... "hard features modifications", Yes let's call it in this way !
I called it in this way because by meaning hard modifications i mean that we will gonna modify more files from not just one repo but more than one.
So i will start it with some minor modifications, but mainly this part will be left to the users, because if you got talent and made some cool modifications and want to share it on the thread, i will add them to the post by including also a propper guide to it
In this post i will also include a difficulty level because as the modifications are not at the same level of all, i will include also a difficulty level in order to make it know to the Developer what he is dealing with.
As always if you got trouble just write in the thread the problem by following the schema written in the OP
That's all
Manage and add new strings to Settings and override them in the compilation process​
Difficulty level: (**°°°)
So, first of all here are the repos which we will gonna modify:
android_vendor_files
Settings (Repo)
Before continue let me give you a basic intro about what we are talking about.
For example when you are seeing a string in Settings (About phone for example) like the Version of the ROM, in order to display the version of the ROM the files beeing modified weren't just one but more than one.
So if you want to add a new string which you know that is gonna to be modified many times like the version of the ROM to display something in Settings here is what you gonna need to do:
At first let's take the Settings repo:
Now go to res/values
Now, here you have two options:
Or you take the default Strings xml and you will add there your new strings
Or you create a new xml file exactly as the Strings one is and you start adding yours there (Better this one in my opinion)
Now open Strings xml (The one created or the default one)
And create a new entry as the other ones
For example i made a string for the Revisions of my ROM.
Now you have to decide where to display this string.
In my opinion the better place is in About phone
So now go to the xml folder and search for:
Code:
device_info_settings.xml
Open it, and now create also here a new entry exactly as the others .
The only thing you need to modify is the android:title and the android:summary
If you don't need a summary of it you can just write only the android:title string as i did:
So after, we move to the Java part.
Go to src/com/android/settings
And search for:
Code:
DeviceInfoSettings.java
Open it, now you will need to create also here an entry for the new string so right after the last private static final String create another one like i did:
Now we will need to assign the value we are gonna override from the vendor files more exactly,
Find this string:
Code:
setValueSummary(KEY_MOD_VERSION,"ro.cm.display.version");
In this string for example we assign the value for the mod version which is the version of the ROM and we are assigning the value coming from the ro.cm.display.version which you all know that is coming from the build.prop but actually is coming from the vendor files
So do the same also for you string (Make sure that the string which the Settings one will read the value from build.prop to start with ro.)
Ok, so done that we can switch repo and go to the vendor files.
Now take the common.mk file which is located inside the config folder.
As i did an entry for the Revision number earlier in Settings, i will made an entry here:
I put it together with the build type because also this string offer informations regarding the ROM, thats' why, but you can put yours anywhere you want (But read always when you write something if it is in the right place)
Now the last thing to do is to Overrride the new value assigned in the common.mk to the desired String, as stated here:
So that's it you finally created a new string which it will gonna change in Settings everytime you change the value here in the Common.mk file.
To modify an existing one just follow the steps made earlier and you should be fine
Add a device to your Organization and add dependencies ​
Difficulty level: (*°°°°)
Another thing to be added here is the one about how to add a device to your organization and to add also propper dependencies for your device.
As you remember when we worked on Android Build i told you to change this file:
Code:
roomservice.py
This file is very important if you want to add dependencies to your device when you want to build the ROM because if you don't have the Device sources cloned to your Main Repo folder the build environment will automatically go and download them all from the Organization.
These dependencies are very useful because avoid confusions and allow also to organize better your Organization.
So what you need to do ?
First go and clone your device tree for example (Not the vendor one) to your Organization
Image
I choosed the ariesve one which is mine.
Clone it to your desktop in order to work on it.
Now before to continue you need to think what dependencies to add i mean to be downloaded, usually the common ones are:
Kernel
Vendor (propietary)
But if you will need to add more repo, just need to follow the schema that i will show you now:
Code:
[
{
"repository": "android_device_samsung_ariesve",
"target_path": "device/samsung/ariesve"
"branch": "lollipop5.1"
}
{
"repository": "android_vendor_samsung",
"target_path": "vendor/samsung"
"branch": "lollipop5.1"
}
{
"repository": "android_kernel_samsung_msm7x30",
"target_path": "kernel/samsung/msm7x30"
"branch": "lollipop5.1"
}
]
This schema is just an example and is made for my device.
As you can see the schema is very simple and you can add as many repo as you want, the only thing to do when you save is to save it in this way: yourromname.dependenicies (all lower case).
We use this syntax to save the file, in order to make i t recognize to the build environment.
So if it's all good then when you will need to build for your device then the build environment will download all the dependencies needed by the device.
Note.
Make sure also to include all the repos needed in the dependencies because if the repo isn't located in the Organization then it will not be downloaded and it will be skipped automatically.
reserved10
reserved
reserved
reserved 13
Linux Distribution Part​
As stated in OP, for building you will need Ubuntu. If you already got it running somewhere on a decent machine, you're fine and can jump to the next post. If you don't like Ubuntu as Desktop system like I do and are using something else (like Arch Linux which I am using) you need to setup Ubuntu. Mostly you don't like to install a full system, so you can choose to install a chroot environment. For this, you only need a separate partition (you can also choose to do this on the partition you have your host system on, but it's better to do it on an own partition so you don't have to reinstall it when you need to reinstall the host system). In this post I'll show you how to setup a chroot environment with Ubuntu installed into it:
1. On the host system, you'll need debootstrap (for installing Ubuntu) and schroot (for chroot-ing to the new environment). On a debian based system, these packages should be installable by apt-get, so you just do
apt-get install debootstrap schroot​If you use Arch Linux like me, schroot is installable by pacman, debootstrap is available in the AUR (so just install it with yaourt). To do so you also need to install gnupg1 from the AUR (including importing the GPG key of the gnupg1 maintainer like described in the comments of the AUR package) and also ubuntu-keyring to validate the Ubuntu release after downloading.
2. If you installed debootstrap and schroot succesfully and got your partition setup and mounted (I use /mnt in this example), you do:
debootstrap --arch=amd64 trusty /mnt (optionally point to a mirror here)​This will take some time (around 500 MB will be downloaded and installed). Once this is done, you need to setup schroot. Open up /etc/schroot/schroot.conf in a text editor of your choice and put in something like this:
[trusty]
description=Ubuntu Build Environment
type=directory
directory=/mnt
users=root​Change directory to the place you mounted the partition for the chroot. To finally get into the new environment, just do
schroot -c trusty​
Environment Setup Part​Now that you have the initial system ready, some software needs to be installed so you can get started. First thing would be to install the java jdk. If you build for Lollipop and later, you'll need openjdk 7. To install that, do
apt-get update
apt-get install openjdk-7-openjdk​if you run into some errors like I did, you'll need to work around them. If you get the error "dependencies failed" (or similar), and sgml-base is in the list of packages that couldn't be installed, just do
groupadd staff
dpkg --configure sgml-base​and try to install openjdk again using the above command. If you run into errors concerning libpam-systemd:amd64 you'll need to do two things, first you do
dpkg-divert --local --rename --add /sbin/initctl​to avoid upstart and init errors and then
sed -i 's/exit 100/exit 0/' /usr/sbin/invoke-rc.d​to work around the systemd-login script not found error (known bug in Ubuntu 14.04).
Now that you've installed openjdk, you need some packages to build android from source. Install them using
apt-get install bison g++-multilib git gperf libxml2-utils make python-networkx zlib1g-dev:i386 zip schedtool​Now you need to select a location inside the chroot to build. One remark here: schroot mounts your home directory from the host system into the chroot, so it's not advisable to build there. You can put the repo binary there if you like, but the sources and output directory should be somewhere else. I chose /opt/android (folder android needed to be created of course), but that's completely up to you. Also, please keep in mind that you shouldn't build as root to avoid replacing system files (just use the user from your host system, it's available under the chroot environment as mentioned earlier). Now just download the repo binary and you're ready to download the sources:
mkdir ~/bin
echo "PATH=~/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo​
Disclaimer and ROM specifications
Hey guys, so before to proceed with anything, please take 2 minutes to read this, because it may help you later.
When i was writing this thread i was thinking to allow the users to take in consideration as ROM base sources any kind of ROM, but i realized that for ROMs like AOSP, PAC or even Omni there's need more than a simply knowledge to modify the sources and make then the builds.
When i refer to AOSP i refer also to all the others AOSP based ROMs.
Those needs more time to stand on it and requires more skills rather than written here.
So the guide name was changed during the work in progress and changed to how it's now in this moment.
All CM based ROMs took as base sources are all good, so every change which i wrote here can be applied to any of the CM based ROMs.
If you want to make a try, go ahead but i will not provide support for that, i will provide my help for the ones who are making CM based ROMs.
Thanks to @jackeagle for pointing me and give me the ideas to write this part of the guide and don't forget guys, if you're having problems with the ROM compilation just go and see his guide ----> [GUIDE][COMPLETE] Android ROM Development From Source To End
So that's it, you can now close this post and go ahead with Guide
Good luck!

CM12.1 Build For Unofficial Device Error - "No matches for product"

Hi! I have the BLU Energy X 2, and I am trying to build CM12.1 for my device. There is no already created device tree and vendor files, so I used the ones from the Infinix Hot 2, and adapted the files to my device., and then I synced the CM12.1 repo. I have also created the device and vendor folders (Device>blu>e050u_blu) & (Vendor>blu>e050u_blu). Then, inside my local manifest, I have these lines:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/blu/e050u_blu" name="OblivionROM/android_device_e050u_blu" remote="github" revision="cm12.1" />
<project path="vendor/blu/e050u_blu" name="OblivionROM/android_vendor_e050u_blu" remote="github" revision="cm12.1" />
</manifest>
That adds my device tree and vendor files. Then I go into my CM12.1 directory, and I run ". build/envsetup.sh". That shows around 10 results, but it also shows
"including device/blu/e050u_blu/vendorsetup.sh".
Then I run "lunch" and choice 7 is cm_e050u_blu-eng and choice 8 is cm_e050u_blu-userdebug. I type "8" and I get an error. Here's the pastebin with my full terminal log, including the error.
http://pastebin.com/DrnPDHsu
If anyone can help me with this, that would be great! Thanks

Building LineageOS 17.1 from source

This is a manfiest to build lineage-17.1 with MiCode kernel from sources:
Based on initial device/vendor work by @alibei + MiCode Android Q sources.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="vendor"
fetch="https://github.com"
revision="lineage-17.1" />
<remote name="device"
fetch="https://github.com"
revision="lineage-17.1"/>
<remote name="kernel"
fetch="https://github.com"
revision="tucana-q-oss"/>
<remote name="sdclang"
fetch="https://github.com"
revision="pie" />
<!--Device Trees-->
<project path="device/xiaomi/tucana" name="b100dian/android_device_xiaomi_tucana" remote="device" />
<!-- Kernel-->
<project path="kernel/xiaomi/tucana" name="b100dian/Xiaomi_Kernel_OpenSource" remote="kernel" />
<!-- Vendor folders -->
<project path="vendor/xiaomi/tucana" name="b100dian/android_vendor_xiaomi_tucana" remote="vendor" />
<!-- Compiler -->
<project path="prebuilds/sdclang/linux-x86_64" name="ThankYouMario/proprietary_vendor_qcom_sdclang-8.0_linux-x86/"
remote="sdclang" />
</manifest>
updated 2020-04-08
What works:
- main camera
- selfie camera
- LTE
- calling
- sound
- accelerometer
- light sensor
- GPS
- wifi
What doesn't work:
- proximity sensor
- other cameras than main and selfie
Not tested:
- infrared port
- magentometer
This is the original post asking for help (any better way to make a collapsible quote?)
Spoiler: Original post 1
ORIGINAL POST1​Hi ROM developers, I would like to build one of the UNOFFICIAL lineage-17.1 roms posted on this forum from sources.
(The reason is that I want to apply sailfish OS build on top of that on my Mi Note 10).
I started with this tucana.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="vendor"
fetch="https://github.com"
revision="lineage-17.1" />
<remote name="device"
fetch="https://github.com"
revision="lineage-17.1"/>
<remote name="kernel"
fetch="https://github.com"
revision="tucana-q-oss"/>
<remote name="hardware"
fetch="https://github.com"
revision="lineage-17.1" />
<!--Device Trees-->
<project path="device/xiaomi/tucana"
name="alibei/android_device_xiaomi_tucana" remote="device" />
<!-- Kernel-->
<project path="kernel/xiaomi/tucana"
name="MiCode/Xiaomi_Kernel_OpenSource" remote="kernel" />
<!-- Vendor folders -->
<project path="vendor/xiaomi/tucana"
name="alibei/android_vendor_xiaomi_tucana" remote="vendor" />
<!-- <project path="hardware/xiaomi"
name="LineageOS/android_hardware_xiaomi" remote="hardware"/> -->
</manifest>
I had a warning about using pre-built kernel and I commented out the usage of prebuilt one and pointed to vendor/tucana_user_defconfig (user means it wont work in userdebug?).
I've also 'fixed' some not-localized strings in some manifests (made them unlocalized, unfortunately lost changes in a repo sync --force sync..) - not big changes that cannot be re-done..
But the end result was a zipfile that when flashed, set me into bootloop to fastboot..
I did flash @alibei's lineage-18.1 and that works. Also, I've tried @Chemuski1's vendor/device repos (various other errors I can't remember).
So the question is, what xml file should I use to build a version of this?
(additional Qs: what are you folks using as a kernel for this device? Is the MiCode one any good? Is there guide to extract the vendor and device files myself?).
Thanks!
P.S. I'm not interested in some advanced android feature for this, mainly the most important peripherals to work (GSM, camera)
Spoiler: Original post 2
ORIGINAL POST 2:​I have gotten one step closer: I managed to build the kernel (only) with instructions from MiCode , qcom clang 8.0 and these changes.
Now I need to test that it boots by re-packing it into boot.img and dtbo.img.
But first, I need to be able to unpack and repack the boot.img and dtbo.img from the device without any changes.
I did manage to unpack boot.img and repack it back (same kernel) and make it boot, with instructions more or less here https://gist.github.com/b100dian/40c8dbe746ff181aff71ee10a75a5f3c
What id did _not_ manage is to do the same (unpack/repack) test for dtbo.img
It seems the image from tucana has .dtb files but also a kernel.
(the size is 32M and unmkbootimg actually extracts a kernel from it, while imjtool actually extracts dtb files)
So the next question is: have you ever seen a dtbo.img with both dtb files and kernel and if so, what to use to extract it all and repack it?
(I have a booting lineage-17.1, not everything working, editing first post and title now)
For the wifi and audio you have to setup the config for modules. I think in my other thread on update 2 it has it on the bottom. It will add it during the build process.
Only managed to add wifi myself. Audio I am unable to merge in. Micode has the sources for wifi audio and drivers. Hope it helps, so you can add it.
I think in my case the vendor proprietary blobs are not complete, looking for the way to extract then afresh. If that fails then I'll follow up with your BoardConfig wifi changes. Thank!
Update: audio and wlan kernel modules are now build inline and work. Thanks @Squida for the nudge in the right direction!
Update: ultrasound proximity works after https://github.com/b100dian/Xiaomi_Kernel_OpenSource/commit/3c8506f460b405e8af6851e7d875212dde3ca8a6 (at least if you boot the kernel with MIUI, haven't tested with lineage)

Categories

Resources