[GUIDE][AOSP][WIP] Build android from source on windows 10 - Android General

CURRENT STATUS: can compile android kernel successfully, right now cant compile complete rom.
Edition: Windows 10
Version: 1607
OS Build: 14393.222
===========================================
REQUIREMENTS
===========================================​
1) Windows 10 64-Bit with Anniversary Update
===========================================
Setting up ubuntu bash on windows 10
===========================================​
1) open the Settings --> Update & Security --> For Developers--> enable Developer Mode
2) search for “Turn Windows Features On or Off” in cortana & hit enter
3) Enable the “Windows Subsystem for Linux (Beta)” option in the list and click “OK.” & restart your system
4) search for “bash” in cortana & hit enter
5) type "y" & hit enter
6) download of ubuntu for windows 10 will start. It will take some time depending on your internet speed. You’ll be asked to create a user account and password for use in the Bash environment. restart your system
7) search for “Bash on Ubuntu on Windows” in cortana & hit enter
8) congratulations you have successfully installed bash on windows 10
9) OPTIONAL
add bash to context menu (developer is Manouchehri)
install this reg entry,... Accept the warnings and import it.
===========================================
Setting up a Linux build environment
===========================================​
1) open “Bash on Ubuntu on Windows”
Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install default-jdk
sudo apt-get install android-tools-adb android-tools-fastboot
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 python-networkx
===========================================
How To's
===========================================​
warning 1: do not edit your linux files i.e. "C:\Users<username>\AppData\Local\lxss" in windows,... it will make the files useless in bash... never add files or edit files of linux subsystem from windows,....
Solution: copy the files out of linux sub system i.e. "lxss", edit them, then use bash to move the files back to "lxss"
---------------------------------------------------------------------
warning 2: Do not mnt and download android source,... download the source in linux subsystem (inside lxss) only...
---------------------------------------------------------------------
Problem: where are my ubuntu files
Solution: All your bash files are located in "C:\Users<username>\AppData\Local\lxss\rootfs". your home directory is located in "C:\Users<username>\AppData\Local\lxss\home"
---------------------------------------------------------------------
Problem: sudo: unable to resolve host
Solution: delete hosts file of ubuntu, it will auto generate the next time you open “Bash on Ubuntu on Windows" (C:\Users\<username>\AppData\Local\lxss\rootfs\etc\hosts)
---------------------------------------------------------------------
Problem: Java 8 doesn't install or work
Solution: know bug. use the following code. it will install java 7
Code:
sudo apt-get install default-jdk
---------------------------------------------------------------------
Problem: how to access windows files in bash
Solution: for example you want to navigate to downloads "C:\Users\<username>\Downloads"
Code:
cd /mnt/c/Users/<username>/Downloads
---------------------------------------------------------------------
Problem: repo not found or needs to be installed even after it was successful installed
Solution: use the following command
Code:
nano ~/.bashrc
add this at the end
Code:
PATH=~/bin:$PATH
press Ctrl+o & Ctrl+x
---------------------------------------------------------------------
Problem: can't mount my drive
Solution:: In order for a drive to show up under /mnt/ it must meet the following criteria:
1. The drive must be a fixed drive
2. The drive must be formatted to NTFS
---------------------------------------------------------------------
=======================================
*****still experimenting with bash, still have a few problems to successfully compile the rom,... will update if i find something

Move Home Ubuntu Directory
I can move ubuntu home directory from C to another drive?

@IacobIonut-DW
i am afraid you cant change it,.... there are duplicate files in ubuntu example lxss\text.txt & lxss Text.txt
if you try to copy the folder you will get a error message

It seems interesting I'm going to try it and will give you my feedback .
BTW , I've ubuntu installed along side with windows can I the files on ubuntu partition with the bash installed on windows ?

@LahKeda
No you can't read that drive

Nice to see that guide, great work!
But I am stuck at this point currently: stackoverflow | Bash on Ubuntu on Windows, Compile AOSP.
My strace file says about the same thing.
Did you find any solution to this?

@Spartaner25
did you try to edit files of linux or files of your build in windows???

Wow thanks!
But one question: Is it just another virtualization ? I mean is it faster than an Ubuntu installed inside a VM ?

For performance of bash on windows vs native Ubuntu read this

chiragkrishna said:
@Spartaner25
did you try to edit files of linux or files of your build in windows???
Click to expand...
Click to collapse
I did not touch any files of the linux base (lxss) in either the windows explorer or the bash and I did not modified anything inside the Windows Folder.
But I upgraded the system via apt update/upgrade which should not be destructive (I hope).
My target was a regular aosp build with the tag android-6.0.1_r58, I only changed a few linies in some files in frameworks/base via nano and added a device and kernel folder which was all done inside the bash.

Spartaner25 said:
I did not touch any files of the linux base (lxss) in either the windows explorer or the bash and I did not modified anything inside the Windows Folder.
But I upgraded the system via apt update/upgrade which should not be destructive (I hope).
My target was a regular aosp build with the tag android-6.0.1_r58, I only changed a few linies in some files in frameworks/base via nano and added a device and kernel folder which was all done inside the bash.
Click to expand...
Click to collapse
Try building only the kernel and see if it builds correctly!!

chiragkrishna said:
Try building only the kernel and see if it builds correctly!!
Click to expand...
Click to collapse
Thanks for the hint, the kernel builds fine.
By the way, building CyanogenMod gets stuck here for me.

Windows Insider Preview for those in Fast Ring
Ubuntu 16.04 Arrives With New Windows 10 Build 14936
change log

I'm currently on this version with ubuntu 16.04 and it's getting better.
Currently the build (aosp and cm) ist stuck on the bison binary which is a prebuilt 32-bit ELF, which can not be executed.
It might be possible to replace the prebuilts with their 64-bit variants.

@chiragkrishna upon using
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 python-networkx
I get the following errors: Unable to locate package zip, lib32ncurses5-dev, libgl1-mesa-dev.
Edit: Fixed by removing the '\' from all lines.

does anyone know how to solve this error?
ionice: ioprio_set failed: Invalid argument

I have been able to successfully build cm-13.0 on Windows 10. I haven't been successful with cm-12.1, since it builds 32-bit binaries for the host executables for some reason.
The fixes I had to do:
Recompile flex and bison as 64-bit binaries according to the instructions in their source directory (github btongminh/android_prebuilts_misc)
Disable futexes in Art (github btongminh/android_art)
Disable v8 snapshots, since it is only possible to make snapshots for 32-bit targets on a 32-bit host (github btongminh/android_v8)
The build for Xiaomi Redmi 3 (ido) was successful, flashed it and it booted into Android Unfortunately after that the launcher kept on crashing, but is looks like I'm almost there.
Ayush1325 said:
does anyone know how to solve this error?
ionice: ioprio_set failed: Invalid argument
Click to expand...
Click to collapse
Build with "make bacon" instead of brunch or mka

btongminh said:
I have been able to successfully build cm-13.0 on Windows 10. I haven't been successful with cm-12.1, since it builds 32-bit binaries for the host executables for some reason.
Build with "make bacon" instead of brunch or mka
Click to expand...
Click to collapse
How do you make a user build signed with release keys instead of a userdebug build signed with testkeys??
EDIT: Well my normal make build failed
Please note I'm trying to compile Lineage OS 14.1
Code:
[ 1% 675/34224] Generating TOC: /root...core-all_intermediates/classes.jar.toc
FAILED: /bin/bash -c "(/root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ) && (if cmp -s /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; then rm /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ; else mv /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; fi )"
ftruncate(fd_out, GetSize()): Invalid argument
/bin/bash: line 1: 7115 Aborted (core dumped) ( /root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp )
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (13:50 (mm:ss)) ####
It looks like I'm having the same error as this person. https://forum.xda-developers.com/lineage/help/building-lineageos-cancro-xiaomi-mi3w-t3530766

What Java version are you using (java -v). LineageOS 14.1 requires Java 1.8.

Link_of_Hyrule said:
Code:
[ 1% 675/34224] Generating TOC: /root...core-all_intermediates/classes.jar.toc
FAILED: /bin/bash -c "(/root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ) && (if cmp -s /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; then rm /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ; else mv /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; fi )"
ftruncate(fd_out, GetSize()): Invalid argument
/bin/bash: line 1: 7115 Aborted (core dumped) ( /root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp )
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (13:50 (mm:ss)) ####
Click to expand...
Click to collapse
I've committed a fix to fix this problem, you can find it here:
https://github.com/imReker/bazel/commit/d2f16b573e0a77653454e64f124e0c4bab3b0fd7

Related

[HOWTO][VM][Compile]Setup Lubuntu for Android compiling (VirtualBox Option)

This Guide is intended to fast-track the curious Windows user into the world of Compiling Android With Linux
It does not cover Linux in depth and does not cover hacking the code.
It does include an introduction to git by way of an example (replacing the default Kernel)
I hope it proves helpful
Below I shall run through setting up VirtualBox and installing Lubuntu.
Lubuntu is a lighter alternative to Ubuntu targeted at older/low powered hardware which makes it ideally suited to running in a VM.
Before we start, I would like to make it clear that unless you have a powerful,memory rich PC, compiling Android inside a VM is not ideal.
Having said that, You can probably get some mileage on a reasonably spec'ed Machine. And this should prove helpful to those who are not quite ready to take the plunge and install a native linux.​
The latter half of the guide detailing Lubuntu will also work running native on the bare metal. Just ignore the VB driver parts.
If you haven't already, Download an iso from http://cdimages.ubuntu.com/lubuntu/releases/11.10/release/
I will be working through the desktop version
if you have a 64-bit PC *AND* your current OS is 64-bit get the lubuntu-11.10-desktop-amd64.iso
if your PC or OS is 32-bit then lubuntu-11.10-desktop-1386.iso is what you want.
As well as a {L}ubuntu disk, you will need:
VirtualBox https://www.virtualbox.org/ optionally grab the extension pack for usb2 support
At least 25 GB free disk space with large file support
A working internet connection, the CM source is 9GB so have that in mind.
VirtualBox Installation
Bit of a no brainer, just install it like any other program
At some point it may prompt you to download Additions, not to be confused with the extension pack.
The Additions Pack is an .iso containing drivers for the guest OS's, video, clipboard etc.
VirtualBox Setup
Once VirtualBox has installed open it
If you downloaded the extensions pack install it as follows:
file >> preferences >> extensions
click the add package icon and navigate to the download
Now create a virtual machine
click new >> next
give it a name like "AndroidCompiler"
OS Type "Linux"
Version "Ubuntu" >> next
The Version is not particularly important, as far as I know it is just for the icon.​
increase the memory , keeping it in the green >> next
create new disk >> next
VDI >> next
Fixed size >> next
select the location (for example your second hard drive X: or whatever)
change the size to 5.00 GB, if the slider is a pita just type it >> next
If you can afford it a larger disk will not hurt, 10GB should be plenty​
review and >> create >> create again
The basic VM is now complete
Fine tune the VM Settings
Highlight the new VM and hit Settings
system
Motherboard tab
in boot order select hdd and 'move' it to the top of the list with the up icon
Processor tab
tick enable PAE/NX
select number of CPUs
Note that if you use all of your cpu cores it will slow down your host​
Display
Video tab
tick enable 3D
Network
Adapter 1 tab
Attached to Bridge Adaptor
Name < select your NIC >
Advanced >
Promiscuous Mode : Allow All
Storage
highlight the empty CD
click the cd icon to the far right
Choose a virtual cd/dvd, (your iso d/l)
highlight the sata Controller
add hard disk (3 stacked disks icon) >> create new disk
create a new disk called AndroidSrc or something, it must be at least 20GB (40GB recommended)
if you plan on playing with ics then triple it​
Shared Folders
add new folder
tick auto mount
navigate to a folder (or create a new one)
this will be used to transfer files between your OS and the VM​
Now click OK, and then start
Installation of Lubuntu
You will be presented with a rather ugly language selection, pick one
Then select install Lubuntu
Ignore any errors about smbpii4 bios blah blah..
Language selection (again but nicer looking) >> continue
Tick download updates while installing >> continue
select something else >> continue
select /dev/sda >> new partition table
select /dev/sda free space >> add
type = logical
size = 555
location = end
use as = swap area
>> OK
Normally Linux Distos create a swap the same size as physical memory.
This is so physical memory can be dumped to swap when going into hibernation (save state with no power use)
Since VirtualBox has it's own Save State feature we don't need it.
And for what it's worth I have always found the resume after hibernate to be painfully slow​
select /dev/sda free space >> add
type = primary
size = <what it says>
location = beginning
use as ext4
mount point = /
>> ok
tick format for /dev/sda2
select /dev/sdb >> new partition table
select /dev/sdb free space >> add
type = primary
size = <what it says>
location = beginning
use as ext4
mount point = /Android
>> ok
tick format for /dev/sdb1
unless you are re-using an old Android source disk​
>> install now
Where are You?
Lubuntu guesses from your IP, if needed correct it​ >> continue
Keyboard setup >> continue
username / password >> continue
wait for it to finish
>> restart now! -- press enter when prompted
You should now be booted to Lubuntu
Ignore the update manager, we will get the script to deal with that.
VirtualBox Drivers
Next to the clock should be a pci card icon
click it
install drivers
activate >> input your password
wait .....
when finished >> close
bottom left is some strange icon, it is the main menu
click it >> logout >> logout (no need to reboot yet) >> login again
Shared Folders
Main Menu >> system tools >> users and groups
Manage Groups >> vboxsf >> Properties >> tick your username
Main Menu >> Accessories >> LXTerminal (right click >> add to desktop, if you like)
The reason for the earlier logout and back in was to activate the VB host to VM clipboard
The below script will install the required packages
It will work for both 32 and 64 bit
The script is based on instructions for 11.10
It will probably work on 11.04 and may even work on 10.xx but I have only tested against Lubuntu 11.10 both 32 and 64 bit
It is not specific to Lubuntu and should work with any Ubuntu 11.10 derivative
To paste with the keyboard ctrl+shift+v *NOT* ctrl+v
ctrl+shift+c to copy​copy and paste this to the term.
Code:
cat > ~/setup.sh << "EOF"
#!/bin/bash
sudo apt-get update
# Reference : http://source.android.com/source/initializing.html
case $(uname -m) in
x86_64) # packages for 64-bit
sudo apt-get -y install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc
sudo apt-get -y install lib32readline-gplv2-dev || \
sudo apt-get -y install lib32readline5-dev
case $(awk -F"=" '/DISTRIB_RELEASE/ {print $NF}' /etc/lsb-release) in
11.10|11.04) sudo apt-get -y install libx11-dev:i386 ;;
10.10|10.04) sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so ;;
esac ;;
i?86) # packages for 32-bit
sudo apt-get -y install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils xsltproc ;;
*) echo "Error: Machine type not recognised" && exit 1;;
esac
# Extras for CyanogenMod builds
sudo apt-get -y install squashfs-tools \
pngcrush libsdl1.2-dev \
libesd0-dev \
libwxgtk2.6-dev \
schedtool
# system update
sudo apt-get -y upgrade
# install sun java jdk
# Reference : top google hit for " ubuntu 11.10 sun-java6-jdk "
# http://www.gaggl.com/2011/10/installing-java6-jdk-on-ubuntu-11-10/
case $(awk -F"=" '/DISTRIB_RELEASE/ {print $NF}' /etc/lsb-release) in
11.10) codename=oneiric;;
11.04) codename=natty;;
10.10) codename=maverick;;
11.10) codename=lucid;;
*) echo "Error: Unrecognised ubuntu version";exit 1;;
esac
test -e /etc/apt/sources.list.d/ferramroberto-java-${codename}.list || \
echo | sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get -y install sun-java6-jdk sun-java6-plugin
# The default lubuntu install does not include java
# but other ubuntu derivatives may include openjdk
Java6Sun=$(echo | update-alternatives --config java | awk '/java-6-sun/ && ($1 !~ /*|^There/){print $1}')
test "$Java6Sun" != "" && echo $Java6Sun | sudo update-alternatives --config java
# create ~/bin if it does not exist
install -v -d ~/bin
# clean up
rm $0
EOF
Now run the script
Code:
bash ~/setup.sh
It will ask for your password
eventually you will be asked to read and accept the Sun Java licence
Once all that is done..
The updates will have installed a new kernel, and we still haven't loaded the VMs special video/shared folder drivers yet so it is time for a reboot
Like the logout we did earlier, but reboot.
Now that you have rebooted lets fix the permissions for our source partition
open a term
Code:
sudo chown $USER:$USER /Android
replace Android with the mount point you gave for your source drive
make a directory for the CM src
Code:
mkdir /Android/CM
cd /Android/CM
Now to get the src
#
# http://source.android.com/source/downloading.html
# http://wiki.cyanogenmod.com/wiki/HTC_Dream_&_Magic:_Compile_CyanogenMod_(Linux)
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync -c -j16
The CM wiki advises repo sync -j16
You will be downloading 9 GB, depending on the speed of your connection this may take some time
Reduce the number of threads(16) if you don't want to saturate your connection
NEW : 2012-03-10
added -c to the repo sync.
-c tells repo to only fetch the current branch which will save time and diskspace
If you are interested in comparing branches then leave out -c
don't forget to include -c with all future repo syncs
using -c will save approx 2GB diskspace as well as network bandwidth (7GB instead of 9GB)​
use this table to get an approximation of how long it will take
Code:
10GB @ 60 Mbit/s 0.46 hrs ( 28 mins)
10GB @ 40 Mbit/s 0.69 hrs ( 42 mins)
10GB @ 20 Mbit/s 1.39 hrs ( 83 mins)
10GB @ 10 Mbit/s 2.78 hrs ( 167 mins)
10GB @ 5 Mbit/s 5.56 hrs ( 333 mins)
10GB @ 2.5 Mbit/s 11.11 hrs ( 667 mins)
10GB @ 1 Mbit/s 27.78 hrs ( 1667 mins)
Assumes Max throughput
When setting up the VM we created a bridge to one of your NICs
If you are on a laptop and switch between wire and wireless, you can also with the VM
Devices >> network adaptors (the VirtualBox Menu)
You could try setting up a 2nd adapter, one for wire and the other wireless, net traffic should be routed automatically
You can only add adaptors while the VM is Powered Off​
When repo sync has completed
Setting up the Environment
Setting up the Environment needs to be done with each new shell session
make sure you are in the repo root
A quick glance at your command prompt should tell you where you are
Code:
source build/envsetup.sh
alternative:
Code:
. build/envsetup.sh
that is <dot><space>bui​
Setting up the build
ccache
not to be confused with compcache, ccache can help speed up recompilations
More information can be found on cm's wiki here
and in google's http://source.android.com/source/initializing.html
Code:
export USE_CCACHE=1
# for reboots and new shell sessions
echo "export USE_CCACHE=1" >> ~/.bashrc
by default ccache uses ~/.ccache we won't have enough space
Code:
export CCACHE_DIR=/Android/.ccache
# for reboots and new shell sessions
echo "export CCACHE_DIR=/Android/.ccache" >> ~/.bashrc
The default max cache size is 976.6 MB (that is what is reported,could be a / 1024 screwup ), this will just about fit our min sized 20GB drive
http://source.android.com/source/initializing.html recommends between 50 and 100 GB. I imagine this is to accommodate multiple targets
space permitting between 5 and 10 GB should be fine for a single device
if you have a 20GB Android drive then leave it at the default
If you opted for a larger drive, adapt to suit
for 5 GB :
Code:
prebuilt/linux-x86/ccache/ccache -M 5G
The setting is stored in CCACHE_DIR so unless you want to change it forget about it.
Lets do lunch
don't ask me why it is called lunch. My best guess is a play on Menu
Code:
lunch
and select your target
when you get bored of seeing that lunch menu
Code:
lunch cyanogen_dream_sapphire-eng
Proprietary Files
The Proprietary Files need to be put into the vendor tree
You have two options:
Extract from a zip
Extract from your device
I'm going to walk through Option 1
Remember the Shared Folder we created?
Well we are going to use that now.
On your Host system copy a recent ROM zip to the folder your shared with the VM
good choices are : ezginger, ADS_magpie, dw9906
in your VM's terminal,
Code:
ls /media/
you should see a folder sf_<Name> and in that folder your rom zip
There are two scripts in device/htc/dream_sapphire/
unzip-files.sh and extract-files.sh
Unfortunately the unzip-files.sh script is not up to date with extract
You can manually fix it or use my script which converts the extract script to an unzip script
to use it:
set a environment var like so
Code:
ROM=/me<tab>s<tab><tab>
<tab> is the tab key, please don't type <tab>
read this to get an idea of what is happening​eventually you should have something like
ROM=/media/sf_5gb/ADS_magpie-V1.0-signed.zip
Code:
pushd device/htc/dream_sapphire
#awk '/adb pull/{sub(/adb pull/,"unzip '$ROM'")sub(/\.\./,"-o ..")};{print}' extract-files.sh | sh
# 2012-03-19 corrected the above script, it should be :
awk '/adb pull/{sub(/adb pull \//,"unzip -o '$ROM' ")sub(/.*/,"-d ../../../vendor/htc/$DEVICE/proprietary/",$NF)};{print}' extract-files.sh | sh
popd
pushd and popd
The above step only needs to be done the once
that is unless the proprietary files require changes, for instance a switch to open sourced versions
Kernel
The DS kernel in CM is old so I added ezterry's latest
I shall show you how, but we are taking the scenic route
We shall create our own git repo and add that to a local_manifest
Configure git
This is a global config, you should only need to do it once per user
Code:
git config --global user.name "Your Name Comes Here"
git config --global user.email [email protected]
taken from file:///usr/share/doc/git-doc/gittutorial.html
Install git docs with
Code:
sudo apt-get install git-doc
Create a git repo and push to it
Code:
git init /Android/my_git_repos/device_htc_dream_sapphire
cd /Android/CM/device/htc/dream_sapphire
git push file:///Android/my_git_repos/device_htc_dream_sapphire github/gingerbread
Now let's have a look
Code:
cd /Android/my_git_repos/device_htc_dream_sapphire
ls
you will see it is empty
But wait.. is it empty?
Code:
ls .<tab><tab>
Code:
git branch -a
git checkout gingerbread
ls
git log # q to exit
git log -p
now lets make some changes
Remember the shared folder?
Well I hope you have ezterry kernel pack in there
Code:
unzip /media/sf_<REPLACEME>/ezgb-2636-v1.5.2_S.zip *2708*
mv 2708-zImage kernel
mv mod-2708/modules.sqf prebuilt/
rmdir mod-2708/
git status
edit full_dream_sapphire.mk
change
device/htc/dream_sapphire/prebuilt/wlan.ko:/system/lib/modules/wlan.ko \
to
device/htc/dream_sapphire/prebuilt/modules.sqf:/system/lib/modules/modules.sqf \
we can do this with a simple sed
Code:
sed -i -e 's[/wlan.ko[/modules.sqf[g' full_dream_sapphire.mk
now
Code:
git diff
Code:
git add full_dream_sapphire.mk kernel prebuilt/modules.sqf
Since the wlan.ko is of no use to us (we replaced the kernel it was for) we need to remove it
but not just from the filesystem but git as well
Code:
git rm prebuilt/wlan.ko
Have another look at git status and git diff
notice that git diff produces no output
now try git diff --cached
commit the staged changes with
Code:
git commit
The default editor for git is nano
^ == ctrl
^O == ctrl+o
write commit notes
Code:
Updated Kernel and kmodules to 2708 ezgb-2636-v1.5.2
http://forum.xda-developers.com/showpost.php?p=14768272&postcount=2427
to save Ctrl+o<enter>
to exit Ctrl+x
if you prefer vim
Code:
git config --global core.editor vim
don’t forget to install vim​Adding a local_manifest.xml
Code:
cat > /Android/CM/.repo/local_manifest.xml << "EOF"
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="Local"
fetch="file:///Android/my_git_repos/" />
<project path="device/htc/dream_sapphire" remote="Local" name="device_htc_dream_sapphire" revision="gingerbread" />
</manifest>
EOF
Apologies My initial post had an error in the above codebox
it should be fetch="file:///Android/my_git_repos/" not fetch="file:///Android/my_git_repos/device_htc_dream_sapphire/"​
make sure you are in /Android/CM/
repo sync
Then look in device/htc/dream_sapphire to see if your changes were applied
Code:
pushd device/htc/dream_sapphire
git branch -a # look for remotes/m/gingerbread -> Local/gingerbread
git log -p # you should see your commit notes
popd
Remove RomManager
Optionally remove RomManager from the build
Code:
sed -i '/RomManager/d' vendor/cyanogen/products/common.mk
The above is not permanent, when you repo sync it will be reverted
That is unless you commit the change​if you want RomManager then
Code:
./vendor/cyanogen/get-rommanager
finally build it
Code:
mka bacon
It is going to take a while depending on the speed of your machine and the memory/cpu cores you gave the VM (if you are using a VM)
Lets hope you don't get any build errors
If all goes well you should end up with a zipfile in /Android/CM/out/target/product/dream_sapphire/
Don't forget your /media/sf_ folder, cp the completed zip to that and from there you can treat it like any other rom
I hope you had fun following this
reserved for extras
like editors, linux tipsntricks, github, eclipse
moar extraz
I was under the impression that 64-bit linux was required now to compile android from source.
I compiled AOSP froyo with the following specs fine:
Ubuntu 10.04 (tried both native and vm)
Pentium 4 3.20ghz Hyper-Threaded
32-bit of course
3.12 GB of RAM
It took about two hours but not as bad as I thought, and it worked
Anyways thank you Scrip for this wonderful guide (yes I'll thank you in a second).
I knew 70%ish of this, and you helped fill up the rest of the holes for me
Thanks a lot man.
I'm sorry for kinda yelling back at you earlier
One question: Is there any hope for grabbing the cm6 source? It's been broken with a lot of files missing for a while now.
select /dev/sda free space >> add
type = primary
size = <what it says>
location = beginning
use as ext4
mount point = /
>> ok
tick format for /dev/sda2
Click to expand...
Click to collapse
Tried this and no matter how many times I do it it still makes the entire 12GB sda partition the SWAP space.
EDIT: So solution is not to type in "555" but to use the arrow selection button to drop it down to "555".
wergeld said:
I was under the impression that 64-bit linux was required now to compile android from source.
Click to expand...
Click to collapse
Pointless and inaccurate post
Come back when you can prove 32-bit won't compile Android
Post the appropriate errors and I will do my best to resolve it
Scrip said:
Pointless and inaccurate post
Come back when you can prove 32-bit won't compile Android
Post the appropriate errors and I will do my best to resolve it
Click to expand...
Click to collapse
Woah, just asking. I saw this:
Ubuntu 10.04 64-bit is recommended. Building using a newer version of Ubuntu or a 32-bit Ubuntu is currently only experimentally supported and is not guaranteed to work on branches other than master.
Click to expand...
Click to collapse
This is taken from http://source.android.com/source/initializing.html
I just wanted to make sure that yes, you can compile against 32-bit before I spend a while setting this up.
wergeld said:
Tried this and no matter how many times I do it it still makes the entire 12GB sda partition the SWAP space.
EDIT: So solution is not to type in "555" but to use the arrow selection button to drop it down to "555".
Click to expand...
Click to collapse
no idea what is wrong there
try the other way round
with a clean 12gb partition
primary = < size - 555 >
use as = ext4
mount point = /
you could just let ubuntu set everything up
downside is
I will need to add instruction to mount the /Android drive
+ wasted diskspace
but again, I don't see why
Scrip said:
no idea what is wrong there
try the other way round
with a clean 12gb partition
primary = < size - 555 >
use as = ext4
mount point = /
you could just let ubuntu set everything up
downside is
I will need to add instruction to mount the /Android drive
+ wasted diskspace
but again, I don't see why
Click to expand...
Click to collapse
No worries on that. Ghost in the Machine maybe. Coming from TFS and VS2010 I have come accustomed to oddball things like this.
So far so good. Best part is the package script you have up there. Waiting to finish package installs...
frankdrey said:
I compiled AOSP froyo with the following specs fine:
Ubuntu 10.04 (tried both native and vm)
Pentium 4 3.20ghz Hyper-Threaded
32-bit of course
3.12 GB of RAM
It took about two hours but not as bad as I thought, and it worked
Anyways thank you Scrip for this wonderful guide (yes I'll thank you in a second).
I knew 70%ish of this, and you helped fill up the rest of the holes for me
Thanks a lot man.
I'm sorry for kinda yelling back at you earlier
One question: Is there any hope for grabbing the cm6 source? It's been broken with a lot of files missing for a while now.
Click to expand...
Click to collapse
I can't say it will build
look at the repo init command
-b <branch>
so if you replace gingerbread with froyo you will checkout cm6
if you have already added the local_manifest then you need to delete that before a repo sync
I will probably cover this in post 2/3
post 1 is basic
my idea is to get people interested
posts 2 and 3 will deal with extras, in post 1 I skipped basics like text editing
mostly because I have no idea how to deal with that.
Personally I use vim or kate
But I plan (if there is interest) on adding eclipse, which would make a text editor redundant
Yes I have downloaded the source for froyo before
A lot of the files are missing and repo sync doesn't complete
I know that all alsa-related files are missing, but there is more that I might have forgotten by now
frankdrey said:
Yes I have downloaded the source for froyo before
A lot of the files are missing and repo sync doesn't complete
I know that all alsa-related files are missing, but there is more that I might have forgotten by now
Click to expand...
Click to collapse
if post (or better pastebin.com)
the errors I can look
I've not tested these instructions against froyo , but I did at least get a zip from froyo asop a while back
missing files stinks of a screwed up prop mk
Yes AOSP works fine
CM6 doesn't
I'll post the errors when I find the time to get it all set up.
That may not be for a while though .
frankdrey said:
Yes AOSP works fine
CM6 doesn't
I'll post the errors when I find the time to get it all set up.
That may not be for a while though .
Click to expand...
Click to collapse
I think cm6 still points to android.git.kernel.org (which is gone). I was gonna fork from cm and change it to the right place but I haven't got around to it yet....
tvall said:
I think cm6 still points to android.git.kernel.org (which is gone). I was gonna fork from cm and change it to the right place but I haven't got around to it yet....
Click to expand...
Click to collapse
Yes I fixed that part.
but there were a whole buncha repos missing, the alsa one is all i can remember right now
WOW! Very well done! I love how you cited your sources and everything.
I appreciate the time and effort you put into this. Definately makes for a great reference.
Sent from my HTC PH39100 using Tapatalk
Thank you very much for this great tutorial! Even if I knew already most of the things, it's very useful to have such a tutorial here. We will see if this tutorial helps to increase the number of active android developers ...
Btw.: this thread should become sticky.
AndDiSa said:
Btw.: this thread should become sticky.
Click to expand...
Click to collapse
+1
Sent from my HTC PH39100 using Tapatalk
Left for work and set up the repo sync. Hopefully when I get home I can get a compile going. Thanks!

[GUIDE]BUILD CM10.1 FROM SOURCE| AIRFLUIP EDITION [Mac + Linux]

GITHUB servers are up!
So I finally thought that I should make a guide to build from source as I feel like the one on the wiki is a bit outdated and isn't very clear.
I will cover both instructions for how to build for Ubuntu 13.04 (64 bit only), and OS X 10.8.x(PLEASE KEEP AT LEAST 35GB Free)
LINUX SPECIFIC INSTRUCTIONS
Please open a terminal window NOW. If you can't do this, don't build android. Please be vigilant in following in-terminal directions, such as pressing enter if it's asking you to do so or confirm something, and using sudo before a command will invoke a password prompt also if entering a new command, please wait until the command exits out to the bash prompt (asking for a new command)
First, let's get rid of the wrong java assuming it's already installed, Android will "REFUSE" to build properly with the wrong java.
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Now let's install the correct java,
Code:
sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && java -version
It should end with this
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
or something like it.
Now let's set up for making bacon!
Enter this in order to get dependencies for building android, please note that this is about 100-150 megs and will take a few minutes/10ish minutes depending on your computer and internet connection.
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
then,
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Repo is required for sucking sources from the cloud, so let's get it
Code:
mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo
Now let's add this repo thing to our path
Code:
sudo nano ~/.bashrc
at the bottom of the file,add this
Code:
export PATH=~/bin:$PATH
now press Ctrl-O followed by Ctrl-X
restart bash by entering
Code:
source ~/.bashrc
now find a directory to build android in. Personally, I use /home/username/android
so for now let's place it in there
Code:
mkdir ~/android && cd ~/android && mkdir cm && cd cm
SYNC TIME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!x10^infinity!
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 && mkdir -p .repo/local_manifests && curl https://raw.github.com/teamuserdebug/page/manifests/manifests/cm10.1-aries.xml > .repo/local_manifests/local_manifest.xml && repo sync
make sure you acknowledge name, color, email etc, or you'll be sitting around and wasting time. this can take anywhere from 1 hr to 1 week depending on your internet connection, personally takes me 3-5 hrs.
go grab a starbucks and come back, you'll need it.
after it's done, make sure you are still in your cm directory.
IT'S BUILDING TIME
OPTIONAL: If you have some free space sitting around eg, 70-100 gigs for building android,
it's time to setup CCACHE, this speeds up future builds by "A LOT"
first edit .bashrc
Code:
sudo nano ~/.bashrc
add these lines at the bottom
Code:
export CCACHE_DIR=/home/-username-/.ccache
(Note, replace "-username-" with your computer username, without the dashes.
Code:
export USE_CCACHE=1
press Ctrl-O followed by Ctrl-X
enter
Code:
[CODE]source ~/.bashrc
[/CODE]
now enable ccache by entering
Code:
prebuilts/misc/linux-x86/ccache/ccache -M50
or
Code:
./prebuilts/misc/linux-x86/ccache/ccache -M50
if the first one doesn't work
BUILD TIME:
enter these
Code:
cd ~/android/cm
Code:
vendor/cm/get-prebuilts
Code:
. build/envsetup.sh
Code:
lunch cm_galaxys4gmtd-userdebug
Code:
mka clobber
Code:
mka bacon
It will be in ~/android/cm/out/products/target/galaxys4gmtd/cm-unofficial-something-something-signed.zip or something like that.
Make sure you don't pick the wrong zip file, because there are 2 or 3 in there.
OS X 10.8.x SPECIFIC INSTRUCTIONS
Please open a terminal window NOW. If you can't do this, don't build android. Please be vigilant in following in-terminal directions, such as pressing enter if it's asking you to do so or confirm something, and using sudo before a command will invoke a password prompt also if entering a new command, please wait until the command exits out to the bash prompt (asking for a new command)
First, let's install java if it's not already installed
Code:
java
Now, we MUST install X-Code otherwise we won't even be able to lunch.
1. Open the App Store
2. Find X-Code,(it's free) and install it [this is a 1+ GB download, and install]
3.Open X-Code and go to preferences. There you find a 'Downloads' tab. Open it and install “Command line tools” It will take a few minutes to download and install
Now let's set up for making bacon!
Download and install MacPorts, not Homebrew, since MacPorts is faster.
You can get the mountain lion pkg installer here
After it is installed, close and open terminal.
edit your bash profile
Code:
sudo nano ~/.bash_profile
add
Code:
export BUILD_MAC_SDK_EXPERIMENTAL=1
somewhere at the bottom
Press Ctrl-X, then y, then "enter/return" Note: Yes, the control key is used, not the command key, so don't be confused
Install dependencies to make bacon
Code:
POSIXLY_CORRECT=1 sudo port install git-core coreutils findutils gsed gnupg pngcrush repo
then
Code:
sudo ln -s /opt/local/bin/gfind /opt/local/bin/find && ln -s /opt/local/bin/gsed /opt/local/bin/sed
run
Code:
pngcrush
in terminal to make sure that things are properly in your path
THEY SHOULD BE since MacPorts edits your .bash_profile for you.
Now, we need a case-sensitive folder so we will need to make a sparseimage which you will have to mount every time you want to do something with your android builds.(like a DMG), but for now, this command will attach it for you. It will be on your desktop
Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "android" -attach ~/Desktop/Android
Make the cm folder
Code:
cd /Volumes/Android && mkdir cm && cd cm
SYNC TIME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!x10^infinity!
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 && mkdir -p .repo/local_manifests && curl https://raw.github.com/teamuserdebug/page/manifests/manifests/cm10.1-aries.xml > .repo/local_manifests/local_manifest.xml && repo sync
make sure you acknowledge name, color, email etc, or you'll be sitting around and wasting time. this can take anywhere from 1 hr to 1 week depending on your internet connection, personally takes me 3-5 hrs.
go grab a starbucks and come back, you'll need it.
after it's done, make sure you are still in your cm directory.
Before we build, we have to fix an elf.h error
Code:
cp /Volumes/android/cm/external/elfutils/libelf/elf.h /usr/local/include
IT'S BUILDING TIME
OPTIONAL: If you have some free space sitting around eg, 70-100 gigs for building android,
it's time to setup CCACHE, this speeds up future builds by "A LOT"
install a ccache which is usable by mac
Code:
sudo port install ccache
edit your bash profile to use ccache.
Code:
sudo nano ~/.bash_profile
find the line that says
Code:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
and edit it to say
Code:
export PATH=/opt/local/libexec/ccache:/opt/local/bin:/opt/local/sbin:$PATH
press Ctrl-X, then y, then "enter/return"
then exit and reopen terminal
now configure ccache's memory
Code:
ccache -M50
BUILD TIME:
enter these
Code:
cd ~/android/cm
Code:
vendor/cm/get-prebuilts
Code:
. build/envsetup.sh
Code:
lunch cm_galaxys4gmtd-userdebug
Code:
mka clobber
Code:
mka bacon
It will be in /Volumes/android/cm/out/products/target/galaxys4gmtd/cm-unofficial-something-something-signed.zip or something like that.
Make sure you don't pick the wrong zip file, because there are 2 or 3 in there
nice, didn't take long to get it stickied either.
sent from within pure darkness
I know right!
Also, I have edited it for the mac version as well.
Now you guys can build on both mac and linux!!!!!!!!!!!!
Also, I will post when github stuffs are back up.
Thx. is this coming from a straight Unbuntu say setup without having to install a bunch of crap? I had that BBQLinux installed which is supposed to be for building android but it didn't have apt installed, so then tried yum to install that, and it didn't have that. lol. Just going to install Ubuntu on a VM and try your directions from a new install.
yes
but obviously you need to have wifi
airfluip1 said:
yes
but obviously you need to have wifi
Click to expand...
Click to collapse
Why do I need wifi?
i mean internet.
airfluip1 said:
i mean internet.
Click to expand...
Click to collapse
O ya, I got tonnes of that. lol. Thanks for the guide though. I've tried a few times to get a build environment going and it always goes wacky or I don't get something right.
i think that they are up now.
airfluip1 said:
i think that they are up now.
Click to expand...
Click to collapse
don't know, I'm getting fetch errors, url can't found, 404 and then when it's done, it craps out and says can't sync, too many fetch errors. Is this the servers still being down?
Maybe
Sent from my SGH-T959V using xda premium
airfluip, you might have been better off creating a local_manifest.xml file (though those are deprecated and now you can just create a manifest file called, for example, airfluip1_aokp.xml).
You're going to have to keep up with the platform_manifest changes and will have to resolve merge conflicts if the AOKP team decides to make some major changes (not unlikely).
You can actually add the changes you made to the manifest.xml into a custom manifest xml file similar to what we did with team acid's CM9/AOKP repos.
maybe, but I thought it was easier. I'll change it in a week or two.
Just thought I'd throw in that BBQLinux is arch based and for building android and linuxBBQ is NOT the same thing, it's probably the worst distro to start from to build android. In case someone else decides to go there.
airfluip1 said:
maybe, but I thought it was easier. I'll change it in a week or two.
Click to expand...
Click to collapse
Just as a way to make syncing source faster, you can also remove the device/kernel trees for other devices that aren't the SGS4G so that we can just download what's necessary for building for our phone.
yeah, I know. I'll do that later as well. I just don't have much time for a few weeks.
I got a rom compiled with your sources airfluip. I haven't flash tested yet.
I did run into problems with the SGS4GParts package so I had to remove it from galaxys4gmtd.mk, other than that the rom compiled fine. I'll help you look into the error later.
Thanks for the guide, easy to follow
EDIT
By the way, are you using TWRP in these builds, or is it CWM?
Code:
______ _____ __ __ _____
/\ _ \/\ __`\/\ \/\ \ /\ _ `\
\ \ \L\ \ \ \/\ \ \ \/'/'\ \ \L\ \
\ \ __ \ \ \ \ \ \ , < \ \ ,__/
\ \ \/\ \ \ \_\ \ \ \\`\ \ \ \/
\ \_\ \_\ \_____\ \_\ \_\\ \_\
\/_/\/_/\/_____/\/_/\/_/ \/_/
===========-Package complete-===========
zip: /home/fb/android/jb_aokp/work/out/target/product/galaxys4gmtd/aokp_galaxys4gmtd_unofficial_2013-05-14.zip
md5: c8fcc3417bab626ca6d018b88450ab42
size: 150M
========================================
It must have been something that I edited.
I am using CWm.
I don't like twrp very much.
It's always something....
I'm not sure if something changed since you made this tutorial but I can't seem to get this to build.
My first attempt resulted in the SGS4GParts error like FB mentioned. Which seems to have something to do with the TVOut setting.
Each attempt at rebuilding I seem to get different errors.
I also get this when building starts...normal?
Code:
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
find: `src': No such file or directory
Edit: Is there a way to grab a log of the entire build output? Is it saved to a file somewhere?
LOL I am building right now.
The src error is normal
AND IF THERE IS A BUILD ERROR, POST A LOG IN PASTEBIN.
ALSO, THERE SHOULDN'T BE ANY BUILD ERRORS RIGHT NOW AS LONG as you
Code:
repo sync
before you do a new build.
Also you should run
Code:
make clobber && mka bacon
everytime.

[GUIDE][DEV] Compile any source built rom for your device [ULTRA NOOB FRIENDLY]

I know there are many other guides avalable regarding this, But I tried to focus on the small points also that many guides overlook
that's why I have this for you. Do let know if I have missed something or more details have to be included in case still there is a difficulty in compiling
This thread on Madteam Forums: http://madteam.co/forum/development...lt-rom-for-your-device-(ultra-noob-friendly)/
So lets start with simple things
Basic FAQ:
Q: What is a Source built rom?
A: Source Built Roms are roms that are compiled from source on a Linux Platform! They are not themed manually.
Q: How do we build these type of roms?
A: Setup Linux and then follow this guide.
Click to expand...
Click to collapse
This post/guide is divided into 4 parts:
1. Setting up build environment
2. Machine specifications etc.
3. Device Tree and source basics
4. Syncing Source and Building
PART 1: Setting up build environment​
Type sudo su and then your password to get rid of Admin Permissions
#Installing Python
STEP 1: Open terminal (CTRL + ALT + T)
Then execute the following commands in terminal one by one
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
sudo make install
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5
Now Python is configured
#Installing JDK
As far as I know PPA which was the earlier method of installing JDK etc. doesn't exist's anymore, So I used another way!
Step 1: Open Terminal (CTRL + ALT + T)
STEP 2: Now we need to download the JDK 6 Binary by executing this command in terminal
Code:
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin"
STEP 3: Then we need to run the binary and move it to a shared location:
Code:
chmod +x jdk-6u45-linux-x64.bin
sudo ./jdk-6u45-linux-x64.bin
sudo mv jdk1.6.0_45 /usr/lib/jvm/
STEP 4: Now you have to install all binaries and give them highest priority, This will also overwrite the previous version of Java Binaries in your computer
Code:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 1
STEP 5: Now check if JDK 1.6 is selected on this:
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo update-alternatives --config jar
sudo update-alternatives --config javadoc
Now JDK is configured! To check if it is done
Execute this is Terminal
Code:
java -version
Output will be similar to this
Code:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
#Installing GNU Make
Code:
cd Downloads
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz
cd make-3.82
./configure
sudo make install
These commands are for Make 1.81 if you want to install Make 1.82 Execute these
Code:
cd
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
tar -xvzf make-3.82.tar.gz
cd make-3.82
./configure
sudo make install
Now GNU make is configures
#Installing Android SDK
STEP ONE: Download the SDK from http://developer.android.com/sdk/index.html and extract it in a folder called "sdk" in the Downloads folder
STEP TWO: Now, Execute these commands in terminal
Code:
cd ~/Downloads/sdk/tools/
./android sdk
SDK is configured now :victory:
#Installing required packages:
STEP 1: Open Terminal
Now execute these commands:
Code:
apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils xsltproc pngcrush gcc-multilib lib32z1 schedtool
Good, Now you have successfully setup linux build environment!​
PART 2: Machine specifications and other misc. stuff​
Basic Computer Specs:
2Ghz Dual Core Processor
2GB Minimum ram
50GB File Space (For only one rom source)
*PLEASE NOTE*: This is the basic specification, It really depends on the condition of your ram and cpu!
If you want to use other apps while compilation you should make a 5GB minimum swap partition!
If ram is more than 4GB ram then you don't swap partition!
PART 3: DEVICE TREE AND SOURCE BASICS​
Basic source folders:
/packages - Proprietary rom applications
/framework - Framework (Overall rom UI and stuff)
/device - Device config
/vendor - Vendor Tree and other vendor files
/hardware - Hardware drivers
Q: What is BoardConfig.mk?
A: It's the file where you setup path's to files like toolchain etc. and enable/disable stuff, its very easy to understand. You can find it in your device's tree
Q: Where is build.prop in source?
A. Build.prop is available in the source in the form of system.prop in the device tree!
Q: How to remove ringtones, video editor, CM wallpapers from bulid?
A: Go to device/releasetools/extras.txt and Delete anything you don't want in your build
PART 4: Syncing Source and Building​
# Installing Repo Package
Code:
mkdir ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
STEP 2: Now it is recommended to reboot your computer (No need of sudo su after reboot)
STEP 3: Now make directory:
Code:
mkdir -p ~/rom/android/system
STEP 4: Go into directory and set path for Repo Package
Code:
cd ~/rom/android/system
PATH=~/bin:$PATH
STEP 5: NOW ITS TIME FOR SYNCING:
Their are different sources for different roms:
Some are listed bellow:
MIUI - www.github.com/micode/
Rootbox - www.github.com/Root-Box/
rasbeanjelly - www.github.com/rascarlo/
Xylon AOSP - www.github.com/xyaosp/
PAC-Man - www.github.com/PAC-Man/
CyanogenMod - www.github.com/Cyanogenmod/
CarbonROM - www.github.com/carbondev/
SaberMOD - www.github.com/SaberMOD/
AOKP - www.github.com/AOKP/
From the above collection some are Gingerbread some are ICS and some are JB 4.1/4.2 you have to visit these links via browser and see which source is which and follow the commands given at android.git/platform_manifest.git
Click to expand...
Click to collapse
For CM10.1 source execute this:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm10.1
For syncing CM10 source execute:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
You have to find for the rest!!
PS: You don't have to execute all the repo init commands written above
Now to sync execute this after the the repo init command
Code:
repo sync
Once it finishes without breaking all the folders will appear in rom/android/system folder
now execute this:
Code:
mkdir -p ~/rom/android/system/device/<ManufacturerName>/<DeviceCodeName>
and extract the device config/tree here
for me its samsung/totoro (galaxy Y, Don't mind )
then do the following:
Code:
mkdir -p ~/rom/android/system/vendor/<ManufacturerName>/<DeviceCodename>
Its the same as for the device folder
Now for compiling:
Code:
. build/envsetup.sh
lunch cm_<DeviceCodename>-eng
brunch cm_<DeviceCodename>-eng
Your build will be located at /rom/android/system/out as <RomName>-date/month/year-UNOFFICIAL-<DeviceCodeName>.zip
HAPPY COMPILING ​
Credits:
MadTeam (motafoca, whitexp etc.) for MADTeam Forums and many help
Team Broadcom CM (bieltv.3, SpaceCaker, Psychogame etc.) for giving my device a quite stable cm.. I learnt to compile because of them! Cheers
BeerGang
mithun46
abhisahara
galaxyfreak
cybojenix
Sniper Killer for supporting me a lot! Thanks dude
prototype-U for Supporting..
Others who supported me
IF YOU LIKE MY GUIDE, DO RATE THIS THREAD A FIVE STAR!
THOSE WHO ARE FACING ERRORS, DO POST YOUR PROBLEM at speed_bot's Source Building Help Thread ​
Good good !! Nicely compiled
abhisahara said:
Good good !! Nicely compiled
Click to expand...
Click to collapse
Thanks
I'll update this guide whenever I get time
Good work on this, I found it quite clear keep up the good work!
Sent from my GT-I9505 using Tapatalk 4 Beta
nicely copied
Aniruddh Chandratre said:
nicely copied
Click to expand...
Click to collapse
Just read what I said at the begging of the thread!
If you are too lazy then:
I know there are many other guides avalable regarding this, But I tried to focus on the small points also that many guides overlook
that's why I have this for you. Do let know if I have missed something or more details have to be included in case still there is a difficulty in compiling
Click to expand...
Click to collapse
And yes, I took reference from others guide... I do give credits!
Have you ever compiled it(successfully) yourself?
Sent from my HTC Desire X using xda app-developers app
prototype-U said:
Have you ever compiled it(successfully) yourself?
Sent from my HTC Desire X using xda app-developers app
Click to expand...
Click to collapse
Yes.. I did..
Thanks for your support
Arnav.G said:
Yes.. I did..
Thanks for your support
Click to expand...
Click to collapse
Where is it?
Sent from my HTC Desire X using xda app-developers app
prototype-U said:
Where is it?
Sent from my HTC Desire X using xda app-developers app
Click to expand...
Click to collapse
It will come...
Please don't spam the thread now! I know you are a RC and you know the rules but still.. Please
http://xda-university.com/as-a-developer/getting-started-building-android-from-source
Nice simplifications...
Noob friendly? Lol! Did you test it on yourself!
When I run the binaries on jdk
I get errors on the 2nd command-Syntax error
Why >
Fang Leone said:
When I run the binaries on jdk
I get errors on the 2nd command-Syntax error
Why >
Click to expand...
Click to collapse
Can you please explain your problem in a little more details?
"This Story Ends Where It Began" - Octavarium (Dream Theater)
Sent from my GT-I9505
Great Guide!!
This is very kind of you to make this helpful thread. It really helped me alot after setting up my new build environment. I ran into an error on you post that you may want to correct, other than that, great work! Here is the typo
"cd Downloads
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz<--this is correct.
cd make-3.82<---it changes here.
./configure
sudo make install"
Hello guys!
I have an error at brunch:
Code:
host Java: guavalib (/home/richard/android/system/out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/classes)
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/content/EventLogTags.java <= frameworks/base/core/java/android/content/EventLogTags.logtags
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/speech/tts/EventLogTags.java <= frameworks/base/core/java/android/speech/tts/EventLogTags.logtags
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/webkit/EventLogTags.java <= frameworks/base/core/java/android/webkit/EventLogTags.logtags
[B]make: *** No rule to make target `/home/richard/android/system/out/host/linux-x86/bin/dx', needed by `/home/richard/android/system/out/target/common/obj/APPS/Apollo_intermediates/proguard.classes-with-local.dex'. Stop.[/B]
make: *** Waiting for unfinished jobs....
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/src/src/java/com/android/internal/telephony/EventLogTags.java <= frameworks/opt/telephony/src/java/com/android/internal/telephony/EventLogTags.logtags
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Anyone knows what's causing it? It couldn't be the roomservice.xml in local_manifest as I used the one which another person successfully built CM with. I also repo sync'ed a few times already. I tried make clobber and built again, but nothing :crying:
I am building PACMAN ROM (4.3) now by the way.
All help is appreciated (with a thank!)
Greedings everyone
For some time now i am trying to download and compile CyanongenMod Sources for my Device. I Install VirtualBox + Linux Mint + all the needed stuff. Then i do the repo init and everything looks ok but when i do the repo sync it always throw me a error fetch stop because of sync errors. Ive done it a lot of time with no luck. Also i tried the repo sync -f which finaly finishes fetching things but stops at getting the project tree. Can anyone help me? :/ its really frustrating
vale amicis said:
I know there are many other guides avalable regarding this, But I tried to focus on the small points also that many guides overlook
that's why I have this for you. Do let know if I have missed something or more details have to be included in case still there is a difficulty in compiling
This thread on Madteam Forums: http://madteam.co/forum/development...lt-rom-for-your-device-(ultra-noob-friendly)/
So lets start with simple things
Basic FAQ:
This post/guide is divided into 4 parts:
1. Setting up build environment
2. Machine specifications etc.
3. Device Tree and source basics
4. Syncing Source and Building
PART 1: Setting up build environment​
Type sudo su and then your password to get rid of Admin Permissions
#Installing Python
STEP 1: Open terminal (CTRL + ALT + T)
Then execute the following commands in terminal one by one
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
sudo make install
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5
Now Python is configured
#Installing JDK
As far as I know PPA which was the earlier method of installing JDK etc. doesn't exist's anymore, So I used another way!
Step 1: Open Terminal (CTRL + ALT + T)
STEP 2: Now we need to download the JDK 6 Binary by executing this command in terminal
Code:
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin"
STEP 3: Then we need to run the binary and move it to a shared location:
Code:
chmod +x jdk-6u45-linux-x64.bin
sudo ./jdk-6u45-linux-x64.bin
sudo mv jdk1.6.0_45 /usr/lib/jvm/
STEP 4: Now you have to install all binaries and give them highest priority, This will also overwrite the previous version of Java Binaries in your computer
Code:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 1
STEP 5: Now check if JDK 1.6 is selected on this:
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo update-alternatives --config jar
sudo update-alternatives --config javadoc
Now JDK is configured! To check if it is done
Execute this is Terminal
Code:
java -version
Output will be similar to this
Code:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
#Installing GNU Make
Code:
cd Downloads
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz
cd make-3.82
./configure
sudo make install
These commands are for Make 1.81 if you want to install Make 1.82 Execute these
Code:
cd
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
tar -xvzf make-3.82.tar.gz
cd make-3.82
./configure
sudo make install
Now GNU make is configures
#Installing Android SDK
STEP ONE: Download the SDK from http://developer.android.com/sdk/index.html and extract it in a folder called "sdk" in the Downloads folder
STEP TWO: Now, Execute these commands in terminal
Code:
cd ~/Downloads/sdk/tools/
./android sdk
SDK is configured now :victory:
#Installing required packages:
STEP 1: Open Terminal
Now execute these commands:
Code:
apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils xsltproc pngcrush gcc-multilib lib32z1 schedtool
Good, Now you have successfully setup linux build environment!​
PART 2: Machine specifications and other misc. stuff​
Basic Computer Specs:
2Ghz Dual Core Processor
2GB Minimum ram
50GB File Space (For only one rom source)
*PLEASE NOTE*: This is the basic specification, It really depends on the condition of your ram and cpu!
If you want to use other apps while compilation you should make a 5GB minimum swap partition!
If ram is more than 4GB ram then you don't swap partition!
PART 3: DEVICE TREE AND SOURCE BASICS​
Basic source folders:
/packages - Proprietary rom applications
/framework - Framework (Overall rom UI and stuff)
/device - Device config
/vendor - Vendor Tree and other vendor files
/hardware - Hardware drivers
Q: What is BoardConfig.mk?
A: It's the file where you setup path's to files like toolchain etc. and enable/disable stuff, its very easy to understand. You can find it in your device's tree
Q: Where is build.prop in source?
A. Build.prop is available in the source in the form of system.prop in the device tree!
Q: How to remove ringtones, video editor, CM wallpapers from bulid?
A: Go to device/releasetools/extras.txt and Delete anything you don't want in your build
PART 4: Syncing Source and Building​
# Installing Repo Package
Code:
mkdir ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
STEP 2: Now it is recommended to reboot your computer (No need of sudo su after reboot)
STEP 3: Now make directory:
Code:
mkdir -p ~/rom/android/system
STEP 4: Go into directory and set path for Repo Package
Code:
cd ~/rom/android/system
PATH=~/bin:$PATH
STEP 5: NOW ITS TIME FOR SYNCING:
For CM10.1 source execute this:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm10.1
For syncing CM10 source execute:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
You have to find for the rest!!
PS: You don't have to execute all the repo init commands written above
Now to sync execute this after the the repo init command
Code:
repo sync
Once it finishes without breaking all the folders will appear in rom/android/system folder
now execute this:
Code:
mkdir -p ~/rom/android/system/device/<ManufacturerName>/<DeviceCodeName>
and extract the device config/tree here
for me its samsung/totoro (galaxy Y, Don't mind )
then do the following:
Code:
mkdir -p ~/rom/android/system/vendor/<ManufacturerName>/<DeviceCodename>
Its the same as for the device folder
Now for compiling:
Code:
. build/envsetup.sh
lunch cm_<DeviceCodename>-eng
brunch cm_<DeviceCodename>-eng
Your build will be located at /rom/android/system/out as <RomName>-date/month/year-UNOFFICIAL-<DeviceCodeName>.zip
HAPPY COMPILING ​
Click to expand...
Click to collapse
I had two things to ask
1)Was installing android-sdk needed
2)If device not yet had a cm build or device tree how to get them

[Noob Friendly] How to build CM 12.1 for Flamingo

Hello guys,
Soo there was thread made by Vynikal but its some kind of dead and outdated for cm 12.1, i managed to make everything work on my pc and want to help everyone who has problems with building CM12.1 for Flamingo.
ATTENTION!:I or xda-dev are not responsible for any damage to your device,eyes or life, made by hapiness of having cm12.1 built
Requirements:
-Ubuntu 64bit: Tuto
-Stable internet connection, no mobile connection(its not stable enough)
-About 100GB of disk space(if you screw something up you will have some in reserve)
-All fastboot,flashboot and adb drivers installed
-Beefy pc
Lets begin:​We will start with preparations
Lets install JDK.
Code:
sudo apt-get update
then:
Code:
sudo apt-get install openjdk-7-jdk
Now you will need to install build packages, they are needed for building CyanogenMod.
Type this in terminal:
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
You will also need USB access for extracting blobs.
Code:
sudo nautilus
This will open file manager as root.
Now you must go through several steps:
1.Click Computer in the left tray of file manager - you will see some folders like: etc
2.Open Folders etc/udev/rules.d/
3.Create new document and name it: 51-android.rules
4.You can close file manager now.
If you done that 4 steps now we can continue. lets fill up that file.
Copy paste that command to console:
Code:
wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
and change <username> to your ubuntu username. in my case it will look like this:
Code:
wget -S -O - http://source.android.com/source/51-android.rules | sed "s/dominik/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
Now we need to create some directories:
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Last thing before loong downloading - repo command:
In terminal type:
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Now you will need to open .bashrc with gedit its in home (you will see it if you enable Show hidden files or CTRL+H)
add that at the end of file:
Code:
export PATH=~/bin:$PATH
Now open .profile with gedit same as .bashrc its in default direction
paste this code to that file:
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Initializing the repo:​Type in terminal:
Code:
cd ~/android/system
repo init -u git://github.com/CyanogenMod/android.git -b cm-12.1
Finally add local_manifest directory and copy-paste file included in attachment(thanks almighty Vynikal)
Code:
Code:
mkdir -p ~/android/system/.repo/local_manifests
And dont-click-the-red-button like command:
Code:
repo sync
And one more command to repair some duplicates in sepolicy
Code:
cd external/sepolicy
git revert 79ff523ac99b339914ccaa754e068072d64da542
Now i have Good and Bad news:
Good: we've done with the preparations.
Bad: this is not the end :silly:
Exporting blobs:​Its kinda tricky now, you will need hiper super duper stock rom and USB debugging toggled on + you need to connect your device to ubuntu, just go to devices/usb and chose your phone (its up in the vm tray)
First make sure that you allowed usb debugging(that window that will pop up in phone)
Once again open .profile and copy-paste this:
Code:
if [ -d "<path-to-sdk>/platform-tools" ] ; then
PATH="<path-to-sdk>/platform-tools:$PATH"
fi
And run that command in terminal to install adb and fastboot drivers.
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
Now enter that commands in terminal:
Code:
cd ~/android/system/device/sony/flamingo
./extract-files.sh
Setting up and preparing our files to building
Code:
cd ~/android/system
. build/envsetup.sh
breakfast flamingo
Build
Code:
brunch flamingo
============================================+#@#+============================================
Thanks to:
[email protected] for creating his tuto for cm12 and manifests
-visi0nary He helped me the most with several problems that we will fix in next post
-Others that i forgot sorry and send me PM (will add you)
pc:
i5 4460
2x g.skill ripjawsx cl7 1600mhz 4gb
took about 2h with ccache
Troubleshooting​Any problems? just post logs and wait for response.
When i was building that CM i had some problems with paths like i said in first post it gave me something like this
Code:
find: `dummy': No such file or directory
find: `../../../../../../external/hamcrest/src': No such file or directory
find: `../../../../../../external/junit/src/org': No such file or directory
find: `../../../../../../external/hamcrest/src': No such file or directory
make: Entering directory `/home/dominik/android/system'
build/core/copy_headers.mk:15: warning: overriding commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit.h'
build/core/copy_headers.mk:15: warning: overriding commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit_priv.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit_priv.h'
build/core/Makefile:46: warning: overriding commands for target `/home/dominik/android/system/out/target/product/flamingo/system/bin/wcnss_service'
build/core/base_rules.mk:550: warning: ignoring old commands for target `/home/dominik/android/system/out/target/product/flamingo/system/bin/wcnss_service'
PRODUCT_COPY_FILES vendor/sony/msm8226-common/proprietary/vendor/etc/audio_effects.conf:system/vendor/etc/audio_effects.conf ignored.
No private recovery resources for TARGET_DEVICE flamingo
make -C kernel/sony/msm8974 O=/home/dominik/android/system/out/target/product/flamingo/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE="/home/dominik/android/system/prebuilts/misc/linux-x86/ccache/ccache arm-eabi-" VARIANT_DEFCONFIG= SELINUX_DEFCONFIG= aosp_yukon_flamingo_defconfig
make[1]: Entering directory `/home/dominik/android/system/kernel/sony/msm8974'
target SharedLib: libm (/home/dominik/android/system/out/target/product/flamingo/obj/SHARED_LIBRARIES/libm_intermediates/LINKED/libm.so)
[B][COLOR="Red"]target SharedLib: libstdc++ (/home/dominik/android/system/out/target/product/flamingo/obj/SHARED_LIBRARIES/libstdc++_intermediates/LINKED/libstdc++.so)
/home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts: Multiple different specifications for /sys/devices/virtual/graphics/fb0/rgb (ubject_r:livedisplay_sysfs:s0 and ubject_r:sysfs_display:s0).
Error loading context file from /home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts[/COLOR][/B]
make: *** [/home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts] Error 4
make: *** Deleting file `/home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts'
make: *** Waiting for unfinished jobs....
GEN /home/dominik/android/system/out/target/product/flamingo/obj/KERNEL_OBJ/Makefile
#
# configuration written to .config
#
make[1]: Leaving directory `/home/dominik/android/system/kernel/sony/msm8974'
make: Leaving directory `/home/dominik/android/system'
#### make failed to build some targets (02:17 (mm:ss)) ####
i marked that place. visi0nary told me that 2 files has same paths that interfere each other and doesnt allow to continue with build. soo we found solution, but idk if its my fault or its some typo or other kind of mistake
Fix:
1. Go to android/system/device/sony/msm8226-common/sepolicy
2. Open file_contexts in gedit and add # before last line
it should look like this:
Code:
# Trim Area daemon
/dev/socket/tad u:object_r:tad_socket:s0
# CPU governor controls
/dev/socket/mpdecision(/.*)? u:object_r:mpctl_socket:s0
/dev/socket/mpctl u:object_r:mpctl_socket:s0
/dev/pn547 u:object_r:nfc_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/modemst1 u:object_r:modem_efs_partition_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/modemst2 u:object_r:modem_efs_partition_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/fsg u:object_r:modem_efs_partition_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/TA u:object_r:trim_area_partition_device:s0
/data/system/default_values u:object_r:mpctl_data_file:s0
/system/bin/sct_service u:object_r:sct_exec:s0
/system/bin/tad_static u:object_r:tad_exec:s0
/system/bin/ta_qmi_service u:object_r:ta_qmi_exec:s0
/system/bin/thermanager u:object_r:thermanager_exec:s0
#/sys/devices/virtual/graphics/fb0/rgb -- u:object_r:sysfs_display:s0
for actual moment cm 12.1 dont work at all
Woah, it's been a long time since I stopped visiting this forum.
Your tut is kinda good, but I can't tell if something has changed in the past.
Actually those blobs you are extracting should be located in this repo, which is also downloaded through local_manifests, so maybe extracting them again is useless.
Bad luck, this device feels abandoned since the begining.
But hey, does it boot? If yes, progress has been made :cyclops:
Vynikal said:
Woah, it's been a long time since I stopped visiting this forum.
Your tut is kinda good, but I can't tell if something has changed in the past.
Actually those blobs you are extracting should be located in this repo, which is also downloaded through local_manifests, so maybe extracting them again is useless.
Bad luck, this device feels abandoned since the begining.
But hey, does it boot? If yes, progress has been made :cyclops:
Click to expand...
Click to collapse
nope dont boot at all at any build
and yeah they should be downloaded with it but somehow when i was compiling it there was error that prevented from building it, after extracting that blobs(something might be missing) everyhing went ok
ps. sorry that i used your thread without permission
MasterDomino said:
nope dont boot at all at any build
and yeah they should be downloaded with it but somehow when i was compiling it there was error that prevented from building it, after extracting that blobs(something might be missing) everyhing went ok
ps. sorry that i used your thread without permission
Click to expand...
Click to collapse
No worries, I have no plans on this forum. My E3 is broken, beaten and scarred. And with Firefox OS installed.
I was always wondering why the hell no CM12 build boots. I guess I won't know anytime soon.
Vynikal said:
No worries, I have no plans on this forum. My E3 is broken, beaten and scarred. And with Firefox OS installed.
I was always wondering why the hell no CM12 build boots. I guess I won't know anytime soon.
Click to expand...
Click to collapse
me and visi0nary found out it's propably fstab because adb not even toggles, its propably problem with mounting :/
Is this will work for all varian?
useone07 said:
Is this will work for all varian?
Click to expand...
Click to collapse
propably not because it doesnt work for my wariant(selinux or fstab problem ) cm 12 works perfectly but on D2203, idk about other wariants.

Problem building Resurrection Remix for Z5P

Hi, I want to make RR for our Z5 Premium; using the CTXz GUIDE and Resurrection one
Everything works great, 'til final building
I just mark the step in case i'm not doing it right
1. OpenJDK
2. Necessaries tools
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 schedtool
I type the whole line in terminal
3. Set up cache, then reboot
4. Git config' (Username + Email)
5. Creation of "Bin" folder into my /home/myname/ and changing permissions of it
6. Now I create "RR" in /home/myname/
7. I switch to this folder (cd ~/RR/)
8. repo init the RR sources
Code:
repo init -u [url]https://github.com/ResurrectionRemix/platform_manifest.git[/url] -b marshmallow
9. repo sync (Waaaaaiting)
10. Once it's done, I have to deal with Z5 files (I suppose this is the part where something goes wrong)
Code:
cd /.repo
Code:
git clone https://github.com/Sony-Kitakami/and..._manifests.git local_manifests
11. cd to go to /RR/ then
Code:
repo sync --force-sync
12.
Code:
source build/envsetup.sh
3.
Code:
lunch cm_satsuki-userdebug
14.
Code:
mka clobber && mka bacon
15. the rom seems in build (many lines of code)
At the end it wrote an error message, and in ~/RR/out/target/product/satsuki/
I only get 3 folders like
system (ridiculous size -> 28.7ko)
obj
root
& 2 .mk files
The problem comes from the step I add Sony files ? , I probably didn't make it right :/
Thanks in advance to anyone who will lose his time with me <3
I got Ubuntu 14.04LTS
Click to expand...
Click to collapse
,
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
Click to expand...
Click to collapse
Set up the terminal so that it at least has 100,000 lines of backlog,
then from the start of entering
mka clobber && mka bacon
copy over the whole log output to e.g. geany
search for error or fail in Document
there must be more output and explaining what went wrong
I'm gonna do that
here it is

Categories

Resources