본문 바로가기

안드로이드

안드로이드 os 빌드 실습

안드로이드 OS 빌드 실습 


-os 설치 사이트

http://androidxref.com/






/droid_oo  (안드로이드 오레오버전 os)

vendor : 할 부분

out : 빌드시 생성






boot.img = kernel (img) + ramdisk.img


커널 위에 system.img가 디스크에 올라간다.


android os = bl(부트로드) + boot.img + ramdisk.img + system.img





빌드하기

1.환경설정해주는 쉘을 돌려준다



2.런치를 해준다 -eng는 앤지니어 버전?



2-1 런치까지 해주면 $OUT , croot 스크립트(명령어) 를 쓸수있다..(새로운 코멘드창 열었으면 다시 런치해줘야 먹는다)

3. make 명령어를 주면 빌드가 된다. 이떄 out 폴더 생김




4. cgrep(씨언어 소스 찾아줌) , jgrep(자바 소스 찾아줌) 


5. 빌드가 되었으면 adb와 fastboot 사용가능

5-1. C:\AndP\AndO\Sdk\platform-tools



6. adb devices 명령어로 휴대폰 연결 확인

6-1 . 장치 - USB 에서 기기 선택 및 아래 설정에도 추가

7.  6번과 동일하게 설정해주고. 장치 - USB 에서 구글 선택



8. adb reboot bootloader 명령어를 치면 폰 리붓이 되면서 폰에 안드로이드 누워있는 모양이 있음



9. 혹시 fastboot devices 하면 모바일에서 FASTVOOT MODE 인데  DEVICE STATE - locked  메세지가 나오면

fastboot oem unlock 



10. 실패하면 휴대폰에서 잠금해제를 풀어준다 설정 - 개발자모드 - oem 사용 해제 한다.

11. 다시  8번부터 순서대로 작업한다.

12. unlock이 되면 fastboot -w frashall 명령어 해준다.








**참고 윈도우에서 붙기

1. 공유해놓은 폴더 share/img

cd /media/

cd share/img <--공유폴더


2. bullhead 밑에 있는 이미지파일 모두 카피

cp *.img /media/share/img

cp android-info.txt /media/share/img


3.윈도우 cmd창에 공유폴더 위치까지 간다.

*** set ANDROID_PRODUCT_OUT=.  <<<<윈도우에서는 이명령어를 해줘야 인식한다. 

명령어

share/img> adb device

share/img> adb reboot bootloader

share/img> fastboot devices

share/img> set ANDROID_PRODUCT_OUT=.

share/img> fastboot -w flashall




다시 넥서스폰 상용버전으로







C:\AndP\factory_img>reboot bootloader

'reboot'은(는) 내부 또는 외부 명령, 실행할 수

배치 파일이 아닙니다.


C:\AndP\factory_img>adb reboot bootloader


C:\AndP\factory_img>fastboot devices

0269830fba53d1a3        fastboot


C:\AndP\factory_img>fastboot oem unlock

...

FAILED (remote: Already unlocked)

finished. total time: 0.030s


C:\AndP\factory_img>flash-all.bat

target reported max download size of 536870912 bytes

sending 'bootloader' (4620 KB)...

OKAY [  0.179s]

writing 'bootloader'...

OKAY [  0.077s]

finished. total time: 0.272s

rebooting into bootloader...

OKAY [  0.020s]

finished. total time: 0.025s

target reported max download size of 536870912 bytes

sending 'radio' (56630 KB)...

OKAY [  1.315s]

writing 'radio'...

OKAY [  0.332s]

finished. total time: 1.653s

rebooting into bootloader...

OKAY [  0.020s]

finished. total time: 0.022s

extracting android-info.txt (0 MB) to RAM...

extracting boot.img (12 MB) to disk... took 0.046s

target reported max download size of 536870912 bytes

archive does not contain 'boot.sig'

archive does not contain 'dtbo.img'

archive does not contain 'dt.img'

extracting recovery.img (16 MB) to disk... took 0.058s

archive does not contain 'recovery.sig'

extracting system.img (1901 MB) to disk... took 23.897s

archive does not contain 'system.sig'

archive does not contain 'vbmeta.img'

extracting vendor.img (180 MB) to disk... took 8.447s

archive does not contain 'vendor.sig'

wiping userdata...

mke2fs 1.43.3 (04-Sep-2016)

Creating filesystem with 6661115 4k blocks and 1667904 inodes

Filesystem UUID: 57fe4502-dc15-11e7-9429-29d40552ef98

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,


        4096000


Allocating group tables: done

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done


wiping cache...

mke2fs 1.43.3 (04-Sep-2016)

Creating filesystem with 24576 4k blocks and 24576 inodes


Allocating group tables: done

Writing inode tables: done

Creating journal (1024 blocks): done

Writing superblocks and filesystem accounting information: done


--------------------------------------------

Bootloader Version...: BHZ21d

Baseband Version.....: M8994F-2.6.39.3.03

Serial Number........: 0269830fba53d1a3

--------------------------------------------

checking product...

OKAY [  0.020s]

checking version-bootloader...

OKAY [  0.017s]

checking version-baseband...

OKAY [  0.016s]

sending 'boot' (12489 KB)...

OKAY [  0.368s]

writing 'boot'...

OKAY [  0.088s]

sending 'recovery' (16513 KB)...

OKAY [  0.450s]

writing 'recovery'...

OKAY [  0.136s]

erasing 'system'...

OKAY [  0.250s]

sending sparse 'system' 1/4 (522797 KB)...

OKAY [ 13.438s]

writing 'system' 1/4...

OKAY [  3.236s]

sending sparse 'system' 2/4 (524282 KB)...

OKAY [ 13.328s]

writing 'system' 2/4...

OKAY [  3.132s]

sending sparse 'system' 3/4 (521503 KB)...

OKAY [ 13.443s]

writing 'system' 3/4...

OKAY [  3.422s]

sending sparse 'system' 4/4 (378361 KB)...

OKAY [  9.600s]

writing 'system' 4/4...

OKAY [  2.280s]

erasing 'vendor'...

OKAY [  0.098s]

sending 'vendor' (184795 KB)...

OKAY [  4.366s]

writing 'vendor'...

OKAY [  1.342s]

erasing 'userdata'...

OKAY [  0.748s]

sending 'userdata' (4412 KB)...

OKAY [  0.190s]

writing 'userdata'...

OKAY [  0.054s]

erasing 'cache'...

OKAY [  0.069s]

sending 'cache' (92 KB)...

OKAY [  0.074s]

writing 'cache'...

OKAY [  0.014s]

rebooting...


finished. total time: 70.402s

Press any key to exit...