NEXUS7 学习
一、编译环境搭建
(更细节的环境搭建请参考:How to Build CyanogenMod for Nexus 7 (Wi-Fi, 2012 version) (codename: grouper))
1、在执行了source build/envsetup.sh的时候,会执行vendor/cm/vendorsetup.sh:
for combo in $(curl -s https://raw.githubusercontent.com/CyanogenMod/hudson/master/cm-build-targets | sed -e 's/#.*$//' | grep cm-12.1 | awk '{printf "cm_%s-%s\n", $1, $2}')
do
add_lunch_combo $combo
done
这里会联网下载文件:https://raw.githubusercontent.com/CyanogenMod/hudson/master/cm-build-targets,它的内容如下:
root@pengdl-HP:/home/pengdl/work/study/nexus7/Nexus7# curl -s https://raw.githubusercontent.com/CyanogenMod/hudson/master/cm-build-targets
# CM build target list
# <device> <build_type> <version> [period: "D"aily, "W"eekly or "M"onthly]
# Absence of a period indicates Daily (the default) # Daily cm-12.1
acclaim userdebug cm-12.1
amami userdebug cm-12.1
bacon userdebug cm-12.1
castor userdebug cm-12.1
castor_windy userdebug cm-12.1
condor userdebug cm-12.1
d2att userdebug cm-12.1
d2spr userdebug cm-12.1
d2tmo userdebug cm-12.1
d2vzw userdebug cm-12.1
d800 userdebug cm-12.1
d801 userdebug cm-12.1
d802 userdebug cm-12.1
d803 userdebug cm-12.1
d850 userdebug cm-12.1
d851 userdebug cm-12.1
d852 userdebug cm-12.1
d855 userdebug cm-12.1
deb userdebug cm-12.1
dlx userdebug cm-12.1
e975 userdebug cm-12.1
e980 userdebug cm-12.1
evita userdebug cm-12.1
falcon userdebug cm-12.1
find7 userdebug cm-12.1
find7s userdebug cm-12.1
flo userdebug cm-12.1
flounder userdebug cm-12.1
fugu userdebug cm-12.1
ghost userdebug cm-12.1
grouper userdebug cm-12.1
hammerhead userdebug cm-12.1
hammerheadcaf userdebug cm-12.1
hlte userdebug cm-12.1
hltespr userdebug cm-12.1
hltetmo userdebug cm-12.1
i605 userdebug cm-12.1
i777 userdebug cm-12.1
i9100 userdebug cm-12.1
i925 userdebug cm-12.1
honami userdebug cm-12.1
huashan userdebug cm-12.1
jactivelte userdebug cm-12.1
jem userdebug cm-12.1
jflteatt userdebug cm-12.1
jfltespr userdebug cm-12.1
jfltetmo userdebug cm-12.1
jfltevzw userdebug cm-12.1
jfltexx userdebug cm-12.1
klimtwifi userdebug cm-12.1
klte userdebug cm-12.1
kltechn userdebug cm-12.1
kltechnduo userdebug cm-12.1
klteduos userdebug cm-12.1
kltedv userdebug cm-12.1
kltekdi userdebug cm-12.1
kltespr userdebug cm-12.1
l900 userdebug cm-12.1
lettuce userdebug cm-12.1
ls980 userdebug cm-12.1
ls990 userdebug cm-12.1
m7 userdebug cm-12.1
m7vzw userdebug cm-12.1
m8 userdebug cm-12.1
mako userdebug cm-12.1
manta userdebug cm-12.1
maserati userdebug cm-12.1
mb886 userdebug cm-12.1
mondrianwifi userdebug cm-12.1
n3 userdebug cm-12.1
n5100 userdebug cm-12.1
n5110 userdebug cm-12.1
nicki userdebug cm-12.1
obake userdebug cm-12.1
peregrine userdebug cm-12.1
picassowifi userdebug cm-12.1
pollux userdebug cm-12.1
pollux_windy userdebug cm-12.1
quark userdebug cm-12.1
rendang userdebug cm-12.1
scorpion userdebug cm-12.1
scorpion_windy userdebug cm-12.1
serrano3gxx userdebug cm-12.1
serranoltexx userdebug cm-12.1
shamu userdebug cm-12.1
sirius userdebug cm-12.1
spyder userdebug cm-12.1
superior userdebug cm-12.1
t0lte userdebug cm-12.1
t6 userdebug cm-12.1
t6spr userdebug cm-12.1
t6vzw userdebug cm-12.1
targa userdebug cm-12.1
tate userdebug cm-12.1
tf300t userdebug cm-12.1
thea userdebug cm-12.1
tilapia userdebug cm-12.1
titan userdebug cm-12.1
togari userdebug cm-12.1
togari_gpe userdebug cm-12.1
tomato userdebug cm-12.1
trltespr userdebug cm-12.1
trltetmo userdebug cm-12.1
trltexx userdebug cm-12.1
umts_spyder userdebug cm-12.1
v400 userdebug cm-12.1
v410 userdebug cm-12.1
v500 userdebug cm-12.1
victara userdebug cm-12.1
ville userdebug cm-12.1
vs980 userdebug cm-12.1
vs985 userdebug cm-12.1
xt897 userdebug cm-12.1
xt907 userdebug cm-12.1
xt925 userdebug cm-12.1
xt926 userdebug cm-12.1
z3 userdebug cm-12.1
z3c userdebug cm-12.1 # Weekly cm-12.0
a5 userdebug cm-12.0 W
e970 userdebug cm-12.0 W
find5 userdebug cm-12.0 W
jewel userdebug cm-12.0 W
ks01lte userdebug cm-12.0 W
ls970 userdebug cm-12.0 W
m7spr userdebug cm-12.0 W
mint userdebug cm-12.0 W
taoshan userdebug cm-12.0 W
trlteusc userdebug cm-12.0 W
tsubasa userdebug cm-12.0 W # Weekly cm-11.0
a700 userdebug cm-11.0 W
apexqtmo userdebug cm-11.0 W
aries userdebug cm-11.0 W
captivatemtd userdebug cm-11.0 W
crespo userdebug cm-11.0 W
d710 userdebug cm-11.0 W
dogo userdebug cm-11.0 W
e973 userdebug cm-11.0 W
encore userdebug cm-11.0 W
endeavoru userdebug cm-11.0 W
enrc2b userdebug cm-11.0 W
epicmtd userdebug cm-11.0 W
exhilarate userdebug cm-11.0 W
expressatt userdebug cm-11.0 W
fireball userdebug cm-11.0 W
galaxysbmtd userdebug cm-11.0 W
galaxysmtd userdebug cm-11.0 W
hercules userdebug cm-11.0 W
hlteusc userdebug cm-11.0 W
hltevzw userdebug cm-11.0 W
hummingbird userdebug cm-11.0 W
i9100g userdebug cm-11.0 W
i9300 userdebug cm-11.0 W
i9305 userdebug cm-11.0 W
i9500 userdebug cm-11.0 W
jflte userdebug cm-11.0 W
klteusc userdebug cm-11.0 W
kltevzw userdebug cm-11.0 W
l01f userdebug cm-11.0 W
m4 userdebug cm-11.0 W
maguro userdebug cm-11.0 W
n1 userdebug cm-11.0 W
n5120 userdebug cm-11.0 W
n7000 userdebug cm-11.0 W
n7100 userdebug cm-11.0 W
odin userdebug cm-11.0 W
otter userdebug cm-11.0 W
otter2 userdebug cm-11.0 W
otterx userdebug cm-11.0 W
ovation userdebug cm-11.0 W
p1 userdebug cm-11.0 W
p3100 userdebug cm-11.0 W
p3110 userdebug cm-11.0 W
p5100 userdebug cm-11.0 W
p5110 userdebug cm-11.0 W
p880 userdebug cm-11.0 W
p930 userdebug cm-11.0 W
r950 userdebug cm-11.0 W
sc02c userdebug cm-11.0 W
skyrocket userdebug cm-11.0 W
t769 userdebug cm-11.0 W
tf700t userdebug cm-11.0 W
tf701t userdebug cm-11.0 W
vs920 userdebug cm-11.0 W
w7 userdebug cm-11.0 W
ypg1 userdebug cm-11.0 W
yuga userdebug cm-11.0 W
其中需要关注的是 grouper user-debug cm-12.1
然后执行lunch
root@pengdl-HP:/home/pengdl/work/study/nexus7/Nexus7# lunch You're building on Linux Lunch menu... pick a combo:
. aosp_arm64-eng . cm_huashan-userdebug . cm_scorpion_windy-userdebug
. aosp_arm-eng . cm_i605-userdebug . cm_serrano3gxx-userdebug
. aosp_grouper-userdebug . cm_i777-userdebug . cm_serranoltexx-userdebug
. aosp_mips64-eng . cm_i9100-userdebug . cm_shamu-userdebug
. aosp_mips-eng . cm_i925-userdebug . cm_sirius-userdebug
. aosp_x86_64-eng . cm_jactivelte-userdebug . cm_spyder-userdebug
. aosp_x86-eng . cm_jem-userdebug . cm_superior-userdebug
. cm_acclaim-userdebug . cm_jflteatt-userdebug . cm_t0lte-userdebug
. cm_amami-userdebug . cm_jfltespr-userdebug . cm_t6spr-userdebug
. cm_bacon-userdebug . cm_jfltetmo-userdebug . cm_t6-userdebug
. cm_castor-userdebug . cm_jfltevzw-userdebug . cm_t6vzw-userdebug
. cm_castor_windy-userdebug . cm_jfltexx-userdebug . cm_targa-userdebug
. cm_condor-userdebug . cm_klimtwifi-userdebug . cm_tate-userdebug
. cm_d2att-userdebug . cm_kltechnduo-userdebug . cm_tf300t-userdebug
. cm_d2spr-userdebug . cm_kltechn-userdebug . cm_thea-userdebug
. cm_d2tmo-userdebug . cm_klteduos-userdebug . cm_tilapia-userdebug
. cm_d2vzw-userdebug . cm_kltedv-userdebug . cm_titan-userdebug
. cm_d800-userdebug . cm_kltekdi-userdebug . cm_togari_gpe-userdebug
. cm_d801-userdebug . cm_kltespr-userdebug . cm_togari-userdebug
. cm_d802-userdebug . cm_klte-userdebug . cm_tomato-userdebug
. cm_d803-userdebug . cm_l900-userdebug . cm_trltespr-userdebug
. cm_d850-userdebug . cm_lettuce-userdebug . cm_trltetmo-userdebug
. cm_d851-userdebug . cm_ls980-userdebug . cm_trltexx-userdebug
. cm_d852-userdebug . cm_ls990-userdebug . cm_umts_spyder-userdebug
. cm_d855-userdebug . cm_m7-userdebug . cm_v400-userdebug
. cm_deb-userdebug . cm_m7vzw-userdebug . cm_v410-userdebug
. cm_dlx-userdebug . cm_m8-userdebug . cm_v500-userdebug
. cm_e975-userdebug . cm_mako-userdebug . cm_victara-userdebug
. cm_e980-userdebug . cm_manta-userdebug . cm_ville-userdebug
. cm_evita-userdebug . cm_maserati-userdebug . cm_vs980-userdebug
. cm_falcon-userdebug . cm_mb886-userdebug . cm_vs985-userdebug
. cm_find7s-userdebug . cm_mondrianwifi-userdebug . cm_xt897-userdebug
. cm_find7-userdebug . cm_n3-userdebug . cm_xt907-userdebug
. cm_flounder-userdebug . cm_n5100-userdebug . cm_xt925-userdebug
. cm_flo-userdebug . cm_n5110-userdebug . cm_xt926-userdebug
. cm_fugu-userdebug . cm_nicki-userdebug . cm_z3c-userdebug
. cm_ghost-userdebug . cm_obake-userdebug . cm_z3-userdebug
. cm_grouper-userdebug . cm_peregrine-userdebug . m_e_arm-userdebug
. cm_hammerheadcaf-userdebug . cm_picassowifi-userdebug . mini_emulator_arm64-userdebug
. cm_hammerhead-userdebug . cm_pollux-userdebug . mini_emulator_mips-userdebug
. cm_hltespr-userdebug . cm_pollux_windy-userdebug . mini_emulator_x86_64-userdebug
. cm_hltetmo-userdebug . cm_quark-userdebug . mini_emulator_x86-userdebug
. cm_hlte-userdebug . cm_rendang-userdebug
. cm_honami-userdebug . cm_scorpion-userdebug
选择38.
编译
mka bacon
2、修改内核配置
如果想编译模块,Nexus7的内核默认配置是不允许的,所以需要修改默认配置,配置文件是 cyanogenmod_grouper_defconfig
首先将这个默认配置备份一下
cd kernel/asus/grouer/arch/arm/configs/ cp cyanogenmod_grouper_defconfig cyanogenmod_grouper_defconfig_bak
修改配置
root@pengdl-HP:/home/pengdl/work/study/nexus7/Nexus7/kernel/asus/grouper# make ARCH=arm cyanogenmod_grouper_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
# #### make completed successfully ( seconds) ####
cd kernel/asus/grouper/ make ARCH=arm menuconfig
作如下修改:
[*] Enable loadable module support --->
[*] Forced module loading
[*] Module unloading
[*] Forced module unloading
需改完后,保存退出,用.config 覆盖 cyanogenmod_grouper_defconfig
然后清理环境:
make mrproper
然后再利用Android的编译系统编译出的boot.img就可以加载模块了。
二、配置USB访问权限
参考:http://source.android.com/source/initializing.html
Under GNU/Linux systems (and specifically under Ubuntu systems), regular users can't directly access USB devices by default. The system needs to be configured to allow such access.
The recommended approach is to create a file /etc/udev/rules.d/51-android.rules
(as the root user) and to copy the following lines in it. <username>
must be replaced by the actual username of the user who is authorized to access the phones over USB.
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="", OWNER="<username>"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="", OWNER="<username>"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="", OWNER="<username>"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="", MODE="", OWNER="<username>"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="", OWNER="<username>"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="", ATTR{idProduct}=="d101", MODE="", OWNER="<username>"
# adb protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="", OWNER="<username>"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="", ATTR{idProduct}=="d022", MODE="", OWNER="<username>"
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="", ATTR{idProduct}=="d00f", MODE="", OWNER="<username>"
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="", ATTR{idProduct}=="d010", MODE="", OWNER="<username>"
# adb protocol on grouper/tilapia (Nexus )
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="", OWNER="<username>"
# fastboot protocol on grouper/tilapia (Nexus )
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="", OWNER="<username>"
# adb protocol on manta (Nexus )
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="", OWNER="<username>"
# fastboot protocol on manta (Nexus )
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="", OWNER="<username>"
NEXUS7 学习的更多相关文章
- 从直播编程到直播教育:LiveEdu.tv开启多元化的在线学习直播时代
2015年9月,一个叫Livecoding.tv的网站在互联网上引起了编程界的注意.缘于Pingwest品玩的一位编辑在上网时无意中发现了这个网站,并写了一篇文章<一个比直播睡觉更奇怪的网站:直 ...
- Angular2学习笔记(1)
Angular2学习笔记(1) 1. 写在前面 之前基于Electron写过一个Markdown编辑器.就其功能而言,主要功能已经实现,一些小的不影响使用的功能由于时间关系还没有完成:但就代码而言,之 ...
- ABP入门系列(1)——学习Abp框架之实操演练
作为.Net工地搬砖长工一名,一直致力于挖坑(Bug)填坑(Debug),但技术却不见长进.也曾热情于新技术的学习,憧憬过成为技术大拿.从前端到后端,从bootstrap到javascript,从py ...
- 消息队列——RabbitMQ学习笔记
消息队列--RabbitMQ学习笔记 1. 写在前面 昨天简单学习了一个消息队列项目--RabbitMQ,今天趁热打铁,将学到的东西记录下来. 学习的资料主要是官网给出的6个基本的消息发送/接收模型, ...
- js学习笔记:webpack基础入门(一)
之前听说过webpack,今天想正式的接触一下,先跟着webpack的官方用户指南走: 在这里有: 如何安装webpack 如何使用webpack 如何使用loader 如何使用webpack的开发者 ...
- Unity3d学习 制作地形
这周学习了如何在unity中制作地形,就是在一个Terrain的对象上盖几座小山,在山底种几棵树,那就讲一下如何完成上述内容. 1.在新键得项目的游戏的Hierarchy目录中新键一个Terrain对 ...
- 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
- 菜鸟Python学习笔记第一天:关于一些函数库的使用
2017年1月3日 星期二 大一学习一门新的计算机语言真的很难,有时候连函数拼写出错查错都能查半天,没办法,谁让我英语太渣. 关于计算机语言的学习我想还是从C语言学习开始为好,Python有很多语言的 ...
- 多线程爬坑之路-学习多线程需要来了解哪些东西?(concurrent并发包的数据结构和线程池,Locks锁,Atomic原子类)
前言:刚学习了一段机器学习,最近需要重构一个java项目,又赶过来看java.大多是线程代码,没办法,那时候总觉得多线程是个很难的部分很少用到,所以一直没下决定去啃,那些年留下的坑,总是得自己跳进去填 ...
随机推荐
- 【poj3260-最少找零】多重背包+完全背包
多重背包+完全背包. 买家:多重背包:售货员:完全背包: 开两个数组,分别计算出买家,售货员每个面额的最少张数. 最重要的是上界的处理:上界为maxw*maxw+m(maxw最大面额的纸币). (网上 ...
- 【Foreign】开锁 [概率DP]
开锁 Time Limit: 10 Sec Memory Limit: 256 MB Description Input Output Sample Input 4 5 1 2 5 4 3 1 5 ...
- set .net principle
var ticket = new FormsAuthenticationTicket(1, username, DateTime.Now, DateTime.Now.AddMinutes(FormsA ...
- UVA 10183 How Many Fibs?
高精度推出大概600项fabi数,就包含了题目的数据范围,对于每组a,b,从1到600枚举res[i]即可 可以直接JAVA大数.我自己时套了C++高精度的版 JAVA 复制别人的 import ja ...
- Shell 脚本实现TCP/UDP协议通讯
Shell 脚本实现TCP/UDP协议通讯 http://www.cnblogs.com/occult/archive/2012/12/25/2832183.html
- 冒泡排序的思想 python 冒泡排序、递归排序
冒泡排序的时间复杂度是O(N^2) 冒泡排序的思想: 每次比较两个相邻的元素, 如果他们的顺序错误就把他们交换位置 比如有五个数: 12, 35, 99, 18, 76, 从大到小排序, 对相邻的两位 ...
- 【POI2017||bzoj4726】Flappy Birds
外国人很良心的啊,这题比NOIP那题还简单…… 不用管他最后的位置,因为移动的次数肯定是恒定的,所以维护在每一个柱子的位置能飞到的范围,递推下去即可. #include<bits/stdc++. ...
- [译]Java8的函数式接口
Java8引入了 java.util.function 包,他包含了函数式接口,具体的描述在以下api说明文档中: 函数式接口为lambda表达式和方法引用提供目标类型.每个函数式接口有一个单独的抽象 ...
- WIN32通用控件之打开对话框获取文件路径
OPENFILENAME ofn; char FileName[MAX_PATH]; memset(&ofn,,sizeof(OPENFILENAME)); memset(FileName,, ...
- AC日记——中山市选[2009]小明的游戏 bzoj 2464
2464 思路: 最短路: 代码: #include <cstdio> #include <cstring> #include <iostream> #includ ...