1、设置hosts,方便访问国外站点
$ wget https://raw.githubusercontent.com/racaljk/hosts/master/hosts -qO /tmp/hosts $ sudo sh -c 'cat /tmp/hosts > /etc/hosts'
2、安装依赖库环境
sudo apt-get install gedit git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev gcc-multilib maven tmux screen w3m ncftp ccache pngquant
3、安装jdk 7
详细页面>> debian/deepin 15.3安装jdk 1.7 (或jdk 7),配置默认环境
4、创建bin目录并指定路径,下载repo并赋予读写权限
$ mkdir ~/bin $ PATH=~/bin:$PATH $ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo
5、创建工作目录,初始化同步源码环境,开始同步
$ mkdir ~/sudamod $ cd ~/sudamod $ repo init -u git://github.com/SudaMod/android.git -b sm-2.0 --no-repo-verify $ repo sync -c -f -j8 --force-sync --no-clone-bundle
6、设置编译缓存空间
$ echo "export USE_CCACHE=1" >> ~/.bashrc $ ~/sudamod/prebuilts/misc/linux-x86/ccache/ccache -M 50G
7、开始编译
$ cd ~/sudamod $ . build/envsetup.sh $ brunch "device name"
8、查看编译完成的刷机包
$ cd ~/sudamod/out/target/product/
9、再次编译,先清理,再同步更新
$ cd ~/sudamod $ make clean $ repo sync -j 16