Background Introduction
In order to break my mystery of Android, I am ready to make a cm rom in person to run on the real machine. Repeatedly read the CM support devices, I can online, the most inexpensive domestic buy, only Xiaomi 2s [0], for this purpose deliberately from the Xiaomi official website set a refurbished standard version.
The hammer under the groove, even despise me, etc., do not let root, do not let install third-party ROM.
About compiling the machine, I used the kind of virtual machine with Azure 3GB memory, a dollar trial version. Now I think I should build the highest-provisioned VM. My i3 notebook can be made up but I can't get the machine stuck in any other job.
About connecting googlesources, buy a foreign VPS bar, or domestic, and then you understand.
The following q&a is a summary of the problems encountered in [0], if you want to toss first to perform the operation it mentioned, here is no longer repeated.
Q: I don't have a real machine, and I can't extract_files on a vps, how do I get a proprietary drive?
A:
Originally I was the official version of the Xiaomi MIUI forum download, missing Diag_klog when extracting, search found [1] mentioned in only.
git clone https://github.com/CyanogenMod/android_device_xiaomi_aries.git device/xiaomi/aries
git clone https://github.com/cyanogenmod/android_kernel_xiaomi_aries kernel/xiaomi/aries
git clone Https://github.com/linuxxxxx/proprietary_vendor_xiaomi vendor/xiaomi/aries
If it is too slow, wget, and notice that the top-level directory is unlocked with multiple files on the line.
Q: Compile acceleration
A: Open the compilation cache, it is best to put the following export to. BASHRC, or re-login to the shell, forgot to set, the previous compilation is in vain.
Export use_ccache=1
Export Ccache_dir=~/disk_c/tmp_aries
Export Out_dir_common_base=~/disk_c/out_aries
./prebuilts/misc/linux-x86/ccache/ccache-m 100G
Set out here for the purpose of separating the source and intermediate results to facilitate switching between different builds [3]
The best source and cache,out are in different partitions, so you can scatter IO and speed up.
(Reference data: Cache is 928MB after successful compilation, Out is 27G)
Parameter "-jn", follow the recommended number of physical threads on cm +2, my VPS is AMD dual core, so take 4,
If the Intel four core, a core can run threads, take 10.
Q: GCC not found.
A: Re-login to the shell after the following envsetup, forget the lunch, just make, then you find the compiled target=generic.
Q:
Make: * * * No rule to make target '/home/azureuser/disk_c/out_aries/xm2s/target/product/aries/obj/static_libraries/ Libinit_msm_intermediates/export_includes ', needed by '/home/azureuser/disk_c/out_aries/xm2s/target/product/aries /obj/executables/init_intermediates/import_includes '. Stop.
A:
I found a temporary solution on the Internet: it says it is not missing this file, we touch one, if written in MK,
Roughly like this:
$ (Shell Touch $ (out)/obj/...)
I don't know which file to add, directly inside the shell.
LIBINIT_MSM.A is missing after continuing the compilation. I don't know what to do if I touch a legitimate. a file.
Suspected multi-threaded compilation, delete hardware directory resynchronization, No.
(Hovering over it, almost spent a day after)
At the end of the code discovery, it is possible to annotate the init by simply commenting it out:
Device/xiaomi/aries/boardconfig.mk
#TARGET_INIT_VENDOR_LIB: = Libinit_msm
Curious to casually look at what is:
Device/xiaomi/aries/init/init_aries.c
Init_msm_properties () Read
/SYS/DEVICES/SYSTEM/SOC/SOC0/RAW_ID,
and set ro.product.model=1812 (MI2S)
<--vendor_load_properties () <--property_service_init_action ()
<--system/core/init/init.c:main ()
experience: Do not worry about mobile phones, boldly add to remove certain modules.
Q: libwebviewchromium.so LD terminated with signal 9
A: Not enough memory. Even if you have 8G of physical memory (because Ld.gold is for Linux 2.6.8?), you need to set the swap partition,
Due to the inconvenience of adding physical partitions on VPS, we use disk files as partitions [6]:
sudo dd if=/dev/zero of=/mnt/10gb.swap bs=1024 count=10485760
sudo chmod 600/mnt/10gb.swap
sudo mkswap/mnt/10gb.swap
sudo swapon/mnt/10gb.swap
On memory issues, I also encountered a strange thing is that the SSH connection is not responding.
Q:Compile
A: I successfully compiled the sequence of instructions, according to this tried again:
Vim ~/.BASHRC export use_ccache=1 export ccache_dir=/mnt/tmp_aries export Out_dir_common_base=/mnt/out_ariessource ~/. BASHRCCD ~/disk_c/xm2ssource build/envsetup.shlunch make-j4--print-directory showcommands | Tee.. /build.log
Todo
Wait for the phone to come, put on the real machine to run.
Ref
[0] Http://wiki.cyanogenmod.org/w/Aries_Info
[1] http://en.miui.com/thread-16834-1-1.html
[2] CM11.0 source code compilation--http://blog.csdn.net/mxgg123/article/details/26269313
[3] CCache--http://blog.cofface.com/archives/78.html#more-78
[4] Https://github.com/razrqcom-dev-team/android_local_razrqcom/issues/1
[5] Http://wiki.cyanogenmod.org/w/Doc:_Using_manifests#The_local_manifest
[6] Signal 9--Http://stackoverflow.com/questions/5682854/why-is-the-linker-terminating-on-me-when-i-build-clang
http://d.hatena.ne.jp/none53/20131128/1385601681
[7] Http://wiki.cyanogenmod.org/w/Doc:_Building_Basics
Several issues encountered in compiling Xiaomi 2s CyanogenMod version