ROM Androud: Manipulasi recovery.img

From OnnoWiki
Revision as of 18:48, 5 January 2015 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

Menggunakan unpack-MT.pl

Download dari

https://github.com/bgcngm/mtk-tools/

Caranya

cd ~/Downloads
wget https://github.com/bgcngm/mtk-tools/archive/master.zip

Buka

cd ~/Downloads
unzip mtk-tools-master.zip

unpack boot.img dari upgrade ROM MTK

cd ~/lokasi-upgrade-ROM-MTK/
~/Downloads/mtk-tools-master/unpack-MTK.pl TWRP_2810_Micromax_A350_KK.img 

Hasilnya

MTK-Tools by Bruno Martins
MTK unpack script (last update: 30-12-2014)

Valid Android signature found...

Input file information:

 Header:

  Boot magic:			ANDROID!
  Kernel size (bytes):		5076992		(0x004d7800)
  Kernel load address:		0x10008000

  Ramdisk size (bytes):		4099097		(0x003e8c19)
  Ramdisk load address:		0x11000000
  Second stage size (bytes):	0		(0x00000000)
  Second stage load address:	0x10f00000 

  Tags address:			0x10000100
  Page size (bytes):		2048		(0x00000800)
  ASCIIZ product name:		
  Command line:			
  ID:				b2fff3b00c887fac7dd1eb1b1615b1817f6adec3

 Other:

  Boot magic offset:		0x00000000
  Base address:			0x10000000

  Kernel offset:		0x00008000
  Ramdisk offset:		0x01000000
  Second stage offset:		0x00f00000
  Tags offset:			0x00000100

Extra arguments written to 'TWRP_2810_Micromax_A350_KK.img-args.txt'
Kernel written to 'TWRP_2810_Micromax_A350_KK.img-kernel.img'
Ramdisk size: 13717 blocks
Extracted ramdisk contents to directory 'TWRP_2810_Micromax_A350_KK.img-ramdisk'

Successfully unpacked kernel and ramdisk.


Menggunakan script mkvendor.sh untuk membuat file

Siapkan developer environment

cd ~/android-cyanogenmod
make -j4 otatools
export PATH=${PATH}:~/android-cyanogenmod/out/host/linux-x86/bin

Agar tidak ada error sebagai berikut

"unpackbootimg not found.
Is your android build environment set up and have the host tools been built?"

Buat secara automatis semua directory cyanogenmod yang dibutuhkan

cd ~/android-cyanogenmod
./build/tools/device/mkvendor.sh lge f240k ~/backup-F240K/boot.img

Dimana

  • vendor adalah lge
  • codename adalah f240k
  • boot.img berada di ~/backup-F240K/boot.img

Hasilnya kira-kira

Arguments: lge f240k /home/onno/backup-F240K/boot.img
Output will be in /home/onno/android-cyanogenmod/device/lge/f240k

gzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Creating initial git repository.
~/android-cyanogenmod/device/lge/f240k ~/android-cyanogenmod
Initialized empty Git repository in /home/onno/android-cyanogenmod/device/lge/f240k/.git/
[master (root-commit) ac5e26f] mkvendor.sh: Initial commit of f240k
 8 files changed, 96 insertions(+)
 create mode 100644 AndroidBoard.mk
 create mode 100644 AndroidProducts.mk
 create mode 100644 BoardConfig.mk
 create mode 100644 cm.mk
 create mode 100644 device_f240k.mk
 create mode 100644 kernel
 create mode 100644 recovery.fstab
 create mode 100644 system.prop
~/android-cyanogenmod
Done!
Use the following command to set up your build environment:
  lunch cm_f240k-eng
And use the follwowing command to build a recovery:
  . build/tools/device/makerecoveries.sh cm_f240k-eng


Yang lebih baik

Arguments: lge f240k /home/onno/backup-F240K/boot.img
Output will be in /home/onno/android-cyanogenmod/device/lge/f240k
Creating initial git repository.
~/android-cyanogenmod/device/lge/f240k ~/android-cyanogenmod
Initialized empty Git repository in /home/onno/android-cyanogenmod/device/lge/f240k/.git/
[master (root-commit) ef9d1de] mkvendor.sh: Initial commit of f240k
 8 files changed, 96 insertions(+)
 create mode 100644 AndroidBoard.mk
 create mode 100644 AndroidProducts.mk
 create mode 100644 BoardConfig.mk
 create mode 100644 cm.mk
 create mode 100644 device_f240k.mk
 create mode 100644 kernel
 create mode 100644 recovery.fstab
 create mode 100644 system.prop
~/android-cyanogenmod
Done!
Use the following command to set up your build environment:
  lunch cm_f240k-eng
And use the follwowing command to build a recovery:
  . build/tools/device/makerecoveries.sh cm_f240k-eng

Perintah di atas akan membuat folder /device/lge/f240k/ dalam struktur repo source CyanogenMod. Dalam folder tersebut ada file AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, cm.mk, device_[codename].mk, kernel (binary), recovery.fstab, dll

Langkah di atas tidak akan membuat directory kernel/ . Kita perlu melakukannya nanti, saat kita sudah siap untuk membuat kernel.


Referensi