ROM Androud: Manipulasi recovery.img

From OnnoWiki
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

Hasilnya

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.4
CM_VERSION=11-20150106-UNOFFICIAL-a80a
TARGET_PRODUCT=cm_a80a
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a7
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=KTU84Q
OUT_DIR=/home/onno/android-cyanogenmod/out
============================================
/home/onno/android-cyanogenmod/out/target/product/a80a/obj/APPS/SignatureTest_intermediates
"ebtables is disabled on this build"
find: `src': No such file or directory
*** Overlay change detected, clean shared intermediate files...
*** rm -rf /home/onno/android-cyanogenmod/out/target/common/obj/APPS/TelephonyProvider_intermediates /home/onno/android-cyanogenmod/out/target/common /obj/APPS/framework-res_intermediates /home/onno/android-cyanogenmod/out/target/common/obj/APPS/Keyguard_intermediates /home/onno/android-cyanogenmo d/out/target/common/obj/APPS/Mms_intermediates /home/onno/android-cyanogenmod/out/target/common/obj/APPS/LatinIME_intermediates /home/onno/android- cyanogenmod/out/target/common/obj/APPS/SettingsProvider_intermediates /home/onno/android-cyanogenmod/out/target/common/obj/APPS/SystemUI_intermediates
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
find: `bootable/recovery/res-720': No such file or directory
No private recovery resources for TARGET_DEVICE a80a
build/core/tasks/kernel.mk:63: ***************************************************************
build/core/tasks/kernel.mk:64: * Using prebuilt kernel binary instead of source              *
build/core/tasks/kernel.mk:65: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED                *
build/core/tasks/kernel.mk:66: * Please configure your device to download the kernel         *
build/core/tasks/kernel.mk:67: * source repository to kernel/evercoss/a80a
build/core/tasks/kernel.mk:68: * See http://wiki.cyanogenmod.org/w/Doc:_integrated_kernel_building
build/core/tasks/kernel.mk:69: * for more information                                        *
build/core/tasks/kernel.mk:70: ***************************************************************
..
..
..
dst

Lanjutkan dengan

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 evercoss a80a ~/backup-A80A/micromax-A350/TWRP_2810_Micromax_A350_KK.img

Dimana

  • vendor adalah evercoss
  • codename adalah a80a
  • boot.img berada di ~/backup-A80A/micromax-A350/TWRP_2810_Micromax_A350_KK.img

Ulangi dengan

cp -Rf /home/onno/backup-A80A/micromax-A350/TWRP_2810_Micromax_A350_KK.img-ramdisk/* /tmp/onno/bootimg/ramdisk/
cd ~/android-cyanogenmod
./build/tools/device/mkvendor.sh evercoss a80a ~/backup-A80A/micromax-A350/TWRP_2810_Micromax_A350_KK.img
rm -Rf /home/onno/android-cyanogenmod/device/evercoss/
cd ~/android-cyanogenmod
./build/tools/device/mkvendor.sh evercoss a80a ~/backup-A80A/micromax-A350/TWRP_2810_Micromax_A350_KK.img

Hasilnya

Output will be in /home/onno/android-cyanogenmod/device/evercoss/a80a
Creating initial git repository.
~/android-cyanogenmod/device/evercoss/a80a ~/android-cyanogenmod
Initialized empty Git repository in /home/onno/android-cyanogenmod/device/evercoss/a80a/.git/
[master (root-commit) d398507] mkvendor.sh: Initial commit of a80a
 8 files changed, 103 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_a80a.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_a80a-eng
And use the follwowing command to build a recovery:
  . build/tools/device/makerecoveries.sh cm_a80a-eng

Perintah di atas akan membuat folder /device/evercoss/a80a/ 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