[Android] Build & nạp kernel Nexus 5 chạy Android L

  • AOSP Android 5.0.1_r1 (cần để build mkbootimg & ramdisk.img + toolchain arm-eabi-4.8)
  • Kernel source 3.4.0 (MSM, 88fbc66)
  • Ubuntu 10.04 x64 cài Oracle Java 7
  • Factory image Android 5.0.1 (LRX22C) (cần lấy thông tin các address từ boot.img chuẩn)
  • Bootimg tools (dùng để xác định base address & các offset khi tạo boot.img)

Screenshot_2015-01-04-22-43-46

<?> Chưa hiểu sao vmlinux ko chứa thông tin liên quan đến 88fbc66

[Updated 16.01.15]

  • Kernel version = “3.4.0” –> source ko có folder .git
  • Kernel version = “3.4.0-g<short commit hash>-dirty” –> source có folder .git nhưng boot.img được build khi trạng thái hiện tại của source chưa được commit
  • Kernel version = “3.4.0-g<short commit hash>” –> source có folder .git & trạng thái hiện tại của sourrce đã được commit trước khi build boot.img

[Android] Upgrade (thủ công) Android L cho Nexus 5

android_L_nexus5

<!> Chạy flash-all.sh bị dừng khi flash các image trong image-hammerhead-lrx22c.zip –> giải nén & fastboot thủ công

$ sh flash-all.sh
 sending 'bootloader' (2579 KB)...
 OKAY [ 0.218s]
 writing 'bootloader'...
 OKAY [ 0.468s]
 finished. total time: 0.686s
 rebooting into bootloader...
 OKAY [ 0.078s]
 finished. total time: 0.078s
 target reported max download size of 1073741824 bytes
 sending 'radio' (45521 KB)...
 OKAY [ 1.638s]
 writing 'radio'...
 OKAY [ 3.128s]
 finished. total time: 4.766s
 rebooting into bootloader...
 OKAY [ 0.062s]
 finished. total time: 0.062s
 target reported max download size of 1073741824 bytes
 archive does not contain 'boot.sig'
 archive does not contain 'recovery.sig'
 failed to allocate 1005027540 bytes
 error: update package missing system.img

$ fastboot -w update image-hammerhead-lrx22c.zip
 target reported max download size of 1073741824 bytes
 archive does not contain 'boot.sig'
 archive does not contain 'recovery.sig'
 failed to allocate 1005027540 bytes
 error: update package missing system.img
$ fastboot flash boot boot.img
target reported max download size of 1073741824 bytes
sending 'boot' (8852 KB)...
OKAY [  0.403s]
writing 'boot'...
OKAY [  0.763s]
finished. total time: 1.166s

$ fastboot flash system system.img
target reported max download size of 1073741824 bytes
erasing 'system'...
OKAY [  0.885s]
sending 'system' (981472 KB)...
OKAY [ 32.435s]
writing 'system'...
OKAY [ 66.301s]
finished. total time: 99.621s

$ fastboot flash userdata userdata.img
target reported max download size of 1073741824 bytes
erasing 'userdata'...
OKAY [  7.039s]
sending 'userdata' (137318 KB)...
OKAY [  4.701s]
writing 'userdata'...
OKAY [  9.185s]
finished. total time: 20.925s

$ fastboot flash recovery recovery.img
target reported max download size of 1073741824 bytes
sending 'recovery' (9552 KB)...
OKAY [  0.426s]
writing 'recovery'...
OKAY [  0.792s]
finished. total time: 1.218s

$ fastboot erase cache
******** Did you mean to fastboot format this partition?
erasing 'cache'...
OKAY [  0.533s]
finished. total time: 0.533s

<!> Nếu bị treo ở bootanimation –> vào Recovery mode –> Wipe data/factory reset –> reboot & chấp nhận việc user data đã ra đi hết 0_o
IMG_2209Screenshot_2014-12-28-12-19-53