Compiling android4.4.4 for NEXUS4

Source: Internet
Author: User

Reference https://source.android.com

1. Configuring the development environment Initializing a Build environment

Compiling the Android4.4.4 requires the use of a 64bit system. So I installed an Ubuntu 14.04 64bit on the virtual machine.

First install Jdk,andorid the installation method provided by the official website is to install openjdk7,android4.4.4 requires the use of jdk1.6. So I went to Oracle to download a 1.6 version of the JDK

Http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

Select Jdk-6u45-linux-x64.bin

After download, execute:

sudo chmod a+x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
After execution, the JDK is unzipped to the current directory, and the folder is then copied to/USR/LIB/JVM
sudo cp–rf jdk1.6.0_45//USR/LIB/JVM
Next, configure the Java environment Variables and add the/etc/profile

Java_home=/usr/lib/jvm/jdk1.6.0_45
Path= $JAVA _home/bin: $PATH
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export Java_home
Export PATH
Export CLASSPATH

Executive profile:

sudo source/etc/profile

Then use update alternatives to switch the JDK

[Email protected]:~$ sudo update-alternatives--config java
There is 3 choices for the alternative Java (Providing/usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 Auto Mode
1/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 Manual Mode
2/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 Manual Mode
* 3/usr/lib/jvm/jdk1.6.0_45/bin/java Manual mode

Press ENTER to keep the current choice[*], or type selection Number:3

[Email protected]:~$ sudo update-alternatives--config javac
There is 3 choices for the Alternative Javac (PROVIDING/USR/BIN/JAVAC).

Selection Path Priority Status
------------------------------------------------------------
0/usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071 Auto Mode
1/usr/lib/jvm/java-6-openjdk-amd64/bin/javac 1061 Manual Mode
2/usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071 Manual Mode
* 3/usr/lib/jvm/jdk1.6.0_45/bin/javac Manual mode

Press ENTER to keep the current choice[*], or type selection Number:3

Next, install the various libraries
sudo apt-get install bison g++-multilib git gperf libxml2-utils
When you are done, download the code now
First create a new folder in the user's root directory bin
mkdir ~/bin
Export Path=~/bin: $PATH
Download repo
Curl Https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Create a new folder to hold the source code
mkdir Android4
CD Android4
Initialize Repo

[Email protected]:~/android4$ repo init-u https://android.googlesource.com/platform/manifest

Next select the branch you want to download here select Android-4.4.4_r1 to download other versions can be queried at the following link:
Http://source.android.com/source/build-numbers.html#source-code-tags-and-builds
Repo Init-u https://android.googlesource.com/platform/manifest-b ANDROID-4.4.4_R1
Next Download the code
Repo Sync
It takes a long time to download. I've been here for two days ...
After the download is complete, you can see all the files in the Android4 folder:
The kernel and vendor folders are added later.
Next to add Vendor,vendor is not compliant with the Asop Open source agreement of the manufacturer driver part, in
Https://developers.google.com/android/nexus/drivers can be found in:
Download these three files and unzip them in the Android source code root directory
At this time according to the official Android method to perform these three shell scripts do not normally extract the vendor file, open the Sh file can be found to perform the following three commands can be extracted:
Tail-n +276 extract-broadcom-mako.sh | Tar zxv
Tail-n +276 extract-lge-mako.sh | Tar zxv
Tail-n +315 extract-qcom-mako.sh | Tar zxv
If you are compiling another device or Android version, you can open the sh file. Find this command after license. Each manufacturer license different lengths resulting in a difference in the following parameters. You can change it slightly.
After completing the above steps, you can start compiling the source code, and note that compiling the source code suggests setting 4g memory. (My virtual machine will be stuck on a file in Chrome when I set up 2g ram ....), it is said that you can add swap. Never tried)
Execute the following code in the Android root directory:
SOURCE build/envsetup.sh
Lunch Full_mako-userdebug
Make–j4
After compiling the phone into the fastboot, the following are the Nexus devices into the FastBoot method O (∩_∩) o~
Re-execute FastBoot flashall–w

[Email protected]:~/android4$ fastboot flashall-w
< waiting for device >
--------------------------------------------
Bootloader Version ...: makoz30d
Baseband Version ...: m9615a-cefwmazm-2.0.1701.03
Serial number ...: xxxxxxxxxxxx

--------------------------------------------
Checking product ...
OKAY [0.004s]
Sending ' boot ' (6370 KB) ...
OKAY [0.781s]
Writing ' Boot ' ...
OKAY [0.362s]
Sending ' recovery ' (6918 KB) ...
OKAY [0.869s]
Writing ' recovery ' ...
OKAY [0.395s]
Erasing ' system ' ...
OKAY [0.314s]
Sending ' system ' (301507 KB) ...
OKAY [36.709s]
Writing ' System ' ...
OKAY [18.345s]
Erasing ' UserData ' ...
OKAY [0.509s]
Formatting ' UserData ' partition ...
Creating filesystem with Parameters:
size:6189744128
Block size:4096
Blocks per group:32768
Inodes per group:8048
Inode size:256
Journal blocks:23612
Label:
blocks:1511168
Block groups:47
Reserved Block Group size:375
Created filesystem with 11/378256 inodes and 50366/1511168 blocks
Sending ' UserData ' (98413 KB) ...
Writing ' UserData ' ...
OKAY [17.536s]
Erasing ' cache ' ...
OKAY [0.046s]
Formatting ' cache ' partition ...
Creating filesystem with Parameters:
size:587202560
Block size:4096
Blocks per group:32768
Inodes per group:7168
Inode size:256
Journal blocks:2240
Label:
blocks:143360
Block Groups:5
Reserved Block Group size:39
Created filesystem with 11/35840 inodes and 4616/143360 blocks
Sending ' cache ' (10984 KB) ...
Writing ' Cache ' ...
OKAY [1.963s]
Rebooting ...

Finished. Total time:77.850s

The burn-write is ready to boot.
Some files may be missing during the compilation process, so you can refer to the blog of Jack the Great God:
http://tianshuzhb.blog.163.com/blog/static/35137793201211872125183/

Compiling android4.4.4 for NEXUS4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.