Help me learn how to add a new device to AOKP so I can build it for my phone - Android Q&A, Help & Troubleshooting

So here's the thing, after wrestling a lot with android sources to get them to compile, I did.
So now comes the task of adding a new device so I can actually compile it for my phone. Here's what I already did:
1. Used the existing CM sources for my phone and put them in devices/samsung/ancora (also ran extract-files.sh, and did all the necessary changes)
2. Got all the vendor files and put them in vendor/samsung/ancora
3. Altered the envsetup.sh to include the line "aokp_ancora-userdebug" so I can actually tell it to build the damn thing
4. Added an ancora.mk to the vendor/aokp/products folder with all the necessary information
Now what happens when I try to build is I get the error:
Code:
build/core/product_config.mk:205: *** No matches for product
How do I go about fixing this?
Thanks in advance for all those who help.

KezraPlanes said:
So here's the thing, after wrestling a lot with android sources to get them to compile, I did.
So now comes the task of adding a new device so I can actually compile it for my phone. Here's what I already did:
1. Used the existing CM sources for my phone and put them in devices/samsung/ancora (also ran extract-files.sh, and did all the necessary changes)
2. Got all the vendor files and put them in vendor/samsung/ancora
3. Altered the envsetup.sh to include the line "aokp_ancora-userdebug" so I can actually tell it to build the damn thing
4. Added an ancora.mk to the vendor/aokp/products folder with all the necessary information
Now what happens when I try to build is I get the error:
Code:
build/core/product_config.mk:205: *** No matches for product
How do I go about fixing this?
Thanks in advance for all those who help.
Click to expand...
Click to collapse
In vendor/products, did you also edit AndroidProducts.mk?

KBizzle said:
In vendor/products, did you also edit AndroidProducts.mk?
Click to expand...
Click to collapse
Yes I did. And it points to the ancora.mk that I created.

Related

[Q] Where to start?

Hello,
I want to compile Android from source. I want to just build a fully default Gingerbread that would run nice on my phone. I got the Android source, kernel source (kernel-2.6.32-U8800-Froyo) and now I don't know what to do next. I compiled the generic one already (lunch full-eng) and it ran fine on the emulator.
My most important question is, if I make it otapackage and flash it, would it start? If it doesn't, can I recover? What folders/files are essential if I make my own device for example in "device/huawei/u8800"
Also, where can I find a GOOD porting guide? I have found some that are old and not used anymore.
Some links
Start by going through source.android.com for the general basics if you havent already.
Also, even though Google removed the PDK (Platform Developer's Kit) from the site, it has been mirrored on kandroid here: http://www.kandroid.org/online-pdk/guide/index.html
The stuff in the the PDK, although inadequate, is still very important and explains how to create the necessary makefiles to add to the build, configuring for a new market, etc. etc.
Also,
watch these two videos over here. These were very helpful in my ROM development:
http://www.youtube.com/watch?v=1_H4AlQaNa0
http://www.youtube.com/watch?v=rFqELLB1Kk8
Learn to use github. It is helpful for you to keep track of your changes as well as incorporate others works into your own.
http://help.github.com/
Finally, Cyanogenmod repos are your BEST friend. Almost all major AOSP ROM devs owe some sort of thanks to those guys who have done so much. If you want to check out some of the code changes and patches that you want to incorporate look here on their gerrit:
review.cyanogenmod.com
If you want to look at the other changes that are actually in the cyanogenmod builds, best to look at their git repos here:
https://github.com/CyanogenMod
I am still learning right now while I create my ROM but your welcome to PM me if you have any questions
Glad someone helped. Now that ICS is available, I will build that instead. Now, I will follow the kandroid tutorial and add hardware_msm7x30 from cyanogenmod's repos. Then I'll make my own makefiles in the huawei/u8800 and I'll see if that works.
Also, some things I am not still clear. If I am not adding any recovery files, it shouldn't replace it, right? I want to make sure I can recover. However, my phone has a bootloader mode, which should still work, even if other's messed up. And the kernel, if I already have a compiled kernel for android 2.2, should it work for newer versions?
Thanks
Well AOSP as far as I know adds the stock recovery into the build so if you have a stock ROM, then you will lose your recovery (unless you change the source to skip the adding of recovery to otapackage).
Your bootloader should be fine. so you will theoretically be able to re-flash a custom recovery with fastboot as long as your bootloader is unlocked (assuming your phone is already rooted and has a custom rom, then it should be unlocked)
If you are using CM7 as base, then you dont have to worry about it as it is configured to NOT replace the recovery during the building and creating the otapackage.
The kernel should not be compatible as there were significant changes from Froyo and you should not use it. By the way, for now, work on the ROM first. Creating a custom kernel from scratch is hard work and should be left as the last task to do (assuming you know linux kernel development). Just use the stock pre-built kernel that comes with the source.
Also, according to Google:
Starting with IceCreamSandwich, the Android Open-Source Project can't be used from pure source code only, and requires additional hardware-related proprietary libraries to run, specifically for hardware graphics acceleration.
Click to expand...
Click to collapse
This means you need to find the correct hardware drivers first. Where to find that is beyond me. Check CM repos. It would be easy if everyone had a Nexus S/ Galaxy Nexus as the drivers are immediately available on source.android.com. Ah...well....
Personally, I am going to wait a few weeks before dabbling into ICS ROMs. Wait till CM7 comes out with a nightly for my nexus one and then rip the drivers from their ROM and use it for mine
I got ICS source and made the necessary Android.mk, AndroidProducts.mk, BoardConfig.mk and u8800(my device).mk, also vendorsetup.sh . Now, when I am trying to build it doesn't give me an error, more of a suggestion. It says to include "LOCAL_MODULE_TAGS := optional" in the hardware/msm7k/liblights/Android.mk. I added that, and tried again. Got that message again, but with other type /libril/Android.mk
About fastboot, I am not sure if my device has that. It can be turned on with volume up and down + power, but it boots to so called "pink screen". When I mount phone using usb to my pc, I can browse the recovery.img and other related stuff. If I have the otapackage, can I just take the recovery out from there or what should I modify in source? Add something to the makefiles?
Yeah I am pretty sure you should add the LOCAL_MODULE_TAGS to all of the relevant pre-built files. maybe they made the compiler less harsh in ICS when compared to the one for gingerbread. In gingerbread, it outright crashed the compile and asked you to add the tags.
According to Google engineers, here is the reason why they use these tags:
Short answer: lack of time.
The urgent concern was to prevent new modules from using a user tag
(implicitly or explicitly), and we took care of that. We haven't had
time to deal with the existing modules, there are over 1000 of those.
JBQ
Click to expand...
Click to collapse
By the way, I hope you have git setup and the changes you have made are being staged and commited to your repo in github. If you ever make a mistake that hardcore crashes your compile and you dont know what you did, git will be there for you to rollback the changes as well as keep track of everything you have done from commit to commit
As far as I know, CM repos dont have everything complete for a full build of ICS but I could be wrong.
So you are working with AOSP correct?
As for the fastboot every android phone should have a fastboot by default but I believe each phone has a slightly different version. I will post how my fastboot looks like in a bit.
As for the removal of recovery, there should be somewhere in either source, makefiles or argument for the otapackage command that should leave out the recovery when making update.zip. You could just remove the recovery from the update.zip, change the updater-script and repackage it but its not a clean solution and those changes should be done in a uniform manner so you dont repeat this step every time you do a new build.
Where exactly is it, I have yet to know. Still learning much of this myself.
I now completely understand what modes of turning on my phone has... First one is normal, second is recovery, third is update-bootloader(I can access all files with it too) and four being the fastboot. The custom recovery I have on has an issue that it wants to boot to charging mode when I type "adb reboot bootloader". I can get to fastboot with the custom ROM I have on right now though. I think I am safe if I have issues.
I edited msm7k Android.mk to remove libaudio and libgralloc (errors with those), and it compiles to the step where it says it has no rule to make kernel requied by boot.img. I have put into BoardConfig.mk the line TARGET_PREBUILT_KERNEL with my kernel. I don't understand, what's wrong now...
My goal is to simply get it booting up. I'll look into libraries and other later.
-e-
Got the kernel thing sorted out. Copied device.mk from tuna device and edited to fit my device. Also modified full_u8800.mk and made the call to inherit from device.mk. Compiling now and I think I got past that.
-e2-
Got it built successfully. Fastboot won't let it install, because it has no mount points. Added mount points and let's see...
Nice to see you are making progress.
Got it built, but the fastboot is kinda buggy in my device, maybe custom rom issue. I can't make otapackage, it says "no rule to make target otapackage". I have a possible fix, trying that later.
Otherwise, I read its possible to flash system.img from recovery via advanced restore, update.zip package or advanced flash_image, but I don't know. Will post results.
Sent from my u8800
-e-
Tried make otapackage again. It still says "make: *** No rule to make target `otapackage'. Stop.". Maybe some things are still missing, I don't know. adb flash_image command will always post -1 to me, update.zip didn't work, advanced restore is not for this. I have a compiled image and I can't wait to test it, but I can't flash it...
If nothing works I'll revert to stock ROM and try again.
Blefish said:
Got it built, but the fastboot is kinda buggy in my device, maybe custom rom issue. I can't make otapackage, it says "no rule to make target otapackage". I have a possible fix, trying that later.
Otherwise, I read its possible to flash system.img from recovery via advanced restore, update.zip package or advanced flash_image, but I don't know. Will post results.
Sent from my u8800
-e-
Tried make otapackage again. It still says "make: *** No rule to make target `otapackage'. Stop.". Maybe some things are still missing, I don't know. adb flash_image command will always post -1 to me, update.zip didn't work, advanced restore is not for this. I have a compiled image and I can't wait to test it, but I can't flash it...
If nothing works I'll revert to stock ROM and try again.
Click to expand...
Click to collapse
If you successfully compiled, take the boot.img and system.img and package them into a zip and use dsixda's kitchen to make it flashable
Blefish, is it possible for you to share your device/vendor structures somewhere? I just finished setting up a build machine for ICS (using Cyanogenmod's repos in my case), and made a working full-eng image that seems to boot just fine in the emulator, so I'm seemingly all ready to hack around our device's specifics. But I would rather not do duplicate work, so I decided to ask
I'm also grabbing Huawei's new 2.6.35-based package to get the new kernel config, can't wait for them to release the actual sources for the update.
I'll share them on GitHib once I get a working build. I haven't got much time, and I changed to CM9 alpha now (repo branch ics). Since we got a 2.3 update, my first task is to port the latest clockworkmod recovery and then the ICS.
Compiling Android is long task and I'll do it in weekends, but the recovery should be available sometime, it shouldn't be hard to port that.
Oh yeah, look up stockwell's, dzo's and genokolar's github, they have done the device configuration. You can get much help from there. This weekend I'll propably test the build, I got otapackage command working now (it needed some things I can't write on mobile).
Sent from my U8800 using Tapatalk

I need help with this build error

Im not quite sure what it wants cause there isnt any folder there that it is calling
Code:
Notice file: system/core/netcfg/NOTICE -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/NOTICE_FILES/src//system/bin/netcfg.txt
Import includes file: /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/pngtest_intermediates/import_includes
Export includes file: external/libpng/Android.mk -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/pngtest_intermediates/export_includes
Notice file: external/libpng/NOTICE -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/NOTICE_FILES/src//system/bin/pngtest.txt
Import includes file: /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/radiooptions_intermediates/import_includes
Export includes file: hardware/ril/rild/Android.mk -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/radiooptions_intermediates/export_includes
Notice file: hardware/ril/rild/NOTICE -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/NOTICE_FILES/src//system/bin/radiooptions.txt
make: *** No rule to make target `/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/SHARED_LIBRARIES/libril_intermediates/export_includes', needed by `/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/rild_intermediates/import_includes'. Stop.
make: *** Waiting for unfinished jobs....
any help would be appreciated
I figured it out lol this is my first time being serious building something, but yay its still building so fingers crossed:fingers-crossed:
T10NAZ said:
Im not quite sure what it wants cause there isnt any folder there that it is calling
Code:
Notice file: system/core/netcfg/NOTICE -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/NOTICE_FILES/src//system/bin/netcfg.txt
Import includes file: /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/pngtest_intermediates/import_includes
Export includes file: external/libpng/Android.mk -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/pngtest_intermediates/export_includes
Notice file: external/libpng/NOTICE -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/NOTICE_FILES/src//system/bin/pngtest.txt
Import includes file: /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/radiooptions_intermediates/import_includes
Export includes file: hardware/ril/rild/Android.mk -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/radiooptions_intermediates/export_includes
Notice file: hardware/ril/rild/NOTICE -- /home/joe/[ubuntuTouch]/out/target/product/jewel/obj/NOTICE_FILES/src//system/bin/radiooptions.txt
make: *** No rule to make target `/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/SHARED_LIBRARIES/libril_intermediates/export_includes', needed by `/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/rild_intermediates/import_includes'. Stop.
make: *** Waiting for unfinished jobs....
any help would be appreciated
Click to expand...
Click to collapse
I had same wrong . How to figure out? @T10NAZ
luzifer1984 said:
I had same wrong . How to figure out? @T10NAZ
Click to expand...
Click to collapse
You need to go to the directories that are said here that was in that error,
Code:
`/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/SHARED_LIBRARIES/libril_intermediates/export_includes', needed by `/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/rild_intermediates/import_includes'.
and make the needed files. So i think i went all the way to the libril_intermediate folder then i needed to create the export_includes folder
T10NAZ said:
You need to go to the directories that are said here that was in that error,
Code:
`/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/SHARED_LIBRARIES/libril_intermediates/export_includes', needed by `/home/joe/[ubuntuTouch]/out/target/product/jewel/obj/EXECUTABLES/rild_intermediates/import_includes'.
and make the needed files. So i think i went all the way to the libril_intermediate folder then i needed to create the export_includes folder
Click to expand...
Click to collapse
Thank U.
I add
Code:
$(shell mkdir -p $(OUT)/obj/SHARED_LIBRARIES/libril_intermediates)
$(shell touch $(OUT)/obj/SHARED_LIBRARIES/libril_intermediates/export_includes)
in 'BoardConfig.mk' . Compiled successfully. but don't work.
I figured it out.
WITH In BoardConfig.mk Comment out this line
> # RIL
> BOARD_PROVIDES_LIBRIL := true
ANY way . Thank u for reply
luzifer1984 said:
Thank U.
I add
Code:
$(shell mkdir -p $(OUT)/obj/SHARED_LIBRARIES/libril_intermediates)
$(shell touch $(OUT)/obj/SHARED_LIBRARIES/libril_intermediates/export_includes)
in 'BoardConfig.mk' . Compiled successfully. but don't work.
I figured it out.
WITH In BoardConfig.mk Comment out this line
> # RIL
> BOARD_PROVIDES_LIBRIL := true
ANY way . Thank u for reply
Click to expand...
Click to collapse
Sorry for digging up this old thread, but I am trying to build for the Evita and encountered this same error. Here was my error.
Just for clarification, did this allow a successful build after editing the BoardConfig.mk? Did it boot?
Black!Jack said:
Sorry for digging up this old thread, but I am trying to build for the Evita and encountered this same error. Here was my error.
Just for clarification, did this allow a successful build after editing the BoardConfig.mk? Did it boot?
Click to expand...
Click to collapse
I dont know if you already found your answer, But I have tried the boardconfig edit and it seems like its building right now it got past the RIL thing
Oh also I had to add qcom media-caf to help get past some libstagefright error too
T10NAZ said:
I dont know if you already found your answer, But I have tried the boardconfig edit and it seems like its building right now it got past the RIL thing
Oh also I had to add qcom media-caf to help get past some libstagefright error too
Click to expand...
Click to collapse
Yeah I ran into some issues with QCOM as well. I just went in, temporarily, to the directory listed in the error, and commented out the line that was stalling the build. Longest Ive been able to keep it building so far.
One other thing that I had to do was pull in the nfc-extras folder from frameworks/base... as I was constantly getting stalled there as well.
Black!Jack said:
Yeah I ran into some issues with QCOM as well. I just went in, temporarily, to the directory listed in the error, and commented out the line that was stalling the build. Longest Ive been able to keep it building so far.
One other thing that I had to do was pull in the nfc-extras folder from frameworks/base... as I was constantly getting stalled there as well.
Click to expand...
Click to collapse
That's good. One snag that I did hit was everything built just fine and flashed a ok, but it didnt boot >.< I dont know why it didnt. I am thinking its because it is having a hard time going to the data partition or something idk
T10NAZ said:
That's good. One snag that I did hit was everything built just fine and flashed a ok, but it didnt boot >.< I dont know why it didnt. I am thinking its because it is having a hard time going to the data partition or something idk
Click to expand...
Click to collapse
Did you update the kernel config file for your device? Any patches?
What device are you building for?
Another thing I am going to attempt is bringing up the phablet source to cm11, rather that cm10.1, which was 4.2.2
Black!Jack said:
Did you update the kernel config file for your device? Any patches?
What device are you building for?
Another thing I am going to attempt is bringing up the phablet source to cm11, rather that cm10.1, which was 4.2.2
Click to expand...
Click to collapse
Yea I put all the kernel configs that I didnt have in and the only thing that I did change was removing the nosuid thing from the data. I did find however that in the scripts/touch folder for the ramdisk has the partition calling and mounting script thing. I wonder if I need to edit that in order for it to boot
Black!Jack said:
Another thing I am going to attempt is bringing up the phablet source to cm11, rather that cm10.1, which was 4.2.2
Click to expand...
Click to collapse
UT moved from CM to AOSP. There is a new AOSP 4.4 based phablet tree.
Sent from my TF300T using Tapatalk
f69m said:
UT moved from CM to AOSP. There is a new AOSP 4.4 based phablet tree.
Sent from my TF300T using Tapatalk
Click to expand...
Click to collapse
Awesome news indeed! I'm on the mailing list, but honestly I haven't paid much attention to it as of late. Now I just have to do some work to the CM device tree to get it to build with AOSP.

[Q] merge manufacturer source into android source

total noob here - web developer turned bad
I was wondering how to merge manufacturer source code into android source code? I see instructions every where for compiling android's source, and the manufacturer's source, and they all say "merge the source code", but they don't say how to do that. i've downloaded, via android's "repo" script, allllllllllllllllllllllllll 20gb of android source code (once it's setup), and i've also got all the LGE source code (for their hardware kernel drivers, i guess?). the instructions are pretty clear, but, there's that 1 damned step that is not clear for this noob "... And, merge the source into the android source code".
what i'm stuck on, is "HOW do i do that, and WHERE do i do that"? Do i just copy the manufacturer source into a specific android source folder, or what?
thanks in advance.
bump.... this is where i'm stuck at too. would like to build from pure source ATT/AOSP Have dl'ed both sources and need to be merged. I have seen several tutorials on building from source but they get vaige and want to use CM all the time. is it possible to do w/o CM? if so how.
Thank you also.
I also was unsure about that point, but after looking at the file, it seems pretty clear. Just extract the content of LGE-file to the android directory, as mentioned in the LGE Readme and overwrite existing files and try your luck with a compile. I tried it, but my installation of OpenJDK conflicts with building Android from sources. Maybe you've got more luck!
00001101 said:
I also was unsure about that point, but after looking at the file, it seems pretty clear. Just extract the content of LGE-file to the android directory, as mentioned in the LGE Readme and overwrite existing files and try your luck with a compile. I tried it, but my installation of OpenJDK conflicts with building Android from sources. Maybe you've got more luck!
Click to expand...
Click to collapse
Thanks for the suggestion, but still no such luck, I tried that and still fails at webcore(permissions denied) =I tried to build as user and as root user and still get some thing, I posted the error in the forums for my phone but no one has replied. but again thank you for the suggestion.
BTY, did you get the JDK to work?
Thanks for your feedback. I couldn't resist and installed Oracles Java version, just to see what problems might be left .
And of course, there came the final point, where I got a 'make no rule to make target' message while compilating, so the process stopped. First with pure AOSP and today with CM 11. Obviously I'm no coder, I just fiddle around with stuff, so there's unfortunatly where I have to give up. But it was interresting to learn a bit about the essentials
Did you have a look at this: http://code.google.com/p/android/issues/detail?id=38879
Following that, it might be, that there is a file missing in your sources?

[Q] Kernel build error for AOSP 4.4.2

Hi,
I am trying to compile a kernel for a specific device on AOSP 4.4.2 and got the following error. I understand that the variable is declared twice and need to be removed from one. Vendor folder cannot be removed since it has device specific configuration files. Looking into external/jpeg folder I am not able to decide which particular file to remove. Could some one let me know how to fix this.
HTML:
build/core/base_rules.mk:134: *** vendor/google/libs: MODULE.TARGET.SHARED_LIBRARIES.libjpeg already defined by external/jpeg. Stop.

Problem building cm12

When I run the ./get-prebuilts command i get "no such file or directory exists". I also get a "remote object '/system/app/CIRModule.apk' does not exist" when running the ./extract-files.sh. Any help? Thanks.
go to your device tree and open proprietary-files.txt and delete the line then save it bud.
Evolutionmods said:
go to your device tree and open proprietary-files.txt and delete the line then save it bud.
Click to expand...
Click to collapse
Why just delete it? I did this then it complained about "system/app/EasyAccessService/EasyAccessService.apk" so I removed it and it complained about "system/vendor/lib/libtime_genoff.so"
Something doesn't seem right here.
I am trying to build cm 12.1 btw.
jfain said:
Why just delete it? I did this then it complained about "system/app/EasyAccessService/EasyAccessService.apk" so I removed it and it complained about "system/vendor/lib/libtime_genoff.so"
Something doesn't seem right here.
I am trying to build cm 12.1 btw.
Click to expand...
Click to collapse
You don't have to delete them , it's just a work around. Those errors are are initially from the vendor, when you ran the extract-files.sh it didn't pull those most likely. You can gather from the Rom itself or find a more complete m8 vendor on github.
OK, those three files was the only missing from the current nightly I believe. I'll look on git hub this evening.
Thanks!

Categories

Resources