[ROM][DEV][WIP] Ubuntu-Touch port - ONE Android Development

I noticed that there is no current port going or started for ubuntu touch, so today i thought i would start that project.
the first thing i noticed was that ubuntu's documentation for porting is one of the worst things ive ever seen, so this will probably end up being kind of a guide until we get a working image or something.
first thing is you will absolutely need Linux. Im using ubuntu for ease of use, although I do build android on arch.
I set up a directory structure on my pc just for android development. i have ~/android/platforms/ in which i have cm11, ubuntu-touch carbon, etc.
so to summarize how i got this started:
Code:
$ mkdir ~/android/platforms/ubuntu-touch-phablet-4.2.2_r1
$ cd ~/android/platforms/ubuntu-touch-phablet-4.2.2_r1
$ repo init -u git://phablet.ubuntu.com/aosp/platform/manifest.git -b phablet-4.2.2_r1 && repo sync -j16
Now im really hoping that is the correct branch. I tried to follow the "porting guide" and its just full of out dated information that lead me to sync a few repos incorrectly. :silly:
after a few failed builds and some common error logs i finally figured i was on the wrong branch. This attempt shall be on 4.2.2_r1 as that appears to be the latest. (I hope)
anyway the rest is still in progress. My sources will be on github for people to help out.
Device
Kernel
also: im on irc on freenode at #oudhitsquad pressy4pie
[update]
i have a huge problem in the real world, so i will have virtually no time to get this updated for now. I am really sorry, hopefully i can get it going again soon
XDA:DevDB Information
Ubuntu Touch , ROM for the ONEPLUS ONE
Contributors
konnorrigby
Version Information
Status: Testing
Created 2014-09-24
Last Updated 2014-10-13

cool mate! thanks for that...cheers!

Nice. Would love to give a hand here, I'll visit the Ubuntu workshop at devcon this weekend to learn some new fresh information about porting. Maybe I'll give it a try later too.

Good news!
Looking forward to see the first builds getting ready for testing.
:good::highfive:

Mackis said:
Good news!
Looking forward to see the first builds getting ready for testing.
:good::highfive:
Click to expand...
Click to collapse
This will take a while. As you can see in OP, there are problems with the porting guide from Ubuntu. When I get back from devcon, I hope to know more about porting.

So turns out i was in fact syncing the wrong repo again. shame on me for following a ubuntu guide. it appears there is a 4.4_r1 repo also. Syncing again. I have a fairly slow connection. ill see what i can get done on 4.2.2_r1 though in the mean time

I have high hopes...
Would like to a working rom.. Wish you best of luck and hope its smooth sailing...

Thanks for scarifying your time and efforts for us
Couple of month ago I wanted to port it for my lenovo phone, but I gave up (sources limited)
Anyway, to say that I went on the IRC channel to get some support, they are willing to help (even though you have to be patient, it's IRC, hundreds of people connected nobody on their computer.). So they told me that (as you noticed) the porting manual is outdated, and they are now basing their port on AOSP. Tthis should not be a problem to use CM though.
So try to get some help there, they know what you have to do
I could give a hand, I have a good internet connection. Could you post all the command history you ran, so I can try on my side?
cheers

ive got some progress, i think.
ubuntu-touch has rebased to aosp rather than cyanogenmod, which makes things a lot more difficult.
if youve ever tried to build something that is not a nexus device against aosp it is a huge pain in the ass. Bacon has a lot of cm specific parts that need to built so it is difficult to get it to build w/ aosp. but to explain where i am currently, i synced 4.4_r1, and now since aosp doesnt build kernel and bacon requires kernel to be packed up with dtb and stuff, i went to my cm11.0 repo, did my ubuntu-touch modifications to kernel, did
Code:
lunch cm_bacon-userdebug && make -j32 bootimage
which (i think) gives me the correct bootimage. What we need now is the android part. i am building inside the ubuntu-touch-4.4_r1 dir with:
Code:
lunch aosp_bacon-userdebug && make -j32 systemimage
that eventually errors out to:
Code:
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar', needed by `out/target/common/obj/JAVA_LIBRARIES/qcmediaplayer_intermediates/classes-full-debug.jar'. Stop.
make: *** Waiting for unfinished jobs....
im not sure why because as far as i know, ubuntu-touch shouldnt be building java parts and that is the first part of building the java stuff in a regular android build. ive never ported ubuntu-touch before. so someone let me know if ive messed something up. i dont think there is something in the device makefiles that starts the java build.
any help

just in case, are you using opensources java or oracle one? I am pretty sure it doesn't work with opensource java. But i would expect that you get the error earlier...

I'm not sure if you already have this or not but Oneplus has aosp kernel sources at https://github.com/OnePlusTech/android_kernel_oneplus_one .

konnorrigby said:
ive got some progress, i think.
ubuntu-touch has rebased to aosp rather than cyanogenmod, which makes things a lot more difficult.
if youve ever tried to build something that is not a nexus device against aosp it is a huge pain in the ass. Bacon has a lot of cm specific parts that need to built so it is difficult to get it to build w/ aosp. but to explain where i am currently, i synced 4.4_r1, and now since aosp doesnt build kernel and bacon requires kernel to be packed up with dtb and stuff, i went to my cm11.0 repo, did my ubuntu-touch modifications to kernel, did
Code:
lunch cm_bacon-userdebug && make -j32 bootimage
which (i think) gives me the correct bootimage. What we need now is the android part. i am building inside the ubuntu-touch-4.4_r1 dir with:
Code:
lunch aosp_bacon-userdebug && make -j32 systemimage
that eventually errors out to:
Code:
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar', needed by `out/target/common/obj/JAVA_LIBRARIES/qcmediaplayer_intermediates/classes-full-debug.jar'. Stop.
make: *** Waiting for unfinished jobs....
im not sure why because as far as i know, ubuntu-touch shouldnt be building java parts and that is the first part of building the java stuff in a regular android build. ive never ported ubuntu-touch before. so someone let me know if ive messed something up. i dont think there is something in the device makefiles that starts the java build.
any help
Click to expand...
Click to collapse
Just post any further errors you'll get here and I'll try to get help at devcon this weekend. Keep it up!

b8e5n said:
just in case, are you using opensources java or oracle one? I am pretty sure it doesn't work with opensource java. But i would expect that you get the error earlier...
Click to expand...
Click to collapse
im using oracle, but that isnt the problem. Ubuntu-touch takes the java out so its not there for a reason but something is causeing it to want to build the java parts..
i think im going to go ahead and fork hammerhead which i know builds, and give it 1+1 parts.

konnorrigby said:
im using oracle, but that isnt the problem. Ubuntu-touch takes the java out so its not there for a reason but something is causeing it to want to build the java parts..
i think im going to go ahead and fork hammerhead which i know builds, and give it 1+1 parts.
Click to expand...
Click to collapse
Good Idea! Let us know

I met @ciwrl at devcon, he'll come here and tell you how to squash that problem.

Great to see someone working on it.
Will bookmark this topic

News?

This is exciting to see, I'd love to try Ubuntu touch on the OPO. I have Ubuntu, but I'm mainly in Linux Mint, or Kali. Let me know if there is anyway I can assist with testing, Web storage/hosting, etc.

@konnorrigby, as @ciwrl suggested at devcon, you should disable the whole java part from the build. Ubuntu doesn't need any of it to build and run.

Wow! I really want to see Ubuntu on my OnePlus one. really Excited. Good luck guys

Related

[Q] build from source help

I am attempting to build AOKP from source, mainly just to learn a little more about how it all work so I can get more into development to help out around here rather than just mooch off of the very talented devs in this forum.
I have followed the guide posted here
http://forum.xda-developers.com/showthread.php?t=1552090
and changed what needed to be changed for the AOKP source.
when attempting ./extract-files.sh, i get errors stating that certain files are not on my phone(I am running stephen's AOKP 30.1 Glitched).
When I attempt to build, the first error I get is
make: *** No rule to make target `vendor/samsung/fascinatemtd/proprietary/gps.xml', needed by `out/target/product/fascinatemtd/system/vendor/etc/gps.xml'. Stop.
make: *** Waiting for unfinished jobs....
and then kicks me back to the command prompt.
GPS.xml is one of the files that the ./extract-files.sh does not find.
Please tell me what I am doing wrong?
Should I be on an official build of AOKP to do this? I didn't think stephen changed that much in the ROM. Or should/could I be on stock to pull these files?
Any help is greatly appreciated, I am hoping to get this figured out so I can help dev for some of the devices around here.
thanks,
Kyle
You shouldn't need to run the extract script, the proprietary files are already in the repo. Just sync and build!
What he said... and a little bit better of a tip. Switch Github/AOKP to Github/AOKPSGS and you get our glitched up repo.... be warned I mess around a lot in there...
Sent from my Glitched AOKP Unicorn.
Thanks Stephen, switching the repo now. I think there may a problem with the AOKP github, looking at the fascinatemtd-vendo-blobs.mk file, the one from the AOKP github calls for a few proprietary files like the GPS.xml that are not in the vendor/samsung/fascinatemtd/proprietary folder which was tripping me up. Looking at the one from your AOKPSGS, it doesn't call for it.
I'll wait for this repo to sync and give it another try and report back.
Update:
Worked like a charm! Thanks! Now to start digging around!

Attempting to start developing

Im going to try and start to develop for the Rezound. Iv decided that I would to take on JB head on, i know its very unlikely that I will make a stable JB rom but i want to try at least, I have the SDK and jb source already i just dont know where to start with JB, if anyone could help that would be great thanks.
I think Joel has JB booting.
The best place to start is modifying other ROMs with the android kitchen. Gives you a feel for how things work.
GrayTheWolf said:
I think Joel has JB booting.
The best place to start is modifying other ROMs with the android kitchen. Gives you a feel for how things work.
Click to expand...
Click to collapse
Nope. jonman www.github.com/JB1tz
I knew it was jo-something.
Good luck! Glad to see you're getting your feet wet.
Looking forward to your JB ROMs in the near future.
The Beeb
Building from source is a lot different than building a kitchen ROM but as Wolf said you might want to start there to at least learn a few things and the program is pretty easy to learn. The kitchen requires a functioning ROM to build from so not sure you could do JB. The AOSP website has a lot of information about building from source but you'll find the directions they give are for building for the nexus devices. AOSP is strictly for Linux or MAC (maybe windows under a virtual machine) and is pretty straight forward for getting it setup, I used Ubuntu 12 but getting a Linux box setup is as far as I took it as I got bored of it all. One of the devs here should have a github repository for JB and maybe you can join in on that or find some instructions on how to use the JB source you have to build for the Rezound. I would contact wildstang83 he's a pretty friendly guy who likes to help. Also get on IRC and start asking questions.
AOSP for setting up a build environment:
http://source.android.com/source/initializing.html
Android Kitchen:
http://forum.xda-developers.com/showthread.php?t=633246
kzoodroid said:
Building from source is a lot different than building a kitchen ROM but as Wolf said you might want to start there to at least learn a few things and the program is pretty easy to learn. The kitchen requires a functioning ROM to build from so not sure you could do JB. The AOSP website has a lot of information about building from source but you'll find the directions they give are for building for the nexus devices. AOSP is strictly for Linux or MAC (maybe windows under a virtual machine) and is pretty straight forward for getting it setup, I used Ubuntu 12 but getting a Linux box setup is as far as I took it as I got bored of it all. One of the devs here should have a github repository for JB and maybe you can join in on that or find some instructions on how to use the JB source you have to build for the Rezound. I would contact wildstang83 he's a pretty friendly guy who likes to help. Also get on IRC and start asking questions.
AOSP for setting up a build environment:
http://source.android.com/source/initializing.html
Android Kitchen:
http://forum.xda-developers.com/showthread.php?t=633246
Click to expand...
Click to collapse
Thanks for all the info, I have linux mint and as far as i can tell everything is set up
gearlo said:
Thanks for all the info, I have linux mint and as far as i can tell everything is set up
Click to expand...
Click to collapse
Then you're pretty much at were I left off setting up my linux box. I was going to try building for the GTab 7+ and there is a github repository for it for CM9 and CM10. Was just starting to learn how to connect to it when I lost interest. There is supposed to be some type of tutorial on the github site but I couldn't find it. I am also not sure if you need eclipse installed or not to use it. This is where you would need the help of a dev or someone else who's set up a linux box. I also didn't see a github for JB for the rezound but I also didn't look all that well just did a quick search.
wildstang, joel, newtoroot, nilsp I know build from source, or at least they did for the incredible, so they would be good sources of information and I know they've helped others in the past so don't mind pm's.
https://github.com/
Here's a tutorial I found on building from source might be some useful info there:
http://www.xda-developers.com/android/compiling-from-source-the-easy-way/
Here's a tutorial for AOKP:
http://forum.xda-developers.com/showthread.php?t=1810297
Maybe antp or wolf would help you setup too as I noticed their posts in the AOKP build forum?

ZTE Nubia Z7 Mini (NX507J) - ROM porting

This has been started for people interested in porting other ROM's for the Nubia Z7 Mini (NX507J). If you are interested in seeing/using/asking questions about ROM's that currently exist, please use the thread created by @Seyron here. I previously posted the following information on that thread, but feel a new thread will be better so the other can be used for people with questions about existing ones.
I'm not sure what you mean by a good background for going at it; however, I think having a good understanding of computers and even some basic programming is very helpful. As for myself, everything is self-taught. I'm pretty familiar with mac, PC, and linux. Even if you are completely new at it, there is lots of good information out there - I would just encourage you to start by learning from credible and well established sources. I have only tried porting for nubia Z7 mini - no other android. I previously used the iphone (and am frankly glad I now have android).
It really depends on whether you want to do a simple port (that's how I call it - don't know if there's an official way of calling it) or port from source. If you are doing a simple port, you can use any computer (mac, pc, linux); however, if you want to port/build from source it is by far the easiest to do it from Linux. There are many resources out there for building/porting from linux - most of which are using Ubuntu. I personally use Debian (which incidentally Ubuntu was created from; however, they are now each distinct and different), but you could use most any linux distro as long as you are comfortable using the command line. Also, if you are using linux, make sure you have enough hard drive space available (most recommended is at least 30GB) and have enough RAM (I have 16GB - minimum recommended is 8GB). It's also very helpful if you have a large swap set up as it makes building go faster. Once you have everything put together, compiling/building takes 3-5 hours depending on the specs of your computer. I have a 1.7ghz i5 in my computer and it is slow - 4-5 hour range for me.
For the sources list below, please note I have no affiliation with them and do not know them. Use at your own risk, I assume no responsibility for what may happen to your computer or phone.
I think some of the best (and frankly most detailed) information comes from the android source code website and from XDA-University.
https://source.android.com/index.html
XDA-University
For what I call simple porting, can be done on any computer - this was the site I started with and it seemed to work except that I kept getting boot loop issues. There are many other sites out there with nearly identical information. This person uses a PC, but you can adjust it quite simply for doing this on mac or linux too:
http://seekandroid.info/2014/05/porting-android-roms-for-your-phone.html
The following site/instructions are very interesting as they are different than any other site I found out there with porting instructions. I have not done it this way - primarily because I am concerned about "bricking" my phone. The method this person uses is the same; however, the files that they transfer are opposite to most any other site I've found. I have not used these instruction - be very cautious until someone else can confirm.
http://anythingsyouneed.blogspot.com/2014/06/how-to-port-custom-rom-rom-porting.html
This one seems interesting; however, I have not used anything on this website and have not used one of the Kitchen programs.
http://www.littlegreenrobot.co.uk/tutorials/how-to-cook-your-own-android-rom/
Android - excellent and very detailed. Personally I think most helpful to those with intermediate to advanced programming knowledge. Or at least have the ambition and time to learn.
https://source.android.com/source/building-devices.html
XDA-University - Truly amazing wealth of information, approachable for anyone from absolute beginners to advanced programers.
http://xda-university.com/as-a-developer
http://xda-university.com/as-a-developer/porting-aosp-roms-using-source-code
I've been busy and haven't had a chance to use these pages yet, but it's what I'm going to do next to try and solve the boot loop errors.
http://xda-university.com/as-a-user/zip-based-rom-tweaking
http://xda-university.com/as-a-user/how-to-recover-from-a-bootloop
If anyone has anything to add, please do. I'd be interested in seeing what else people use.
I haven't found the required sources to port from source, so I don't know if that's possible. Neither am I experienced in any of that.
In basic porting I do, however so far it has been unsuccesful for the Z7 Mini.
I have tried to port CM11S from the OPO, but it didn't work out, the phone became stuck in a bootloop, and logcat wasn't working to find out what's the problem of not booting. Might be dual-sim related but that should more likely run into a non-working sim/ril or a lot of crashes, not making it not booting at all.
I do wonder how they got the CM11 / Mokee with eng/ch languages to work. Tried using those as base too but that didn't do the trick.
To build completely from source you need to have the kernel source.
ZTE has not yet released it, but I'm hoping it will be released soon.
You can check here.
On Github there's a repo but it's apparently broken.
Anyway you can build cyanogenmod without having the kernel source (http://wiki.cyanogenmod.org/w/Doc:_porting_intro)
As soon as I get my own device I'll try that.
Nice, will follow this thread
I was trying to port the Z7 Max CM11 to the Z7 Mini, still work in progress because i'm new at this...
So, do you have any idea how the existing ROM's were ported then? If they weren't from source, we should be able to port others without getting the boot loop error - in theory. Not finding the kernel source is the main reason (besides finding the time) why I haven't worked on porting others. I also cannot find the vendor tree for the phone - which incidentally, may well be part of the kernel source. If you can port CM without source the others should be equally possible. Personally, I'm not interested in a CM based ROM (although a couple I listed in the other thread that I tried porting were CM based); I'm more interested in an AOSP based ROM. I wonder why ZTE has been so slow to release the kernel? Especially since they've released all the others (albeit not the other Z7's) and they have been so popular.
Also, as I stated in the other thread, I was able to get a couple to boot, but they were stuck in boot loop issues. I forgot to use logcat to see what the issue was.
@voetbalremco I agree with you, how did they get MoKee and MIUI to work? I tried using MoKee as base too - though didn't try MIUI. Does anyone know if it's possible to extract the kernel from the current stock ROM?
pierg75 said:
To build completely from source you need to have the kernel source.
ZTE has not yet released it, but I'm hoping it will be released soon.
You can check here.
On Github there's a repo but it's apparently broken.
Anyway you can build cyanogenmod without having the kernel source (http://wiki.cyanogenmod.org/w/Doc:_porting_intro)
As soon as I get my own device I'll try that.
Click to expand...
Click to collapse
pedrud said:
So, do you have any idea how the existing ROM's were ported then? If they weren't from source, we should be able to port others without getting the boot loop error
Click to expand...
Click to collapse
There are different ways to port a Rom...or you build it from scratch, so you compile everything. And for that you need source for every component.
Or you can use the various kitchens (this one for example) to repack and tweak an existent rom.
pedrud said:
Does anyone know if it's possible to extract the kernel from the current stock ROM?
Click to expand...
Click to collapse
You can do it with the kitchen above or using one of the tools available (like this one for example.
Probably everything can be done with dd (as mentioned in the cyanogenmod guide).
Hopefully my device will be her soon, so I can also try these as well
pierg75 said:
There are different ways to port a Rom...or you build it from scratch, so you compile everything. And for that you need source for every component.
Or you can use the various kitchens (this one for example) to repack and tweak an existent rom.
You can do it with the kitchen above or using one of the tools available (like this one for example.
Probably everything can be done with dd (as mentioned in the cyanogenmod guide).
Hopefully my device will be her soon, so I can also try these as well
Click to expand...
Click to collapse
Thanks for the resources! I think combining those two, plus the info on the CM website, and what's on XDA-University; I should be able to get this figured out. Now all I need to do is find the time.
Today my phone arrived! Tomorrow I'll pick it up and start to do some tests.
Sent from my Nexus 7 using Tapatalk
Here it is Kernel source code for NX507J
github.com/ztemt/Z7Mini_NX507J_H128_kernel
felipebarney said:
Here it is Kernel source code for NX507J
github.com/ztemt/Z7Mini_NX507J_H128_kernel
Click to expand...
Click to collapse
I thought that was the kernel that was either incomplete or broken. Do you know otherwise? I had seen it previously, but had read there were errors with it. If not, that's great! I also wonder if it has the "fixes" that ZTE has made for wifi, BT, etc in the recent updates.
pedrud said:
I thought that was the kernel that was either incomplete or broken. Do you know otherwise? I had seen it previously, but had read there were errors with it. If not, that's great! I also wonder if it has the "fixes" that ZTE has made for wifi, BT, etc in the recent updates.
Click to expand...
Click to collapse
I found on the nubia.cn, but i don't know if this have issues... Anyway last updated was 22 days ago, I hope they have fixed...
felipebarney said:
I found on the nubia.cn, but i don't know if this have issues... Anyway last updated was 22 days ago, I hope they have fixed...
Click to expand...
Click to collapse
Can you post the link where you originally found it? Thanks.
pedrud said:
Can you post the link where you originally found it? Thanks.
Click to expand...
Click to collapse
bbs.nubia.cn/thread-266348-1-1.html
:good:
felipebarney said:
bbs.nubia.cn/thread-266348-1-1.html
:good:
Click to expand...
Click to collapse
Thanks. Although, one person commented on the thread that it is nubia development and isn't open source yet. Won't know for sure and I'm not totally sure how to tell from looking at it. May have to keep waiting - or at least dig a little deeper. Thanks again.
So I started to try to build something with CM-11.
I thought I could put my steps here, in case someone else needs them (or has a better way to do it):
1) Get the repo uility:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
2) Initialize the repository:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
3) Sync the repository:
Code:
repo sync
This will take a while (the repo is pretty big).
I've taken some infos from the phone (build.prop, partitioning, kernel, boot.img).
I'll continue as soon as the repo is sync'ed.
Repo sync'ed, now build the environment:
Code:
. build/envsetup.sh
At this point we have to build the structure as explained here
Make sure you have the boot.img extracted (see previous posts about a tool).
Make sure you have the utility "unpackbootimg" installed.
I downloaded from https://github.com/osm0sis/mkbootimg/blob/master/unpackbootimg.c and compiled with:
Code:
gcc -o unpackbootimg unpackbootimg.c
Put it in your $PATH.
Then run the commands to create the directory structure:
Code:
./build/tools/device/mkvendor.sh nubia NX507J ../original/boot.img
"nubia" and "NX507J" come from the build.prop, respectively
Code:
ro.product.manufacturer=nubia
ro.product.device=NX507J
The result from the mkvendor.sh is:
Code:
[...]
Use the following command to set up your build environment:
lunch cm_NX507J-eng
And use the follwowing command to build a recovery:
. build/tools/device/makerecoveries.sh cm_NX507J-eng
...to be continued
pierg75 said:
So I started to try to build something with CM-11.
I thought I could put my steps here, in case someone else needs them (or has a better way to do it):
1) Get the repo uility:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
2) Initialize the repository:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
3) Sync the repository:
Code:
repo sync
This will take a while (the repo is pretty big).
I've taken some infos from the phone (build.prop, partitioning, kernel, boot.img).
I'll continue as soon as the repo is sync'ed.
Click to expand...
Click to collapse
This is great! Thanks. Are you using a PC or Linux and what OS? Those are the next steps that I want to take. I'm interested in doing it with carbon, omni, and maybe paranoid.
pedrud said:
This is great! Thanks. Are you using a PC or Linux and what OS? Those are the next steps that I want to take. I'm interested in doing it with carbon, omni, and maybe paranoid.
Click to expand...
Click to collapse
Obviously I'm using Linux
No windows here
Sent from my NX507J using Tapatalk
pierg75 said:
Obviously I'm using Linux
No windows here
Sent from my NX507J using Tapatalk
Click to expand...
Click to collapse
That's what I assumed, but hey, you never know. You know what they say when you make assumptions... What distro are you using?
Fedora and Debian...BTW I added few more steps in the previous message.
pierg75 said:
Fedora and Debian...BTW I added few more steps in the previous message.
Click to expand...
Click to collapse
Did you see the post by yiphoming on the other thread that CM11 already exists? Any other ROM's you're interested in?

Atempting to build an AOSP-based rom - and I've got a question.

Hey guys...hoping someone here who is wiser than I can offer some information on how I might complete the task I am after. I've got limited knowledge in the rom-building department, but would really like to learn at least enough to "get my feet wet" so to speak, and so I'm trying hard to do just that. I would like to build a version of SlimKat based on the latest code available, and have it be compatible with our device (the VS985). I've gotten so far as to set up the Ubuntu build environment and everything, installing repo and initializing the directory with the SlimKat 4.4.4 caf (by doing repo init -u git://github.com/SlimRoms/platform_manifest.git -b kk4.4-caf), and finally repo sync'ing the whole thing.
I'm pretty sure that I need to eventually use the ". build/envsetup.sh" and then "brunch vs985" commands to begin the actual build process itself, but my main question now even after all the tutorials I've read is whether or not there are additional "device-specific" commands I need to run or things need to do or sync in order to make the final product compatible with our VS985. I found a tutorial on building CM11 for our device, and it talked about having to create a local_manifest.xml file and then repo sync'ing again, but this is pretty much where I got lost and where I'm still quite confused. Can anyone with prior AOSP building experience help me out with some idiot-friendly () pointers/instructions and explanations on where to go after repo sync'ing? I would seriously appreciate any help anyone can offer. Thanks!!
ohlin5 said:
Hey guys...hoping someone here who is wiser than I can offer some information on how I might complete the task I am after. I've got limited knowledge in the rom-building department, but would really like to learn at least enough to "get my feet wet" so to speak, and so I'm trying hard to do just that. I would like to build a version of SlimKat based on the latest code available, and have it be compatible with our device (the VS985). I've gotten so far as to set up the Ubuntu build environment and everything, installing repo and initializing the directory with the SlimKat 4.4.4 caf (by doing repo init -u git://github.com/SlimRoms/platform_manifest.git -b kk4.4-caf), and finally repo sync'ing the whole thing.
I'm pretty sure that I need to eventually use the ". build/envsetup.sh" and then "brunch vs985" commands to begin the actual build process itself, but my main question now even after all the tutorials I've read is whether or not there are additional "device-specific" commands I need to run or things need to do or sync in order to make the final product compatible with our VS985. I found a tutorial on building CM11 for our device, and it talked about having to create a local_manifest.xml file and then repo sync'ing again, but this is pretty much where I got lost and where I'm still quite confused. Can anyone with prior AOSP building experience help me out with some idiot-friendly () pointers/instructions and explanations on where to go after repo sync'ing? I would seriously appreciate any help anyone can offer. Thanks!!
Click to expand...
Click to collapse
It all depends. If the source you grabbed does not have anything specific for the vs985, then the build command itself won't work. The build scripts and configuration has to be modified to add that build command and even then, it means going into the source and making whatever changes you need to make it specific to the VS985.
Since it's AOSP, it should work no matter what, but that means anything that requires vs985 specific calls to make it work aren't there.
It's not just a magic command that makes it work. You have to go in and figure out what isn't and is working and make the necessary changes.
I'm assuming you are a programmer? If not, better learn.
iBolski said:
It all depends. If the source you grabbed does not have anything specific for the vs985, then the build command itself won't work. The build scripts and configuration has to be modified to add that build command and even then, it means going into the source and making whatever changes you need to make it specific to the VS985.
Since it's AOSP, it should work no matter what, but that means anything that requires vs985 specific calls to make it work aren't there.
It's not just a magic command that makes it work. You have to go in and figure out what isn't and is working and make the necessary changes.
I'm assuming you are a programmer? If not, better learn.
Click to expand...
Click to collapse
I see. I have had some very basic programming exposure, but I wouldn't consider myself anywhere near skilled and it's been a while haha. Well I do appreciate the info and I'll probably be best off leaving this to those much smarter than I Thanks!
ohlin5 said:
I see. I have had some very basic programming exposure, but I wouldn't consider myself anywhere near skilled and it's been a while haha. Well I do appreciate the info and I'll probably be best off leaving this to those much smarter than I Thanks!
Click to expand...
Click to collapse
I don't want to scare you off. If you feel like you want to learn something new, then don't hold back. I just wanted to let you know that it's not just a simple "grab the source from another phone and compile it for the G3". That's why you'll see different ROMs for each of the different phones. But, in the case of this phone, you all have to add the bump to the ROM in order for it to work and that is specific to each version of the G3. You can't take a bumped D850 (AT&T) ROM and just flash it onto a Verizon G3 (VS985). It won't work.
Now, bumping is not that hard as one of the posts on how to compile a ROM for the G3 gives you the instructions to "bump" your ROM, which is done after you've compiled it. Where it gets more difficult and requires some more tech savy and programming knowledge, is how to modify the ROM to take advantage of the hardware specific to the G3. The AOSP code pulled down for say CM11/CM2 is just that - AOSP. What you were doing was taking a completely different ROM's base source and trying to make that work on the G3. Not impossible by any means, but would require more than just a basic understanding of programming. You also need to understand how the Android OS works, etc. Again, not a trivial task by any means, but also, could end up being something that challenges you to learn more and eventually become a contributor to the G3 dev forums.
I myself am a programmer. I've been learning Android app development but I also wanted to delve into ROM building and was grateful to see the post on how to do so, so I'll be looking into that when I can, but I know it's not an trivial thing to master, but I'm a persistent person and most of my computer programming I learned was self taught when I was in high school on an Apple ][+ and //e. Those were the days when Apple wasn't so closed. Woz had a hand in wanting to keep it open - Jobs didn't. We all know who won on that count.
Any ways, if you are up to a challenge and like solving problems, programming is definitely the way to go.
I've been trying to build my own just for fun as well, but after I brunch, it doesn't create a zip.
I've been following this guide: http://forum.xda-developers.com/lg-g3/general/guide-how-to-build-cyanogenmod-11-d850-t2971538
I feel like it has something to do with my local_manifest.xml, but it's probably because I tried building CM12 and it's not as easy as just changing the branch...
Probably just going to start over from scratch with CM11 and see how it goes.

Help: Understanding Basics of Building and Compiling?

Hi all,
In short i want to modify Android 4.2.2 on my MK802IIIS to allow me to use an external USB WIFI Adapter. The one i have uses a Ralink (MediaTek) RT5372 chipset.
I'm not a beginner, but by no means an expert. I have compiled firmware for my Linux based routers. But compiling Android, or parts of, seems much more complicated. I only want to add support for a USB adapter. Do i need to build the kernel from scratch, or can i create a module? Do i need to cross compile a module or can it be "made" in Ubunutu and just copied across?
I have searched for a RT5372.ko file online, finding references to RT5370, but i dont think it's the same.
I downloaded the driver from the Mediatek website and proceeded to attempt to create a .ko file by making it in Ubuntu but it only created a RT5372STA.dat file. Does this driver need to be cross compilied for android? Also how do i turn it in to a module that i can just load into my currently installed ROM?
I have been poking around for a while so i havent covered everhything i've tried. I'd really like to understand how building for Android works. If anyone can answer any of these questions for me, it'd help me imensely. Or if there is a resource covering these topics that i have yet to come across please point me at it. I know there are a lot of very detailed How-To's for compliling but i seem to get lost with the amount of detail.
Many thanks
More info regarding my setup:
Building in Ubuntu 14.04, 64bit.
The current ROM appears to have been built using the Linaro 4.6.2 toolchain, so u have downloaded that, currently stored in /home/wriggerz/RK3066/Toolchains
Also downloaded the RK3066 Kernel Source, stored in /home/wriggerz/RK3066/RK3066-Kernel
The RT5372 driver has been extracted to /home/wriggerz/RT5572NEW
I've been mashing bits of different guides and suggestions found on other forums together to try and frankenstien this KO module. From within the drivers folder i ran the two commands below. From what i've read this needs to be done to specify which "Toolchain" and "Compiler" to use.
Code:
export CROSS_COMPILE=~/home/wriggerz/rk3066/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
export ARCH=arm
Then i ran the make command like below to try and have the driver built for the correct Toolchain with the correct Compiler:
Code:
make ARCH=arm CROSS_COMPILE=arm-eabi-linaro-4.6.2
However i get the following response:
Code:
make -C tools
make[1]: Entering directory `/home/wriggerz/RT5572NEW/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/wriggerz/RT5572NEW/tools'
/home/wriggerz/RT5572NEW/tools/bin2h
cp -f os/linux/Makefile.6 /home/wriggerz/RT5572NEW/os/linux/Makefile
make -C /lib/modules/3.16.0-30-generic/build SUBDIRS=/home/wriggerz/RT5572NEW/os/linux modules
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-30-generic'
Makefile:652: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
make[1]: arm-eabi-linaro-4.6.2-gcc: Command not found
CC [M] /home/wriggerz/RT5572NEW/os/linux/../../common/crypt_md5.o
/bin/sh: 1: arm-eabi-linaro-4.6.2-gcc: not found
make[2]: *** [/home/wriggerz/RT5572NEW/os/linux/../../common/crypt_md5.o] Error 127
make[1]: *** [_module_/home/wriggerz/RT5572NEW/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.16.0-30-generic'
make: *** [LINUX] Error 2
Someone knowledgeable will hopefully look at the steps i have just taken to rip it to shreds...... :fingers-crossed:
If not, is there anyone with any ideas of where i'm going wrong?
I think i've put this in the wrong section....
If anyone has to go out of their way to move it they have my sincere apologies.
J Double You said:
I think i've put this in the wrong section....
If anyone has to go out of their way to move it they have my sincere apologies.
Click to expand...
Click to collapse
First of all, I would suggest to recompile the kernel and the entire source code (like when building CM), it is way better than insmodding modules every time, and you have less errors to solve. I'm currently writing a guide about building Cyanogenmod to support awus036h wireless adapter, maybe I can have a look for yours too, shouldn't be too hard. There are two or there good references around, however I'm trying to out all of them together in this new one I want to publish. Hope this will help you too.
Don't download a .KO from internet, it's not going to work. You would not only need to build for the specific device, but also for the specific kernel, which may vary from build to build, that's why I recommend to compile the whole kernel. Please consider to download a ROM's source code or your device kernel.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Thanks for the helpful response Ciuffy.
Before i ask any more potetnially stupid questions i will do some research on that approach. I look forward to seeing your guide. For now i may be back for some direction.
Thanks again
I do like the ROM i'm on at the minute. NeoTV CR 2.0 (4.2.2), works really well, snappier than others i;ve tried and the benchmark results are pretty good too, but there are a couple of issues with it:
Busybox isnt installed and doesnt install.
Commands dont seem to work in terminal.
Now it doesnt really matter, as i wont be Insmodding the driver now, but it would be nice to have. How do i stay as cose to my current ROM as possible while re-compiling? Do i need to contact the ROM creator and ask them for the source? Should it be available on the web somewhere? Or can i "rip" it off the device? My main goal is to add driver support to the kernel from the drivers srouce files. But it would be nice to have busybox installed too. Was thinking i might re-comile the whole rom, but that be like trying to run before i can stand..... But, learning is amazing, and i learn best by doing!!
Main question: Whats the easiest way to re-compile my current kernel? Do i need source files from the ROM creator? I have asked but havent had a repsonse yet, but it's only been about 16 hours, not even that.
J Double You said:
I do like the ROM i'm on at the minute. NeoTV CR 2.0 (4.2.2), works really well, snappier than others i;ve tried and the benchmark results are pretty good too, but there are a couple of issues with it:
Busybox isnt installed and doesnt install.
Commands dont seem to work in terminal.
Now it doesnt really matter, as i wont be Insmodding the driver now, but it would be nice to have. How do i stay as cose to my current ROM as possible while re-compiling? Do i need to contact the ROM creator and ask them for the source? Should it be available on the web somewhere? Or can i "rip" it off the device? My main goal is to add driver support to the kernel from the drivers srouce files. But it would be nice to have busybox installed too. Was thinking i might re-comile the whole rom, but that be like trying to run before i can stand..... But, learning is amazing, and i learn best by doing!!
Main question: Whats the easiest way to re-compile my current kernel? Do i need source files from the ROM creator? I have asked but havent had a repsonse yet, but it's only been about 16 hours, not even that.
Click to expand...
Click to collapse
Definetely, you should find the kernel source code, I think you can find it on Github, I'll give a look at it. I honestly don't think you can reverse engineer the kernel and recompile it.
Edit: I can't seem to find it. It is also possibile that the source code was not released.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Stupid Question: Is the SDK the same thing as the source?
If so i think i found what i need to build from scratch here: http://www.cnx-software.com/2013/08/20/rockchip-rk3066-android-4-2-2-hdmi-tv-stick-sdk-leaked/
If thats right, i need to find a way to add the driver i found to the source so it's included in the compilation.
Boom, think i found my base... And answered my previous question. SDK is not source.
http://freaktab.com/forum/tv-player...73-full-1080p-modded-kit-kat-4-4-2-rk3066-rom
The OP kindly links to the kernel source.
Apologies for spamming my own thread, i like to keep anyone watching up to date with progress so they dont waste their time replying to old stuff.
J Double You said:
Boom, think i found my base... And answered my previous question. SDK is not source.
http://freaktab.com/forum/tv-player...73-full-1080p-modded-kit-kat-4-4-2-rk3066-rom
The OP kindly links to the kernel source.
Apologies for spamming my own thread, i like to keep anyone watching up to date with progress so they dont waste their time replying to old stuff.
Click to expand...
Click to collapse
SDK stands for Software Development Kit, in other words the environment that lets you build applications and related for a specific platform.
So, you found the source you were looking for?
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Sure did, i also now know which compiler i need.... arm-linux-gnueabi-4.7.
Now to find out how to add the driver i have downloaded to the kernel.
From what i've read i need to "make" the driver, cross compiling in the process, then put some of the resulting files in situ within the kernel source. (along these lines: http://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code).
J Double You said:
Sure did, i also now know which compiler i need.... arm-linux-gnueabi-4.7.
Now to find out how to add the driver i have downloaded to the kernel.
From what i've read i need to "make" the driver, cross compiling in the process, then put some of the resulting files in situ within the kernel source. (along these lines: http://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code).
Click to expand...
Click to collapse
Excuse me, are you then going to compile the enitre kernel? Waiting for your answer, there should be an easier way to do this.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
I was going to, based on your suggestion to compile from scratch, but i have most likely mis-understood what it was you were getting at.
Also, i have downloaded a bunch of toolchains and i have arm-linux-androideabi-4.7, but is that the same as arm-linux-gnueabi-4.7
Again, i could be barking up the completely wrong tree. Which is a shame, as i thought i was actually getting somewhere..... hahaha!
As always, your continued input is greatly appreciated Ciuffy.
J Double You said:
As always, your continued input is greatly appreciated Ciuffy.
Click to expand...
Click to collapse
Yes, I was in fact suggesting you to build from scratch, thinking you could include modules for your adapter in the kernel configuration. However, I can't find what kernel module is exactly going to do it. I found rt2800usb, however I am not sure. You may try to include support for rt2800 and also build the kernel module from the driver source code, as explained in that link for example.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Ciuffy said:
Yes, I was in fact suggesting you to build from scratch, thinking you could include modules for your adapter in the kernel configuration. However, I can't find what kernel module is exactly going to do it. I found rt2800usb, however I am not sure. You may try to include support for rt2800 and also build the kernel module from the driver source code, as explained in that link for example.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Click to expand...
Click to collapse
Ah.... I have downloaded the Linux driver from the MediaTek websitefor the RT5372, but it needs "making". Would cross compiling the driver not give me the modules i need to load in to the kernel?
That link explains how to add the required files, but doesnt explain how they're created. I dont think....
J Double You said:
Ah.... I have downloaded the Linux driver from the MediaTek websitefor the RT5372, but it needs "making". Would cross compiling the driver not give me the modules i need to load in to the kernel?
That link explains how to add the required files, but doesnt explain how they're created. I dont think....
Click to expand...
Click to collapse
If by cross compiling you mean building the kernel module while also compiling the source code and then loading it in the running kernel, yes, as long as you downloaded the drivers compatible with the Linux kernel on your Android.
You can either use the instruction on that link on StackExchange, or follow the "How to build them?" section here:
http://forum.xda-developers.com/showthread.php?t=1455382
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Thanks Ciuffy.
Seems i've still got some stuff to get my head around. I'll re-read up and come back.
FAIL!!!
Tried flashing the unit with the ROM i was going to compile a kernel for. Looked to go well, but wouldn't boot past the boot splash screen. And after rebooting wouldnt boot at all. Obviously some fundamental incompatibility, or the fact that it cant handle the overclock....
Problem is i have previously broken the OTG port so i have no way to flash using ADB, not until i get a cable soldered in it's place.
Really just wanted to explain why i may be absent from this topic for a bit. I'm going to make some calls to see if any nearby electronics shops can do the job. Once done i'll be back.
J Double You said:
FAIL!!!
Tried flashing the unit with the ROM i was going to compile a kernel for. Looked to go well, but wouldn't boot past the boot splash screen. And after rebooting wouldnt boot at all. Obviously some fundamental incompatibility, or the fact that it cant handle the overclock....
Problem is i have previously broken the OTG port so i have no way to flash using ADB, not until i get a cable soldered in it's place.
Really just wanted to explain why i may be absent from this topic for a bit. I'm going to make some calls to see if any nearby electronics shops can do the job. Once done i'll be back.
Click to expand...
Click to collapse
In case you misunderstood: I just wanted to point out that once compiled the kernel modules along with the kernel, you don't keed to flash the kernel, only insmod the modules.
Hope you can solve the OTG problem, waiting for your response.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.

Categories

Resources