Building AOSP using CM device files - Android Q&A, Help & Troubleshooting

Hello
I'm trying to build AOSP 6.0.1 using your CM device files (CM13 has been successfully built for my device, Huawei P8). I'm not too experienced with this so some help is appreciated. Right now I have synced the google repo
repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r80
cd .repo
git clone https://github.com/CM-Huawei-P8-Development/local_manifests_gra_l09
cd local_manifests_gra_l09
cd ../..
repo sync
This is where I'm now. The confusion is about am I supposed to also download or sync the device files from https://github.com/CM-Huawei-P8-Development/device_gra_l09 (the device tree)
Also is this https://github.com/CM-Huawei-P8-Development/kernel needed to be downloaded separately? I see in the hwgra-l09-dev.xml file that the repos are indeed listed but will it also work for AOSP?
I'm following a guide for Sony device and it says that next I'm supposed to
source build/envsetup.sh && lunch <--- here something device specific maybe?
and
make –j 8
What am I missing ?

Related

[GUIDE][DEV][DISCONTINUED] How I build my own CM10.1 test builds

This is still unofficial. This thread is intended for devs & advanced users only.
Guide how I build CM10.1 for my smultron.
For the first time you try to build CM10.1
Follow this guide up to "Initialize the CyanogenMod source repository" step (don't execute this step).
http://wiki.cyanogenmod.org/w/Build_for_smultron
Download & install lzop compression tool
Code:
sudo apt-get install lzop
Initialize the CyanogenMod source repository
Enter the following to initialize the repository:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
Get the required local manifest
Code:
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
Download the source code
Code:
repo sync
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/updates.sh > ~/android/system/updates.sh
chmod a+x updates.sh
./updates.sh
Get the prebuilts
Code:
cd ~/android/system/vendor/cm
./get-prebuilts
Setup the environment & prepare the device-specific code.
Code:
cd ~/android/system
. build/envsetup.sh
breakfast smultron
Build the ROM (takes long time)
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-10.1-DATE-UNOFFICIAL-smultron.zip
The next times you want to build, you only need to do the following:
Sync the repositories & make sure you are using the latest local_manifest.
Code:
cd ~/android/system/
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
repo sync
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/updates.sh > ~/android/system/updates.sh
chmod a+x updates.sh
./updates.sh
Setup the environment
Code:
. build/envsetup.sh
Build the ROM
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-10.1-DATE-UNOFFICIAL-smultron.zip
Steps to build only the kernel:
Sync the repositories.
Code:
cd ~/android/system/
repo sync
Setup the environment
Code:
. build/envsetup.sh
Build the kernel
Code:
breakfast smultron
make -j4 bootimage
If the build finishes successfully, you will find the boot image here:
~/android/system/out/target/product/smultron/boot.img
Credits: Thanks to hnl_dk for the initial CM9 & CM10 guides.
Build is successful using this guide now. You can build for all xperia 2011 phones by replacing "smultron" with your device's name in the guide.
More info can be found here: https://github.com/LegacyXperia/local_manifests/wiki
Re: [GUIDE][WIP] How I build my own CM10.1 test builds
Wew good guide! :thumbup: hope can get the stable version of the CM10.1with this guide here
Sent from my SK17i using xda premium
After 'repo init' there should be a
Code:
mkdir -p ~/android/system/.repo/local_manifests
Script to apply not yet merged changes:
Code:
#!/bin/sh
android=~/android/system
#http://review.cyanogenmod.org/#/c/32906/
cd ${android}/frameworks/av/
git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_av refs/changes/06/32906/2 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
#http://review.cyanogenmod.org/#/c/28336/
cd ${android}/packages/apps/LegacyCamera/
git fetch http://review.cyanogenmod.org/CyanogenMod/android_packages_apps_LegacyCamera refs/changes/36/28336/1 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
#http://review.cyanogenmod.org/#/c/34989/
cd ${android}/hardware/qcom/audio-caf
git fetch http://review.cyanogenmod.org/CyanogenMod/android_hardware_qcom_audio-caf refs/changes/89/34989/5 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
From http://forum.xda-developers.com/showthread.php?t=1358547
Code:
repo sync -f
May fix error: Exited sync due to fetch errors
hi,
I want to build CM 10.1 for my mango, guide is perfectly explain, just one question :
does i need to add the script part explain by M66B two post above or it's outdated and i just need to follow the first post ?
Thanks
Edit : sorry for the noob question, i have read the reviews and have my answer
kosmo666 said:
hi,
I want to build CM 10.1 for my mango, guide is perfectly explain, just one question :
does i need to add the script part explain by M66B two post above or it's outdated and i just need to follow the first post ?
Thanks
Edit : sorry for the noob question, i have read the reviews and have my answer
Click to expand...
Click to collapse
The scrip parts from above are outdated, we maintain this script now.
How to merge in this nAa 3.4.45 kernel sources? Is it connected with kernel sources?
mastero9017 said:
How to merge in this nAa 3.4.45 kernel sources? Is it connected with kernel sources?
Click to expand...
Click to collapse
If you look at Mike's github (https://github.com/LegacyXperia)
you'll see that he maintains his own branch of the nAa kernel (https://github.com/LegacyXperia/msm7x30-3.4.x-nAa).
They are not the same, but similar (Mike currently has more changes, since nAa hasn't updated anything for two weeks).
-> If you build Mike's sources, you'll also get a 3.4.45 kernel.
What am I doing wrong? Did everything, checked all libs 10 times..
EDIT: It's a KDE error,aghhr. Delete/clean /root/.config directory fixes it
Code:
[email protected]:~/android/system# brunch haida
including vendor/cm/vendorsetup.sh
Trying dependencies-only mode on a non-existing device tree?
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=10.1-20130603-UNOFFICIAL-haida
TARGET_PRODUCT=cm_haida
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/root/android/system/out
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=10.1-20130603-UNOFFICIAL-haida
TARGET_PRODUCT=cm_haida
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/root/android/system/out
============================================
make: *** /.config: is a directory. Stop.
Guys,
For your info Windows Host NTFS file system is case insensitive and will break android compilation!!!
Workaround: Create a new virtual hdd with ext3 format and mount it to your ubuntu guest! Sad that ntfs cannot be used.
So, below is for your info if u came across this post. It is useful for sharing folders between Linux guest and Windows host.
IF you are using Virtualbox on a Win7/8 host system,
To use Shared Folder feature and add automount (note, VirtualBox needs to be run as Administrator so that os.symlink works!!!!
In Windows:
1. Go to your VirtualMachine Folder and look for MyVM.vbox,
2. Open with notepad++
3. Look for <ExtraData>
4. Add this inside the <ExtraData></ExtraData>
Code:
<ExtraDataItem name="VBoxInternal2/SharedFoldersEnableSymlinksCreate/android" value="1"/>
where "android" is my shared folder!!! =)
In terminal:
Code:
sudo nano /etc/fstab
Add this line:
Code:
/android /home/myName/android vboxsf rw,uid=1000,gid=1000 0 0
where android is the folder I give when sharing in SharedFolder of the VirtualBox and /home/myName/android is the folder I created in Ubuntu.
Ctrl+O and hit Enter to save. Ctrl+X to quit. and Reboot and you are done.
Also, if you encounter error or Virtualbox/ubuntu hung on repo sync, add -j2 or -j3 to prevent race condition!!!
Code:
repo sync -j3
Syncing work tree error!!!
If you encounter syn error
Code:
Fetching projects: 100% (204/224), done.
Syncing work tree: 90% (204/224) error: manifest required for this command -- please run init
1. Go to "android\system\.repo\"
2. Open "project.list" with notepad or notepad++
3. Go to the line of error. In this case, line 204 as above.
4. E.g. Ling 204 shows: external/wpa_supplicant_6, So, go to the folder "android\system\external\wpa_supplicant_6" and delete ".git" folder
5. Go back to Terminal and "repo sync"
=)
You need the lz4 compression tool from now on to be able to build the kernel. First post is updated with instructions on how to get it.
Code:
sudo apt-get install subversion
cd ~/Downloads
svn checkout -r 91 http://lz4.googlecode.com/svn/trunk/ lz4
cd lz4 && make && cp lz4demo ~/bin/lz4demo
Can any body please tell me,what's the exact size of full cm10.1. Source repo
I had set my laptop to download repo from last 32 hours
And till now more than 8gb data was downloaded ....
And how to know how much data left for download...?
Can anybody give me the exact size of the gits which are to be download so that I can compare that sizes with the files which I had downloaded....?
Sent from my Xperia Mini Pro
Hey @mikeioannina,
Do you have any guide on repo branch? In windows, git gui is easy to do. But I'm not familiar with ubuntu.
How do you branch out the project without error?
I tried in ~/android/system:
Code:
repo start kernel-patch .
it says . project not found. What the hell. Needa branch and test some codes!!! =)
Also, is there a private directory for us to put binary to system/apps or scripts which will not be affected by "repo sync" during compilation?
---------- Post added at 06:42 PM ---------- Previous post was at 06:40 PM ----------
hijagdeep said:
Can any body please tell me,what's the exact size of full cm10.1. Source repo
I had set my laptop to download repo from last 32 hours
And till now more than 8gb data was downloaded ....
And how to know how much data left for download...?
Can anybody give me the exact size of the gits which are to be download so that I can compare that sizes with the files which I had downloaded....?
Sent from my Xperia Mini Pro
Click to expand...
Click to collapse
It's around ~25GB. Maybe less due to compression. ^_^
shenlong85 said:
It's around ~25GB. Maybe less due to compression. ^_^
Click to expand...
Click to collapse
Someone told me that its around 8 gb
Sent from my Xperia Mini Pro
hijagdeep said:
Someone told me that its around 8 gb
Sent from my Xperia Mini Pro
Click to expand...
Click to collapse
If you initiated with the CM10.1 branch, it will be 14Gig, if you initiated with no branch, 25Gig
Langes said:
If you initiated with the CM10.1 branch, it will be 14Gig, if you initiated with no branch, 25Gig
Click to expand...
Click to collapse
I have initiated with this repo command
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
and also used this local manifests
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/master/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
and now 25 hours are passed and it downloaded 9.5gb data ..
hijagdeep said:
I have initiated with this repo command
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
and also used this local manifests
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/master/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
and now 25 hours are passed and it downloaded 9.5gb data ..
Click to expand...
Click to collapse
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 is for the whole cm10.1 sources. Be patient. Are you using full blown linux host or just a virtual machine? IF you are using virtual machine, it may be slow and have race condition during repo which results in errors. Try using
Code:
repo sync -j3
For 3 simultaneous thread or j2 depending on the number of core in your processor and whether there is hyperthreading. It'll make it more stable.

{All 2011}[GUIDE][DEV] How to build CyanogenMod 11.0

This thread is intended for devs & advanced users only.
Here you can learn how to build CyanogenMod 11.0 for any of the 2011 xperia devices.
I will use 'smultron' as an example device, you should replace the codename with the device you want to build.
For the first time you try to build CM11.0
Follow this guide up to "Initialize the CyanogenMod source repository" step (don't execute this step).
http://wiki.cyanogenmod.org/w/Build_for_smultron
Initialize the CyanogenMod source repository
Enter the following to initialize the repository:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
Get the required local manifest
Code:
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.githubusercontent.com/LegacyXperia/local_manifests/cm-11.0/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
Download the source code
Code:
repo sync
Setup the build environment
Code:
. build/envsetup.sh
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
ln -s vendor/extra/updates.sh updates.sh
./updates.sh
Get the prebuilts
Code:
cd ~/android/system/vendor/cm
./get-prebuilts
Setup the build environment & prepare the device-specific code.
Code:
cd ~/android/system
. build/envsetup.sh
breakfast smultron
Build the ROM (takes long time)
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-11.0-DATE-UNOFFICIAL-LegacyXperia-smultron.zip
The next times you want to build, you only need to do the following:
Sync the repositories & make sure you are using the latest local_manifest.
Code:
cd ~/android/system/
curl https://raw.githubusercontent.com/LegacyXperia/local_manifests/cm-11.0/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
repo sync
Setup the build environment
Code:
. build/envsetup.sh
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
./updates.sh
Build the ROM
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-11.0-DATE-UNOFFICIAL-LegacyXperia-smultron.zip
Steps to build only the kernel:
Sync the repositories.
Code:
cd ~/android/system/
repo sync
Setup the environment
Code:
. build/envsetup.sh
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
./updates.sh
Build the kernel
Code:
breakfast smultron
make -j4 bootimage
If the build finishes successfully, you will find the boot image here:
~/android/system/out/target/product/smultron/boot.img
Some suggestions for faster builds:
* Enable ccache
* Use the fastest hdd on your pc to store the source, build output & ccache
* You can also buy an ssd, if it's not large enough to hold everything, just store the build output & ccache
* mount /tmp on tmpfs (RAM).
The above have greatly improved my dirty build times with removed /out/target from 1h30m to 30m.
Mounting /tmp on tmpfs made the biggest improvement for me.
Credits: Thanks to hnl_dk for the initial CM9 & CM10 guides.
Reserved
bro your devs are awesome but when you gonna give us the opportunity to taste kitkat
Thanks so muxh
Sent from my Xperia Live with Walkman using xda premium
Sorry for the noob question, first time builder here. You say you prepare the device specific code, but there is no official CM11 for 2011 Xperia. Where does this code come from? Do you upload somehow your ROMs to Cyanogenmod servers? If it is true, that means that if I build CM11 on my own I can get the latest features before you even release them with a nightly?
johnny.tifosi said:
Sorry for the noob question, first time builder here. You say you prepare the device specific code, but there is no official CM11 for 2011 Xperia. Where does this code come from? Do you upload somehow your ROMs to Cyanogenmod servers? If it is true, that means that if I build CM11 on my own I can get the latest features before you even release them with a nightly?
Click to expand...
Click to collapse
Legacy Xperia maintains the device trees on github. All the respective devices have their codes there. No, the builds are not uploaded to CM servers. But, if you build CM11 at whatever respective time you build, the latest feautes merged till that time will be incorporated in the build.
Sent from my Xperia Mini Pro using XDA Premium 4 mobile app
Hi,
For compile KitKat which better 32bit or 64bit Ubuntu ?
r00lz said:
Hi,
For compile KitKat which better 32bit or 64bit Ubuntu ?
Click to expand...
Click to collapse
32 bit
r00lz said:
Hi,
For compile KitKat which better 32bit or 64bit Ubuntu ?
Click to expand...
Click to collapse
The link in the OP states:
"Note:
You want to use a 64-bit version of Linux. According to Google, 32-bit Linux environment will only work if you are building older versions prior to Gingerbread (2.3.x)/CyanogenMod 7. However, as of 10.1 CyanogenMod does not build with 64bit host binaries on some systems. You will have to set something like BUILD_HOST_32bit=1 in your environment when building on such 64bit system. "
Start build.
Hope good luck.
In order to build for Xperia Ray I just have to replace "smultron" with "urushi" in each command, right?
johnny.tifosi said:
In order to build for Xperia Ray I just have to replace "smultron" with "urushi" in each command, right?
Click to expand...
Click to collapse
yes
hint:
I already had a build env for 10.1/10.2, and the first repo init... failed with "gpg bla cannot verify".
"gpg bla" is Finnish for "you need a new repo tool version". I re-installed it with
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
can anybody help with this please http://pastebin.com/2Te1YuPt
Building stops after about 10 minutes with the following error: AttributeError: 'NoneType' object has no attribute 'group'.
Code:
target thumb C++: third_party_WebKit_Source_wtf_wtf_gyp <= external/chromium_org/third_party/WebKit/Source/wtf/ArrayBuffer.cpp
Traceback (most recent call last):
File "../../base/android/jni_generator/jni_generator.py", line 1070, in <module>
sys.exit(main(sys.argv))
File "../../base/android/jni_generator/jni_generator.py", line 1066, in main
options.optimize_generation)
File "../../base/android/jni_generator/jni_generator.py", line 1001, in GenerateJNIHeader
jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
File "../../base/android/jni_generator/jni_generator.py", line 514, in CreateFromClass
jni_from_javap = JNIFromJavaP(stdout.split('\n'), namespace)
File "../../base/android/jni_generator/jni_generator.py", line 457, in __init__
contents[1]).group('class_name')
AttributeError: 'NoneType' object has no attribute 'group'
make: *** [/home/johnny/android/system/out/target/product/urushi/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Error 1
make: *** Waiting for unfinished jobs....
Any help?
Successfully build smultron on a clean Ubuntu VM. No problems.
ivosat said:
Successfully build smultron on a clean Ubuntu VM. No problems.
Click to expand...
Click to collapse
Same here. Had not a single problem while building. And it works amazingly fast with barely any noticeable bugs.
p0werdirector said:
Same here. Had not a single problem while building. And it works amazingly fast with barely any noticeable bugs.
Click to expand...
Click to collapse
How much data is being used during the whole process...
You will need more than 55 GB free space to build it from scratch ( Linux installation and everything else ).
ivosat said:
You will need more than 55 GB free space to build it from scratch ( Linux installation and everything else ).
Click to expand...
Click to collapse
I have no issues with storage ...cause ofd 1 tb hdd
but how much data i have to download to build it from scratch ?
Does everyone downloads that who build their own build ? !!
(Dont high speed bandwidths costs expensive in your countries ?)

Help building from linaro

Hi folks i see alot of guides using the google source code has anyone used linaro branches to build with
lolipop repo init -u git://android.git.linaro.org/platform/manifest.git -b android-5.0.0_r2
kitkat repo init -u git://android.git.linaro.org/platform/manifest.git -b android-4.4.4_r2.0.1
iam just starting to learn and wanted to try something different from the aosp
any guides would be great thanks
wanting to build for nexus 5 [hammerhead]

Local Manifest Help

Hey, i am from India. I am trying to compile a CM13 ROM for my device Micromax Q370 following XDA University guide. Well. There is no such fork available for my device in git. Well. I am done up to repo sync state successfully. But stucked after that. No idea about making device specific tree or adding a local manifest xml file. Whenever I give the command " $source build/envsetup.sh ", after repo sync process completes, I get an error with bash build/envsetup.sh : no such file or directory. same with Vendor/cm command also.
Whats the fix ?

Need Help with 'git Cherry-Pick' use and how it is affected on 'Repo Sync'

Hello,
I have an android repo that is init and synced to the 7.0 branch, and I have cherry picked fixes for a few projects.
My question is: if I invoke 'repo sync' does it sync back to the original init 7.0 branch without the cherry-picks for the projects? Everytime I run 'repo sync' to update my manifest, I seem to lose the cherry picked projects.
If so, how do I make my repo remember the changes I have made?
I tried 'repo start'
Code:
repo start 'my-local' --all
But that just seemed to change my original init branch to the "master" android branch, and then proceed to place the projects in to the 'my-local' branch.
https://github.com/NeoBeum/XpeRicoverE5823/tree/suzuran-7.0
Thanks
Yes, every time you execute repo sync it will sync back to original source. To keep your changes you have to fork manifest and push it to your git account. Than you have to init repo from your git fork of manifest. After that you should fork module you want to modify and charry pick commit. Push changes to your repo. Than modify manifest to download modified module from your repo instead from AOSP etc. You have to specify you remote in manifest and than repo sync. Propably you will have to force sync that particular module.
Look here, there are 3 parts: http://blog.udinic.com/2014/05/24/aosp-part-1-get-the-code-using-the-manifest-and-repo
I found a lot of useful things in that blog.
Thanks, yeah, I also got a reply from GitKraken and read how to use submodules. I also found that if you get disconnected, from the internet when doing anything git, sometimes messes up the objects.
I also realised now the reason repo has all projects, so you can make a full production build, and why it breaks when certain projects are removed... Only took 200GB of trial and error

Categories

Resources