ROM Android: Porting F240K

From OnnoWiki
Jump to navigation Jump to search

Dapatkan /system/build.prop

mkdir backup-F240K
cd backup-F240K/

adb devices
adb pull /system/build.prop

Hasilnya

# begin build properties
# autogenerated by buildinfo.sh
led=50
fast_charge=0
imei=
ro.build.id=JDQ39E
ro.build.display.id=cm_geefhd_att_us-eng 4.2.2 JDQ39E eng.root.20140329.160704 test-keys
ro.build.version.incremental=4.5.18
ro.build.version.sdk=17
ro.build.version.codename=REL
ro.build.version.release=4.2.2
ro.build.date=2014年 03月 29日 星期六 16:08:01 CST
ro.build.date.utc=1396080481
ro.build.type=userdebug
ro.build.user=root
ro.build.host=ws008
ro.build.tags=release-keys
ro.product.model=LG-Optimus G Pro
ro.product.brand=LGE
ro.product.name=cm_geefhd_att_us
ro.product.device=geefhd_att_us
ro.product.board=geefhd
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=LGE
ro.product.locale.language=zh
ro.product.locale.region=CN
ro.wifi.channels=
ro.board.platform=msm8960
# ro.build.product is obsolete; use ro.product.device
ro.build.product=geefhd_att_us
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=occam-user 4.2.2 JDQ39 573038 release-keys
ro.build.fingerprint=google/occam/mako:4.2.2/JDQ39/573038:user/release-keys
ro.build.characteristics=default
ro.cm.device=geefhd_att_us
# end build properties
#
# system.prop for geefhd_hk
#
rild.libpath=/system/lib/libril-qc-qmi-1.so
rild.libargs=-d /dev/smd0
persist.rild.nitz_plmn=
persist.rild.nitz_long_ons_0=
persist.rild.nitz_long_ons_1=
persist.rild.nitz_long_ons_2=
persist.rild.nitz_long_ons_3=
persist.rild.nitz_short_ons_0=
persist.rild.nitz_short_ons_1=
persist.rild.nitz_short_ons_2=
persist.rild.nitz_short_ons_3=
ril.subscription.types=NV,RUIM
DEVICE_PROVISIONED=1 

ro.hdmi.enable=true
lpa.decode=false
tunnel.decode=true
tunnel.audiovideo.decode=true
lpa.use-stagefright=true 

#system props for the MM modules

media.stagefright.enable-player=true
media.stagefright.enable-http=true
media.stagefright.enable-aac=true
media.stagefright.enable-qcp=true
media.stagefright.enable-fma2dp=true
media.stagefright.enable-scan=true
mmp.enable.3g2=true 

#
# Haptic
#
ro.haptic.vibrate_ex.enabled=0
sys.haptic.long.weak=0,0,1,15,20,0,21
sys.haptic.long.normal=0,0,1,35,20,0,21
sys.haptic.long.strong=0,0,1,80,30,0,21
sys.haptic.down.weak=0,15,5,-5,5
sys.haptic.down.normal=0,30,5,-5,5
sys.haptic.down.strong=0,80,10,-5,5
sys.haptic.up.weak=0,15,5,-5,5
sys.haptic.up.normal=0,0,5,-5,5
sys.haptic.up.strong=0,80,10,-5,5
sys.haptic.tap.weak=0,15,5,-5,5
sys.haptic.tap.normal=0,0,10,-5,5
sys.haptic.tap.strong=0,80,5,-5,5 

#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.rommanager.developerid=cyanogenmod
keyguard.no_require_sim=true
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html
ro.com.google.clientidbase=android-google
ro.com.android.wifi-watchlist=GoogleGuest
ro.setupwizard.enterprise_mode=1
ro.com.android.dateformat=MM-dd-yyyy
ro.com.android.dataroaming=true
ro.cm.version=10.1-20140329-UNOFFICIAL-geefhd_att_us
ro.modversion=10.1-20140329-UNOFFICIAL-geefhd_att_us
ro.carrier=unknown
ro.opengles.version=131072
ro.sf.lcd_density=480
persist.audio.handset.mic=digital
persist.audio.fluence.mode=endfire
persist.audio.lowlatency.rec=false
af.resampler.quality=255
# System prop to select MPQAudioPlayer by default on mpq8064
mpq.audio.decode=true
persist.radio.apm_sim_not_pwdn=1
ro.telephony.call_ring.multiple=0
ro.telephony.ril_class=LgeLteRIL
ro.telephony.ril.v3=qcomdsds
ro.telephony.slowModem=1
debug.mdpcomp.maxlayer=2
persist.hwc.mdpcomp.enable=true
ro.qualcomm.bt.hci_transport=smd
drm.service.enabled=true
wifi.interface=wlan0
ap.interface=wlan0
media.aac_51_output_enabled=true
debug.prerotation.disable=1
debug.egl.recordable.rgba8888=1
dalvik.vm.heapstartsize=16m
dalvik.vm.heapgrowthlimit=192m
dalvik.vm.heapsize=512m
dalvik.vm.heaptargetutilization=0.75
dalvik.vm.heapminfree=2m
dalvik.vm.heapmaxfree=8m
dalvik.vm.lockprof.threshold=500
telephony.lteOnCdmaDevice=0
telephony.lteOnGsmDevice=1
ro.telephony.default_network=0
ro.ril.def.preferred.network=0
dalvik.vm.dexopt-flags=m=y
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
ro.miui.ui.version.code=3
ro.miui.ui.version.name=V5
ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg
#Increase the volume steps in-call
ro.config.vc_call_steps=20
wifi.supplicant_scan_interval=60
ro.telephony.call_ring.delay=0
#phone sleeps better
pm.sleep_mode=1
ro.product.mod_device=gpro_ws008
ro.skia.use_data_fonts=1

Diperoleh

ro.product.manufacturer=LGE > vendor lge
ro.product.name=cm_geefhd_att_us
ro.product.device=geefhd_att_us > codename geefhd_att_us (harusnya f240k)
ro.product.board=geefhd

Teliti Struktur Partisi

Lakukan

adb pull /proc/partitions

Hasilnya

major minor  #blocks  name

 179        0   30535680 mmcblk0
 179        1      65536 mmcblk0p1
 179        2        512 mmcblk0p2
 179        3        512 mmcblk0p3
 179        4       2048 mmcblk0p4
 179        5        512 mmcblk0p5
 179        6        512 mmcblk0p6
 179        7      24576 mmcblk0p7
 179        8        512 mmcblk0p8
 179        9          1 mmcblk0p9
 179       10       3072 mmcblk0p10
 179       11       3072 mmcblk0p11
 179       12        780 mmcblk0p12
 179       13        780 mmcblk0p13
 179       14        780 mmcblk0p14
 179       15       8192 mmcblk0p15
 179       16       8192 mmcblk0p16
 179       17          8 mmcblk0p17
 179       18      16384 mmcblk0p18
 179       19      16384 mmcblk0p19
 179       20       8192 mmcblk0p20
 179       21        512 mmcblk0p21
 179       22        512 mmcblk0p22
 179       23    2621440 mmcblk0p23
 179       24    1048576 mmcblk0p24
 179       25   24862720 mmcblk0p25
 179       26       8192 mmcblk0p26
 179       27     262144 mmcblk0p27
 179       28      24576 mmcblk0p28
 179       29       3072 mmcblk0p29
 179       30          8 mmcblk0p30
 179       31      32768 mmcblk0p31
 259        0      32768 mmcblk0p32
 259        1        512 mmcblk0p33
 259        2        512 mmcblk0p34
 259        3      16384 mmcblk0p35
 259        4          8 mmcblk0p36
 259        5          8 mmcblk0p37
 259        6      16384 mmcblk0p38
 259        7    1412063 mmcblk0p39
 179       32    3929088 mmcblk1
 179       33    3928064 mmcblk1p1

Lakukan

adb devices
adb shell
su
ls -l /dev/block/platform/msm_sdcc.1/by-name/ 

Hasilnya

lrwxrwxrwx root     root              1970-01-01 20:27 DDR -> /dev/block/mmcblk0p30
lrwxrwxrwx root     root              1970-01-01 20:27 aboot -> /dev/block/mmcblk0p5
lrwxrwxrwx root     root              1970-01-01 20:27 bnr -> /dev/block/mmcblk0p20
lrwxrwxrwx root     root              1970-01-01 20:27 boot -> /dev/block/mmcblk0p7
lrwxrwxrwx root     root              1970-01-01 20:27 cache -> /dev/block/mmcblk0p24
lrwxrwxrwx root     root              1970-01-01 20:27 drm -> /dev/block/mmcblk0p15
lrwxrwxrwx root     root              1970-01-01 20:27 eksst -> /dev/block/mmcblk0p22
lrwxrwxrwx root     root              1970-01-01 20:27 encrypt -> /dev/block/mmcblk0p21
lrwxrwxrwx root     root              1970-01-01 20:27 factory -> /dev/block/mmcblk0p19
lrwxrwxrwx root     root              1970-01-01 20:27 fota -> /dev/block/mmcblk0p31
lrwxrwxrwx root     root              1970-01-01 20:27 fsg -> /dev/block/mmcblk0p29
lrwxrwxrwx root     root              1970-01-01 20:27 grow -> /dev/block/mmcblk0p39
lrwxrwxrwx root     root              1970-01-01 20:27 lcdlog -> /dev/block/mmcblk0p37
lrwxrwxrwx root     root              1970-01-01 20:27 m9kefs1 -> /dev/block/mmcblk0p12
lrwxrwxrwx root     root              1970-01-01 20:27 m9kefs2 -> /dev/block/mmcblk0p13
lrwxrwxrwx root     root              1970-01-01 20:27 m9kefs3 -> /dev/block/mmcblk0p14
lrwxrwxrwx root     root              1970-01-01 20:27 misc -> /dev/block/mmcblk0p18
lrwxrwxrwx root     root              1970-01-01 20:27 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx root     root              1970-01-01 20:27 modemst1 -> /dev/block/mmcblk0p10
lrwxrwxrwx root     root              1970-01-01 20:27 modemst2 -> /dev/block/mmcblk0p11
lrwxrwxrwx root     root              1970-01-01 20:27 mpt -> /dev/block/mmcblk0p32
lrwxrwxrwx root     root              1970-01-01 20:27 pad -> /dev/block/mmcblk0p9
lrwxrwxrwx root     root              1970-01-01 20:27 persist -> /dev/block/mmcblk0p26
lrwxrwxrwx root     root              1970-01-01 20:27 rct -> /dev/block/mmcblk0p36
lrwxrwxrwx root     root              1970-01-01 20:27 recovery -> /dev/block/mmcblk0p28
lrwxrwxrwx root     root              1970-01-01 20:27 reserved -> /dev/block/mmcblk0p38
lrwxrwxrwx root     root              1970-01-01 20:27 rpm -> /dev/block/mmcblk0p6
lrwxrwxrwx root     root              1970-01-01 20:27 rpmbak -> /dev/block/mmcblk0p34
lrwxrwxrwx root     root              1970-01-01 20:27 sbl1 -> /dev/block/mmcblk0p2
lrwxrwxrwx root     root              1970-01-01 20:27 sbl2 -> /dev/block/mmcblk0p3
lrwxrwxrwx root     root              1970-01-01 20:27 sbl3 -> /dev/block/mmcblk0p4
lrwxrwxrwx root     root              1970-01-01 20:27 sns -> /dev/block/mmcblk0p16
lrwxrwxrwx root     root              1970-01-01 20:27 ssd -> /dev/block/mmcblk0p17
lrwxrwxrwx root     root              1970-01-01 20:27 system -> /dev/block/mmcblk0p23
lrwxrwxrwx root     root              1970-01-01 20:27 tombstones -> /dev/block/mmcblk0p27
lrwxrwxrwx root     root              1970-01-01 20:27 tz -> /dev/block/mmcblk0p8
lrwxrwxrwx root     root              1970-01-01 20:27 tzbak -> /dev/block/mmcblk0p33
lrwxrwxrwx root     root              1970-01-01 20:27 userdata -> /dev/block/mmcblk0p25
lrwxrwxrwx root     root              1970-01-01 20:27 ve -> /dev/block/mmcblk0p35


Beberapa partisi yang penting

boot       /dev/block/mmcblk0p7
recovery   /dev/block/mmcblk0p26
system     /dev/block/mmcblk0p23
cache      /dev/block/mmcblk0p24

Dapatkan boot.img

adb devices
adb shell
su

dd if=/dev/block/mmcblk0p7 of=/sdcard/boot.img
exit

Di laptop / pc lakukan

adb pull /sdcard/boot.img

Dapatkan recovery.img

adb devices
adb shell
su

dd if=/dev/block/mmcblk0p26 of=/sdcard/recovery.img
exit

Di laptop / pc lakukan

adb pull /sdcard/recovery.img


Dapatkan system.img dan cache.img

adb devices
adb shell
su

dd if=/dev/block/mmcblk0p23 of=/sdcard/system.img
dd if=/dev/block/mmcblk0p24 of=/sdcard/cache.img
exit

Di laptop / pc lakukan

adb pull /sdcard/system.img
adb pull /sdcard/cache.img


Dapatkan /proc/config.gz dan /proc/version

adb devices
adb pull /proc/config.gz
adb pull /proc/version


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.

Tambahkan di /device/lge/f240k

cp -Rf ~/android-cyanogenmod/device/lge/f240k ~/android-cyanogenmod/device/lge/f240k.asli
cp -Rf ~/android-cyanogenmod/device/lge/e980/* ~/android-cyanogenmod/device/lge/f240k
cd ~/android-cyanogenmod/device/lge/f240k

Edit semua entry dengan e980 menjadi f240k

Edit

vi cm.dependencies

Isi dengan

[
 {
   "repository": "android_device_lge_gproj-common",
   "target_path": "device/lge/gproj-common"
 },
 {
   "repository": "lge-kernel-gproj",
   "target_path": "kernel/lge/gproj"
 }
]


Edit project.list

cd ~/android-cyanogenmod/.repo/
vi project.list 

Tambahkan

device/lge/f240k

Edit local_manifests/roomservice.xml

cd ~/android-cyanogenmod/.repo/ 
vi local_manifests/roomservice.xml 

Tambahkan

<project name="CyanogenMod/android_device_lge_f240k" path="device/lge/f240k" remote="github" />

Tambahkan kernel source

Download dari

https://www.lg.com/global/support/opensource/opensourceList?superOsCategoryId=CAT00000001&osCategoryId=CAT00000002

Pilih

LGF240K
LGF240K_Gpro_Kikat_V20e_Android 			
LGF240K_Gpro_Kikat_V20e_kernel

Lakukan

cp -Rf ~/android-cyanogenmod/kernel/lge/gproj ~/android-cyanogenmod/kernel/lge/gproj.backup
unzip LG-F240_Gpro_Kikat_V20e_kernel.zip 
tar zxvf LGF240_Gpro_Kikat_V20e_kernel_140807.tar.gz
rsync --progress --recursive -a kernel/ ~/android-cyanogenmod/kernel/lge/gproj/
#
# copy .config dari device ke konfigurasi kernel
#
cd ~/android-cyanogenmod/kernel/lge/gproj
chmod 777 make_defconfig.sh
cp ~/backup-F240K/config ~/android-cyanogenmod/kernel/lge/gproj/arch/arm/configs/cyanogenmod_f240k_defconfig
cp ~/backup-F240K/config .config
./make_defconfig.sh cyanogenmod_f240k_defconfig
make mrproper

Compile ROM

cd  ~/android-cyanogenmod
~/android-cyanogenmod/vendor/cm/get-prebuilts
. build/envsetup.sh
lunch cm_f240k-eng

Keluar

Trying dependencies-only mode on a non-existing device tree?

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.4
CM_VERSION=11-20150104-UNOFFICIAL-f240k
TARGET_PRODUCT=cm_f240k
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
============================================

Solusi:

Tampaknya harus edit .repo/local_manifest.xml dan .repo/project.list agar f240k masuk.


Jika local_manifest.xml & project.list benar

Jika .repo/local_manifest.xml dan project.list benar, maka bisa di jalankan


cd  ~/android-cyanogenmod
~/android-cyanogenmod/vendor/cm/get-prebuilts
. build/envsetup.sh
brunch f240k

Akan keluar

including vendor/cm/vendorsetup.sh
Looking for dependencies

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.4
CM_VERSION=11-20150105-UNOFFICIAL-f240k
TARGET_PRODUCT=cm_f240k
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
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
============================================
..
..
dst

Referensi