Building Kernels for Galaxy Nexus

本文档详细介绍了为Google Galaxy Nexus设备构建定制内核的过程,包括选择正确的内核源码分支、设置编译环境变量及工具链路径、执行编译步骤等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Building Kernels for Galaxy Nexus

                                        ---from http://source.android.com/source/building-kernels.html      20130726

1.Figuring out which kernel to build

This table lists the name and locations of the kernel sources and binaries:
Device  Binary location  Source location  Build configuration

maguro  device/samsung/tuna/kernel  kernel/omap  tuna_defconfig


grouperdevice/asus/grouper/kernelkernel/tegrategra3_android_defconfig

panda  device/ti/panda/kernel  kernel/omap  panda_defconfig

 

Device projects are of the form device/<vendor>/<name>.

$ git clone https://android.googlesource.com/device/samsung/tuna
$ cd tuna
$ git log --max-count=1 kernel

The commit message for the kernel binary contains a partial git log of the kernel sources that were used to build the binary in question. The first entry in the log is the most recent, i.e. the one used to build that kernel. You will need it at a later step.
Downloading sources

Depending on which kernel you want,


$ git clone https://android.googlesource.com/kernel/omap.git

    The goldfish project contains the kernel sources for the emulated platforms.
   
    The omap project is used for PandaBoard and Galaxy Nexus, and can be used as a starting point for work on TI OMAP chipsets.
   
$ cd omap
$ git branch -a

$ git checkout  remotes/origin/android-omap-tuna-3.0


Ensure that the prebuilt toolchain is in your path.

//$ export PATH=$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH  官网的。编译android4.1.1 for galaxy nexus 没用到,编译android4.2.2 for nexus 7 则用到
export PATH=/media/本地磁盘/WORKING_DIRECTORY/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH  //build android 4.1.1 for galaxy nexus


Building --------To build the tuna kernel


$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=arm-eabi-
$ cd omap
//$ git checkout <commit_from_first_step> 官网 我没用到
$ make tuna_defconfig
$ make


  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  Building modules, stage 2.
  MODPOST 4 modules
  CC      crypto/ansi_cprng.mod.o
  LD [M]  crypto/ansi_cprng.ko
  CC      drivers/rpmsg/rpmsg_client_sample.mod.o
  LD [M]  drivers/rpmsg/rpmsg_client_sample.ko
  CC      drivers/rpmsg/rpmsg_server_sample.mod.o
  LD [M]  drivers/rpmsg/rpmsg_server_sample.ko
  CC      drivers/scsi/scsi_wait_scan.mod.o
  LD [M]  drivers/scsi/scsi_wait_scan.ko

To build the tuna kernel
The kernel binary is output as `arch/arm/boot/zImage`, and needs to be copied into the Android source tree in order to build the matching boot image. 
这一步具体操作如下:
DH: cp  arch/arm/boot/zImage   device/samsung/tuna/kernel  然后重新编译android源码

LH:直接将zImage改名成kernel,  然后拷贝到源码层的tuna下覆盖原先的kernel文件。再重新编译android源码.

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值