Fedora 20 Compile Cyanogenmod 11.0 - Nexus 4 ( mako ) example

本文详细介绍了如何在Linux环境下安装Android SDK、JDK,并通过配置环境变量实现adb和fastboot命令的可用性。同时,文章还指导了如何安装Eclipse IDE和初始化Cyanogenmod 11.0的源代码目录,为开发者提供了全面的开发环境搭建教程。
Install adb/fastboot/android sdk :

# cd /opt
# wget http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20131030.zip
# unzip adt-bundle-linux-x86_64-20131030.zip
# ln -s adt-bundle-linux-x86_64-20131030 adt-bundle

Add new path for a normal user:
$echo "export PATH="/opt/adt-bundle/sdk/platform-tools:\$PATH"" >> /home/maccu/.bashrc
$ bash
$ which fastboot
/opt/adt-bundle/sdk/platform-tools/fastboot
$ which adb
/opt/adt-bundle/sdk/platform-tools/adb

Add new path for ror root:
# echo "export PATH="/opt/adt-bundle/sdk/platform-tools:\$PATH"" >> /root/.bashrc
# bash 
# which fastboot
/opt/adt-bundle/sdk/platform-tools/fastboot
# which adb
/opt/adt-bundle/sdk/platform-tools/adb


Install jdk:

Download Java JDK from here and install:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

# rpm -qa | grep java 
java-1.7.0-openjdk-headless-1.7.0.60-2.4.3.0.fc20.x86_64
abrt-java-connector-1.0.6-1.fc20.x86_64
java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64
javapackages-tools-3.4.1-1.fc20.noarch
tzdata-java-2013h-1.fc20.noarch
python-javapackages-3.4.1-1.fc20.noarch

# rpm -ivh jdk-7u45-linux-x64.rpm

# which javah
/usr/bin/which: no javah in (/opt/adt-bundle/sdk/platform-tools:/opt/adt-bundle-linux-x86-20130522/sdk/platform-tools:/opt/adt-bundle-linux-x86-20130522/sdk/tools:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

# ls /usr/java/default/bin/javah 
/usr/java/default/bin/javah

# ln -s /usr/java/default/bin/javah /usr/bin/javah
# which javah
/bin/javah

#  java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (fedora-2.4.3.0.fc20-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)


If you have problem during the building of CM11.0 ,you need a version 6 Java Development Kit for building  CM11.0. Usually, the SUN JDK 6 is recommended. But there is another way: you can use the OpenJDK 6. When you installed the required packages as described above, you will just need to configure your Java installation.

Remove jdk

# rpm -qa | grep jdk 
java-1.7.0-openjdk-headless-1.7.0.60-2.4.3.0.fc20.x86_64
java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64
jdk-1.7.0_45-fcs.x86_64

# rpm -e jdk-1.7.0_45-fcs.x86_64

Download from oracle site, you must need a oracle account.
http://download.oracle.com/otn/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin

# chmod +x jdk-6u45-linux-x64-rpm.bin 
# ./jdk-6u45-linux-x64-rpm.bin 

# ln -s /usr/java/default/bin/javah /usr/bin/javah


# /usr/bin/javah -version
javah version "1.6.0_45"

Install dependencies:

# yum install -y zip curl gcc gcc-c++ flex bison gperf glibc-devel.{x86_64,i686} zlib-devel.{x86_64,i686} ncurses-devel.i686 libX11-devel.i686 libstdc++.i686 readline-devel.i686 libXrender.i686 libXrandr.i686 perl-Digest-MD5-File python-markdown mesa-libGL-devel.i686 git

This is important

If you have 64-bit systems, you will need to install some 32bit packages, because Android SDK is 32bit
32 bit packages
# yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686

If you are compiling custom ROM's, most utilize CyanogenMod's squisher script and mka command

which needs these two packages.
# yum install -y schedtool pngcrush

Install Eclipse:
This is important
If you have problems like [Bug875490] try to install the "Fedora Eclipse" group rather than just "yum install eclipse"
Eclipse IDE (3.5 and higher is needed because of ADT plugin dependency on Equinox P2)
yum install eclipse-jdt

# yum install eclipse-jtd

Installing Repo Script:

# mkdir ~/bin
# export PATH=~/bin:$PATH
# echo "export PATH=~/bin:\$PATH" >> /root/.bashrc

# curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
# chmod a+x ~/bin/repo

For version 1.20, the SHA-1 checksum for repo is e197cb48ff4ddda4d11f23940d316e323b29671c
# /usr/bin/openssl sha1 repo 
SHA1(repo)= e197cb48ff4ddda4d11f23940d316e323b29671c

# which repo 
~/bin/repo


Inizialize source directory:

Inizialize source directory for Cyanogenmod 11.0:

# mkdir -p ~/android/cm-11.0
# cd ~/android/cm-11.0

# git config --global user.email "yourmailaddress@gmail.com"
# git config --global user.name "Maccu Maccu"


# repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0

If you want to change this, please re-run 'repo init' with --config-name

Testing colorized output (for 'repo diff', 'repo status'):
  black    red      green    yellow   blue     magenta   cyan     white
  bold     dim      ul       reverse
Enable color display in this user account (y/N)? y

Inizialize source directory for Cyanogenmod 10.2:



# mkdir -p ~/android/cm-10.2
# cd ~/android/cm-10.2


# git config --global user.email "yourmailaddress@gmail.com"
# git config --global user.name "Maccu Maccu"


# repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2

If you want to change this, please re-run 'repo init' with --config-name

Testing colorized output (for 'repo diff', 'repo status'):
  black    red      green    yellow   blue     magenta   cyan     white
  bold     dim      ul       reverse
Enable color display in this user account (y/N)? y


Initialize source directory behind a proxy:

# git config --get http.proxy http://localhost:5865 (ntlmaps example)
# repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0

with https:

# repo init -u https://github.com/CyanogenMod/android.git -b cm-11.0


Start download - Sync source repo:

you must have at least 25 GB free
# cd ~/android/cm-11.0
# repo sync

wait...
If your not on the ultra super fast connection, you need to wait.

# cd .. 
# du -sh cm-11.0/
20G cm-11.0/

If you are running into a lot of syncing errors the reason might be that the 'repo sync' command is establishing four threads automatically. This might be too much. So try to change the command to run with one thread only by using

# repo sync -j1 

Get prebuild apps :

# cd /home/maccu/android/cm-11.0/vendor/cm
# ./get-prebuilts 

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   178  100   178    0     0    179      0 --:--:-- --:--:-- --:--:--   179
100  455k  100  455k    0     0   217k      0  0:00:02  0:00:02 --:--:-- 1221k
Archive:  ./proprietary/Term.apk
  inflating: ./proprietary/lib/armeabi/libjackpal-androidterm4.so  
  inflating: ./proprietary/lib/mips/libjackpal-androidterm4.so  
  inflating: ./proprietary/lib/x86/libjackpal-androidterm4.so  

or

#  ./vendor/cm/get-prebuilts

Prepare device specific code : 

# cd /home/maccu/android/cm-11.0/
# pwd
/home/maccu/android/cm-11.0

# . build/envsetup.sh 
or 
# source build/envsetup.sh 
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/goldfish/vendorsetup.sh
including device/generic/mips/vendorsetup.sh
including device/generic/x86/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash


# breakfast mako 
including vendor/cm/vendorsetup.sh
ls: cannot access device/*/mako/cm.mk: No such file or directory
build/core/product_config.mk:233: *** Can not locate config makefile for product "cm_mako".  Stop.
Device mako not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_lge_mako
Default revision: cm-11.0
Checking branch info
CyanogenMod/android_device_lge_mako already exists
Syncing repository to retrieve project.
Fetching project CyanogenMod/android_device_lge_mako

============================================
PLATFORM_VERSION_CODENAME= REL
PLATFORM_VERSION= 4.4
CM_VERSION= 11-20131125-UNOFFICIAL-mako
TARGET_PRODUCT= cm_mako
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA= Linux-3.11.8-300.fc20.x86_64-x86_64-with-fedora-20-Heisenbug
HOST_BUILD_TYPE=release
BUILD_ID= KRT16S
OUT_DIR= /home/maccu/android/cm-11.0/out
============================================


if you have problem with "mako" try with "lge_mako" :
ls: cannot access device/*/mako/cm.mk: No such file or directory
build/core/product_config.mk:234: *** Cannot locate config makefile for product "cm_mako".  Stop.
** Don't have a product spec for: 'cm_mako'
** Do you have the right repo manifest?

warning: local_manifest.xml is deprecated; put local manifests in `/home/maccu/android/cm-11/.repo/local_manifests` instead


# breakfast lge_mako
including vendor/cm/vendorsetup.sh
ls: cannot access device/*/lge_mako/cm.mk: No such file or directory
build/core/product_config.mk:233: *** Can not locate config makefile for product "cm_lge_mako".  Stop.

Device lge_mako not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).....


Helpful Tip from  http://wiki.cyanogenmod.org/w/Build_for_mako

If the build doesn't start, try lunch and choose your device from the menu. If that doesn't work, try breakfast and choose from the menu. The command make mako should then work.

A second, bonus tip! If you get a command not found error for croot or brunch or lunch, be sure you’ve done the “ . build/envsetup.sh” command in this Terminal session from the ~/android/system directory.

Extract proprietary data:

Connect your device to your computer and turn on USB debugging on Developer Options.
Go to your device vendor directory and extract files from your phone, for Nexus 4:

# adb devices
List of devices attached 
04d6f87fe10e0122 device

# cd device/lge/mako/
# ./extract-files.sh

# cat extract-files.sh 
#!/bin/sh

VENDOR=lge
DEVICE=mako

BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $BASE/*

for FILE in `cat proprietary-blobs.txt | grep -v ^# | grep -v ^$`; do
    DIR=`dirname $FILE`
    if [ ! -d $BASE/$DIR ]; then
        mkdir -p $BASE/$DIR
    fi
    adb pull /system/$FILE $BASE/$FILE
done


Enable caching :

# export USE_CCACHE=1

Setup the environment :

# cd /home/mfalchi/android/cm-11.0/
# . build/envsetup.sh

# croot
# brunch mako

Use your device specific code instead of mako, if you are using different device.
Wait for build to complete. It can take 1-5 hours.
Get installable zip from out directory and install it via custom recovery.
内容概要:本文详细介绍了一个基于MATLAB实现的无人机三维路径规划项目,采用深度Q网络(DQN)与蚁群算法(ACO)相结合的混合优化策略。项目涵盖了三维环境建模、状态与动作空间设计、DQN局部避障与ACO全局搜索的协同机制、多目标奖励函数设计、路径评价与可视化等核心模块。通过DQN-ACO混合控制模块实现粗粒度全局探索与细粒度局部优化的融合,提升了路径规划的智能化水平、实时性与鲁棒性。项目还提供了完整的代码实现、GUI界面设计、训练流程、性能评估及部署方案,支持动态环境适应、多场景应用与工程落地。; 适合人群:具备一定MATLAB编程基础,熟悉深度学习与智能优化算法的科研人员、工程师及研究生,尤其适合从事无人机路径规划、智能控制、强化学习应用等相关领域的技术人员。; 使用场景及目标:①实现复杂三维环境中无人机的安全、高效路径规划;②融合深度强化学习与群体智能优化,解决单一算法易陷局部最优的问题;③应用于智能物流、应急救援、电力巡检、农业植保、边防安防等实际场景;④为智能无人系统提供可扩展、模块化、可视化的技术参考与工程范例。; 阅读建议:建议读者结合提供的完整MATLAB代码与GUI界面进行实践操作,重点关注DQN与ACO的协同机制、多目标奖励函数设计及参数调优策略。在学习过程中应逐步调试各模块功能,理解算法流程与系统集成逻辑,并尝试在不同环境配置下运行仿真,以深入掌握无人机三维路径规划的核心原理与工程实现方法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值