2010년 5월 16일 일요일

Install 0xdroid of 0xlab in devkit8000

출처 : http://code.google.com/p/0xdroid/wiki/Source
  • 소스 코드 받기

프로젝트 홈페이지 http://gitorious.org/0xdroid.

0xdroid 소스코드 다운 받기.

build-from-scratch.

  • 준비물: Sun JDK

Donut 버전을 설치하기 위해서 Sun JDK version 1.5가 필요하지만, 현재 최신버전이 아니다.

그리고 우분투 리눅스 9.10 버전은 더이상 지원하지 않는다.

우분투 리눅스 9.10버전의 사용자들은 /etc/apt/sources.list에 다음의 두라인을 추가하자.

deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

그리고 Sun JDK 1.5를 설치하자.

$ sudo apt-get update

$ sudo apt-get install sun-java5-jdk

Java 5를 사용하도록 설정하기 위해서 다음을 수행하자.

$ sudo update-alternatives --config java

그리고 java-1.5.0-sun을 선택하자.

  • 준비물: git 와 repo

소스코드를 다운로드 하기 위해선 git 와 repo 가 필요하다.

우분투 9.04 호스트 에선 다음과 같이 하면된다.

git:

$ sudo apt-get install git-core

repo:

$ curl -o ~/bin/repo http://android.git.kernel.org/repo

$ chmod a+x ~/bin/repo

Repo에 대한 좀더 자세한 사항들은 Using Repo and Git.

  • 0xdroid 소스코드 얻기

$ mkdir beagle-donut

$ cd beagle-donut

$ repo init -u git://gitorious.org/0xdroid/manifest.git -b BRANCH_NAME

$ repo sync

BRANCH_NAME 은 다음중 하나로 설정하자.:

* beagle-eclair - for Eclair version of 0xdroid
* beagle-donut - for Donut version 0f 0xdroid
* beagle-cupcake - for Cupcake version of 0xdroid

다른 방식으로 좀 더 빠른 속도로 받을 수 있는 git mirror를 사용하

$ repo init -u git://git.0xlab.org/manifest.git -b beagle-donut
$ sed -i -e 's#git://gitorious.org/0xdroid/#git://git.0xlab.org/#' .repo/manifests/default.xml
$ repo sync

  • 소스코드를 가지고 0xdroid 만들기

DevKit8000을 설정하고 활성화 하자.

$ echo "TARGET_PRODUCT :=devkit8000” > buildspec.mk
$ echo “INSTALL_PREBUILT_DEMO_APKS := true” >> buildspec.mk

$ make

성공적으로 만들어 졌다면, 루트 파일 시스템은 다음의 곳에 생성된다.

* out/target/product/beagleboard/root/
* out/target/product/beagleboard/system/

NAND flash를 위한 UBIFS system image은 다음과 같다.:

* out/target/product/beagleboard/system.img

좀더 세세한 것들은 scratch 에서 Linux kernel를 만들고 설정하자.

$ cd ..
$ git clone git://gitorious.org/0xlab-kernel/kernel.git
$ cd kernel
$ git checkout -b kernel_omap3 origin/omap3
$ make ARCH=arm devkit8000_defconfig # build for devkit8000
$ make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- uImage
$ make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules

이미지를 타겟 보드에 심자.

긴 빌딩과정이 끝나면 Android kernel과 system 이미지들을 얻게 된다. happy Installer를 이용해서 SD card booting을 할 수 있다.

* SD card의 첫번째 파티션을 100MB이상을 갖는 VFAT로 포멧하자 .
* 인스톨러 uImage.bin를 다운로드하자.
* out/target/product/beagleboard/system.img 을 android-beagle.ubi으로 바꾸자.
* arch/arm/boot/uImage을 0xkernel-beagle.bin으로 바꾸자.
* 이 세파일들을 SD/MMC card의 첫번째 파티션에 복사하자.
* Beagle board의 SD slot에 SD card를 넣고 Beagleboard를 재시작하자.
* UI installer가 끝날때까지 기달리자. installer는 NAND flashing 과 u-boot 환경번수를 설정한다.
* Beagleboard에서 SD card를 제거하고 재부팅하자.
* 즐기자!
  • Uboot Update
0xdroid의 eclair-0x4버전에 알맞는 devkit8000의 flash-uboot.bin으로 uboot를 변경하자. 낮은 버전의 커널에서는 문제가 없지만 높은 버전의 리눅스 커널에서 ID를 체크하는 부분때문에 리눅스 부팅이 안되는 경우가 생긴다.
우선, SD 카드로 flash-uboot.bin 이미지를 복사한다.

$ cp ~/download/flash-uboot.bin /media/sdcard/

그리고 uboot에서

# mmcinit (uboot 버전에 따라 mmc init인 경우도 존재함)
# fatload mmc 0:1 80000000 flash-uboot.bin
reading flash-uboot.bin

$(file size) bytes read
# nand unlock
device 0 whole chip
nand_unlock: start: 00000000, length: 134217728!
NAND flash successfully unlocked
# nand ecc sw (uboot 버전에 따라 nandecc 인 경우도 존재함)
# nand erase 80000 160000

NAND erase: device 0 offset 0x80000, size 0x160000
Erasing at 0x1c0000 -- 100% complete
OK
# nand write.i 80000000 80000 160000

NAND write: device 0 offset 0x80000, size 0x160000

Writing data at 0x1df800 -- 100% complete.
1441792 bytes written: OK

  • 커널과 루트 파일시스템 이미지 설치하기
커널과 푸트 파일 시스템은 위에서 언급한데로 Happy 인스톨러로 인한 설치는 안된다. 그레서 uboot에서 설치를 시도하자.
SD 카드에 리눅스 커널 이미지와 루트 파일 시스템을 복사하자
$ cp kernel/arch/arm/boot/uImage /media/sdcard/
$ cp out/target/product/devkit8000/system.img /media/sdcard
$ sync
$ umount /media/sdcard

SD 카드를 보드에 꼽고, 전원을 올리자.
U-Boot 2009.11-00423-gb5f90cf-dirty (Mar 19 2010 - 19:16:52)

OMAP3530-GP ES3.1, CPU-OPP2 L3-165MHz
OMAP3 DevKit8000 + LPDDR/NAND
I2C: ready
DRAM: 256 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Die ID #2cf2002400000000040365fa19019014
Net: dm9000
Hit any key to stop autoboot: 0
OMAP3 DevKit8000 #

그리고 uboot상에서 SD 카드의 이미지들을 설치하자.
# mmcinit (uboot 버전에 따라 mmc init인 경우도 존재함)
# fatload mmc 0:1 80000000 uImage
reading uImage

1790588 bytes read
# nand unlock
device 0 whole chip
nand_unlock: start: 00000000, length: 134217728!
NAND flash successfully unlocked
# nand ecc sw (uboot 버전에 따라 nandecc 인 경우도 존재함)
# nand erase 280000 200000

NAND erase: device 0 offset 0x280000, size 0x200000
Erasing at 0x460000 -- 100% complete
OK
# nand write.i 80000000 280000 200000

NAND write: device 0 offset 0x280000, size 0x200000

Writing data at 0x47f800 -- 100% complete.
2097152 bytes written: OK

# mmcinit
# fatload mmc 0:1 81000000 system.img
read system.img

43253760 bytes read
# nand unlock
# nand ecc sw
# nand erase 680000

NAND erase: device 0 offset 0x680000, size 0xf980000
Erasing at 0xffe0000 -- 100% complete
OK
# nand write.i 81000000 680000 2940000

NAND write: device 0 offset 0x680000, size 0x2940000
43253760 bytes written: OK

  • In uboot, bootcmd and bootargs
# setenv bootcmd 'nand read 80300000 280000 300000; bootm 80300000'
# setenv bootargs 'console=ttyS2,115200n8 ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs video=omapfb:mode:4.3inch_LCD omapfb.mode=lcd:480x272 omapfb.rotate=1 init=/init androidboot.console=ttyS2'
# saveenv
# reset


댓글 없음:

댓글 쓰기