Hi Everyone,
I have recently decided to build a custom ROM for my Nexus 5 and I've set up the VM and downloaded the source code. I'm a little confused when it comes to making my modifications. Do I stay on the Google repo and just modify from there (using git add, git commit and then repo sync)? Or am I supposed to create my own to save all of my modifications.
Thanks in advance
(Sorry if this is in the wrong place, I'm a little unsure about where this should be posted.)
p3ntyne said:
Hi Everyone,
I have recently decided to build a custom ROM for my Nexus 5 and I've set up the VM and downloaded the source code. I'm a little confused when it comes to making my modifications. Do I stay on the Google repo and just modify from there (using git add, git commit and then repo sync)? Or am I supposed to create my own to save all of my modifications.
Thanks in advance
(Sorry if this is in the wrong place, I'm a little unsure about where this should be posted.)
Click to expand...
Click to collapse
repo sync will erase all your changes and sync with AOSP.
You'll want to push your changes to a Github (or similar) repository, and create your manifest to init from, as well as to sync from your own repos instead of using Google's AOSP ones.
e.g. https://github.com/Elluel/elluel_manifest, https://github.com/Elluel?tab=repositories
Elluel said:
repo sync will erase all your changes and sync with AOSP.
You'll want to push your changes to a Github (or similar) repository, and create your manifest to init from, as well as to sync from your own repos instead of using Google's AOSP ones.
e.g. https://github.com/Elluel/elluel_manifest, https://github.com/Elluel?tab=repositories
Click to expand...
Click to collapse
Thanks! So, am I right in saying that I should 'repo init -u' to my repository and this 'git clone' AOSP into it? If so, how would I update the Android version without wiping the modifications I've made? And secondly, I have created a repo in github but I'm not sure how to how to create a manifest.
Elluel said:
repo sync will erase all your changes and sync with AOSP.
Click to expand...
Click to collapse
There's a way around that.
Create a new local branch, have git set it to track whatever tag or remote branch you want. Make your changes in that new branch.
When you repo sync after this, repo will try to merge upstream commits onto your local branch, fast forwarding your own changes, instead of discarding them.
beekay201 said:
There's a way around that.
Create a new local branch, have git set it to track whatever tag or remote branch you want. Make your changes in that new branch.
When you repo sync after this, repo will try to merge upstream commits onto your local branch, fast forwarding your own changes, instead of discarding them.
Click to expand...
Click to collapse
Thanks, but it seems like the method of creating my own repo would be easier. I'm just confused about the manifest and if I should clone AOSP into my repo...
p3ntyne said:
Thanks, but it seems like the method of creating my own repo would be easier. I'm just confused about the manifest and if I should clone AOSP into my repo...
Click to expand...
Click to collapse
Whatever makes you go. I wasn't really talking to you, but hey, if you know git, this is trivial.
How difficult is it to build your own rom? Is it worth learning or do I need programing skills? I have modified a little bit of code before but using guides ect.. Could I use a guide to build my own ROM or is there a lot more to it?
It is not that difficult once you have your build environment set up. Lots of guides to help you, hint it is not device specific (I mean the concept of building, it is when you are building). I first started using slim, check out the slim builders collective, lots of info there.
beekay201 said:
There's a way around that.
Create a new local branch, have git set it to track whatever tag or remote branch you want. Make your changes in that new branch.
When you repo sync after this, repo will try to merge upstream commits onto your local branch, fast forwarding your own changes, instead of discarding them.
Click to expand...
Click to collapse
Well yeah, but I was saying if he just simply went and used it without making a local branch lol.
wangdaning said:
It is not that difficult once you have your build environment set up. Lots of guides to help you, hint it is not device specific (I mean the concept of building, it is when you are building). I first started using slim, check out the slim builders collective, lots of info there.
Click to expand...
Click to collapse
Do I need to use Linux to build? So I'd need a vm with umbuntu? how much ram would I need? I'd love to build a stock rom with only the tweaks I need, I love lite ROMs and every aosp ROM feels so much faster than the others. Just feels like every ROM out there is always near perfect but has something I'd have to compromise. I'm thinking about 5.1 stock with xposed when its stable but maybe a self built ROM would be better if I am able to build it.
cyberdude020 said:
Do I need to use Linux to build? So I'd need a vm with umbuntu? how much ram would I need? I'd love to build a stock rom with only the tweaks I need, I love lite ROMs and every aosp ROM feels so much faster than the others. Just feels like every ROM out there is always near perfect but has something I'd have to compromise. I'm thinking about 5.1 stock with xposed when its stable but maybe a self built ROM would be better if I am able to build it.
Click to expand...
Click to collapse
Yes, you will be building on Linux. RAM isn't a huge issue, even 4GB would probably be more than enough. If you have a very poor performing CPU however, it'll probably take many hours for the first clean build.
Elluel said:
Yes, you will be building on Linux. RAM isn't a huge issue, even 4GB would probably be more than enough. If you have a very poor performing CPU however, it'll probably take many hours for the first clean build.
Click to expand...
Click to collapse
OK thanks, I have six core at 3.5 GHz and 4gb of ram, used to have 8gb but one stick went bad. I could always buy another 4gb stick if i run low on memory. I'll look at some YouTube videos to see if it looks like something I could do.
cyberdude020 said:
OK thanks, I have six core at 3.5 GHz and 4gb of ram, used to have 8gb but one stick went bad. I could always buy another 4gb stick if i run low on memory. I'll look at some YouTube videos to see if it looks like something I could do.
Click to expand...
Click to collapse
Your CPU is fairly decent. Some people have built on cheap/thin laptops (Intel Atom, etc..) and it takes them 12-24 hours for a clean build.
If you're running in a VM and your entire system only has 4GB it could possibly be an issue if you're unlucky, but running it natively should definitely be fine.
I wouldn't look at YouTube videos as they are probably much harder to follow. There are plenty of written guides on XDA, a quick Google search will yield many results.
---------- Post added at 12:46 ---------- Previous post was at 12:18 ----------
p3ntyne said:
Thanks, but it seems like the method of creating my own repo would be easier. I'm just confused about the manifest and if I should clone AOSP into my repo...
Click to expand...
Click to collapse
You can clone the AOSP manifest I guess (5.0.2: https://android.googlesource.com/platform/manifest/+/refs/heads/android-5.0.2_r1)
Then create a new branch in the manifest, call it whatever you like (when you init from this manifest, you'll reference the manifest branch, e.g. to init from mine, you use "repo init -u https://github.com/Elluel/elluel_manifest.git -b lollipop", where "lollipop" is the my manifest branch's name).
If you look at default.xml (https://android.googlesource.com/platform/manifest/+/refs/heads/android-5.0.2_r1/default.xml), then look at mine (https://github.com/Elluel/elluel_manifest/blob/lollipop/default.xml), you will see a difference.
The beginning part defines remote locations.
e.g. in mine I have additionally added:
Code:
<remote name="rascarlo"
fetch="git://github.com/rascarlo/" />
<remote name="Elluel"
fetch="git://github.com/Elluel/" />
<remote name="lichti1901"
fetch="git://github.com/lichti1901/" />
<remote name="CyanogenMod"
fetch="git://github.com/CyanogenMod/" />
<remote name="linaro"
fetch="git://github.com/ArchiDroid" />
Then if we look at the referenced projects:
I'll use frameworks/base as an example, line 282 in the AOSP default.xml:
Code:
<project path="frameworks/base" name="platform/frameworks/base" groups="pdk-cw-fs" />
then if we look at mine:
Code:
<project path="frameworks/base" name="android_frameworks_base" groups="pdk-cw-fs" remote="Elluel" revision="lollipop" />
"path" is the directory the project will be stored when manifest is synced from (you'll usually leave this alone)
"name" is the name/location of the remote repo (note my Github uses "android_frameworks_base" instead of "platform/frameworks/base" so I changed it here as such)
"remote" is the remote to fetch it from, as defined at the beginning of the manifest (in this case "Elluel", which was defined as "git://github.com/Elluel")
"revision" is the branch of the remote repo to sync from (if you look at my android_frameworks_base, my main branch is named "lollipop")
If the remote or revision is not defined, it will use the default revision, which is also at the beginning of the manifest with the remotes, in the "default" tag (best to leave this alone unless you want to fork/clone every single AOSP repo and keep up with them all lol..):
Code:
<default revision="refs/tags/android-5.0.2_r1"
remote="aosp"
sync-j="8" />
You'll probably fork/clone the AOSP repos then push them to your Github, create your new manifest branch then add your Github remote, and point the projects at your Github repos + branches instead of AOSP.
Elluel said:
Your CPU is fairly decent. Some people have built on cheap/thin laptops (Intel Atom, etc..) and it takes them 12-24 hours for a clean build.
If you're running in a VM and your entire system only has 4GB it could possibly be an issue if you're unlucky, but running it natively should definitely be fine.
I wouldn't look at YouTube videos as they are probably much harder to follow. There are plenty of written guides on XDA, a quick Google search will yield many results.
---------- Post added at 12:46 ---------- Previous post was at 12:18 ----------
You can clone the AOSP manifest I guess (5.0.2: https://android.googlesource.com/platform/manifest/+/refs/heads/android-5.0.2_r1)
Then create a new branch in the manifest, call it whatever you like (when you init from this manifest, you'll reference the manifest branch, e.g. to init from mine, you use "repo init -u https://github.com/Elluel/elluel_manifest.git -b lollipop", where "lollipop" is the my manifest branch's name).
If you look at default.xml (https://android.googlesource.com/platform/manifest/+/refs/heads/android-5.0.2_r1/default.xml), then look at mine (https://github.com/Elluel/elluel_manifest/blob/lollipop/default.xml), you will see a difference.
The beginning part defines remote locations.
e.g. in mine I have additionally added:
Code:
<remote name="rascarlo"
fetch="git://github.com/rascarlo/" />
<remote name="Elluel"
fetch="git://github.com/Elluel/" />
<remote name="lichti1901"
fetch="git://github.com/lichti1901/" />
<remote name="CyanogenMod"
fetch="git://github.com/CyanogenMod/" />
<remote name="linaro"
fetch="git://github.com/ArchiDroid" />
Then if we look at the referenced projects:
I'll use frameworks/base as an example, line 282 in the AOSP default.xml:
Code:
<project path="frameworks/base" name="platform/frameworks/base" groups="pdk-cw-fs" />
then if we look at mine:
Code:
<project path="frameworks/base" name="android_frameworks_base" groups="pdk-cw-fs" remote="Elluel" revision="lollipop" />
"path" is the directory the project will be stored when manifest is synced from (you'll usually leave this alone)
"name" is the name/location of the remote repo (note my Github uses "android_frameworks_base" instead of "platform/frameworks/base" so I changed it here as such)
"remote" is the remote to fetch it from, as defined at the beginning of the manifest (in this case "Elluel", which was defined as "git://github.com/Elluel")
"revision" is the branch of the remote repo to sync from (if you look at my android_frameworks_base, my main branch is named "lollipop")
If the remote or revision is not defined, it will use the default revision, which is also at the beginning of the manifest with the remotes, in the "default" tag (best to leave this alone unless you want to fork/clone every single AOSP repo and keep up with them all lol..):
Code:
<default revision="refs/tags/android-5.0.2_r1"
remote="aosp"
sync-j="8" />
You'll probably fork/clone the AOSP repos then push them to your Github, create your new manifest branch then add your Github remote, and point the projects at your Github repos + branches instead of AOSP.
Click to expand...
Click to collapse
Thanks! I just reset the VM so I could start fresh and typed in
Code:
repo init -u https://github.com/p3ntyne/Lollipop-ROM.git
(which is the name of the repo I created). The only issue I'm having is that it says:
Code:
fatal: manifest 'default.xml' not available
fatal: manifest default.xml not found
p3ntyne said:
Thanks! I just reset the VM so I could start fresh and typed in
Code:
repo init -u https://github.com/p3ntyne/Lollipop-ROM.git
(which is the name of the repo I created). The only issue I'm having is that it says:
Code:
fatal: manifest 'default.xml' not available
fatal: manifest default.xml not found
Click to expand...
Click to collapse
If you look here: https://github.com/p3ntyne/Lollipop-ROM
You're missing a default.xml, you can clone/fork/whatever it from the AOSP version tree you're building, then create a new branch in your manifest repo and modify it from there.
Elluel said:
If you look here: https://github.com/p3ntyne/Lollipop-ROM
You're missing a default.xml, you can clone/fork/whatever it from the AOSP version tree you're building, then create a new branch in your manifest repo and modify it from there.
Click to expand...
Click to collapse
Right. Well I forked Android but it created an entirely new repository. Is that what's supposed to happen? Anyway, I created a new branch named "Modifications" but I want to make sure It's correct before I sync it. BTW, the new repository is called 'p3ntyne/android'. Can I change the name to the name of my ROM? (Sorry if I'm annoying but I'm compeletely new to modifying any source code despite having done some development before!)
And, how do you think building would be on a computer with a 1.7 - 3.3GHz i7 with a VM assigned to 2 threads, 6 Gb's RAM and 200 GB SSD space?
Thanks for all your help so far!
p3ntyne said:
Right. Well I forked Android but it created an entirely new repository. Is that what's supposed to happen? Anyway, I created a new branch named "Modifications" but I want to make sure It's correct before I sync it. BTW, the new repository is called 'p3ntyne/android'. Can I change the name to the name of my ROM? (Sorry if I'm annoying but I'm compeletely new to modifying any source code despite having done some development before!)
And, how do you think building would be on a computer with a 1.7 - 3.3GHz i7 with a VM assigned to 2 threads, 6 Gb's RAM and 200 GB SSD space?
Thanks for all your help so far!
Click to expand...
Click to collapse
You forked Github's Android app, not AOSP source LOL
You want to fork the AOSP manifest repo (relevant to the Android version), create a new branch on it, then point it at your own other repos, as shown in my previous post (then push it to your Github of course).
You can name a repo whatever you want as long as the manifest points to it's name correctly (most people leave this alone to avoid confusion when other people look at it).
Your initial build ("clean") will probably take around 3–6 hours (maybe more), subsequent builds ("dirty") should be much faster, as if you have it set up correctly, it'll only need to recompile parts that were changed.
Elluel said:
You forked Github's Android app, not AOSP source LOL
You want to fork the AOSP manifest repo (relevant to the Android version), create a new branch on it, then point it at your own other repos, as shown in my previous post (then push it to your Github of course).
You can name a repo whatever you want as long as the manifest points to it's name correctly (most people leave this alone to avoid confusion when other people look at it).
Your initial build ("clean") will probably take around 3–6 hours (maybe more), subsequent builds ("dirty") should be much faster, as if you have it set up correctly, it'll only need to recompile parts that were changed.
Click to expand...
Click to collapse
Ok. So I think I understand now. So I run repo init to the original google source, then create a branch and then link that branch to my github (somehow?!) Is that right?
p3ntyne said:
Ok. So I think I understand now. So I run repo init to the original google source, then create a branch and then link that branch to my github (somehow?!) Is that right?
Click to expand...
Click to collapse
1. You init and sync to AOSP source
2. Create a new branch in the manifest
3. Push your manifest to a Github repo.
Then when you modify other parts/repos of the source:
1. Create a branch then push that to another new Github repo
2. Point your manifest at this new Github repo (as my previous posts described)
If you're still confused look at my Github's manifest, then look at my other Github repositories, it might give you a general idea.
Elluel said:
1. You init and sync to AOSP source
2. Create a new branch in the manifest
3. Push your manifest to a Github repo.
Then when you modify other parts/repos of the source:
1. Create a branch then push that to another new Github repo
2. Point your manifest at this new Github repo (as my previous posts described)
If you're still confused look at my Github's manifest, then look at my other Github repositories, it might give you a general idea.
Click to expand...
Click to collapse
Thanks - that makes more sense. So, just to summarise once more, once repo sync is finished, I navigate to the manifest and type repo start (name of the branch) . ? And then repo upload to push it to github? How will it know to go into my one?
Thanks again.
Hey folks,
i'm trying to get a "vanilla" aka unmodified device tree for the Shield Tablet K1. I know that you can sync over from nvidia's gitweb, tough the device tree is looking weird.
When i look at let's say cm's android_device_nvidia_shieldtablet it looks different. So i wonder how i would go from nvidias mutated tree to cm's layout without actually just forking it from cm.
Reason is, i want to port another custom rom over to the shield tablet, but i can't neither figure out how i'd do that with nvidias sources, nor how i would create a device tree similar to cm's, without any modifications.
I googled around for about 2-3 months now and still have no clue, so if anyone could give me a hint, i'd be very grateful!
What's wrong with the cm tree?
Unjustified Dev did the initial port of everything by hand. I've done maintainance manually since then. And to my knowledge, there's only been one other person to do a manual conversion (vartom). All custom ROMs derive from my tree. Should work in aosp as well. If there's something you need different from the cm tree, you can just add it on top. Or if something is broke in general, I need to know and fix it.
There's nothing "wrong", just not " clean", if you catch my drift. It's just a matter of reverting inwanted things, but yeah.. feels dirty.
Anyways, thanks for the info, man.
*shrugs* Okay, if you want to set up a new tree, nothing's stopping you. I wouldn't mind someone else knowing how to do it (pretty sure I'm the only active dev that has experience there), but it's a lot of parsing and research. I'll say that CMs trees are 95% unmodified from Nvidia's upstream, though. It's just rearranged into an aosp style tree. The kernel is a merge of the console and tablet since they were 98% identical anyways. I do my best to keep everything as clean as possible since I don't want to do through the work of making a lot of modifications every time a new release comes out... Engineers are lazy like that. I think the only things that aren't pure identical copies are the LTE init files and the unified device stuff (making the wifi only and lte models work in one ROM).
Nah, don't get me wrong there, i don't want to discredit you there.
I'm more talking about cm specific things like gello browser and stuff. Like i said, just a matter of a few changes to not include these. I'm just a beginner in any way, i can just follow instructions at best, i don't know c, and almost no java at all. So what you do is an astounishing task - it's just a personal preference coming and starting with nexus devices to tinker around, i have had the luxury of an AOSP tree, that's pretty much "my dilemma". I'm unexperienced and thus this might take a while for me. I've started to modify your device tree the day before yesterday, but i have something done wrong, as when i start compiling it'll ask if it should use " full_eng" config. (6.0.1 is used)
Again, thanks for putting me in the right direction, also for your efforts in maintaining our device.
What ROM are you trying to build? You could look at Carbonrom or Blissrom to see the rename changes needed to use the tree in a different ROM. Those should be similar across the board. I think the only CM specific package references would be gello and snap. Those commits could be reverted easily enough. Or if the ROM doesn't have them, I think they'd be ignored even if left as is.
Hi,
you can take a look at here
the base was the official cm tree, this is not vanilla but it s a K1 only tree.
Steel01 said:
What ROM are you trying to build? You could look at Carbonrom or Blissrom to see the rename changes needed to use the tree in a different ROM. Those should be similar across the board. I think the only CM specific package references would be gello and snap. Those commits could be reverted easily enough. Or if the ROM doesn't have them, I think they'd be ignored even if left as is.
Click to expand...
Click to collapse
I'm trying to port OmniROM https://docs.omnirom.org/Porting_Omni_To_Your_Device
Shouldn't be that difficult, i'm just doing something wrong.
kylon said:
Hi,
you can take a look at here
the base was the official cm tree, this is not vanilla but it s a K1 only tree.
Click to expand...
Click to collapse
Thank you, man.
I've forked it and will use it as a base.
Oh, omni. I build TWRP from omni. Take a look at the following two commits.
https://github.com/TeamWin/android_...mmit/c8e564a5ea44d963ab8d0e7829d9becd2ad5b0c0
https://github.com/TeamWin/android_...mmit/9b8772627795492f3380d2bf86680c09aada92c9
I haven't built the full ROM, but that should work. If you're using a K1 specific tree, the only difference should be in omni_shieldtablet.mk, instead of gsm.mk, use whatever omni has for tablet wifi only.
Steel01 said:
Oh, omni. I build TWRP from omni. Take a look at the following two commits.
https://github.com/TeamWin/android_...mmit/c8e564a5ea44d963ab8d0e7829d9becd2ad5b0c0
https://github.com/TeamWin/android_...mmit/9b8772627795492f3380d2bf86680c09aada92c9
I haven't built the full ROM, but that should work. If you're using a K1 specific tree, the only difference should be in omni_shieldtablet.mk, instead of gsm.mk, use whatever omni has for tablet wifi only.
Click to expand...
Click to collapse
Thank you, man. In fact i heavily orientaded on TWRP sources in this case. Also took a look at zombipop's repo.
Still whatever i do all i get is
[[email protected] omni]$ brunch shieldtablet
build/core/product_config.mk:241: *** No matches for product "omni_shieldtablet". Stop.
WARNING: Trying to fetch a device that's already there
Traceback (most recent call last):
File "build/tools/roomservice.py", line 352, in <module>
fetch_device(device)
File "build/tools/roomservice.py", line 320, in fetch_device
git_data = search_gerrit_for_device(device)
File "build/tools/roomservice.py", line 81, in search_gerrit_for_device
device_data = check_repo_exists(git_data, device)
File "build/tools/roomservice.py", line 58, in check_repo_exists
"exiting roomservice".format(device=device))
Exception: shieldtablet not found,exiting roomservice
build/core/product_config.mk:241: *** No matches for product "omni_shieldtablet". Stop.
** Don't have a product spec for: 'omni_shieldtablet'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
Click to expand...
Click to collapse
Oh, brunch won't work because it wants to sync from the upstream server. Use lunch instead. Then run make to build.
Steel01 said:
Oh, brunch won't work because it wants to sync from the upstream server. Use lunch instead. Then run make to build.
Click to expand...
Click to collapse
Looks like a derp moment, i just had to modify the devicetree in another directory which is the actual working dir, instead on androidsrc/device/nvidia/shieldtablet directly. Like i said i just did something wrong.
It' compiling now, thank you for all the support!