Build CM 7 for HTC Vision

       入手Desire Z两年多,当年的旗舰机如今运行大型app也日渐吃力,于是乎,拿它当测试机吧。上网下载了CyanogenMod的源码,编译刷机包,刷了Desire Z。
       在CM的官网里,有关于编译CM刷HTC Desire Z的教程,但是我单纯的按照教程操作,在一开始需要执行 ./extract-files.sh 抽取手机内的属性文件时,CM_DZ_SRC/device/htc/目录里根本就没找到vision,后来参照网上的一个blog,自己下载了for vision的包,以及for vision的 proprietary包,才编译成功。

1.搭建Android源码编译环境
不赘述了,Google一大把。

2.下载CM7源码,一开始基本就参照CM的官方教程操作即可。

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/CM_DZ_SRC

Install the repo command

Enter the following to download the "repo" binary and make it executable (runnable):

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

Make sure that the ~/bin directory you just created is in your path of execution so that you can easily run the repo command even when you're not in ~/bin. Assuming you are using the BASH shell, the default in recent versions of Ubuntu, you can set it like this:

$ export PATH=${PATH}:~/bin

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

$ cd ~/CM_DZ_SRC
$ repo init -u git://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

3.CM源码下载完后,就不用按照官方教程操作了,直接把手机连上电脑,提取手机中的属性文件。

手机开启USB调试,连接后,如果adb devices能正常发现则ok,进入CM_DZ_SRC/device/htc/vision/目录,

ps:如果 CM_DZ_SRC/device/htc/ 没有对应的手机型号,可以Google下,去Github上下载一个for CM 的手机型号对应的包,我的vision目录一开始也没有,就是在Github上面下载的。下好后,拷到CM_DZ_SRC/device/htc/里面,改个名字好了。

在CM_DZ_SRC/device/htc/vision/ 里,执行 extract-files.sh ,抽取手机属性文件。


如果抽取文件的过程中,报找不到一些文件,依旧请Google,关键字如 proprietary_vendor_htc ,就会有一些放在Github上的proprietary下载,选择正确的分支后,下载缺少的文件,放到CM_DZ_SRC/vendor/htc/vision/proprietary/目录下。


4.下载Rom Manager。

Get prebuilt Rom Manager

Next,
$ cd /home/ritter/work/CM_DZ_SRC/vendor/cyanogen

then enter:

$ ./get-rommanager

5.终于可以编译啦。

Start the build

Time to start building! So now type:

$ source build/envsetup.sh
$ brunch vision

6.最后成功在CM_DZ_SRC/out/target/product/vision/目录下编译出cm-7-20130603-UNOFFICIAL-vision.zip,recovery刷机成功,上图:



7.结语:

关键是官方下载的源码里找不到对应的手机型号,以及抽取手机属性文件时会有缺失,最后都在Github上找到了,手动添加进去,终于编译成功。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值