当前位置:   article > 正文

Ubuntu18.04编译Android7.1.2源码(刷机Pixel)_android 7.1.2 rom下载

android 7.1.2 rom下载

Pixel系列Android Beta版本ROM下载

  1. 1.安装所需工具
  2. # apt-get install -y openjdk-8-jdk openjdk-11-jdk flex bison gperf build-essential
  3. libncurses5-dev:i386 git flex bison gperf build-essential libncurses5-dev:i386 libx11-
  4. dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown
  5. libxml2-utils xsltproc zlib1g-dev:i386 dpkg-dev libsdl1.2-dev libesd0-dev git-core gnupg
  6. flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-
  7. i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev
  8. libxml2-utils xsltproc unzip m4
  9. # sudo apt install libncurses5:i386 libncurses5-dev libncurses5
  10. <1>.配置JDK
  11. # sudo apt-get install openjdk-8-jdk
  12. # sudo vim /etc/profile
  13. export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
  14. export JRE_HOME=${JAVA_HOME}/jre
  15. export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
  16. export PATH=${JAVA_HOME}/bin:$PATH
  17. <2>.安装需要工具
  18. # sudo apt-get install m4 g++-multilib gcc-multilib lib32ncurses5-dev lib32readline6-dev
  19. lib32z1-dev flex curl bison
  20. <3>.查看并开启jack-server
  21. # ./prebuilts/sdk/tools/jack-admin list-server
  22. # ./prebuilts/sdk/tools/jack-admin start -server
  23. # ./prebuilts/sdk/tools/jack-admin stop -server
  24. 2.使用清华源下载源码
  25. # curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
  26. # chmod +x repo
  27. # sudo mv ./repo /usr/local/bin
  28. # sudo vim /usr/local/bin/repo //把REPO_URL='改为清华源'
  29. REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
  30. <1>.下载源码的初始化包(加速源码下载时间看网速而定)
  31. 可下载某一天初始化包
  32. # wget https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-20180901.tar //33G
  33. 也可下载最新的初始化包
  34. # wget https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar //58G
  35. # tar -xvf aosp-latest.tar
  36. # cd ~/aosp
  37. # cd .repo/manifests
  38. # git branch -a //查看分支
  39. # git tag //查看打的tag
  40. <2>.下载pixel手机驱动(必须下载,否则手机不能开机),选择NZH54D
  41. Android版本列表:https://source.android.google.cn/setup/start/build-numbers?hl=zh-cn#source-code-tags-and-builds
  42. Android版本列表(最新):https://source.android.google.cn/docs/setup/reference/build-numbers?hl=en
  43. 驱动地址:https://developers.google.com/android/drivers
  44. 驱动别弄错了,不然pixel起不来:Pixel binaries for Android 7.1.2 (NZH54D)
  45. 细分版本 分支 版本 支持的设备
  46. NZH54D android-7.1.2_r33 Nougat Pixel XL、Pixel
  47. 注意:
  48. NZH54D:对应Google和高通的vend.img和外设驱动程序
  49. android-7.1.2_r33:要切换的android分支,必须严格匹配,否则设备起不来
  50. Pixel XL、Pixel:支持的手机设备
  51. <3>.解压驱动分别为两个.sh文件,然后拷贝到~/asop
  52. # tar zxvf google_devices-sailfish-nzh54d-cc9ac173.tgz
  53. # tar zxvf qcom-sailfish-nzh54d-56bb51e3.tgz
  54. # cp extract-google_devices-sailfish.sh ~/asop
  55. # cp extract-qcom-sailfish.sh ~/asop
  56. # ./extract-google_devices-sailfish.sh
  57. # ./extract-qcom-sailfish.sh
  58. 最后输入 “I ACCEPT”, Enter同意即可
  59. Pixel内部代号:sailfish(旗鱼)
  60. Pixel XL内部代号:marlin(金枪鱼)
  61. <4>.根据上面选的版本(NZH54D)来切换代码分支(android-7.1.2_r33)
  62. # cd ~/aosp
  63. # repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.1.2_r33
  64. 然后运行同步,获取完整的源码(大约需要1天时间,反正我这边3天都没成功).
  65. # repo sync -j8
  66. 3.编译
  67. # source build/envsetup.sh
  68. # lunch aosp_sailfish-userdebug
  69. 接下里调整一个Java参数,要不然会出现Java OOM错误
  70. # export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8192m"
  71. # make -j8
  72. 4.刷机
  73. <1>.全刷
  74. # cd out/target/product/sailfish
  75. # adb reboot bootloader
  76. # fastboot -w flushall
  77. 注意:此命令会在当前文件夹中查找全部img文件,将这些img文件烧写到全部相应的分区中,并又一次启动手机。
  78. # fastboot reboot
  79. # fastboot reboot-bootloder //restart bootloader
  80. //清空分区
  81. # fastboot erase boot
  82. # fastboot erase system
  83. # fastboot erase data
  84. # fastboot erase cache
  85. 上面的命令也可以简化成一条命令
  86. fastboot erase system -w
  87. <1>.单刷
  88. 最重要刷boot.img、system.img、userdata.img、vendor.img这四个固件.
  89. # adb reboot bootloader
  90. # fastboot flash boot boot.img
  91. # fastboot flash system system.img
  92. # fastboot flash userdata userdata.img
  93. # fastboot flash vendor vendor.img
  94. # fastboot flash recovery recovery.img //没有编出来,可选
  95. # fastboot flash cache cache.img //没有编出来,可选
  96. # fastboot flash persist persist.img //没有编出来,可选
  97. # fastboot reboot
  98. 5.pixel系列官方Image
  99. https://developers.google.com/android/images

Good blog

Binder Driver分析

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/649309
推荐阅读
相关标签
  

闽ICP备14008679号