yashsingh1/xdaforums huggingface dataset:
[HTC Pico (Explorer)] immortal_yash:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Dude i was building mini cm 9 on Ubuntu 11.10 32 bit and everything worked except when there was a motherboard failure
[HTC Pico (Explorer)] #define:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

hmmmm... Thats weird..

Coz google themselves recommend 64 bit for gb n above

Sent from my Nexus 7
[HTC Pico (Explorer)] immortal_yash:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

They recommend but we can use 32 bit as well just a little more downloading will be req
[HTC Pico (Explorer)] #define:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

i've never tried 32 for rom compiling..

Get that info here.. So op can add it..

Sent from my Nexus 7
[HTC Pico (Explorer)] Doublepranks:
Good to hear that! The sources are all out there just waiting to be gathered and putted together while I never done such stuff before I still am a linux user and I understand most of androids concepts I even already dumped the entire system folder out of my Moto g and its running 4.3 which will come very handy making everything easier! Thanks a lot for your time answering!

#Edit

Correct me if I'm wrong but it seems like this command is no longer working

so I had to use this:

Typing the first one in I was getting syntax error but the second one which I found on google's official page worked and i'm now downloading CM10.2 sources.

Hope it will help somebody.

#edit 2

Hey guys I made through the entire guide but got stuck on the most fun part! That's what I get when trying to build.

does anyone know how I could get it to build?

Again, it's my first time doing such a thing excuse me if I'm bothering you all ;)
[HTC Pico (Explorer)] galaxyfreak:
No problem mate, but error message speaks for itself this time.

Go to BoardConfig.mk and add TARGET_CPU_VARIANT := cortex-a9, or whatever cortex version your device have.

If you don't know, set it to generic
[HTC Pico (Explorer)] SSKSSK:
Guys while following the 3rd step in op's post i got the following error

root@ssk-desktop:/home/ssk# apt-get install oracle-java6-set-default

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package oracle-java6-set-default

What to do guys??
[HTC Pico (Explorer)] Powerhouse:
Great Guide .. :beer:
[HTC Pico (Explorer)] shorinryu:
While I was installing I double checked the oracle site to see what the current version of java was and changed the 6 to a 7 since that is the current version number released. I did that from the beginning so never got an error. Hope that helps

Following on from this, I have had a problem adding the libraries and git. The first command line worked fine:

apt-get install git-core gnupg flex bison gperf build-essential

The next command returns an error

zip warning: name not matched: zlib1g-dev

zip warning: name not matched: libc6-dev

zip warning: name not matched: libncurses5-dev

zip warning: name not matched: x11proto-core-dev

I have never used Linux before and this is my first time working with a virtual machine environment. I am using virtualbox with Ubuntu 13.10 64-bit installed and not sure how to check that the files are correct or not. I am getting an idea for some of the command and how linux works as I do this but obviously I am missing something.

EDIT: I have managed to get it working and begin setup of the CM repo. Clearly the packages that were required needed to be typed in as one command and that was my mistake for not realising. This has been a very good guide and much easier than some others that I have seen and tried using.
[HTC Pico (Explorer)] DG|Buu:
error

Bash:Repo: command not found :(:crying::crying:
[HTC Pico (Explorer)] Mister_Magister:
Help! "Cannot fetch galaxyfreak/android_frameworks_native"
[HTC Pico (Explorer)] v_superuser:
It doesn't exists, therefore, you cannot fetch it.
[HTC Pico (Explorer)] Mister_Magister:
Ok but how to fix it? I want download source CM10.1
[HTC Pico (Explorer)] v_superuser:
Find another trusted repo source and change the path accordingly in the local manifest.
[HTC Pico (Explorer)] Mister_Magister:
But where?
[HTC Pico (Explorer)] v_superuser:
https://github.com/androidarmv6/android_frameworks_native/tree/cm-10.1
[HTC Pico (Explorer)] mirhl:
Swapping on usb key.. shouldn't fu** up the flash memory?
[HTC Pico (Explorer)] thewisenerd:
IMO, 4GB of RAM is enough for compiling android versions till 4.3.1.

I personally run a 4GB RAM PC (~3.7 GB available), and didn't have any problems compiling 4.3.1.

Problems arose with 4.4 compilations with large libraries like libwebviewchromium, which need a lot of memory (greater than 4GB, currently), so, I have used a transcend 4 gigs pendrive, with live-swap, for finishing the compilation.

As for the "phucking up the flash memory" part, is when I decided to go for repartitioning my hard-drive, and creating a 5.4 gigs swap drive (and ofc, adding it to /etc/fstab later).

So, RAM, or, flash memory, in the end, make sure the compiler gets enough to wedge through the memory constraints to complete the compilation.

p.s. if you are planning on using your computer while compiling, make sure you throw in a few extra gigs of swap, and/or preferably lower the number of jobs. the RAM is filled first, then, goes to swap (which can be overriddedn by vm.swappiness), so, you could either lower the jobs, use your computer, or buy a few more gigs of RAM, and probably a better processor.
[HTC Pico (Explorer)] mirhl:
yeah, for sure

I simply didn't understand why it's recommended to swap on the usb memory instead of creating a 3-4GB swap partition on the hard disk
[HTC Pico (Explorer)] Mister_Magister:
many repositories not found!
[HTC Pico (Explorer)] thewisenerd:
Nice. One does not simply *blindly* follow guides.

P.S. Find those repos ;)
[HTC Pico (Explorer)] Mister_Magister:
some i find some not so what?
[HTC Pico (Explorer)] v_superuser:
Why building CM 10.1, if not, follow steps in appropriate branch in https://github.com/CyanogenMod/android
[HTC Pico (Explorer)] po8pimp:
Help please

I am trying to compile CM from source and keep getting the error with android.kernel.org not being a correct url. I did gedit the .repo/manifest and still no luck, just keep getting errors from that point. Can someone please help guide me in the right directions. I can provide screenshots if needed. Thanks in advance. Also I have googled it and searched around with no luck except small guides for editing the manifest which did not work. I could be doing it wrong, but I am not a complete noob to this stuff so I am pretty sure that's not the case. I am compiling an older Cyanogen too. CM7 to be exact.
[HTC Pico (Explorer)] djalfy:
Could someone please explain to me why after i built my first cm13.0 build for hammerheadcaf (20160319) and i've tried the next days to build again, after i flash the builds named clearly 20160320 or 20160321 in my about phone section i still see the 20160319 build and my first build's date and time? I did the repo sync and all but it seems that i keep building the same build again and again. I'm new to the building scene and i think i'm doing something wrong. Thank you.
[HTC Pico (Explorer)] galaxyfreak:
Type "make clean" and start build again.
[HTC Pico (Explorer)] djalfy:
Thank you. That worked but now i have another issue. When i try to repo sync i get the message fatal, *some recovery file* is allready defined in *some other recovery file* leaving folder

Make failed.

My first idea was to delete everything and resync all sources again but maybe there is a simpler, quicker solution.
[HTC Pico (Explorer)] galaxyfreak:
There is a simpler solution. Delete one of those two.

If you need more help, give me exact error message, and link to device repositories you use.
[HTC Pico (Explorer)] djalfy:
I'building cm 13.0 caf for hammerhead using a script made by an xda user. The script is here https://github.com/suksit/cm13_hammerheadcaf_build_script/blob/master/build_hammerheadcaf.sh

After the first build i ran the same script again but without the first part wich is downloading the tools for building. Right now i am starting clean again. After the sources download i will try to make 2 builds and see if the second one gives me any errors again and will let you know. Thank you for your help. :D
[HTC Pico (Explorer)] hackslash:
Hello everyone! I need some help here. I'm trying to compile CM 13 from source but the build is always failing at libtinyalsa (it isn't getting compiled):

In file included from bionic/libc/include/signal.h:32:0,
from bionic/libc/include/sys/select.h:33,
from bionic/libc/include/unistd.h:35,
from external/tinyalsa/pcm.c:35:
/media/android/system/out/target/product/hi6210sft/obj/KERNEL_OBJ/usr/include/asm/sigcontext.h:53:2: error: unknown type name '__uint128_t'
__uint128_t vregs[32];
^
external/tinyalsa/mixer.c: In function 'mixer_ctl_set_value':
external/tinyalsa/mixer.c:406:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (value < 0 || value >= mixer_ctl_get_num_enums(ctl))
^
make: *** [/media/android/system/out/target/product/hi6210sft/obj_arm/SHARED_LIBRARIES/libtinyalsa_intermediates/mixer.o] Error 1
make: *** Waiting for unfinished jobs....
external/tinyalsa/pcm.c: In function 'pcm_mmap_commit':
external/tinyalsa/pcm.c:1113:51: warning: unused parameter 'offset' [-Wunused-parameter]
int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames)
^
make: *** [/media/android/system/out/target/product/hi6210sft/obj_arm/SHARED_LIBRARIES/libtinyalsa_intermediates/pcm.o] Error 1

Any idea what I'm doing wrong?

Thanks!
[HTC Pico (Explorer)] Sudarshankakoty:
Well, Noob here. I have downloaded CM13 Source Code in Compressed Format (10GB) from a another computer, so I dont have to download that separately. But no idea where to place those downloaded source codes after extractions. Which steps to skip from your instructions as I have already downloaded them ?
[HTC Pico (Explorer)] smr404:
Just wanted to say thanks to all the contributors to this thread. It's been really helpful, even all these years later.
[HTC Pico (Explorer)] HarshOne:
Any solution for this error?

Starting build with ninja
ninja: Entering directory `.'
ninja: error: '/home/harshone/android/lineage/out/target/product/m8/obj/KERNEL_OBJ/usr', needed by '/home/harshone/android/lineage/out/target/product/m8/obj/STATIC_LIBRARIES/libsdcard_intermediates/sdcard.o', missing and no known rule to make it
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/harshone/android/lineage'

#### make failed to build some targets (02:30 (mm:ss)) ####

:confused::confused::confused:
[HTC Pico (Explorer)] theviper:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Gud wrk dude!!
[HTC Pico (Explorer)] Nihar.G:
This stuff is not for noobs.

Great work Marin!
[HTC Pico (Explorer)] theviper:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

This and bhargz's compiling guides should be pinned
[HTC Pico (Explorer)] #define:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Pm any mod with links..

This may just be ur lucky day

Sent from my Nexus 7
[HTC Pico (Explorer)] ngoralph:
for example i would like to build a rom from source ie slimbean/ blackbean and the likes what should i change from the given instruction??

is it device tree??
[HTC Pico (Explorer)] #define:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

The source repos and device trees..

That's all you need to change..

If the device tree doesnt exist, then you'll hv to port it...

Sent from my Nexus 7
[HTC Pico (Explorer)] galaxyfreak:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Added tutorial and explanation about using SWAP memory in 2nd post!
[HTC Pico (Explorer)] derefas:
repo sync -j8 - 50% that you stuck on 80-99% of syncing and you will need to start from zero...

just use repo sync without -jN
[HTC Pico (Explorer)] galaxyfreak:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

I remember 99% stuck happened to oblikas, I have slow connection so I personally used -j4. OK edited post, thanks for note! :D
[HTC Pico (Explorer)] Nihar.G:
You need to change the repo init line. Also make changes in device tree if the ROM needs any.

Kernel remains exactly same in 99% of the cases.

Some device tree changes are obvious such as changing paths and stuff.
[HTC Pico (Explorer)] immortal_yash:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

I use j1 so downloading speed is constant and repo gets downloaded faster for me
[HTC Pico (Explorer)] russelldias:
What's your download speed?
[HTC Pico (Explorer)] immortal_yash:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

130kbs per sec i know it's slow but if i get constant speed source gets sync faster
[HTC Pico (Explorer)] #define:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Slow??

I download at 30kbps...

Thats what you call slow..

:p

Sent from my Nexus 7
[HTC Pico (Explorer)] ngoralph:
the proprietary files from cm9-cm10.1 does not change right?

its still the one on the OP??
[HTC Pico (Explorer)] Nihar.G:
You mean vendors ?
[HTC Pico (Explorer)] #define:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

No they're the same across different platforms...

Sent from my Nexus 7
[HTC Pico (Explorer)] ngoralph:
yes thats what i mean :)

EDIT:

Thanks guys cant press it limited to 8 thanks pero day hope XDA increases it lol
[HTC Pico (Explorer)] galaxyfreak:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Yes, vendor is same

Sent from a chocolate cake.
[HTC Pico (Explorer)] Red Devil:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

A huge bump and thumbs up for this guide. Thanks a lot.

Ps : Bump for changes. Better than other threads in the forum being up there.
[HTC Pico (Explorer)] <CyberAnarchy>:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

I really have to thank you for this excellent guide
[HTC Pico (Explorer)] aamir0701:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

now this wat called noob frienly tut :thumbup:

great job
[HTC Pico (Explorer)] Jbyn4e:
So for 15gb of cm10.1 repo sync you need.... how much time?

---------- Post added at 10:37 PM ---------- Previous post was at 10:32 PM ----------

Why do we have to reboot in this step?
[HTC Pico (Explorer)] galaxyfreak:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Its recommemend, because you installed a lot of new stuff.

Sent from a chocolate cake.
[HTC Pico (Explorer)] <CyberAnarchy>:
I will now try this tut.. the instructions are detailed and simplified. And 4gb ram should be enough right?
[HTC Pico (Explorer)] galaxyfreak:
Re: [TUT][REMAKE] Compile CyanogenMod from source - Very detailed and noob friendly

Yea

Sent from a chocolate cake.
[HTC Pico (Explorer)] ngoralph:
is it okay for 2gb without swap?

and.....

display legacy also for cm9/10????
[HTC Pico (Explorer)] immortal_yash:
keep swap about 5 gb for smooth run :)
[HTC Pico (Explorer)] Nihar.G:
Display legacy source needed only for CM10.1.

CM10, CM9 work without any source hacks. :)

If u have 2GB RAM, at least a 6gb swap is recommended. I have 4GB RAM and at peak RAM usage I have only about 400MB ram free. So you can guess how much RAM it requires.

Also, dont do anything more than -j2.
[HTC Pico (Explorer)] ngoralph:
umm.. ram is required for the building right??

i'm still in the process of repo syncing :)

its more than 2 hours already :)
[HTC Pico (Explorer)] <CyberAnarchy>:
If I have more ram can I keep it greater than -j2?

Im running ubuntu on a virtual machine so pls tell me

How much ram should I allocate for good performance out of

16gb total without allocating whole 16 gb though.
[HTC Pico (Explorer)] galaxyfreak:
I added FAQ in 4th post. Now this guide is complete. Good luck! :)
[HTC Pico (Explorer)] Nihar.G:
How much have you allocated to VM ? Personally I have 4GB RAM and a Quad core processor. I have done till -j6 and it works totally fine.

---------- Post added at 10:30 PM ---------- Previous post was at 10:25 PM ----------

Yup. Building requires lots of resources.
[HTC Pico (Explorer)] ngoralph:
help guys

after putting

this appeared

including vendor/cm/vendorsetup.sh
ls: cannot access device/*/pico/cm.mk: No such file or directory
build/core/product_config.mk:234: *** Cannot locate config makefile for product "cm_pico". Stop.
Device pico not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Traceback (most recent call last):
File "build/tools/roomservice.py", line 59, in <module>
result = json.loads(urllib2.urlopen(githubreq).read())
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
ls: cannot access device/*/pico/cm.mk: No such file or directory
build/core/product_config.mk:234: *** Cannot locate config makefile for product "cm_pico". Stop.

** Don't have a product spec for: 'cm_pico'
** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'
[HTC Pico (Explorer)] immortal_yash:
give me a screenshot of device folder and device/htc/pico folder
[HTC Pico (Explorer)] ngoralph:
fixed it :) forgot to put it on device/htc/pico folder

---------- Post added at 02:26 PM ---------- Previous post was at 02:18 PM ----------

sir, "could not find jdk tools.jar"

jdk needed to be installed?
[HTC Pico (Explorer)] galaxyfreak:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

You need to put device tree in device/htc/pico

Sent from a chocolate cake.
[HTC Pico (Explorer)] Nihar.G:
First of all, only

brunch pico -jX

is fine. No need for whole name.

Secondly, looks like u havent put the device tree in the right place.

---------- Post added at 12:28 PM ---------- Previous post was at 12:28 PM ----------

Yep. Oracles JDK is needed. Open JDK gives problems.

---------- Post added at 12:35 PM ---------- Previous post was at 12:28 PM ----------

Follow this to install Java:

Copy and paste in terminal:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer

Then to set it as default:

sudo apt-get install oracle-java6-set-default
[HTC Pico (Explorer)] ngoralph:
thanks dude :)

i think this should be posted at the OP
[HTC Pico (Explorer)] Nihar.G:
Yep, I notified galaxyfreak about that. Looks like he missed this part. :)
[HTC Pico (Explorer)] ngoralph:
is this error normal??

Trying dependencies-only mode on a non-existing device tree?
[HTC Pico (Explorer)] galaxyfreak:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

Its not error, just let it go

Sent from a chocolate cake.
[HTC Pico (Explorer)] immortal_yash:
yes :)
[HTC Pico (Explorer)] galaxyfreak:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

1stly, tnx nihar g. And Immortal_yash for providing support here. Ill add it when i come home

Sent from a chocolate cake.
[HTC Pico (Explorer)] #define:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

Guys, remember one thing...

When building, a lot of warnings will show...

But if the build continues, disregard all of them..
[HTC Pico (Explorer)] ngoralph:
gonna try to restart all over again lol after "brunch pico"

no zip file appeared only bunch of files lol i think i made a mistake somewhere
[HTC Pico (Explorer)] galaxyfreak:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

Done some changes:

- Corrected singleton.h patch folder path

- Fixed singleton.h collapsed URL (XDA automatically added URL tags)

- Corrected vendor folder path

- Removed duplicate words :P

- Added Java installation

- Added pngcrush package (its bad to see much red color at the end) :P

I think everything is now correct. I apologize one more time for mistakes, because I wrote whole tutorial myself (copypasted only packages, and ofc, download links).
[HTC Pico (Explorer)] ngoralph:
step 9 should be

~/Cm10.1/Android/system/....

---------- Post added at 04:55 PM ---------- Previous post was at 04:16 PM ----------

anyone knows how to fix this error??

host C: libmincrypt <= system/core/libmincrypt/rsa.c
prebuilts/tools/gcc-sdk/gcc: line 56: /root/CM10/android/system/prebuilts/tools/gcc-sdk/../../gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/i686-linux-gcc: No such file or directory
make: *** [/root/CM10/android/system/out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/rsa.o] Error 127
make: *** Waiting for unfinished jobs....
# In case value of PACKAGES is empty.
[HTC Pico (Explorer)] galaxyfreak:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

Corrected now!
[HTC Pico (Explorer)] galaxyfreak:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

Ask on thread I linked in FAQ

Sent from a chocolate cake.
[HTC Pico (Explorer)] Nihar.G:
Why are you compiling as root :eek:
[HTC Pico (Explorer)] ngoralph:
compling doesn't need to be root????

you need root to reach the repo folder right??

and btw i fixed that error already by installing some libs

EDIT;

HOLY....

this the only time i went back to the OP and see that building doesn't need to be in root :(

anyways

@ NIhar. G

anyway i can transfer the whole repo out of root without redownloading repo???
[HTC Pico (Explorer)] Nihar.G:
Yep. Just copy the source folder from /root (or wherever it is) to /home/<yourusername>/CM10.1 (Or whatever you like it to be).
[HTC Pico (Explorer)] galaxyfreak:
Re: [GUIDE] Compile CM from source, source basics & FAQ - Very detailed and noob frie

I entered sudo su at beggining so we dont need to type sudo all the time while setup, when actually compiling you dont need root.
[HTC Pico (Explorer)] ngoralph:
sooo basically repo folder should not be located at the root folder

thanks for the help again guys :)
[HTC Pico (Explorer)] manoj94:
great work :good:..
[HTC Pico (Explorer)] Nihar.G:
Nope. Its better if it is in /home/<username>/<foldername>
[HTC Pico (Explorer)] Red Devil:
I cant seem to find the folder in the specific folder to which I cd-ed and started to repo sync.. It is in the /home/username/ folder.. I cant even check where the files are downloading to..

I did

:confused:
[HTC Pico (Explorer)] galaxyfreak:
told ya this already on facebook... CTRL+L and /home/username/folder/android/.repo or /android/system/.repo not sure...after its downloaded it will be visible in /android/system