Full Process of Android system Transplantation

Source: Internet
Author: User
Tags gnupg

 

Android Development Environment

1. installation:

Required packages

Android requires the following system packages:

  • Flex: This lexical analyzer generator is used to read a given input file for a description of a failed to generate.
  • Bison: this is a general-purpose Parser Generator.
  • Gperf: this is a perfect hash function generator.
  • Libesd0-dev: This enlightened sound daemon (Dev files) is used to mix digitized audio streams for playback by a single device.
  • Libwxgtk2.6-Dev: this package provides GUI components and other facilities for each different platforms.
  • Build-essential: This package contains a list of packages considered fundamental to building Debian packages.

$ Sudo apt-Get install Git-core GnuPG gperf libsdl-dev libesd0-dev

$ Sudo apt-Get install libwxgtk2.6-dev zip curl minicom tftpd

$ Sudo apt-Get install uboot-mkimage libx11-dev libncurses-Dev

$ Sudo apt-Get install verify CT bison build-essential flex zlib1g-dev

4. install Java tools

1. I encountered many problems during Java installation:

If the sun-java6-jdk is already installed, the following error is prompted during preparation:

Your version is: Java version "1.6.0 _ 20 ".
The correct version is 1.5.
Or there is no prompt, but the final encoding still fails, saying that many databases cannot be found.

If the sun-java5-jdk is already installed, the following error is prompted during preparation:

Your version is: Java version "1.5.0 _ 19"
The correct version is 1.6.

2. Then I thought of a solution and tried ubuntu9.10 and ubuntu10.04 to work properly.

Installation steps:
(1) For Ubuntu 9.10 and later users, first Modify/etc/APT/sources. List

Add two lines at the end:

Deb http://cn.archive.ubuntu.com/ubuntu/ jaunty multiverse
Deb http://cn.archive.ubuntu.com/ubuntu/ jaunty-Updates multiverse
Then execute
$ Sudo apt-Get update

(2). Install sun-java6-jdk
$ Sudo apt-Get install sun-java6-jdk

(3). Uninstall sun-java6-jdk
$ Sudo apt-Get remove sun-java6-jdk
$ Sudo apt-Get remove sun-java6-bin

(4). Install sun-java5-jdk
$ Sudo apt-Get install sun-java5-jdk

The installation process has a graphical interface. If you cannot press it, press the tab key to switch over.

Check the version after installation.
$ Java-version
Java version "1.5.0 _ 19"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 19-b02)
Java hotspot (TM) Client VM (build 1.5.0 _ 19-b02, mixed mode, sharing)

Now, the development environment is complete!

Android SDK

1. Install Repo
01. $ curl http://android.git.kernel.org/repo>/bin/repo/* I chose to install to the/bin directory */

02. $ chmod A + x/bin/Repo
Copy code 2. Create a working directory
01. $ export Android = your android directory # define the Source Path

02. $ mkdir-p $ android

03. $ CD $ android
Copy code 3. Download source code

1. First download all manifest stuff
01. $ repo init-u git: // android.git.kernel.org/platform/manifest.git

02. $ repo sync
Copying a 1.7g file is not easy to download, so we need to back up the file.
After the download, there is a hidden folder ". Repo". Save the folder and delete other files.

2. Get android-2.2_r1.1 items

(1) initialize the android-2.2_r1.1 Project
01. $ repo init-u git: // android.git.kernel.org/platform/manifest.git-B android-2.2_r1.1
(Copy code (2) create a local_manifest.xml File
01. $ touch. repo/local_manifest.xml

02. $ VI. repo/local_manifest.xml
Copy the code/* do not want to use VI, or use gedit */
Copy the following content:/* Currently, ALSA-related items are used first. In the future, you may need to choose your own */
01. <? XML version = "1.0" encoding = "UTF-8"?>

02. <manifest>

03. <project Path = "external/ALSA-lib" name = "platform/external/ALSA-lib" revision = "Froyo"/>

04. <project Path = "external/ALSA-utils" name = "platform/external/ALSA-utils" revision = "Froyo"/>

05. <project Path = "Hardware/alsa_sound" name = "platform/hardware/alsa_sound" revision = "Froyo"/>

06. </manifest>
Copy the code (3) synchronize) (I think the red part can be left blank, no need)
01. $ repo sync
Since the sync operation has been done before, it is much faster now and can be completed in just a few minutes.

Iv. Patch i8320
01. $ CD $ android

02. Method 1: Download the attachment directly, decompress it to the current directory, and you can see the vendor folder. This method is not recommended for backup.

03. Method 2: We recommend that you obtain the latest vendor from the GIT repository of mephistoph:

04. $ git clone git: // gitorious.org/h1droid/vendor.git

05. Then copy the vendor folder to the $ Android directory.

06. $ CD vendor

07. $./Sola/omap3/patches/omap3-patch.sh
Copy Code 5. Android Coding
01. $ CD $ android

02. $ source build/envsetup. Sh

03. $ lunch i8320board-eng.

04. $ make-J3
Copy Code 5. Prepare the environment for generating the image file
01. $ CD $ android

02. $./vendor/Sola/omap3/image/i8320board-image.sh
Copy Code 6. TI's Android sgx sdk, which is a tool for generating SDK image.

1. Install ti_android_sgx_sdk
01. $ CD $ android

02. $ git clone git: // gitorious.org/rowboat/ti_android_sgx_sdk.git ti_android_sgx_sdk

03. $ CD ti_android_sgx_sdk

04. $./omap35x_android_graphics_sdk_setuplinux_3_01_00_03.bin
Copy the code and the interface will pop up. We will start to install the SDK. Note that the installation directory must be the current directory (ti_android_sgx_sdk ).

2. Modify the make rule.
After installation, edit the/opt/omap35x_android_graphics_sdk_3_01_00_03/rules. Make file.

Find the corresponding location in the file and modify the following content:
01. Home = $ (Android)

02. graphics_install_dir = $ (Android)/ti_android_sgx_sdk

03. android_root = $ (Android)/vendor/Sola/omap3/image/i8320board/android

04. cstool_dir = $ (Android)/prebuilt/linux-x86/toolchains/arm-eabi-4.4.0/

05. kernel_install_dir = [color = darkorchid] absolute path of the Linux Kernel
Copy the Code 3. Execute the following command. Note that you need to redo the following steps every time you modify the kernel)
01. $ CD $ Android/ti_android_sgx_sdk

02. $ make

03. $ make install omapes = 3.x
Copy the code and your SDK image will be generated.

7. Copy the image to the TF card

TF card requirements: More than MB, ext3 file system.
Go to the $ Android/vendor/Sola/omap3/image/i8320board/Android directory, and copy all the files to the TF root directory.

8. Run

Switch i8320 to the download status, plug in the USB cable, and download boot. Bin.
01. $ CD Odin

02. $./Odin ../boot. Bin
Copy the code/* boot. bin in the previous directory */

If everything goes well, the screen will be white or blurred for a few seconds, and then the penguin and some character information will come out.
For the first startup, We need to initialize our TF card. wait patiently and we can see the android logo, which is then the exciting main interface of android2.2.

I started running Android only yesterday. There are still many issues that need to be studied together:
(1) Power Supply Management
(3) Wi-Fi, sound card, listen lth, watchdog, pl_sensor, etc.

Kernel
I. Preparations
1. toolchain Creation
Download and decompress toochain:
$ Wget

Http://www.codesourcery.com/sgpp/lite/arm/portal/package5383/public/arm-none-linux-gnueabi/arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

$ Tar xvjf arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2-C the directory you want to extract
Copy code
Set toolchain:
$ Export Path =/toolchain folder location/bin: $ path
$ Export cross_compile = arm-None-Linux-gnueabi-
$ Export arch = arm
Copy code
2. Install git
# Apt-Get install Git-core
Copy code
Ii. U-boot Encoding
1. Download the source code for the master branch $ git clone git: // h1.pargon. nl/srv/git-h1/u-boot.git
$ Cd u-boot
2. Get the code update for the nowplus Branch (nowplus is the i8320 alias) $ git checkout nowplus * if it fails, use this command: $ git checkout-B nowplus origin/nowplus */
The GIT repository of h1.pargon. nl is broken. Use the repository created by Mephisto:
$ Git clone git: // gitorious.org/h1droid/u-boot.git
$ Cd u-boot
Copy code
3. Modify U-boot/include/configs/omap3_nowplus.h
Config_bootdelay, config_extra_env_settings and config_bootcommand
# Define config_bootdelay 0
# Define config_extra_env_settings \
"Loadaddr = 0x82000000 \ 0 "\
"Console = ttys2, 115200n8 \ 0 "\
"Usbtty = cdc_acm \ 0 "\
"Stdout = usbtty \ 0 "\
"Stdin = usbtty \ 0 "\
"Stderr = usbtty \ 0 "\
"Bootargs = root =/dev/mmcblk0p1 RW init =/init rootdelay = 1 rootfstype = ext3 rootwait debug \ 0 "\
# Define config_bootcommand \
"Bootm 0x86c30000"
Copy code
4. Compile U-boot
$ Make omap3_nowplus_config
$ Make
Copy code
3. Linux kernel version 2.6.32.9
1. Download the source code of the master Branch
$ Cd u-boot first-level directory/* Note: U-boot and i8320kernel should be easily generated under the same level directory */
(The GIT repository has been moved. The old one is GIT: // github.com/mephistophilis/i8320kernel.git)
$ Git clone git: // gitorious.org/h1droid/i8320kernel.git
$ CD i8320kernel
Copy code
2. Get the code update for the i8320 Branch
(Now there is no i8320 branch. $ git checkout i8320/* If not, use this command: $ git checkout-B i8320 origin/i8320 */$ git pull origin i8320)
Currently, you only need to execute:
$ Git pull origin master # update code
Copy code
3. Set the tool path for uimage generation
$ Export Path = u-boot directory/tools: $ path
Copy code
4. Compile uimage
$ Cp arch/ARM/configs/omap_nowplus_defconfig. config
$ Make uimage
Copy code
4. Generate boot. Bin
Boot. Bin is designed to synthesize u-boot.bin and uimage.
1. Get makeboot Tool
$ CD kernel and the first-level directory of U-boot
$ Wget http://h1droid.googlecode.com/files/makeboot.sh
$ Chmod + x makeboot. Sh
Copy code
2. Generate boot. Bin
$ ../Makeboot. Sh./U-boot/u-boot.bin./i8320kernel/ARCH/ARM/boot/uimage
Copy code
5. Run the kernel
1. Download Tool
$ Git clone git: // h1.pargon. nl/srv/git-h1/Odin. Git
$ CD Odin
Copy code
2. Compile
$ Make Brick
Copy code
3. Switch i8320 to the download status, plug in the USB cable, and download boot. Bin.
$./Odin ../boot. Bin
Copy code
/* Boot. bin directory at the previous level */
At this time, the screen will be white or blurred for a few seconds, then the penguin and some character information will come out.
The system is working !!!!

Android Development Environment

1. installation:

Required packages

Android requires the following system packages:

  • Flex: This lexical analyzer generator is used to read a given input file for a description of a failed to generate.
  • Bison: this is a general-purpose Parser Generator.
  • Gperf: this is a perfect hash function generator.
  • Libesd0-dev: This enlightened sound daemon (Dev files) is used to mix digitized audio streams for playback by a single device.
  • Libwxgtk2.6-Dev: this package provides GUI components and other facilities for each different platforms.
  • Build-essential: This package contains a list of packages considered fundamental to building Debian packages.

$ Sudo apt-Get install Git-core GnuPG gperf libsdl-dev libesd0-dev

$ Sudo apt-Get install libwxgtk2.6-dev zip curl minicom tftpd

$ Sudo apt-Get install uboot-mkimage libx11-dev libncurses-Dev

$ Sudo apt-Get install verify CT bison build-essential flex zlib1g-dev

4. install Java tools

1. I encountered many problems during Java installation:

If the sun-java6-jdk is already installed, the following error is prompted during preparation:

Your version is: Java version "1.6.0 _ 20 ".
The correct version is 1.5.
Or there is no prompt, but the final encoding still fails, saying that many databases cannot be found.

If the sun-java5-jdk is already installed, the following error is prompted during preparation:

Your version is: Java version "1.5.0 _ 19"
The correct version is 1.6.

2. Then I thought of a solution and tried ubuntu9.10 and ubuntu10.04 to work properly.

Installation steps:
(1) For Ubuntu 9.10 and later users, first Modify/etc/APT/sources. List

Add two lines at the end:

Deb http://cn.archive.ubuntu.com/ubuntu/ jaunty multiverse
Deb http://cn.archive.ubuntu.com/ubuntu/ jaunty-Updates multiverse
Then execute
$ Sudo apt-Get update

(2). Install sun-java6-jdk
$ Sudo apt-Get install sun-java6-jdk

(3). Uninstall sun-java6-jdk
$ Sudo apt-Get remove sun-java6-jdk
$ Sudo apt-Get remove sun-java6-bin

(4). Install sun-java5-jdk
$ Sudo apt-Get install sun-java5-jdk

The installation process has a graphical interface. If you cannot press it, press the tab key to switch over.

Check the version after installation.
$ Java-version
Java version "1.5.0 _ 19"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 19-b02)
Java hotspot (TM) Client VM (build 1.5.0 _ 19-b02, mixed mode, sharing)

Now, the development environment is complete!

Android SDK

1. Install Repo
01. $ curl http://android.git.kernel.org/repo>/bin/repo/* I chose to install to the/bin directory */

02. $ chmod A + x/bin/Repo
Copy code 2. Create a working directory
01. $ export Android = your android directory # define the Source Path

02. $ mkdir-p $ android

03. $ CD $ android
Copy code 3. Download source code

1. First download all manifest stuff
01. $ repo init-u git: // android.git.kernel.org/platform/manifest.git

02. $ repo sync
Copying a 1.7g file is not easy to download, so we need to back up the file.
After the download, there is a hidden folder ". Repo". Save the folder and delete other files.

2. Get android-2.2_r1.1 items

(1) initialize the android-2.2_r1.1 Project
01. $ repo init-u git: // android.git.kernel.org/platform/manifest.git-B android-2.2_r1.1
(Copy code (2) create a local_manifest.xml File
01. $ touch. repo/local_manifest.xml

02. $ VI. repo/local_manifest.xml
Copy the code/* do not want to use VI, or use gedit */
Copy the following content:/* Currently, ALSA-related items are used first. In the future, you may need to choose your own */
01. <? XML version = "1.0" encoding = "UTF-8"?>

02. <manifest>

03. <project Path = "external/ALSA-lib" name = "platform/external/ALSA-lib" revision = "Froyo"/>

04. <project Path = "external/ALSA-utils" name = "platform/external/ALSA-utils" revision = "Froyo"/>

05. <project Path = "Hardware/alsa_sound" name = "platform/hardware/alsa_sound" revision = "Froyo"/>

06. </manifest>
Copy the code (3) synchronize) (I think the red part can be left blank, no need)
01. $ repo sync
Since the sync operation has been done before, it is much faster now and can be completed in just a few minutes.

Iv. Patch i8320
01. $ CD $ android

02. Method 1: Download the attachment directly, decompress it to the current directory, and you can see the vendor folder. This method is not recommended for backup.

03. Method 2: We recommend that you obtain the latest vendor from the GIT repository of mephistoph:

04. $ git clone git: // gitorious.org/h1droid/vendor.git

05. Then copy the vendor folder to the $ Android directory.

06. $ CD vendor

07. $./Sola/omap3/patches/omap3-patch.sh
Copy Code 5. Android Coding
01. $ CD $ android

02. $ source build/envsetup. Sh

03. $ lunch i8320board-eng.

04. $ make-J3
Copy Code 5. Prepare the environment for generating the image file
01. $ CD $ android

02. $./vendor/Sola/omap3/image/i8320board-image.sh
Copy Code 6. TI's Android sgx sdk, which is a tool for generating SDK image.

1. Install ti_android_sgx_sdk
01. $ CD $ android

02. $ git clone git: // gitorious.org/rowboat/ti_android_sgx_sdk.git ti_android_sgx_sdk

03. $ CD ti_android_sgx_sdk

04. $./omap35x_android_graphics_sdk_setuplinux_3_01_00_03.bin
Copy the code and the interface will pop up. We will start to install the SDK. Note that the installation directory must be the current directory (ti_android_sgx_sdk ).

2. Modify the make rule.
After installation, edit the/opt/omap35x_android_graphics_sdk_3_01_00_03/rules. Make file.

Find the corresponding location in the file and modify the following content:
01. Home = $ (Android)

02. graphics_install_dir = $ (Android)/ti_android_sgx_sdk

03. android_root = $ (Android)/vendor/Sola/omap3/image/i8320board/android

04. cstool_dir = $ (Android)/prebuilt/linux-x86/toolchains/arm-eabi-4.4.0/

05. kernel_install_dir = [color = darkorchid] absolute path of the Linux Kernel
Copy the Code 3. Execute the following command. Note that you need to redo the following steps every time you modify the kernel)
01. $ CD $ Android/ti_android_sgx_sdk

02. $ make

03. $ make install omapes = 3.x
Copy the code and your SDK image will be generated.

7. Copy the image to the TF card

TF card requirements: More than MB, ext3 file system.
Go to the $ Android/vendor/Sola/omap3/image/i8320board/Android directory, and copy all the files to the TF root directory.

8. Run

Switch i8320 to the download status, plug in the USB cable, and download boot. Bin.
01. $ CD Odin

02. $./Odin ../boot. Bin
Copy the code/* boot. bin in the previous directory */

If everything goes well, the screen will be white or blurred for a few seconds, and then the penguin and some character information will come out.
For the first startup, We need to initialize our TF card. wait patiently and we can see the android logo, which is then the exciting main interface of android2.2.

I started running Android only yesterday. There are still many issues that need to be studied together:
(1) Power Supply Management
(3) Wi-Fi, sound card, listen lth, watchdog, pl_sensor, etc.

Kernel
I. Preparations
1. toolchain Creation
Download and decompress toochain:
$ Wget

Http://www.codesourcery.com/sgpp/lite/arm/portal/package5383/public/arm-none-linux-gnueabi/arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

$ Tar xvjf arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2-C the directory you want to extract
Copy code
Set toolchain:
$ Export Path =/toolchain folder location/bin: $ path
$ Export cross_compile = arm-None-Linux-gnueabi-
$ Export arch = arm
Copy code
2. Install git
# Apt-Get install Git-core
Copy code
Ii. U-boot Encoding
1. Download the source code for the master branch $ git clone git: // h1.pargon. nl/srv/git-h1/u-boot.git
$ Cd u-boot
2. Get the code update for the nowplus Branch (nowplus is the i8320 alias) $ git checkout nowplus * if it fails, use this command: $ git checkout-B nowplus origin/nowplus */
The GIT repository of h1.pargon. nl is broken. Use the repository created by Mephisto:
$ Git clone git: // gitorious.org/h1droid/u-boot.git
$ Cd u-boot
Copy code
3. Modify U-boot/include/configs/omap3_nowplus.h
Config_bootdelay, config_extra_env_settings and config_bootcommand
# Define config_bootdelay 0
# Define config_extra_env_settings \
"Loadaddr = 0x82000000 \ 0 "\
"Console = ttys2, 115200n8 \ 0 "\
"Usbtty = cdc_acm \ 0 "\
"Stdout = usbtty \ 0 "\
"Stdin = usbtty \ 0 "\
"Stderr = usbtty \ 0 "\
"Bootargs = root =/dev/mmcblk0p1 RW init =/init rootdelay = 1 rootfstype = ext3 rootwait debug \ 0 "\
# Define config_bootcommand \
"Bootm 0x86c30000"
Copy code
4. Compile U-boot
$ Make omap3_nowplus_config
$ Make
Copy code
3. Linux kernel version 2.6.32.9
1. Download the source code of the master Branch
$ Cd u-boot first-level directory/* Note: U-boot and i8320kernel should be easily generated under the same level directory */
(The GIT repository has been moved. The old one is GIT: // github.com/mephistophilis/i8320kernel.git)
$ Git clone git: // gitorious.org/h1droid/i8320kernel.git
$ CD i8320kernel
Copy code
2. Get the code update for the i8320 Branch
(Now there is no i8320 branch. $ git checkout i8320/* If not, use this command: $ git checkout-B i8320 origin/i8320 */$ git pull origin i8320)
Currently, you only need to execute:
$ Git pull origin master # update code
Copy code
3. Set the tool path for uimage generation
$ Export Path = u-boot directory/tools: $ path
Copy code
4. Compile uimage
$ Cp arch/ARM/configs/omap_nowplus_defconfig. config
$ Make uimage
Copy code
4. Generate boot. Bin
Boot. Bin is designed to synthesize u-boot.bin and uimage.
1. Get makeboot Tool
$ CD kernel and the first-level directory of U-boot
$ Wget http://h1droid.googlecode.com/files/makeboot.sh
$ Chmod + x makeboot. Sh
Copy code
2. Generate boot. Bin
$ ../Makeboot. Sh./U-boot/u-boot.bin./i8320kernel/ARCH/ARM/boot/uimage
Copy code
5. Run the kernel
1. Download Tool
$ Git clone git: // h1.pargon. nl/srv/git-h1/Odin. Git
$ CD Odin
Copy code
2. Compile
$ Make Brick
Copy code
3. Switch i8320 to the download status, plug in the USB cable, and download boot. Bin.
$./Odin ../boot. Bin
Copy code
/* Boot. bin directory at the previous level */
At this time, the screen will be white or blurred for a few seconds, then the penguin and some character information will come out.
The system is working !!!!

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.