http://wiki.cyanogenmod.org/w/Build_for_mako 这个和m2用的一样的soc。
https://github.com/CyanogenMod/android_device_lge_mako/blob/cm-10.1/extract-files.sh
https://android.googlesource.com/device/lge/mako/+/master/proprietary-blobs.txt
对比m2,大多数的私有库是一样的。从这里看来,移植应该不难,至少基本的功能应该没问题。因为这些私有库是不需要编译的,而java编译的话问题会很少。
下一步先看看能否使用CM的recovery。
已经有CM 10 for m1:http://www.miui.com/thread-954095-1-1.html
如何[url=http://wiki.cyanogenmod.org/w/Doc:_porting_intro]port CM[/url]
https://github.com/fkpwolf/android_device_xiaomi_m2
device name本来想用aries(定义在/system/build.prop),不过[url=https://github.com/CyanogenMod]CM[/url]上三星有个同名的。
取出recovery.fstab参考[url=http://forum.xda-developers.com/showthread.php?t=633246]这里[/url]的“How to add new devices”章节。如果在linux上面,对于system.img,参考[url=http://forum.xda-developers.com/showthread.php?t=1588461]这里[/url]使用mount,xiaomi的img文件先要转换成raw的img,然后才能用ext4 mount。而对于recovery.img,要用不同方法。参考[url=http://forum.xda-developers.com/showthread.php?t=1590039]这里[/url]。
如何disbale一些功能做最小化编译:https://groups.google.com/d/msg/android-porting/u1rbpdEXqQw/92OUZiSf8wIJ
linux下使用adb连接device:看[url=http://www.linuxidc.com/Linux/2013-01/77625.htm]这里[/url]和[url=http://ubuntuforums.org/showthread.php?t=1918512]这里[/url]。我搞了半天才发现需要一个adb_usb.ini文件。
[size=large]安装Recovery[/size]
做了个很粗糙的otg build,通过miui recovery安装到98%时失败。也不知道是何原因,因为看到log。于是猜想是recovery的原因,于是想自己Build cm recovery。但是即使使用xiaomi stock rom里面的kernel,启动到recovery时还是黑屏。
[size=large]未知问题[/size]
android linux kernel: http://en.wikipedia.org/wiki/Android_version_history
最好linux的kenel和stock rom里面的一致,这样一些私有库可以直接使用,否则没有办法啊。好消息是[url=https://github.com/CyanogenMod/lge-kernel-mako/blob/jellybean/Makefile]leg linux kernel[/url]用的也是3.4.0的版本,和小米2原生的一样,看来高通这个U用的版本都是一样的。
[url=http://hackaday.com/2013/05/30/giving-the-nexus-4-a-serial-port/]一般手机[/url]都有uart接口,不过小米倒没有找到相关信息。
[size=large]常用命令[/size]
1. Git. 在某个module目录下运行"git status"可以看到代码的check in状态。
[size=large]编译错误[/size]
1. No rule to make target
这是因为libdumpstate.m2这个module没有定义。--->Modify device/xiaomi/m2/dumpstate/Android.mk
2.
https://github.com/CyanogenMod/android_device_lge_mako/blob/cm-10.1/extract-files.sh
https://android.googlesource.com/device/lge/mako/+/master/proprietary-blobs.txt
对比m2,大多数的私有库是一样的。从这里看来,移植应该不难,至少基本的功能应该没问题。因为这些私有库是不需要编译的,而java编译的话问题会很少。
下一步先看看能否使用CM的recovery。
已经有CM 10 for m1:http://www.miui.com/thread-954095-1-1.html
如何[url=http://wiki.cyanogenmod.org/w/Doc:_porting_intro]port CM[/url]
https://github.com/fkpwolf/android_device_xiaomi_m2
device name本来想用aries(定义在/system/build.prop),不过[url=https://github.com/CyanogenMod]CM[/url]上三星有个同名的。
取出recovery.fstab参考[url=http://forum.xda-developers.com/showthread.php?t=633246]这里[/url]的“How to add new devices”章节。如果在linux上面,对于system.img,参考[url=http://forum.xda-developers.com/showthread.php?t=1588461]这里[/url]使用mount,xiaomi的img文件先要转换成raw的img,然后才能用ext4 mount。而对于recovery.img,要用不同方法。参考[url=http://forum.xda-developers.com/showthread.php?t=1590039]这里[/url]。
如何disbale一些功能做最小化编译:https://groups.google.com/d/msg/android-porting/u1rbpdEXqQw/92OUZiSf8wIJ
linux下使用adb连接device:看[url=http://www.linuxidc.com/Linux/2013-01/77625.htm]这里[/url]和[url=http://ubuntuforums.org/showthread.php?t=1918512]这里[/url]。我搞了半天才发现需要一个adb_usb.ini文件。
[size=large]安装Recovery[/size]
做了个很粗糙的otg build,通过miui recovery安装到98%时失败。也不知道是何原因,因为看到log。于是猜想是recovery的原因,于是想自己Build cm recovery。但是即使使用xiaomi stock rom里面的kernel,启动到recovery时还是黑屏。
[size=large]未知问题[/size]
android linux kernel: http://en.wikipedia.org/wiki/Android_version_history
最好linux的kenel和stock rom里面的一致,这样一些私有库可以直接使用,否则没有办法啊。好消息是[url=https://github.com/CyanogenMod/lge-kernel-mako/blob/jellybean/Makefile]leg linux kernel[/url]用的也是3.4.0的版本,和小米2原生的一样,看来高通这个U用的版本都是一样的。
[url=http://hackaday.com/2013/05/30/giving-the-nexus-4-a-serial-port/]一般手机[/url]都有uart接口,不过小米倒没有找到相关信息。
[size=large]常用命令[/size]
1. Git. 在某个module目录下运行"git status"可以看到代码的check in状态。
[size=large]编译错误[/size]
1. No rule to make target
make: *** No rule to make target `/home/fan/android/system/out/target/product/m2/obj/STATIC_LIBRARIES/libdumpstate.m2_intermediates/export_includes', needed by `/home/fan/android/system/out/target/product/m2/obj/EXECUTABLES/dumpstate_intermediates/import_includes'. Stop.
这是因为libdumpstate.m2这个module没有定义。--->Modify device/xiaomi/m2/dumpstate/Android.mk
2.