How to unpack and analyze the gphone File System

Source: Internet
Author: User
Tags unpack

To analyze the G1 file system, it is the most convincing to use the file system on the actual mobile phone. So how to extract the package and analyze the gphone file system? You can easily find a solution by searching for information on the Internet!

 

1. Extract the image file.

To extract an image file, you must have the root permission to connect to the Super Terminal of your mobile phone. That is, if you use "ADB shell" to log on to your mobile phone, the prompt is "#". If not, run the su command to obtain it. However, this permission is generally not granted to users who have not been flushed. My G1 was built on the Android 2.2 system, so I had the root permission on it.

 

First insert the SD card on G1, and then connect G1 to the computer through USB. Download the SDK, unpack the SDK, and run it in the tools directory through shell:

Sudo./ADB kill-Server

Sudo./ADB Shell
* Daemon not running. Starting it now *
* Daemon started successfully *
# Cat/proc/MTD
Dev: Size erasesize name
Mtd0: 00040000 00020000 "Misc"
Mtd1: 00500000 00020000 "recovery"
Mtd2: 00280000 00020000 "Boot"
Mtd3: 05a0000000020000 "system"
Mtd4: 01e00000 00020000 "cache"
Mtd5: 059c00000 00020000 "userdata"
Mtd6: 10000000 00020000 "msm_nand"
# Cat/dev/MTD/mtd1>/sdcard/mtd1.img
# Cat/dev/MTD/mtd2>/sdcard/mtd2.img

 

In this way, both the recovery and boot images are on your SD card.

 

Ii. Release files in the image

The content of the two extracted files is similar, but the rediscovery function is used to restore the system when the boot is damaged. Therefore, the rediscovery function does not enter the GUI, but a character recovery mode, it is used for recovery more than boot.Program. I will write these comparisons later. Because these two images are similar, the same is true for decompression. To release an image, use the following gadgets: split_bootimg.pl
. Place the image and the above four tools in the same folder and decompress the package.

Decompression method:

 

./Split_bootimg.pl boot. img
Mkdir ramdisk
CD ramdisk
Gzip-DC ../boot.img-ramdisk.gz | cpio-I
CD ..

 

In this way, you will see

The ramdisk folder is the released ramdisk for startup.

Boot. IMG-kernel is the Linux kernel of the system.

 

 

Tomorrow we will compare the difference between the recovery and boot images.

The day after tomorrow, I will introduce how to create and fl images.

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.