Build errors after Brunch Hammerhead - Nexus 5 Developer Discussion [Developers Only]

Running into build errors after brunch hammerhead. Some files are missing in the out folder and the build stops and displays error 127 Ubuntu 14.2 LTS

Related

Compiling Rom From Source Help!

So I am trying to compile CM from his source code. As a learning exercise for me. I got the kernel to compile, without too much problem.
I then created a directory for the rom the path is ~/myandroid/cm/rom I initialized repo in this directory and gave the sync command.
Next I set up the build environment with the . build/envsetup.sh command.
Next I typed this: sed -n -e "s/^add_lunch_combo//gp" vendor/*/vendorsetup.sh
Then I gave this command lunch cyanogen_passion-userdebug (I also tried with eng version)
Now it runs for a while, and I have a decent machine (6 gig ram, dual core 2.6ghz proc, running 64bit karmic koala) when it gets to the end it says waiting for unfinished jobs and finishes.
But when I go to the out/target/product/passion folder there is no boot.img

[Q] Sync CNA source & build

Hey folks, hopefully someone can help me out. I've decided to start playing around with source, and have been trying to sync the CNA source on my ubuntu box.
So, I setup the development environment, made sure I had JDK 6, installed all the required packages, etc. All good.
Then I did
Code:
repo init -u git://github.com/CNA/android_manifest.git -b mod-4.0.3
I chose the mod-4.0.3 branch because its the only one I saw with any repositories related to the i9000 (obviously, posting here, I'd like to compile from source for my i9000). After the init, I just ran repo sync and let it go.
The problem is I get a few errors like:
Code:
fatal: not a git repository: '/home/me/android/system/.repo/projects/android.git'
error: cannot fetch android_manifest
fatal: not a git repository: '/home/me/android/system/.repo/projects/bionic.git'
error: cannot fetch android_bionic
error: Exited sync due to fetch errors
Anyway, I searched and can't seem to figure out what the heck I'm doing wrong. Any help would be fantastic.
Thanks!

[GUIDE] Build CM10 kernel from source + wkpark's RAM hack

For any CM10 ROM, except new bootloader one, hackfest, and CM10.1
This tutorial shows you how to build CM10 kernel from RC and the CM team's source(it is their work), and using wkpark's ramhack patch or other patches
If you are uncomfortable in building the kernel, you use my flashable sample kernel at the end of the post, which uses 56 MB RAM hack.
Pre-requistes:
A Linux system
An internet connectionc
Some time and patience
But the time required for downloading resources, and building once everything is set up, is only a fraction of the time required for a full CM10 ROM
You can follow this guide, with or without having built CM10 following Raum1807's excellent CM10 building guide. At one of the places, the difference occurs whether you had built CM10 before or not, and I have listed it at that place
For a first time build, you need to follow all the steps, but 2nd time onwards, you can skip to the build step or RAM hack setting step
Instructions:
STEP 1: SETTING UP THE ENVIRONMENT
Install any CM10 ROM on the device (old bootloader, non-hackfest, non-CM10.1 one)
If you already have CM10 environment set up, skip to "Create an environment variable..." part
Install development support packages:
Debian based Linux distributions (like Ubuntu)
64bit systems:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils schedtool pngcrush xsltproc zlib1g-dev:i386
then
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Red Hat based Linux distributions
32bit and 64bit systems:
git gnupg java-1.6.0-openjdk-devel flex bison gperf SDL-devel esound-devel wxGTK-devel zip curl ncurses-devel zlib-devel gcc-c++ glibc-devel
64bit only:
glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686
Setting up Java (thanks to Raum for the java setup guide)
You need a Java Development Kit for building CM10. Recommended is the SUN JDK 6. As of writing the most recent version is SUN JDK 6 Update 37.
1. Download the jdk-6u37-linux-i586.bin from the Oracle/Sun Java Download Area. If you are on 64-bit Ubuntu as I am, you should grab jdk-6u37-linux-x64.bin.
2. Make the bin file executable:
Code:
$ chmod +x jdk-6u37-linux-x64.bin
3. Extract the bin file:
Code:
$ ./jdk-6u37-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
$ sudo mv jdk1.6.0_37 /usr/lib/jvm/./jdk-6u37-linux-x64.bin
5. Install the new Java source in system:
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/java 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javaws 1
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javadoc 1
$ sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javah 1
$ sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javap 1
$ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
7. Check Java version:
Code:
$ java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
Now,
If you have CM10 source fetched already (if you have built cm10)
If the directory name where the cm10 source exists is "cm10" (as in Raum's building guide)
Create an environment variable denoting the location of the android toolchain as follows:
Code:
export CCOMPILER=${HOME}/cm10/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Or else, replace the path/name if yours is different
(If your arm-eabi version is not 4.4.3, check the folder name and change it accordingly)
If you do not have cm10 source on your pc, then you need to download the ARM EABI Toolchain separately
Download link, ready to extract
If above does not work, download from official site here
Download and extract then, create an environment variable denoting the location of the toolchain as follows:
Code:
export CCOMPILER=[extraction directory]/bin/arm-eabi-
Download Kernel Source Code:
Code:
mkdir -p ~/kernel
cd ~/kernel
Now download RC's CM10 kernel source
In terminal, do
Old bootloader:
Code:
git clone git://github.com/CyanogenMod/lge-kernel-star.git -b jellybean
New bootloader:
Here, pengus77 has made the necessary changes in his repo, so we fetch from that
Code:
git clone git://github.com/pengus77/lge-kernel-star.git
Thus, there should be a folder named "lge-kernel-star" inside /kernel folder
Then in terminal, cd to that directory "lge-kernel-star"
Code:
cd lge-kernel-star
Getting the config file
The next step is to copy the file "/kernel/lge-kernel-star/arch/arm/configs/cyanogenmod_p990_defconfig" to "/kernel/lge-kernel-star and rename it to ".config"
using the command:
Code:
cp arch/arm/configs/cyanogenmod_p990_defconfig .config
(Thanks to tonyp for the tip!)
STEP 2: CONFIGURATION
Configure the build:
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER oldconfig
If it happens to ask anything, just accept the defaults at every step by pressing enter.
STEP 3: APPLYING PATCHES
Applying patches like wkpark's RAM hack patch
If you skip this step, the kernel will work, but you'll have a completely stock kernel without RAM hack or other tweaks
Download wkpark's two patches from here and here, and put them in your /kernel directory
Code:
cd ~/kernel
Now to apply the patches, we use the patch command like this:
Code:
patch -Np1 -d lge-kernel-star < patchname.patch
(replace patchname with name of the patch file)
Here, -N is for ignoring patches that seem to be already applied or reversed
p<num> Strip the smallest prefix containing num(here num=1) leading slashes from each file name found in the patch file
In this case, num=1 according to the path names in wkpark's patch, and in a lot of cases, the value of 1 is common
-d is to change to the directory immediately, before doing anything else
You need to apply wkpark's two patches one by one (0001-..., then bootloader-...)
If you get errors while patching, if they are basic errors like file not found etc. then you should manage to fix it yourself.
But if you get errors like "HUNK ... failed",
try
Code:
patch -Np1 --ignore-whitespace -d lge-kernel-star < patchname.patch
A "HUNK ignored" is ok, if patch was attempted previously, since that file might have been successfully patched last time
if a HUNK still fails, then read the troubleshooting guide
Setting RAM hack size (If you skipped the above patching step, dont do this)
wkpark's patch makes it possible for you to set ramhack size in kernel command line parameter.
The cmdline parameter has to have the full boot.img command line parameters, which you can obtain from dmesg. I have done it for you, so you can save time on that
Here's how it looks for the old bootloader: (for the new one, ignore this)
Code:
<5>[70:01:01 00:00:00.000] Kernel command line: loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097
Paste the line starting from loglevel=0 till the end (serialno) into .config file in lge-kernel-star folder in
CONFIG_CMDLINE="<here>"
Insert a carveout size in between vmalloc and androidboot.mode
Determing carveout size: carveout=<152 - RAM hack size>M
For example, if RAM hack size is 56, then carveout is 96M
So in that case, the cmdline is like this:
old bootloader:
Code:
CONFIG_CMDLINE="loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M carveout=96M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097"
new bootloader:
Code:
CONFIG_CMDLINE="tegraid=20.1.4.0.0 [email protected] carveout=152M android.commchip=0 vmalloc=128M androidboot.serialno=037c7006421f6097 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,-3 androidboot.mode=normal usbcore.old_scheme_first=1 [email protected] [email protected] muic_state=0 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,boot:34700:1000:800,mbr:400:200:800,persist:600:2bc00:800,cache:2c200:7f00:800,misc:34200:400:800,userdata:38700:c0000:800,bcttable:0:600:800,bootloader:100:300:800,data/ve:f8800:1400:800,system:34c000:40000:800 "
and save the file
Dont set carveout too low, or else some gpu-intensive stuff may not work properly.
STEP 4: BUILDING THE KERNEL
In terminal,
Code:
cd ~/kernel/lge-kernel-star
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
This step may take a while, depending on your computer. Took ~5-10 mins for the first build for me, and ~1 min for the second build onwards.
If it asks in the terminal "use default config?" then say "y", if not, then ignore this
If you get some error and the building aborts within a few seconds, try the "Create environment variable part" again, and then return back directly to the build step.
After it is done, you should have a kernel stored in ~/kernel/lge-kernel-star/arch/arm/boot/zImage
Preparing the flashable zip for the kernel
Some compiled modules need to be included so that problems like wifi not switching on dont occur.
They are:
drivers/misc/bthid/bthid.ko
drivers/scsi/scsi_wait_scan.ko
drivers/net/wireless/bcm4329/wireless.ko
They will be used while preparing the flashable zip below.
Thanks to feav's compiled modules and benee's anykernel updater for star, all this is ready-made and you can simply:
Download the sample kernel zip attached below and replace /kernel/zImage and and the above modules in system/lib/modules/hw in that with yours, edit updater-script if you want.
Your flashable zip is now ready
STEP 5: FLASHING AND TESTING THE KERNEL
Put the sample kernel below as a backup in case your kernel does not boot and you need a working phone immediately.
Flash the kernel in recovery, wipe cache, dalvik cache and reboot.
If the phone goes past the LG logo screen(s) and into the bootscreen of the ROM, then it should work
Then you can check "kernel version" in settings->about phone to see your kernel information,
and you can see the new RAM size (which should be 342 MB + RAM hack size) in some app like battery dr saver, or antutu benchmark's system info.
If it doesnt work, make sure you have followed the entire guide properly and then ask queries
If you want to revert to another kernel, flash that kernel in recovery, or for stock kernel, flash your ROM.
Keeping kernel source up to date (for building again later after RC has made changes to the source):
Code:
cd ~/kernel/lge-kernel-star
git pull
This will update your source with the latest commits by RC. Then you can rebuild the kernel by doing the "create environment variable" and then skip directly to the build stage
Standard disclaimer:
I am not responsible if anything goes wrong with your phone or anything else.
Credits:
aremcee/RC and the rest of the CM team for all their work. This is their kernel you are building
wkpark for his valuable contributions, including the ramhack patches and cracking the new bootloader
benee for his Anykernel updater for star, and other tweaks
feav for his compiled wifi modules
pengus77 for the work to make it suitable for the new bootloader
Download links for sample kernels:
SAMPLE 56 MB RAMHACK KERNEL
SAMPLE 32 MB RAMHACK KERNEL
SAMPLE 24 MB RAMHACK KERNEL
Troubleshooting guide:
1. Patch failure
HUNK failed means that a particular file was not patched to some problem. In this case, a .rej file is saved in the same folder as the file to be patched, and it contains the stuff not patched.
Do not neglect "failed" hunk since it means a partially applied patch(some files patched, some files not), and may cause problems. "Ignored hunk" is ok, if the patch had been attempted before on a file and had succeeded on that file last time.
To manually patch the failed hunk, go that file where the hunk failed (has same name as .rej file without .rej extension)
For example, if .rej file is board-star.c.rej, and it contains the following sample lines (look for lines beginning with '+' and remove the + before adding, similar for -) go to board-star.c, and add the lines manually like this:
Code:
#if defined (CONFIG_STAR_REBOOT_MONITOR) || defined (CONFIG_BSSQ_REBOOT_MONITOR)
#define RAM_RESERVED_SIZE 100*1024
/* Force the reserved_buffer to be at its old (Froyo/GB) location
for reboot to work with the older bootloader */
if (strstr(saved_command_line, "brdrev=")) {
extern void *reserved_buffer;
pr_info("The older bootloader detected\n");
if (memblock_end_of_DRAM() > 0x17f80000) {
if (memblock_reserve(0x17f80000, RAM_RESERVED_SIZE)) {
pr_err("Fail to get reserved_buffer for the older bootloader\n");
} else {
pr_info("Change reserved_buffer for the older bootloader\n");
reserved_buffer = phys_to_virt(0x17f80000);
}
} else {
pr_info("Change reserved_buffer\n");
reserved_buffer = ioremap(0x17f80000, RAM_RESERVED_SIZE);
}
}
#endif
This was in the .rej file, and is to be added immediately after
Code:
#if defined(CONFIG_LGE_BROADCAST_TDMB)
star_dmb_init();
#endif /* CONFIG_LGE_BROADCAST */
in board-star.c (and before the next #if defined or closing bracket)
Similarly, the - lines to be deleted and + lines are to be added in that failed hunk file
(do this manual stuff only if hunk fails)
2. If ramhack kernel fails, but normal kernel works:
From your pc, in terminal do
adb shell dmesg > dmesg.txt
or from your phone, in android terminal emulator, do
dmesg > /sdcard/dmesg.txt
Copy it from your dmesg.txt starting from loglevel=0 till the end (serialno)
Look for a line in dmesg.txt which resembles this:
Code:
<5>[70:01:01 00:00:00.000] Kernel command line: loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097
Use your own phone's parameters instead of this and then set carveout size.
3. Problem with config file:
Pulling kernel config from device:
You need to retrieve a working kernel config from the device, and unzip it.
For that, connect your phone to your pc, enable USB debugging if it was disabled, and then in terminal
Code:
adb pull /proc/config.gz ~/kernel/lge-star-kernel-jellybean/config.gz
cat config.gz | gunzip > .config
Alternatively, you can pull the .config from the newest boot.img
Code:
scripts/extract-ikconfig boot.img > .config
Changes and updates:
25/12/12:
Added changes to be made for the new bootloader (in red color)
24/12/12:
Updated the guide, added some fixes and changes
22/12/12:
Slightly modified version of wkpark's 2nd patch (bootloader one) which may possibly fix one of the errors and may remove need for manually adding some lines
Last one
rugglez.....you rock mate....
I am not sure if I will really do something as I am getting old(lolz) and if I understand enough....
but thanks mate, for keeping spirits alive for this device
rugglez,
Did you see these posts: http://forum.xda-developers.com/showpost.php?p=34600723&postcount=189
http://forum.xda-developers.com/showpost.php?p=34601277&postcount=192
Did you experienced any ploblem with USB?
SREEPRAJAY said:
rugglez.....you rock mate....
I am not sure if I will really do something as I am getting old(lolz) and if I understand enough....
but thanks mate, for keeping spirits alive for this device
Click to expand...
Click to collapse
There are always some things worth experiencing once in life, like if you are an Android user, building a ROM and a kernel. You have experienced it with your wonderful AF kernel, thats important
feav said:
rugglez,
Did you see these posts: http://forum.xda-developers.com/showpost.php?p=34600723&postcount=189
http://forum.xda-developers.com/showpost.php?p=34601277&postcount=192
Did you experienced any ploblem with USB?
Click to expand...
Click to collapse
USB works fine, both adb and mass storage
This guide may seem intimidating, but trust me, once you complete it the first time, you'll find it really simple from the next build onwards.
Uploaded a slightly modified version of wkpark's 2nd patch (bootloader one) which may possibly fix one of the errors and may remove need for manually adding some lines. Updated link in OP and attached here too.
I tried the sample kernel and my camera stops functioning and so with other apps such as contacts, they don't start at all. Im on dec 20 nightly. Could it be the ramhack size? Maybe 32mb will suffice. Just saying.
Thanks to this, will probably try this next week..
aldyu said:
I tried the sample kernel and my camera stops functioning and so with other apps such as contacts, they don't start at all. Im on dec 20 nightly. Could it be the ramhack size? Maybe 32mb will suffice. Just saying.
Thanks to this, will probably try this next week..
Click to expand...
Click to collapse
Uploaded 32 MB ram hack kernel for those having problem with camera, try it out.
Download link 32MB RH
Update:
Added 24MB version too. Here you go:
24MB RH kernel
Thanks rugglez, 32 mb rh is ok so far, cm10 is way smoother and can still play nfs most wanted. Btw, can you apply the patch for double lg logo too by wkpark?
Sent from my P990-CM10
After installing the new kernel, if some apps still don't work or there any lag, disable "force gpu rendering" and "disable hardware overlays" in developer settings.
Thank you for your work! Just flashed the 32mb version without any problem. On cm7 the 48mb ramhack was the biggest without breaking 720p recording. Maybe you should give it a try!
Uhm download a kernel zip file?
How about git clone?
Sent from my Nexus 7 using xda app-developers app
tonyp said:
Uhm download a kernel zip file?
How about git clone?
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
Git clone size = ~440mb
Zip size = 120mb which extracts to that same size
Takes more time to download more for people like me with slow Internet, no other reason
Hi rugglez, got the ff. error when installing the required packages, Im on ubuntu 12.10 x64.
Note, selecting 'libsdl1.2-dev' instead of 'libsdl-dev'
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'sun-java6-jdk' has no installation candidate
E: Unable to locate package libwxgtk2.6-dev
E: Couldn't find any package by regex 'libwxgtk2.6-dev'
How to fix? Thanks.
aldyu said:
Hi rugglez, got the ff. error when installing the required packages, Im on ubuntu 12.10 x64.
Note, selecting 'libsdl1.2-dev' instead of 'libsdl-dev'
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'sun-java6-jdk' has no installation candidate
E: Unable to locate package libwxgtk2.6-dev
E: Couldn't find any package by regex 'libwxgtk2.6-dev'
How to fix? Thanks.
Click to expand...
Click to collapse
Can you install the dependencies from Raum's CM10 building thread here?
Follow steps 1 and 2 there.
Let me know if that works, ive updated the guide's step 1(setting up environment)
Installing the dependencies from this guide was the only thing i didnt test, since i had the CM10 environment set up already
a step is missing from this guide.
adb pull /proc/config.gz ~/kernel/lge-star-kernel-jellybean/config.gz
cat config.gz | gunzip > .config
Click to expand...
Click to collapse
then
mv config arch/arm/configs/<your_config_name>_defconfig
make ARCH=arm CROSS_COMPILE=$CCOMPILER oldconfig
make <your_config_name>_defconfig
make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
Click to expand...
Click to collapse
then continue...
if you don't make the default config the compiler throws out some errors.
ps: nice guide btw
rugglez said:
Git clone size = ~1.5gb
Zip size = 440mb which extracts to that same size
Takes forever to download more than a gig for people like me with slow Internet, no other reason
Click to expand...
Click to collapse
Hmm.. downloading it now and wondering why it's only 120mb, not 440mb as you said.
rugglez said:
Can you install the dependencies from Raum's CM10 building thread here?
Follow steps 1 and 2 there.
Let me know if that works, ive updated the guide's step 1(setting up environment)
Installing the dependencies from this guide was the only thing i didnt test, since i had the CM10 environment set up already
Click to expand...
Click to collapse
Thanks, ok now using your updated guide.
Btw, did you happen to upload a copy of the kernel zip file? Downloading from github takes forever, only 8 kb/s.
aldyu said:
Thanks, ok now using your updated guide.
Btw, did you happen to upload a copy of the kernel zip file? Downloading from github takes forever, only 8 kb/s.
Click to expand...
Click to collapse
Just use "git clone git://github.com/CyanogenMod/lge-kernel-star.git", it should give you better download speed than for the zipped archive.
I synced the whole CM10 source tree on the remote buildbox in about 5-10 minutes - so github does provide great downspeed
@rugglez: You should add to the OP that you don't have to use adb to get the kernel config, it's already there
arch/arm/configs/cyanogenmod_p990_defconfig
Please refer to the old cm7 kernel how to by pastime: http://forum.xda-developers.com/showthread.php?t=1227241
I really like the fact that more and more building guides get posted here - and that more and more people are building their own ROMs and kernels these days.
After building (which already is a great start) many people even want to learn more about android development in general. That's the true xda spirit!
Kudos!

[H][DEV] [T] Build CM12 for Xperia T Mint

Hello to everyone, my name is Tkd-Alex and I'm Italian :good: . Excuse me if I do English errors.
I woult to build the Cyanogenmod 12 for Xperia T mint by a source code of CM. Thanks to the cm wiki as I understand how this works. But I've errors with it! I hope you can help me. :angel:
Let's start! :laugh:
The first step to me is prepare the enviroment to build the rom. I've installed Ubuntu 13.10 64bit inside a Virtual Machine and I've installed Java and other tools/packages for building on it.
After basic installations I set up the repo command.
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Code:
sudo nano ~/.bashrc
Add at the end line: export PATH=~/bin:$PATH save and restart the bash
Code:
source ~/.bashrc
The second step is the Building.
Create the folder.
Code:
mkdir ~/cm12
Move in to the folder
Code:
cd ~/cm12
Initialize the CyanogenMod source repository
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-12.0
Sync the repo
Code:
repo sync
ERROR!
After repo sync I'll get prebuilt apps but when I send the command:
Code:
./get-prebuilts
I get the following error:
Code:
bash: ./get-prebuilts: File o directory not existing
Can anyone help me? @GabMus @updateing @WhiteNeo @Chefov01
You are not in the right directory.. "get-prebuilts" is an executable file that isn't present in the cm12 root directory.
Type this in Terminal before "./get-prebuilts":
Code:
cd ~/cm12/vendor/cm
However, afaik those prebuilt apps are no longer needed to build cm12. They have been removed from the build process some days ago.
WhiteNeo said:
You are not in the right directory.. "get-prebuilts" is an executable file that isn't present in the cm12 root directory.
Type this in Terminal before "./get-prebuilts":
Code:
cd ~/cm12/vendor/cm
However, afaik those prebuilt apps are no longer needed to build cm12. They have been removed from the build process some days ago.
Click to expand...
Click to collapse
bro is there any chance you could make a build for us T users? at least for testing purposes, im sure our developers would appreciate it a lot as well and would help as a starting point.. :-/
Not working.
WhiteNeo said:
You are not in the right directory.. "get-prebuilts" is an executable file that isn't present in the cm12 root directory.
Type this in Terminal before "./get-prebuilts":
Code:
cd ~/cm12/vendor/cm
However, afaik those prebuilt apps are no longer needed to build cm12. They have been removed from the build process some days ago.
Click to expand...
Click to collapse
Thank for reply, but I know that you say :highfive: . I had already tried the command ./get-prebuilts in the folder /cm12/vendor/cm but I forgot to say in the post. Now I'll try to ignore the prebuilds and download the muppets repo, extract the zip, rename in sony and copy the folder in /cm12/vendor. After that I will go in the root folder
Code:
croot
and try the brunch command
Code:
brunch mint
Is that correct?
tkd-alex said:
Thank for reply, but I know that you say :highfive: . I had already tried the command ./get-prebuilts in the folder /cm12/vendor/cm but I forgot to say in the post. Now I'll try to ignore the prebuilds and download the muppets repo, extract the zip, rename in sony and copy the folder in /cm12/vendor. After that I will go in the root folder
Code:
croot
and try the brunch command
Code:
brunch mint
Is that correct?
Click to expand...
Click to collapse
Well.. No.
For CM11 it would work, but CM12 needs different device files than the ones downloaded by "breakfast mint" or "brunch mint"..
I'm not quite sure it compiling Lollipop is a good start for learning android development if you've never built a rom before.
WhiteNeo said:
Well.. No.
For CM11 it would work, but CM12 needs different device files than the ones downloaded by "breakfast mint" or "brunch mint"..
I'm not quite sure it compiling Lollipop is a good start for learning android development if you've never built a rom before.
Click to expand...
Click to collapse
Infact with the breakfast command I've this:
Code:
[email protected]:~/cm12$ breakfast mint
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/sony/mint/cm.mk]]: "device/sony/common/resources.mk" does not exist. Arresto.
Device mint not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_sony_mint
Default revision: cm-12.0
Checking branch info
CyanogenMod/android_device_sony_mint already exists
Syncing repository to retrieve project.
Fetching project CyanogenMod/android_device_sony_mint
Fetching projects: 100% (1/1), done.
Repository synced!
Looking for dependencies
Done
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/sony/mint/cm.mk]]: "device/sony/common/resources.mk" does not exist. Arresto.
** Don't have a product spec for: 'cm_mint'
** Do you have the right repo manifest?
We can not do anything?
tkd-alex said:
Infact with the breakfast command I've this:
Code:
[email protected]:~/cm12$ breakfast mint
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/sony/mint/cm.mk]]: "device/sony/common/resources.mk" does not exist. Arresto.
Device mint not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_sony_mint
Default revision: cm-12.0
Checking branch info
CyanogenMod/android_device_sony_mint already exists
Syncing repository to retrieve project.
Fetching project CyanogenMod/android_device_sony_mint
Fetching projects: 100% (1/1), done.
Repository synced!
Looking for dependencies
Done
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/sony/mint/cm.mk]]: "device/sony/common/resources.mk" does not exist. Arresto.
** Don't have a product spec for: 'cm_mint'
** Do you have the right repo manifest?
We can not do anything?
Click to expand...
Click to collapse
Maybe you can check if some entries are missing in local_manifest (e.g. the sony common repo it listed there) mine is here: http://forum.xda-developers.com/showpost.php?p=57492538&postcount=52
And it's not a nice idea to learn building Android on T & CM12. It's not easy as CM11, lots of patches have to be applied to make it work...

[DEV] Building CyanogenMod 13 for Zenfone 5/6

Development: Building CyanogenMod 13 for Zenfone 5/6​
Prerequisites:
Ubuntu 16.04 (Installation Guide)
~80 GiB of Available Disk Space
Establishing a Build Environment
Open a Terminal Emulator (Ctrl+Alt+T)
Install the latest Ubuntu updates:
Code:
sudo apt-get update
sudo apt-get dist-upgrade
Add the OpenJDK 7 Repository:
Code:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
Install the Required packages by Android:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip maven yasm optipng openjdk-7-jdk
Install Repo:
Code:
sudo wget https://storage.googleapis.com/git-repo-downloads/repo -O/usr/bin/repo
sudo chmod +x /usr/bin/repo
Setup Git:
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Recommended: Reboot.
Downloading the Source:
Create a Working Directory:
Code:
mkdir -p ~/CM13
cd ~/CM13
Initialize the Repository (choose a command below):
Stable (ZNH2K):
Code:
repo init -u git://github.com/zf5/android.git -b stable/cm-13.0-ZNH2K
Stable (ZNH5Y):
Code:
repo init -u git://github.com/zf5/android.git -b stable/cm-13.0-ZNH5Y
Nightly:
Code:
repo init -u git://github.com/zf5/android.git -b cm-13.0
Download the Code:
Code:
repo sync -c -j4
Optional: Setup ccache (ccache acts as a compiler cache that can be used to speed up rebuilds)
Code:
echo "export USE_CCACHE=1" >> ~/.bashrc
export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Applying the Patches:
Download the Patches
Extract the Patches at your working directory
Apply the patch files by changing the directory to where they are and using the following command:
Code:
patch -p1 < filename.patch
Example: Applying the Patch for Vibration:
Code:
cd frameworks/base
patch -p1 < vibration.patch
(Do the same for every patch file in their respective directories)
Building the System:
Prepare the build environment:
Code:
. build/envsetup.sh
lunch cm_T00F-user
Build the System:
Code:
make -j4
That's it. Your system.img is located at WORKING_DIRECTORY/out/target/product/T00F/system.img
Also check out: Development: Building a Marshmallow Kernel for Zenfone 5/6
XDA:DevDB Information
Development: Building CyanogenMod 13 for Zenfone 5/6, Tool/Utility for the Asus Zenfone 5
Contributors
dgadelha
Version Information
Status: Stable
Created 2016-04-21
Last Updated 2016-09-13
For T00G:
Device Tree: https://github.com/T00G-Marshmallow-DEV/android_device_asus_T00G
Vendor Tree: https://github.com/T00G-Marshmallow-DEV/android_vendor_asus_T00G
Information: Sensors and some bugs fixed.
Gooood! Thanks very much
For cm12.1 also same method? Because I got some error on building cm12.1
AhZhi said:
For cm12.1 also same method? Because I got some error on building cm12.1
Click to expand...
Click to collapse
Yes. But I think you'll need to apply the Vibration patch manually, as it will probably fail.
And, well, no need to apply all the patches, only vibration.
That's it.
dgadelha said:
Yes. But I think you'll need to apply the Vibration patch manually, as it will probably fail.
And, well, no need to apply all the patches, only vibration.
That's it.
Click to expand...
Click to collapse
Thank you now i go to try it
Error
dgadelha said:
Development: Building CyanogenMod 13 for Zenfone 5/6​
Prerequisites:
Ubuntu 15.10 (Installation Guide)
~80 GiB of Available Disk Space
Establishing a Build Environment
Open a Terminal Emulator (Ctrl+Alt+T)
Install the latest Ubuntu updates:
Code:
sudo apt-get update
sudo apt-get dist-upgrade
Install the Required packages by Android:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip maven yasm optipng openjdk-7-jdk
Install Repo:
Code:
sudo wget https://storage.googleapis.com/git-repo-downloads/repo -O/usr/bin/repo
sudo chmod +x /usr/bin/repo
Setup Git:
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Recommended: Reboot.
Downloading the Source:
Create a Working Directory:
Code:
mkdir -p ~/CM13
cd ~/CM13
Initialize the Repository:
Stable:
Code:
repo init -u git://github.com/zf5/android.git -b stable/cm-13.0-ZNH2K
Nightly:
Code:
repo init -u git://github.com/zf5/android.git -b cm-13.0
Download the Code:
Code:
repo sync -c -j4
Optional: Setup ccache (ccache acts as a compiler cache that can be used to speed up rebuilds)
Code:
echo "export USE_CCACHE=1" >> ~/.bashrc
export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Applying the Patches:
Download the Patches
Extract the Patches at your working directory
Apply the patch files by changing the directory to where they are and using the following command:
Code:
patch -p1 < filename.patch
Example: Applying the Patch for Vibration:
Code:
cd frameworks/base
patch -p1 < vibration.patch
(Do the same for every patch file in their respective directories)
Building the System:
Prepare the build environment:
Code:
. build/envsetup.sh
lunch cm_T00F-user
Build the System:
Code:
make -j4
That's it. Your system.img is located at WORKING_DIRECTORY/out/target/product/T00F/system.img
Also check out: Development: Building a Marshmallow Kernel for Zenfone 5/6
XDA:DevDB Information
Development: Building CyanogenMod 13 for Zenfone 5/6, Tool/Utility for the Asus Zenfone 5
Contributors
dgadelha, tank0412
Version Information
Status: Stable
Created 2016-04-21
Last Updated 2016-05-11
Click to expand...
Click to collapse
Fetching projects: 51% (222/435)
error: Exited sync due to fetch errors
Can you help me ?
HONGARC said:
Fetching projects: 51% (222/435)
error: Exited sync due to fetch errors
Can you help me ?
Click to expand...
Click to collapse
type again last comand
it will resume, try use google there are some comands what will help you
And how to creat .zip flash on twrp
adekcan said:
And how to creat .zip flash on twrp
Click to expand...
Click to collapse
you can use otapackage but you must this have in device tree or you can extrac system.img file after build
Hi @dgadelha..
I have successfully built the rom and kernel in my laptop using the steps you provided on first page..
After that I flashed it to my phone and it's been working so smooth and stable. It was a great experience for me getting the phone work using the firmware compiled by me ?. Many thanks for you..
Sent from my ASUS_T00F using XDA-Developers mobile app
sapiterbang said:
Hi @dgadelha..
I have successfully built the rom and kernel in my laptop using the steps you provided on first page..
After that I flashed it to my phone and it's been working so smooth and stable. It was a great experience for me getting the phone work using the firmware compiled by me ?. Many thanks for you..
Sent from my ASUS_T00F using XDA-Developers mobile app
Click to expand...
Click to collapse
Ohh that's good it means new dev come !! ??
sapiterbang said:
Hi @dgadelha..
I have successfully built the rom and kernel in my laptop using the steps you provided on first page..
After that I flashed it to my phone and it's been working so smooth and stable. It was a great experience for me getting the phone work using the firmware compiled by me . Many thanks for you..
Click to expand...
Click to collapse
Nice to hear that.
What is the procedure if I want to run this rom on stock kernel? (I am asking this because I have no camera found bug after unlocking bootloader.)
Beside that your guide is awesome.
[email protected][email protected]@ said:
What is the procedure if I want to run this rom on stock kernel? (I am asking this because I have no camera found bug after unlocking bootloader.)
Beside that your guide is awesome.
Click to expand...
Click to collapse
There is no procedure, you can't do that.
[email protected][email protected]@ said:
What is the procedure if I want to run this rom on stock kernel? (I am asking this because I have no camera found bug after unlocking bootloader.)
Beside that your guide is awesome.
Click to expand...
Click to collapse
You have to build a Lollipop 5.0 based ROM to run with stock kernel.
leonardohenrique10 said:
You have to build a Lollipop 5.0 based ROM to run with stock kernel.
Click to expand...
Click to collapse
I'm a bit disappointed,but anyway thanks a lot for information.
getting error in applying patches
I am getting erros while applying patch.....I reffered ur steps from guide by u that how to build cyanogenmod for zenfone 5....I have downloaded and synced sources and when i come to apply patch then i get error..
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/linker/linker.cpp b/linker/linker.cpp
|index bc40cf1..899eeca 100644
|--- a/linker/linker.cpp
|+++ b/linker/linker.cpp
--------------------------
File to patch: y
y: No such file or directory
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
please help me...
Desert fox2612 said:
I am getting erros while applying patch.....I reffered ur steps from guide by u that how to build cyanogenmod for zenfone 5....I have downloaded and synced sources and when i come to apply patch then i get error..
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/linker/linker.cpp b/linker/linker.cpp
|index bc40cf1..899eeca 100644
|--- a/linker/linker.cpp
|+++ b/linker/linker.cpp
--------------------------
File to patch: y
y: No such file or directory
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
please help me...
Click to expand...
Click to collapse
You need to copy the file bionic/linker.patch to the directory ~/CM13/bionic/
then you need to do
Code:
cd ~/CM13/bionic
patch -p1 < linker.patch
dgadelha said:
You need to copy the file bionic/linker.patch to the directory ~/CM13/bionic/
then you need to do
Code:
cd ~/CM13/bionic
patch -p1 < linker.patch
Click to expand...
Click to collapse
Thanks....that helped me.. Btw should I ignore warnings generated between building img file? & one prob is linker.patch is not worked....rest all patches worked....will it create problem?

Categories

Resources