Android 解壓boot.img

來源:互聯網
上載者:User

其實解壓、打包boot.img沒什麼難度一看就會咯!!
   1.先下附件:工具。
點擊開啟連結
6.0 KB, 下載次數: 60)      解壓到bin檔案夾裡,方便以後使用。
   2.解壓boot.img檔案
     去到boot.img所在的檔案夾,輸入下面的命令:split.pl boot.img         

       Page size: 2048 (0x00000800)
        Kernel size: 2240184 (0x00222eb8)
        Ramdisk size: 221504 (0x00036140)
        Second size: 0 (0x00000000)
        Board name:
        Command line:androidboot.hardware=blade console=null g_android.product_id=0x1354 g_android.serial_number=Blade-CM7
        Writing boot.img-kernel ... complete.
        Writing boot.img-ramdisk.gz ... complete.
        完了之後,你就會發現多了boot.img-kernel 和 boot.img-ramdisk.gz檔案,這就是解壓出來的boot.img,其中boot.img-kernel 就是核心,boot.img-ramdisk.gz就是ramdisk。
   
       3.打包boot.img檔案

             在替換和核心後,就要對boot.img打包了!!下是代碼:

mkbootimg --cmdline 'androidboot.hardware=blade console=null g_android.product_id=0x1354 g_android.serial_number=Blade-CM7'  --kernel boot.img-kernel --ramdisk boot.img-ramdisk.gz -o new.img

             命令中-cmdline‘xxx’,xxx就是解壓boot.img是Command line:xxx

new.img檔案就是你修改後的boot.img檔案了。改個名字替換到ROM裡面就可以了。!!

             new.img檔案就是你修改後的boot.img檔案了。改個名字替換到ROM裡面就可以了。!!

# ./split_bootimg.pl boot.img
Page size: 2048 (0x00000800)
Kernel size: 1388548 (0x00153004)
Ramdisk size: 141518 (0x000228ce)
Second size: 0 (0x00000000)
Board name:
Command line: no_console_suspend=1
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.

Extract the ramdisk.

# mkdir ramdisk
# cd ramdisk
# gzip -dc ../*-ramdisk.gz | cpio -i
# cd ..

Make any changes necessary (e.g., set ro.secure=0 in default.prop).

Recreate the cpio archive using the mkbootfs binary produced from building the Android source code (The cpio utility in OS X does not recognize the newc format, therefore mkbootfs is the best option for OS X users).

# mkbootfs ./ramdisk | gzip > ramdisk-new.gz

Recreate the image file using the mkbootimg binary produced from building the Android source code.

# mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel boot.img-kernel --ramdisk ramdisk-new.gz -o boot-new.img --base 0x20000000

=======================================================================

Make any changes necessary (e.g., set ro.secure=0 in default.prop).

Recreate the cpio archive using the mkbootfs binary produced from building the Android source code (The cpio utility in OS X does not recognize the newc format, therefore mkbootfs is the best option for OS X users).

# mkbootfs ./ramdisk | gzip > ramdisk-new.gz

Recreate the image file using the mkbootimg binary produced from building the Android source code.

# mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel boot.img-kernel --ramdisk ramdisk-new.gz -o boot-new.img --base 0x20000000

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.