{"id":1825,"date":"2016-07-19T20:18:16","date_gmt":"2016-07-19T18:18:16","guid":{"rendered":"https:\/\/blog.shade.sh\/?p=1825"},"modified":"2016-09-10T21:54:46","modified_gmt":"2016-09-10T19:54:46","slug":"xiaomi-mi5-cyanogenmod-13","status":"publish","type":"post","link":"https:\/\/blog.shade.sh\/index.php\/archive\/1825","title":{"rendered":"Xiaomi Mi5 Cyanogenmod 13"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-1838\" src=\"https:\/\/blog.shade.sh\/wp-content\/uploads\/2016\/07\/mi5-300x300.jpg\" alt=\"mi5\" width=\"300\" height=\"300\" srcset=\"https:\/\/blog.shade.sh\/wp-content\/uploads\/2016\/07\/mi5-300x300.jpg 300w, https:\/\/blog.shade.sh\/wp-content\/uploads\/2016\/07\/mi5-150x150.jpg 150w, https:\/\/blog.shade.sh\/wp-content\/uploads\/2016\/07\/mi5-144x144.jpg 144w, https:\/\/blog.shade.sh\/wp-content\/uploads\/2016\/07\/mi5.jpg 500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>I got one of this very nice mobiles. Snapdragon 820, 3GB RAM, 32GB Storage and all of this with a tiny pricetag of around 350 Euro (Shopped from <a href=\"http:\/\/www.honorbuy.com\" target=\"_blank\">Honorbuy<\/a>). The only thing i don&#8217;t like is the Miui ROM&#8230;. typical chinese features and a iOS like UI, hey i bought a Android!<\/p>\n<p>So the &#8220;Level Zen&#8221; Developers \ud83d\ude09 from <a href=\"http:\/\/forum.xda-developers.com\/mi-5\/development\/unofficial-private-cyanogenmod-13-builds-t3426349\">XDA<\/a> came together and created the <a href=\"https:\/\/github.com\/Mi5Devs\" target=\"_blank\">Device Tree<\/a> for it &#8211; <del>There is no kernel source released so far, so they have to use the prebuild Xiaomi kernel.<\/del><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Disclamer<\/strong>: I only show you how to use that device tree to build a fully working ROM! If you want to donate, you directly should do it to the developers of the device tree! My programming skills are way to low to contribute code :\/<\/p>\n<p>If you trust me, you can download my daily, weekly or whatever builds (Depends on how often the device tree and \/ or Cyanogenmod gets updates) directly from &gt;\u00a0<a href=\"https:\/\/store.shade.sh\/mi5\/\" target=\"_blank\">here<\/a>\u00a0&lt; and install it via TWRP.<\/p>\n<p>In case somebody wants to build Cyanogenmod 13 for it, keep reading! But before get a fast and large \u00a0(!) cloud instance or bare metal server! It takes ages to compile when you don&#8217;t have a powerful host! I can recommend <a href=\"http:\/\/www.vultr.com\/?ref=6925196-3B\" target=\"_blank\">Vultr<\/a>\u00a0for it. I won&#8217;t cover the Ubuntu installation here, you should already know that.<\/p>\n<ol>\n<li>Do a openssh only installation of Ubuntu 16.04<\/li>\n<li>Login with your created user and let&#8217;s begin!<\/li>\n<\/ol>\n<p><!--more--><\/p>\n<p>First we have to be sure that our Ubuntu is up2date and has all needed packages installed:<\/p>\n<pre class=\"lang:default decode:true \" title=\"Install needed packages\">sudo apt update; apt full-upgrade -y\r\nsudo apt install\u00a0git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven bc -y\r\nsudo add-apt-repository ppa:openjdk-r\/ppa\r\nsudo apt update; sudo apt install openjdk-7-jdk -y\r\nsudo apt remove --purge openjdk-8-jre-headless -y<\/pre>\n<p>Now we can take care about the repository settings:<\/p>\n<pre class=\"lang:default decode:true\" title=\"Repository setup\">mkdir ~\/bin ; wget http:\/\/commondatastorage.googleapis.com\/git-repo-downloads\/repo -O ~\/bin\/repo ; chmod a+x ~\/bin\/repo\r\necho \"export PATH=~\/bin:$PATH\" &gt;&gt; ~\/.bashrc\r\necho \"USE_CCACHE=1\" &gt;&gt; ~\/.bashrc\r\nsource ~\/.bashrc<\/pre>\n<p>Please keep in mind: You&#8217;ll need at least 100GB to do the build process, so please create this directory on a partition with enough space! (Here i create the directory in the users home):<\/p>\n<pre class=\"lang:default decode:true\" title=\"Build Directory\">mkdir ~\/buildenv ; cd\u00a0~\/buildenv<\/pre>\n<p>Now we prepare and sync the Cyanogenmod 13 repository (This take some time, depending on your connection speed):<\/p>\n<pre class=\"lang:default decode:true \" title=\"Cyanogenmod Sync\">repo init -u https:\/\/github.com\/CyanogenMod\/android.git -b cm-13.0\r\nrepo sync<\/pre>\n<p>After the repository is syncronized, we have to implement and sync the device tree:<\/p>\n<pre class=\"lang:default decode:true \" title=\"Device Tree\">mkdir ~\/buildenv\/.repo\/local_manifests\r\nwget https:\/\/raw.githubusercontent.com\/Mi5Devs\/android\/master\/roomservice.xml -O ~\/buildenv\/.repo\/local_manifests\/roomservice.xml\r\nrepo sync<\/pre>\n<p>At this point, you have everything to homebrew your Mi5 rom! Ready?<\/p>\n<pre class=\"lang:default decode:true\" title=\"Build\">source\u00a0build\/envsetup.sh\r\nbrunch cm_gemini-userdebug<\/pre>\n<p>This will take several hours to complete! Get a very large coffee or do a forest walk with your girlfriend, friend, dog, cat or with whatever you usual walk in a forest!<\/p>\n<p>On a 8 Core, 16GB RAM and SSD cloud instance it took:<\/p>\n<h4 class=\"p1\"><span class=\"s1\">#### make completed successfully (02:04:34 (hh:mm:ss)) ####<\/span><\/h4>\n<p class=\"p1\">Then you&#8217;ll find the ROM zipped in the folder:<\/p>\n<p class=\"lang:default decode:true \" title=\"Device Tree\"><em>~\/buildenv\/out\/target\/product\/gemini\/<\/em><\/p>\n<p class=\"p1\">The name of the ZIP file looks like this:\u00a0<em><span class=\"s1\">cm-13.0-20160719-UNOFFICIAL-gemini.zip<\/span><\/em><\/p>\n<p class=\"p1\"><strong>Edit (24.07.2016):<\/strong><\/p>\n<p class=\"p1\">If you have problems with Fingerprint Sensor and be familiar with ADB \/ Fastboot:<\/p>\n<pre class=\"lang:default decode:true \" title=\"Fingerprint Firmware Fix\">adb reboot bootloader\r\nfastboot flash dsp adspso.bin\r\nfastboot flash bluetooth BTFM.bin \r\nfastboot flash cmnlib cmnlib.mbn\r\nfastboot flash cmnlibbak cmnlib.mbn\r\nfastboot flash cmnlib64 cmnlib64.mbn\r\nfastboot flash cmnlib64bak cmnlib64.mbn\r\nfastboot flash devcfg devcfg.mbn\r\nfastboot flash aboot emmc_appsboot.mbn\r\nfastboot flash abootbak emmc_appsboot.mbn\r\nfastboot flash hyp hyp.mbn\r\nfastboot flash hypbak hyp.mbn\r\nfastboot flash keymaster keymaster.mbn\r\nfastboot flash keymasterbak keymaster.mbn\r\nfastboot flash pmic pmic.elf\r\nfastboot flash pmicbak pmic.elf\r\nfastboot flash rpm rpm.mbn\r\nfastboot flash rpmbak rpm.mbn\r\nfastboot flash tz tz.mbn\r\nfastboot flash tzbak tz.mbn\r\nfastboot flash xbl xbl.elf\r\nfastboot reboot<\/pre>\n<p class=\"p1\">If you encounter problems or have suggestions, please leave a nice comment!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got one of this very nice mobiles. Snapdragon 820, 3GB RAM, 32GB Storage and all of this with a tiny pricetag of around 350 Euro (Shopped from Honorbuy). The only thing i don&#8217;t like is the Miui ROM&#8230;. typical &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/blog.shade.sh\/index.php\/archive\/1825\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,49,132,5],"tags":[376,276,382,384,385,383],"class_list":["post-1825","post","type-post","status-publish","format-standard","hentry","category-allgemein","category-android","category-downloads","category-linux","tag-android","tag-build","tag-cyanogenmod","tag-mi5","tag-rom","tag-xiaomi"],"_links":{"self":[{"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/posts\/1825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/comments?post=1825"}],"version-history":[{"count":24,"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/posts\/1825\/revisions"}],"predecessor-version":[{"id":1862,"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/posts\/1825\/revisions\/1862"}],"wp:attachment":[{"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/media?parent=1825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/categories?post=1825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.shade.sh\/index.php\/wp-json\/wp\/v2\/tags?post=1825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}