Android image creation method

Source: Internet
Author: User

I. Preparation of update.zip package
1: Create a new target and prepare the required files in this directory, such as the system directory file, Boot. IMG, and recovery. IMG.
Mkdir testupdate
CP system/testupdate/-TF
Note: If the file is a system. IMG image, unyaffs can be decompressed to obtain the system
2: Use the make-Update-script tool to generate the update-Script script, as shown below:
CP make-Update-script testupdate/
CP android-info.txt testupdate/
CD testupdate
./Make-Update-script system android-info.txt> Update-script
Rm make-Update-script android-info.txt.
VI Update-script // modify the script as needed
Note: systemis the directory to be updated. android-info.txt is the version information of the board, and update-script is the output file name.
3: create a directory named META-INF/COM/Google/Android, put the script generated above
Mkdir-P META-INF/COM/Google/android
MV Update-script META-INF/COM/Google/Android/
4: compressed file
META-INF zip-r update.zip System
5. Add a signature to the compressed file
MV update.zip ../signapk/
CD ../signapk/
Java-jar signapk. Jar testkey. x509.pem testkey. pk8 update.zip signed-update.zip
6. Delete unnecessary files and rename the generated package.
Rm update.zip
Music signed-update.zip ../update.zip
CD ../
7. Copy the updated update.zip package to the sdcard root directory for verification!

Note:
1) if there is a connection in the file, you should delete the link file in the original file after obtaining Update-script, and then package it. Otherwise, symlink will fail;
2) if there is an empty directory in the original file, the signature will lose this record. Therefore, if the empty directory must exist, the updated file will be different from the original file (empty directory is missing)

Ii. ramdisk. IMG Creation
Method 1:
Decompress:
1) mV ramdisk. IMG ramdisk.img.gz
2) gunzip ramdisk,img.gz
3) mkdir ramdisk; CD ramdisk
4) cpio-I-f ../ramdisk. img
Compression:
1) generate a list of directories to be packed, or you can column it yourself
Cpio-I-t-f ../ramdisk. img> List
2) use the generated list file list to archive cpio
Cpio-o-h NEWC-O new. IMG <list
3) gzip new. img
Method 2:
Decompress: gunzip-C ../your-ramdisk-file | cpio-I
Compression: Find. | cpio-o-h NEWC | gzip> ../newramdisk.cpio.gz

Note: In Android
1) obtain the files required by ramdisk, such as the root directory.
2) use mkbootfs to create ramdisk. IMG. The usage is as follows:
Mkbootfs root | gzip> ramdisk. img
Here we need to verify which one can be written on Android

Iii. Production of boot. img
1: Android normal practices
1): Connection
Mkbootimg -- kernel your-kernel-file -- ramdisk newramdisk.cpio.gz -- using line "mem = 128 console = ttymxc0, 115200n8 init =/init RW" -- output mynewimage. img
Or
Mkbootimg -- kernel your-kernel-file -- ramdisk newramdisk.cpio.gz -- export line -- output mynewimage. img

2): extract the kernel and ramdisk from IMG.
./Split_bootimg.pl mynewimage. img

2: uboot
Rename uimage as boot. IMG.

4. Create System. IMG (only in yaffs2 format)
1) suppression:./mkyaffs2image system/system. img
2) decompress:./unyaffs system. img

4. Create System. IMG (only in yaffs2 format)
1) suppression:./mkyaffs2image system/system. img
2) decompress:./unyaffs system. img

V. Production of rediscovery. img
1: If the rediscovery image is only used in the file system, the fourth example can be used.
2: If the recovery is in the ramdisk format

========================================================== =====
Ramdisk.
1. Create the rdmnt and rdimg directories under/mnt
Mkdir rdmnt
Mkdir rdimg
2. Create a ramdisk file with a size of 32768x1 K.
Dd If =/dev/Zero of = rdimg/ramdisk BS = 1 k count = 32768
3. The file is in ext2 format.
Mke2fs-F-v-M0 rdimg/ramdisk
4. Mount the ramdisk file and rdmnt
Mount-o loop rdimg/ramdisk rdmnt/
5. copy the file to the mounted directory.
The file system directory is/home/xrqun/workdir/filesys/
CP-Av/home/xrqun/workdir/filesys/* rdmnt
6. Uninstall ramdisk
Umount rdmnt
7. compress the ramdisk File
Gzip-C-9 <rdimg/ramdisk> rdimg/ramdisk.gz
8.beibei.ramdisk.gz image to the tftpboot directory
CP rdimg/ramdisk.gz/tftpboot/
9. Use the mkimage Tool
Mkimage-n "uboot. ramdisk. filesys"-A arm-O Linux-T ramdisk-C gzip-D ramdisk.gz uboot.ramdisk.gz

Reference: http://liaowb1234.blog.163.com/blog/static/771555472010027104534626/

Related Article

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.