2013년 7월 19일 금요일

Nexus S(SHW-M200S) upgrade to Android JB 4.2


Nexus S(SHW-M200S) upgrade to Android JB 4.2

Nexus S를 Android Jelly Bean 4.2 버전 업그레이드 과정을 정리합니다.
( 잊어버리지 않기 위한 흔적 남기기... )

GMS 관련 항목 미적용 상태이며 몇 가지 경로에서 Exception이 발생하지만 기본적은 음성/데이터 접속에 문제는 없습니다.

기본 부팅 된 상태에서 130MB 정도 RAM 공간이 남아 있습니다.
GMS 관련 사항 추가하고 안정화를 거치면 RAM 여유 공간이 얼마나 될지 모르겠습니다.
Ram Info.

[ Build 환경 ]

Os : Ubuntu 12.04 LTS

$ export ARCH=arm
$ export CROSS_COMPILE=/opt/toolchains/arm-linux-androideabi-4.7-linaro/bin/arm-linux-androideabi-
$ java -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)

1. copy crespo device files. 

- /device/samsung/crespo & crespo4g (from AOSP 4.1.2)

2. add define 

TARGET_ARCH=arm
- device/samsung/crespo/BoardConfig.mk

3. extract files from device 

3.1 connect device to pc via usb

3.2 extract-files (copy from device to aosp.4.2/vendor/* )


Linux81:/home3/aosp/crespo/android.jb.4.2/device/samsung/crespo$ ./extract-files.sh 
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
112 KB/s (13844 bytes in 0.120s)
6291 KB/s (1742988 bytes in 0.270s)
83 KB/s (6616 bytes in 0.077s)
185 KB/s (17663 bytes in 0.092s)
102 KB/s (8192 bytes in 0.078s)
560 KB/s (70776 bytes in 0.123s)
51 KB/s (4840 bytes in 0.091s)
3289 KB/s (413752 bytes in 0.122s)
2842 KB/s (335632 bytes in 0.115s)
305 KB/s (34608 bytes in 0.110s)
195 KB/s (22564 bytes in 0.112s)
613 KB/s (54668 bytes in 0.086s)
1177 KB/s (239176 bytes in 0.198s)
1252 KB/s (62096 bytes in 0.048s)
421 KB/s (20964 bytes in 0.048s)
76 KB/s (6184 bytes in 0.078s)
71 KB/s (5972 bytes in 0.081s)
3744 KB/s (555440 bytes in 0.144s)
977 KB/s (106296 bytes in 0.106s)
1104 KB/s (150024 bytes in 0.132s)
3394 KB/s (870216 bytes in 0.250s)

4. full build & fix compile error

4.1 Build

Linux81:/home3/aosp/crespo/android.jb.4.2$ make -j4 2>&1 | tee crespo.build.log
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2
TARGET_PRODUCT=full_crespo
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-48-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JOP40C
OUT_DIR=out
============================================

4.2 Compile Error - just block.. 

file path : device/samsung/crespo/libcamera/SecCameraHWInterface.cpp
957 void CameraHardwareSec::save_postview(const char *fname, uint8_t *buf, uint32_t size)
 958 {
 959     int nw;
 960     int cnt = 0;
 961     uint32_t written = 0;
 962
 963     ALOGD("opening file [%s]\n", fname);
 964     //soma int fd = open(fname, O_RDWR | O_CREAT);
 965     int fd = open(fname, O_RDWR );

+++++++++++++++++++++++++++++++

file path : device/samsung/crespo/overlay/packages/apps/Launcher2/res/values/config.xml
- 2Line  error: Resource at config_hardwareAccelerated appears in overlay but not in the base package; use <add-resource> to add.
make: *** [out/target/common/obj/APPS/Launcher2_intermediates/src/R.stamp] Error 1
make: *** Waiting for unfinished jobs....

1 <resources>
2     <!-- soma <bool name="config_hardwareAccelerated">true</bool> -->
3 </resources>

5. check Output files

Linux81:/home3/aosp/crespo/android.jb.4.2/out/target/product/crespo$ ls -alh
total 216M
drwxrwxr-x  9 wschoi wschoi 4.0K Jul 19 20:05 .
drwxrwxr-x  3 wschoi wschoi 4.0K Jul 18 21:53 ..
-rw-rw-r--  1 wschoi wschoi   22 Jul 19 14:33 android-info.txt
-rw-r--r--  1 wschoi wschoi 4.1M Jul 19 17:13 boot.img
-rw-rw-r--  1 wschoi wschoi 219K Jul 19 20:07 boot.log
-rw-rw-r--  1 wschoi wschoi  26K Jul 19 17:04 clean_steps.mk
drwxrwxr-x  2 wschoi wschoi 4.0K Jul 19 14:32 data
-rw-rw-r--  1 wschoi wschoi  47K Jul 19 17:27 installed-files.txt
-rwxrwxr-x  1 wschoi wschoi 3.9M Jul 19 15:30 kernel
drwxrwxr-x 14 wschoi wschoi 4.0K Jul 19 17:27 obj
-rw-rw-r--  1 wschoi wschoi  583 Jul 19 17:04 previous_build_config.mk
-rw-rw-r--  1 wschoi wschoi 180K Jul 19 17:13 ramdisk.img
-rw-rw-r--  1 wschoi wschoi 680K Jul 19 17:13 ramdisk-recovery.img
drwxrwxr-x  3 wschoi wschoi 4.0K Jul 19 17:13 recovery
-rw-r--r--  1 wschoi wschoi 4.6M Jul 19 17:13 recovery.img
drwxrwxr-x  8 wschoi wschoi 4.0K Jul 19 17:12 root
drwxrwxr-x  5 wschoi wschoi 4.0K Jul 19 17:12 symbols
drwxrwxr-x 13 wschoi wschoi 4.0K Jul 19 17:57 system
-rw-r--r--  1 wschoi wschoi 184M Jul 19 17:27 system.img
drwxrwxr-x  3 wschoi wschoi 4.0K Jul 19 16:32 test
-rw-r--r--  1 wschoi wschoi  19M Jul 19 17:13 userdata.img

6. Download Binaries

- ref : http://source.android.com/source/building-devices.html

6.1 Unlocking the bootloader

$ fastboot oem unlock

6.2 Flasing adevice

$ fastboot -w flashall

7. ScreenShot

Version Info
Registraion Success
Camera UI

Camera UI

Menu
System UI



====================================================
Network Provider 오류로 인해 Google Now 및 Map 관련 오동작 수정
1. error log : 
08-08 17:47:55.439 W/LocationManagerService(  344): no network location provider found

2. 수정사항
// 649 Line 추가
file Path : frameworks/base/core/res/res/values/config.xml
 646     <string-array name="config_locationProviderPackageNames" translatable="false">
 647         <!-- The standard AOSP fused location provider -->
 648         <item>com.android.location.fused</item>
 649         <item>com.google.android.location</item>
 650     </string-array>

댓글 없음:

댓글 쓰기