Talking about compiling high-pass android5.1 source code

Source: Internet
Author: User
Tags create directory first string

Why compile Qualcomm 5.1 source code for the simple reason that the company does the Qualcomm platform for the phone, so it is necessary to compile the

Basic Linux Learning Chapter

1. Common directives

LS Display file or directory

–l Listing File Details

L (list) –a lists all files and directories under the current directory, including Hidden A (all)

mkdir Creating a Directory

-P Create directory, if no parent directory, create p (parent)

    • CD Switch Directory

    • Touch creates an empty file

    • Echo creates a file with content.

    • Cat View File Contents

    • CP Copy

    • MV Move or rename

    • RM Delete File

-R Recursive Delete, can delete subdirectories and files

-F Force Delete

    • Find searches a file system for a file

    • WC statistics Text line number, word count, number of characters

    • Grep finds a string in a text file

    • RmDir Delete Empty Directory

    • Tree structure display directory, need to install tree package

    • PWD Displays the current directory

    • LN creates a linked file

    • More, less pagination displays text file contents

    • Head, tail display file header, tail content

    • CTRL+ALT+F1 command line full-screen mode

2. System administration Commands

    • Stat Displays details of the specified file, more detailed than LS

    • Who shows online login

    • WHOAMI Show current Operation user

    • Hostname Display host name

    • Uname Display System Information

    • Top dynamic display currently consumes the most resources process information

    • PS Display transient process status

    • Ps-aux du view directory size

    • Du-h/home with units display directory information

    • DF View disk Size

    • Df-h with unit display disk information

    • Ifconfig Viewing network conditions

    • Ping Test network connectivity

    • Netstat Displaying network status information

    • Man command won't work, find men like: Guy ls

    • Clear Clear Screen

    • Alias to rename the command such as: Alias showmeit= "Ps-aux", in addition to de-use Unaliax showmeit kill kill process, you can first use the PS or top command to view the process ID, and then kill the process with the kill command.

3. Packaging compression Related commands

Gzip:bzip2:tar: Packaging compression-C archive file-X compressed file-z gzip compressed file-j bzip2 Compressed file-V display compression or decompression process (view)-F Use file name example: tar-cvf/home/abc.tar/h OME/ABC is packaged only, does not compress TAR-ZCVF/HOME/ABC.TAR.GZ/HOME/ABC packaging, and is packaged with gzip compression tar-jcvf/home/abc.tar.bz2/home/abc, with bzip2 compression of course, if you want to Unzip, you can replace the above command TAR-CVF/TAR-ZCVF/TAR-JCVF "C" in the "X".

4. Power off/Restart the machine

Shutdown

-R shutdown Restart

-H shutdown does not restart

Now turn the machine off.

Halt shut down the machine

Reboot restart

5. The Linux pipeline takes the standard output of one command as the standard input for another command. That is, the combination of several commands to use, the latter command in addition to the results of a previous command. Example: Grep-r "Close"/home/* | More in the home directory to find all files, including close files, and paging output.

6. Linux Package Management

Dpkg (Debian package) management tool with a. deb suffix. This approach is suitable for systems that are not networked. For example, install the tree command installation package, first upload tree.deb to the Linux system. Then install it using the command below. sudo dpkg-i tree_1.5.3-1_i386.deb install software sudo dpkg-r tree Uninstall software Note: There are several ways to upload tree.deb to a Linux system. Vmwaretool, use of Mount mode, use of WINSCP tools, etc., APT (Advanced Packaging tool) premium software tools. This method is suitable for the system to be able to connect the internet situation. Still take tree For example sudo apt-get install tree installation tree sudo apt-get remove tree uninstall tree sudo apt-get update update software sudo apt-get upgrade will The. rpm file to the. deb file. RPM is the software format used by Redhat. cannot be used directly under Ubuntu, so you need to convert it. sudo alien abc.rpm

7.VI command

    • VI FileName: Opens or creates a new file and places the cursor at the beginning of the first

    • VI +n FileName: Opens the file and places the cursor at the beginning of nth

    • VI + FileName: Opens the file and places the cursor at the end of the line V

    • I +/pattern filename: Open the file and place the cursor at the first string matching the pattern

    • Vi-r FileName: The last time you were editing with VI, a system crash occurred, restoring filename

    • VI filename...filename: Open multiple files, edit them sequentially

    • I: Before the cursor

    • I: At the beginning of the current

    • A: After the cursor

    • A: At the end of the current line

    • O: A new line below the current line

    • O: New row above the current line

    • R: Replace the current character

    • R: Replaces the current character and the character after it, until the ESC key is pressed

    • S: replaces the specified number of characters with the input text starting at the current cursor position

    • S: Deletes the specified number of rows and replaces them with the input text

    • NCW or NCW: Modifies a specified number of words

    • NCC: Modifying a specified number of rows

Environment Configuration Chapter

I. Installing and configuring virtual machines

    1. Install VirtualBox directly next to

    2. The parameters of the configuration virtual machine are the following hard disk 300g+; memory 8g+

    3. Installing Ubuntu Images

Ii. setting up the environment (with Ubuntu 14.04 as an example)

1. Install OPENJDK $ sudo apt-get update $ sudo apt-get install openjdk-7-jre-headless $ sudo apt-get install Openjdk-7-jre $ sud o apt-get Install OPENJDK-7-JDK

2. Install the required package $ 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

If you use SELinux, you may also want to install the PYTHON-NETWORKX hint: if you encounter installation problems, you can install them individually.

Third, compile (compile Android native code can go to Android source this website, need to flip the wall)

    1. SOURCE Entire project

    2. ./go.sh

    3. After the compilation is successful, it is packaged make_unsparse_image.sh Android compilation system (iii) MAIN.MK analysis

MAIN.MK Analysis

Main.mk mainly contains the following parts of the content

1. Shell Settings

2. Compiling the Environment configuration

3. Compile the Environment check

4. Include the necessary macros

5. Set compile-time variables according to make parameters

6. Contains android.mk that need to be compiled

7. Set up the compilation system Target:prerequisites control the entire compilation process

Here are the necessary explanations for the above points:

With the previous section of the Android compilation system architecture analysis, if you need to modify the Android compilation system, you can not blindly look for problems, modify the code. Analyze main.mk today to see what valuable information it can provide for our Android compilation, and how to customize our Android build system.

Main.mk's first sentence is based on Android_build_shell to wrap the SHELL that the system uses, if we do not want to use bash, but want to use SH, then you can write in front of it android_build_shell: =/bin/sh, Or, add the relevant definitions in build/envsetup.sh.

After the shell is defined, the make_version is checked, and the default compilation target is defined droid!

If we do not add any parameters after typing make, the target is the droid. Note that although the following include $ (Build_system)/CONFIG.MK is written after the default target droid dependency, but both its and subsequent statements are executed, this is the makefile syntax.

The following will include Config.mk Cleanbuild.mk to make the necessary configuration for the compilation system. This is followed by a review of the compilation environment, including case sensitivity, path checking, Java version checking, and javac version checking. Android's check of the compiled environment will not be checked again at the next compile time if the condition is met.

After checking the version, it will be included in the Definations.mk, as described earlier, the DEFINATIONS.MK defines many of the macros used in the compilation system, these macros need to be called frequently at compile time, so it is included in the pre-compilation stage.

The compiled configuration is then made for the type of compilation (Eng user Userdebug Showcommands, etc.) that is passed in for make, which affects the modules that are included in the final compilation target. For the difference between compilation targets such as the ENG user Userdebug SDK Win_sdk tests, readers can find out what is different by looking at the MAIN.MK code.

Omit some of the unimportant content here and skip directly to

Ifeq ($ (sdk_only), true), around 368 lines, this judgment statement until the end of this statement block, is the subdirs variable settings, the Subdirs variable determines which subfolders are ultimately compiled.

In the following setting of the Subdir_makefiles variable, it determines which android.mk are compiled. The dependencies of all these android.mk files are added immediately after the include $ (subdir_makefiles). This includes the droid's dependence, which we'll find later.

Then, based on these makefile, find all the modules that need to be compiled, and perform the necessary classifications (Eng_modules/debug_modules/tests_modules, modules_to_check/ Modules_to_install, etc.) to be treated differently.

This is followed by a series of implicit objectives: prebuilt, all_copied_headers, files, Checkbuild, RAMDisk, Systemtallball, Userdataimage, Userdatatarball, bootimg, Droidcore and so on. The most important point is that the droid relies on Droidcore, and Droidcore relies on

Droidcore:files \

Systemimage \

$ (installed_bootimage_target) \

$ (installed_recoveryimage_target) \

$ (installed_userdataimage_target) \

$ (Installed_files_file)


Problems encountered

1. The compile-time prompt does not support OPENJDK, only Oracle JDK solution is supported:

Download the JDK version from the Oracle website to jdk-7u45-linux-x64.tar.gz

Example: sudo tar zxvf jdk-7u45-linux-x64.tar.gz-c/USR/LIB/JVM

Environment variables sudo gedit/etc/profile export java_home=/usr/lib/jvm/jdk1.7.0_65

Export Classpath= ".: $JAVA _home/lib: $CLASSPATH"

Export path= "$JAVA _home/bin: $PATH"

Change the default JDK

sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.7.0_65/bin/java 300

sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.7.0_5/bin/javac 300

sudo update-alternatives--config java Validation command

Java–version

2. Compile-time with./GO.SH encountered the following prompt Out/target/...kill, more CPU-related

Workaround: Use i7,16g's computer to

This article is from the "Small Night" blog, please be sure to keep this source http://237722726.blog.51cto.com/6114043/1767973

Talking about compiling high-pass android5.1 source code

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.