android goldfish kernel build
1. android kernel 소스 다운로드
$ git clone https://android.googlesource.com/kernel/common.git
$ git clone https://android.googlesource.com/kernel/exynos.git
$ git clone https://android.googlesource.com/kernel/goldfish.git
$ git clone https://android.googlesource.com/kernel/msm.git
$ git clone https://android.googlesource.com/kernel/omap.git
$ git clone https://android.googlesource.com/kernel/samsung.git
$ git clone https://android.googlesource.com/kernel/tegra.git
$ git clone https://android.googlesource.com/kernel/exynos.git
$ git clone https://android.googlesource.com/kernel/goldfish.git
$ git clone https://android.googlesource.com/kernel/msm.git
$ git clone https://android.googlesource.com/kernel/omap.git
$ git clone https://android.googlesource.com/kernel/samsung.git
$ git clone https://android.googlesource.com/kernel/tegra.git
2. goldfish용 커널 다운로드
- [goldfish]# git checkout android-goldfish-2.6.29 => success
- [goldfish]# git checkout android-goldfish-3.4 => fail
- [goldfish]# git checkout android-goldfish-3.4 => fail
- yaffs2 에서 fail => 개발 사이트에 패치 존재 => 컴파일 성공 => 커널 부팅 문제
- 커널 로그도 출력되지 않음 ("$ emulator -show-kernel"로 테스트)
- Thomas Keel 라는 사람이 위에 패치를 50여개 올려 두었는데
테스트 결과 x86은 되는데 arm은 부팅이 안된다는 글이 존재
- yaffs2 대신 ext4로 이미지로 테스트 시도
- ext4 지원 빌드 시도 => goldfish tty,fb,battery의 IO_START undefine 에러
- mach/hardware.h에 define 되어 있는데 왜? => 추가 분석 필요
- linux 3.2.28의 바닐라 커널에 goldfish 패치하고 yaffs2 패치해서 emulator 부팅 성공했다는 사이트 발견
- 위의 가이드 따라서 시도했으나 부팅 실펴
3. 빌드
- # cd [android source]
- # source build/envsetup.sh
- # lunch full-eng
- # cd prebuilts/qemu-kernel/arm
- # ./rebuild.sh /home/dkyun77/dev/android-kernel/goldfish
Using output directory: /home/dkyun77/dev/android-open/prebuilt/android-arm/kernel
Using cross-toolchain prefix: /home/dkyun77/dev/android-open/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
Cleaning up source tree.
Setting up goldfish_defconfig...
Building goldfish_deconfig...
Copying goldfish_defconfig binaries to /home/dkyun77/dev/android-open/prebuilt/android-arm/kernel.
Cleaning up source tree.
Setting up goldfish_armv7_defconfig...
Building goldfish_armv7_deconfig...
Copying goldfish_armv7_defconfig binaries to /home/dkyun77/dev/android-open/prebuilt/android-arm/kernel.
Done.
Using cross-toolchain prefix: /home/dkyun77/dev/android-open/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
Cleaning up source tree.
Setting up goldfish_defconfig...
Building goldfish_deconfig...
Copying goldfish_defconfig binaries to /home/dkyun77/dev/android-open/prebuilt/android-arm/kernel.
Cleaning up source tree.
Setting up goldfish_armv7_defconfig...
Building goldfish_armv7_deconfig...
Copying goldfish_armv7_defconfig binaries to /home/dkyun77/dev/android-open/prebuilt/android-arm/kernel.
Done.
- 결과 파일
- prebuilt/android-arm/kernel 디렉터리에
kernel-qemu kernel-qemu-armv7 vmlinux-qemu vmlinux-qemu-armv7
위 파일 생성
- emulator로 실행 시 kernel-qemu-armv7 만
prebuilts/qemu-kernel/arm 디렉터리에 존재하면 됨
4. 빌드 스크립트 help
- [android-open/prebuilts/qemu-kernel/arm]# ./rebuild.sh --help
Usage: rebuild.sh <options> /path/to/kernel
Usage: rebuild.sh <options> /path/to/kernel
Rebuild the prebuilt Android goldfish-specific kernel from sources.
Options (default are inside brackets):
--help Print this message.
--verbose Enable verbose output.
--android=<path> Set Android top-level directory [/home/dkyun77/dev/android-open]
--out-dir=<path> Set output directory [/home/dkyun77/dev/android-open/prebuilt/android-arm/kernel]
--toolchain=<name> Toolchain name [arm-eabi-4.4.0]
--cc=<path> Path to C compiler [arm-eabi-gcc]
--jobs=<count> Perform <count> parallel builds [4]
--verbose Enable verbose output.
--android=<path> Set Android top-level directory [/home/dkyun77/dev/android-open]
--out-dir=<path> Set output directory [/home/dkyun77/dev/android-open/prebuilt/android-arm/kernel]
--toolchain=<name> Toolchain name [arm-eabi-4.4.0]
--cc=<path> Path to C compiler [arm-eabi-gcc]
--jobs=<count> Perform <count> parallel builds [4]
The --toolchain option is ignored if you use the --cc one.
댓글
댓글 쓰기