Android ROM Porting

Source: Internet
Author: User

Preface this is a content that will always be updated, will I do in the next one weeks to do some of the things to do some records and summary, of course, will be updated frequently, I hope you can also thread discussion
Download the Standard Edition ROM for the meter 2s

Select the line brush package to download
Unzip and pack boot.img after the decompression is complete, you can get system.img files and boot.img files in the Aries_images_4.7.4_4.1_cn/images directory
TAR-ZXVF aries_images_4.7.4_4.1_cn_3cb6d39979.tgz

Decompression boot.img Decompression Tool Address: http://code.google.com/p/zen-droid/downloads/detail?name=split_bootimg.pl, I stored in the ~/bin/directory
Execute the following command under the images directory extracted from the Rom:
~/bin/split_bootimg.pl boot.img


After the decompression will find out more than two files: Boot.img-kernel and boot.img-ramdisk.gz, which is extracted from the boot.img, which:
    • Boot.img-kernel: This is the kernel
    • Boot.img-ramdisk.gz: Is RAMDisk, the corresponding source code compiled directory for out/target/product/generic/root/

Decomposition RAMDisk


Packaging Boot.img Replace the contents of RAMDisk can be packaged operations, packaging needs to use three tools, respectively, Unpackbootimg, Mkbootfs and mkbooting. You can search directly with Google
UNPACKBOOTIMG get boot.img parameter 1. How to use
Usage:unpackbootimg-i | --input boot.img [-o |--output output_directory]

2. Example


Mkbootfs Packing RAMDisk
Mkbootfs ramdisk/| Gzip >ramdisk-new.gz


Mkbooting generating BOOT.IMG1. How to use
Usage:mkbootimg
--kernel <filename>
--ramdisk <filename>
[--second <2ndbootloader-filename>]
[--cmdline <kernel-commandline>]
[--board <boardname>]
[--base <address>]
[--pagesize <pagesize>]
-O | --output <filename>

2. Example



Unpack and pack system.img next, you'll talk about another important IMG file, system,img
Decompression System.img decompression system.img using the Simg2img tool, the command is as follows:
Simg2img system.img SYSTEM.IMG.EXT4

Create mount directory tmp for SYSTEM.IMG.EXT4
mkdir tmp

Hanging in SYSTEM.IMG.EXT4 to TMP directory
sudo mount-t ext4-o loop system.img.ext4 tmp/

Modifying the system directory is typically based on a comparison of the init.rc files of the porting ROM and then modifies the system directory
Package system.img Use the following command to repackage the TMP directory into a system.img file
Make_ext4fs-s-  L 1024m-a system system-new.img tmp/

Parameter annotations:
    • -S: Generate EXT4 S mode
    • -L: Specifies the partition size of the system
    • -A: Specify this img for Android, Mount Partition to System

Unpack and package userdata.img The final step, unpack and package the Userdata.img file, which is similar to unpacking system.img files
Decompression userdata.img Unzip the userdata.img file is also using the Simg2img tool, the command is as follows:
Simg2img userdata.img USERDATA.IMG.EXT4

Create mount directory data for Userdata.img
mkdir data

Hang in USERDATA.IMG.EXT4 to data directory
sudo mount-t ext4-o loop userdata.img.ext4 data/


To pack userdata.img or use the Make_ext4fs tool, note that the mount point is the data partition

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.