zoukankan      html  css  js  c++  java
  • ANDROID深度探索(卷1)HAL与驱动开发 第四章

    配置android源代码下载环境

    (1)创建一个用于存放下载脚本文件(repo)的目录(可将该脚本文件一放到任何目录中,在这里使用~/bin)。#mkdir ~/bin    #PATH=~/bin:¥PATH

    (2)下载脚本文件(用于下载Android源代码)。#curl https//dl-sslGoogle.Com/dl/googlesource/git-repo/repo>~/bin/repo     #chmod a+x  ~/bin/repo

    (3)创建用于存放Android源代码的目录(可放在其他目录中)。#mkdir android-source   #cd android-source

    (4)初始化#rcpo init -u https://android.googlesource.com/platform/manifeet   #repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1-rl

    (5)开始下载Android源代码 #repo sync

    编译Android源代码

    apt-get命令一般需要root权限执行,所以一般跟着sudo命令。   

    sudo apt-get install git-core curl   

    这条命令会从互联网的软件仓库中安装git-corecurl   

    其中curl是一个利用URL语法在命令行方式下工作的文件传输工具,它支持很多协议,包括FTPFTPSHTTPHTTPSTELENT等,我们需要安装它从网络上获取Repo脚本文件。   

    curl http://android.git.kernel.org/repo >~/bin/repo   

    这句命令会下载repo脚本文件到当前主目录的/bin目录下,并保存在文件repo中。   

    最后我们需要给repo文件可执行权限   

    chmod a+x ~/bin/repo

    待续...

    下载和编译Linux内核源代码

          1. 使用GIT工具下载,执行以下命令:

          www.linuxidc.com@linuxidc:~/Android$ mkdir kernel

          www.linuxidc.com@linuxidc:~/Android$ cd kernel
          www.linuxidc.com@linuxidc:~/Android/kernel$ git clone git://android.git.kernel.org/kernel/common.git
          同样是经过漫长的等待后,在kernel目录下有一个common目录,Linux内核代码就在这里了。
          2. 下载完成后,可以查看下载的内核代码版本:
         www.linuxidc.com@linuxidc:~/Android/kernel$ cd  common
          www.linuxidc.com@linuxidc:~/Android/kernel/common$ git  branch
          android-2.6.36
          3. 下载完Android的Linux内核代码后,会发现在arch/arm/configs下没有模拟器要使用的硬件配置文件goldfish_defconfig

     下载完毕后,就能在arch/arm/configs下看到goldfish_defconfig这个文件了。

  • 相关阅读:
    Airflow 使用 Celery 时,如何添加 Celery 配置
    什么是唯品会JIT业务
    Linux 性能优化排查工具
    HttpClient 报错 Invalid cookie header, Invalid 'expires' attribute: Thu, 01 Jan 1970 00:00:00 GMT
    如何使用 Enterprise Architect 画 UML
    通过maven profile 打包指定环境配置
    Git 使用总结
    Git 分支模型
    本地Windows环境Dubbo搭建测试
    makefile
  • 原文地址:https://www.cnblogs.com/wuxinxinxin/p/5439950.html
Copyright © 2011-2022 走看看