{"id":6167,"date":"2019-10-09T21:16:09","date_gmt":"2019-10-09T19:16:09","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=6167"},"modified":"2019-10-09T09:16:32","modified_gmt":"2019-10-09T07:16:32","slug":"android-is-not-open-source","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2019\/10\/09\/android-is-not-open-source\/","title":{"rendered":"Android is NOT open source"},"content":{"rendered":"<h2>Now I know I&#8217;ve done <em><strong>the-right-thing <\/strong><\/em>supporting Librem5.<\/h2>\n<p>I knew that almost all phones comes with a proprietary OS, either the prison-ware iOS or proprietary derivative of Android. Yet I wasn&#8217;t aware that the situation is <strong>SO<\/strong> bad. Read this.<\/p>\n<h1><a href=\"https:\/\/medium.com\/@quantvc\/android-is-not-open-source-fa76f880fdba\"><img decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/miro.medium.com\/max\/656\/0*rXeu_I4X1kbBfGxb\" alt=\"\" \/><\/a><a href=\"https:\/\/quantifiedvc.wordpress.com\/2016\/08\/27\/android-is-not-open-source\/\">Android<\/a><em><a href=\"https:\/\/quantifiedvc.wordpress.com\/2016\/08\/27\/android-is-not-open-source\/\"> is not open source &#8211; The Quantified VC &#8211; Medium<\/a><\/em><\/h1>\n<p>&nbsp;<\/p>\n<p><!--more--><\/p>\n<p>Now there are some real issues these days:<\/p>\n<ol>\n<li>there are so many applications available &#8220;for Android&#8221; that non-tech people will want on their hardware,<\/li>\n<li>most of them are sadly proprietary,<\/li>\n<li>almost all proprietary are available only on Google Play store<\/li>\n<li>some of those proprietary, available only throught proprietary store is almost mandatory to access some facilities such as most European home-banking<\/li>\n<\/ol>\n<p>Now free-as-in-freedom Android application can be found on the net or conviently on <a href=\"https:\/\/f-droid.org\/\">F-Droid<\/a> while access to &#8220;apps&#8221; (how I dislike this abbreviation!) can be &#8220;extracted&#8221; using <a href=\"https:\/\/f-droid.org\/it\/packages\/com.aurora.store\/\">Aurora Store<\/a>. Sadly:<\/p>\n<blockquote><p>Using Aurora <span class=\"vm-hook-outer vm-hook-default\"><span class=\"vm-hook\">Store<\/span><\/span> with your own Google account may cause your account to be blacklisted, use at your own risk.<\/p><\/blockquote>\n<p>So this is not a long-term solution. A more long-term way to handle this issue is <a href=\"https:\/\/microg.org\/\">microg.org<\/a> &#8220;A free-as-in-freedom re-implementation of Google\u2019s proprietary Android user space apps and libraries.&#8221;<\/p>\n<p>But this is not a solution. It is a work-around. A solution would to have free-as-in-freedom software. I fear that their inofficial Google PlayStore Client,\u00a0<a class=\"d-inline-block\" href=\"https:\/\/github.com\/microg\/Phonesky\" data-hovercard-type=\"repository\" data-hovercard-url=\"\/microg\/Phonesky\/hovercard\">Phonesky<\/a> will be blacklistable as Aurora.<\/p>\n<p><!--nextpage--><\/p>\n<blockquote>\n<div>\n<div id=\"5a3c\" class=\"is it fa bh iu b iv iw ix iy iz ja jb\">\n<h1 class=\"iu b iv jc fa\">Android is not open source<\/h1>\n<\/div>\n<\/div>\n<div id=\"576c\" class=\"jd it bl bh bg dl je jf jg jh ji jj jk\">\n<h2 class=\"bg dl jl jm bl\">Cutting through Google\u2019s marketing speak and seeking the truth<\/h2>\n<\/div>\n<div class=\"jn\">\n<div class=\"ah v\">\n<div><a href=\"https:\/\/medium.com\/@quantvc?source=post_page-----fa76f880fdba----------------------\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"l ee jo jp\" src=\"https:\/\/i0.wp.com\/miro.medium.com\/fit\/c\/96\/96\/2%2AIIjKQ-4FNjYDwitRK_WQJQ.jpeg?resize=48%2C48&#038;ssl=1\" alt=\"The Quantified VC\" width=\"48\" height=\"48\" \/><\/a><\/div>\n<div class=\"jq af l\">\n<div class=\"v\">\n<div>\n<div class=\"jr v ah js\">\n<p><span class=\"bg dl dm bi jt ju jv jw jx jy fa\"><a class=\"aq ar as at au av aw ax ay az ii bc bd be bf\" href=\"https:\/\/medium.com\/@quantvc?source=post_page-----fa76f880fdba----------------------\" rel=\"noopener\">The Quantified VC<\/a><\/span><\/p>\n<div class=\"jz l ap h\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"jn\">\n<div class=\"ah v\">\n<div class=\"jq af l\">\n<div><a class=\"aq ar as at au av aw ax ay az ii bc bd be bf\" href=\"https:\/\/medium.com\/@quantvc\/android-is-not-open-source-fa76f880fdba?source=post_page-----fa76f880fdba----------------------\" rel=\"noopener\">Aug 27, 2016<\/a> \u00b7 5 min read<\/div>\n<\/div>\n<\/div>\n<\/div>\n<figure class=\"kd ke kf kg kh do ci cj paragraph-image\">\n<div class=\"ci cj kc\">\n<div class=\"kl l cy km\">\n<div class=\"kn l\"><img loading=\"lazy\" decoding=\"async\" class=\"mo mp ey n o ex af ev\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/max\/803\/0*rXeu_I4X1kbBfGxb\" alt=\"\" width=\"656\" height=\"438\" \/><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"6625\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">I\u2019m getting tired of hearing people claim that Android is open-source. The Android Open Source Project (AOSP) isn\u2019t what ships on most Android devices and can\u2019t be built <em class=\"lf\">unmodified<\/em>. Most Android devices are not even shipping an OS that AOSP has the sources for internally. Android has become some proprietary OS that passes Android Compatibility Test Suite (CTS).<\/p>\n<p id=\"7c87\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">AOSP code still depends on Qualcomm build utilities which are not provided by the AOSP source tree. Without them, certain functionality ends up missing. The missing Qualcomm code is in many cases open source as part of CAF (a custom Linux kernel branch optimized for Snapdragon phones). Google DOES have a bunch of proprietary Qualcomm code in their internal tree, but takes the easy route of removing it all when converting from the internal tree to AOSP.<\/p>\n<blockquote class=\"lg\">\n<div id=\"b4cb\" class=\"lh li gm bh iu b jl lj lk ll lm ln le\" data-selectable-paragraph=\"\">\n<p class=\"iu b lo lp bl\">The \u201copen source\u201d Android codebase depends on proprietary applications. Android source is almost entirely per-device code.<\/p>\n<\/div>\n<div id=\"aaff\" class=\"lh li gm bh iu b jl lq lr ls lt lu le\" data-selectable-paragraph=\"\">\n<p class=\"iu b lo lp bl\">In theory, AOSP could run on open hardware without this nonsense. It becomes a huge problem when it\u2019s not possible to build for the non-open hardware, since that open hardware does not exist yet.<\/p>\n<\/div>\n<\/blockquote>\n<p id=\"05dd\" class=\"kr ks fa bh kt b ku lv kw lw ky lx la ly lc lz le\" data-selectable-paragraph=\"\">In 6.0 Marshmallow, it was possible to make an incomplete build of the Android Open Source Project for Nexus 5X and 6P with missing blobs. It\u2019s apparently not even possible to get that far with AOSP in 7.0 Nougat, since Google open-sourced something without providing the dependencies. It\u2019s no longer possible to do an incomplete build without setting up binary blobs (which they don\u2019t offer now), since `<em class=\"lf\">device\/huawei\/angler\/location<\/em>` and `<em class=\"lf\">device\/lge\/bullhead\/location<\/em>` depend on a having the blob build system. Either way, you need blobs simply to boot, but can get away with unmodified `<em class=\"lf\">vendor.img<\/em>` by not having verified boot.<\/p>\n<p id=\"928e\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">Google added <a class=\"aq cd ma mb mc md\" href=\"https:\/\/android.googlesource.com\/device\/lge\/bullhead\/+\/android-7.0.0_r1\/location\/loc_api\/loc_api_v02\/Android.mk\" target=\"_blank\" rel=\"noopener noreferrer\">this code<\/a> to the source tree of Nexus 5X without providing the dependencies, so the `<em class=\"lf\">aosp_bullhead<\/em>` target simply doesn\u2019t work at all. The same applies to the other Nexus devices. This code can simply be removed and bundled as a blob, but it demonstrates that Google hasn\u2019t even built AOSP 7.0 for its Nexus devices.<\/p>\n<p id=\"1d29\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">The AOSP codebase is much, much worse than it used to be. It all started going downhill with the <a class=\"aq cd ma mb mc md\" href=\"https:\/\/en.wikipedia.org\/wiki\/Nexus_9\" target=\"_blank\" rel=\"noopener noreferrer\">Nexus 9<\/a>. Google\u2019s pre-optimized proprietary apps are a massive roadblock. A Google engineer could easily fix that for Nexus devices, but instead Google has chosen to prevent binary releases and make dependencies unavailable in the source code. It doesn\u2019t seem like anyone at Google works on AOSP anymore \u2014 it has become just an afterthought.<\/p>\n<p id=\"8214\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">You pretty much have to reverse engineer the <em class=\"lf\">.dex<\/em> files from the optimized code. Copy binaries from the factory images, like CyanogenMod does. Google stopped shipping proper apks with <em class=\"lf\">classes.dex<\/em> some time ago, though. You now get only oat files. You can do a <a class=\"aq cd ma mb mc md\" href=\"https:\/\/github.com\/anestisb\/android-prepare-vendor\" target=\"_blank\" rel=\"noopener noreferrer\">giant hack<\/a> and convert the .oat files back into .dex files. Yet it doesn\u2019t fully work. The new version of Android changes the formats of these files, so that mostly working workaround is gone for now.<\/p>\n<p id=\"0561\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">This <a class=\"aq cd ma mb mc md\" href=\"https:\/\/android.googlesource.com\/device\/huawei\/angler\/+\/df11231524df233ed3c7284174f852e4a4486023%5E!\/\" target=\"_blank\" rel=\"noopener noreferrer\">commit<\/a> gives the impression that Google delayed the release of factory images and OTA updates for 7.0 Nougat on Nexus 6P because it couldn\u2019t play 480p video properly.<\/p>\n<p id=\"58d1\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">The 6P release moves a lot of blobs from system to vendor unlike the 5X release. One of the problems is that the vendor partition is likely too small, i.e. they didn\u2019t account for the required growth of the vendor partition since they started with half of the blobs in system. It likely won\u2019t all fit. Regardless, the vendor partition has to be reassembled to make a proper build with functional verified boot among other issues without it.<\/p>\n<p id=\"a51e\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">The intended purpose appears to be allowing AOSP builds to bundle a `<em class=\"lf\">vendor.img<\/em>` and ship it as is, but that\u2019s broken. So what is the point?<\/p>\n<p id=\"720a\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">The one nice thing about the vendor partition is that every blob on there needs to be included. For system, a list has to be built by hand choosing them. It also ends up fixing the oat issue on a case-by-case basis, but it would need to be fixed in all cases to avoid needing a tool to reverse engineer dex.<\/p>\n<p id=\"4f0b\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">AOSP 7.0 really only has support for a single device right now: Google\u2019s own Pixel C tablet, powered by the NVIDIA Tegra X1 processor. Building for anything else requires unofficial modifications. Google\u2019s `<em class=\"lf\">vendor.img<\/em>` shell game doesn\u2019t work. They can\u2019t move apps needing platform key signatures there; not regenerating that `<em class=\"lf\">vendor.img<\/em>` is broken, with verified boot being the main issue. Open-source components now depend on the unpublished build system used to make the proprietary blobs. It\u2019s still not possible to update the Nexus 5X bootloader without using the update-binary from stock OTA firmware due to a proprietary LG library.<\/p>\n<p id=\"0633\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">On the Pixel C Android tablet, Google decided to use the open-source <a class=\"aq cd ma mb mc md\" href=\"http:\/\/www.phoronix.com\/scan.php?page=news_item&amp;px=Nouveau-Pixel-C-Default\" target=\"_blank\" rel=\"noopener noreferrer\">Nouveau DRM kernel driver<\/a> by default for this ARM device powered by NVIDIA\u2019s Tegra X1 SoC. Nouveau has terrible performance on Linux systems, just FYI.<\/p>\n<p id=\"e1ce\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">What\u2019s surprising is that NVIDIA is actually once of the leaders when it comes to mainlining code for their mobile platform (Tegra). Isn\u2019t that a bit disturbing?<\/p>\n<p id=\"4b8f\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">The Android kernel drivers are primarily open-source at this point, but few vendors try to land the code upstream. So they have 2\u20133 million of lines of code for their platform out-of-tree for a specific kernel version, with no hope of a mainline kernel ever being used. Users may receive security updates, but don\u2019t hope for more than 2\u20133 years of updates since the kernels age poorly.<\/p>\n<p id=\"185d\" class=\"kr ks fa bh kt b ku kv kw kx ky kz la lb lc ld le\" data-selectable-paragraph=\"\">TLDR: Although the Android platform is advertised as \u201copen source,\u201d Android hardware makers can lock down the devices and prevent users from modifying the software \u2014 and they do \u2014 while carriers can have complete control over user experience.<\/p>\n<\/blockquote>\n<p data-selectable-paragraph=\"\"><!--nextpage--><\/p>\n<blockquote>\n<div>\n<div id=\"2681\" class=\"jf jg an bv jh b ji jj jk jl jm jn jo\">\n<h1 class=\"jh b ji jp an\"><a href=\"https:\/\/medium.com\/@quantvc\/running-debian-on-android-device-natively-73545c9b0757\">Running Debian Linux on Android device natively<\/a><\/h1>\n<\/div>\n<\/div>\n<div id=\"0f70\" class=\"jq jg bz bv bu dz jr js jt ju jv jw jx\">\n<h2 class=\"bu dz jy jz bz\">No, not <code class=\"\" data-line=\"\">chroot<\/code>, but like a matrix.<\/h2>\n<\/div>\n<div class=\"kf\">\n<div class=\"ah v\">\n<div class=\"kj v ah kk\"><a href=\"https:\/\/medium.com\/@quantvc?source=post_page-----73545c9b0757----------------------\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"l es kg kh\" src=\"https:\/\/i0.wp.com\/miro.medium.com\/fit\/c\/59\/59\/2%2AIIjKQ-4FNjYDwitRK_WQJQ.jpeg?resize=48%2C48&#038;ssl=1\" alt=\"The Quantified VC\" width=\"48\" height=\"48\" \/><\/a><span class=\"bu dz ea bw at kl km aq ar as an\"><a class=\"be bf bg bh bi bj bk bl bm bn iv bq br bs bt\" href=\"https:\/\/medium.com\/@quantvc?source=post_page-----73545c9b0757----------------------\" rel=\"noopener\">The Quantified VC<\/a><\/span><\/div>\n<\/div>\n<\/div>\n<section class=\"iz ja jb jc jd\">\n<div class=\"cp je af cy cu cv\">\n<div class=\"kf\">\n<div class=\"ah v\">\n<div class=\"ki af l\">\n<div><a class=\"be bf bg bh bi bj bk bl bm bn iv bq br bs bt\" href=\"https:\/\/medium.com\/@quantvc\/running-debian-on-android-device-natively-73545c9b0757?source=post_page-----73545c9b0757----------------------\" rel=\"noopener\">Sep 12, 2016<\/a> \u00b7 17 min read<\/div>\n<\/div>\n<\/div>\n<\/div>\n<figure class=\"kr ks kt ku kv ec cw cx paragraph-image\">\n<div class=\"kw kx dm ky af\">\n<div class=\"cw cx kq\">\n<div class=\"lc l dm ka\">\n<div class=\"ld l\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"6168\" data-permalink=\"https:\/\/monodes.com\/predaelli\/2019\/10\/09\/android-is-not-open-source\/x3mo7r1b52bi_whua_ylxq\/\" data-orig-file=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2019\/10\/x3mo7R1b52BI_whuA_YLXQ.png?fit=953%2C939&amp;ssl=1\" data-orig-size=\"953,939\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"x3mo7R1b52BI_whuA_YLXQ\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2019\/10\/x3mo7R1b52BI_whuA_YLXQ.png?fit=300%2C296&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2019\/10\/x3mo7R1b52BI_whuA_YLXQ.png?fit=510%2C503&amp;ssl=1\" class=\"alignleft size-full wp-image-6168\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2019\/10\/x3mo7R1b52BI_whuA_YLXQ-1.png?resize=910%2C897&#038;ssl=1\" alt=\"\" width=\"910\" height=\"897\" \/><\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"bz ea lh li he cy cw cx lj lk bu dz\" data-selectable-paragraph=\"\">Debian running natively atop Android, the Matrix Way.<\/figcaption><\/figure>\n<p id=\"1730\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Last year I picked up a decent mid-end and relatively <a class=\"be cr lz ma mb mc\" href=\"https:\/\/medium.com\/@quantvc\/android-is-not-open-source-fa76f880fdba\" target=\"_blank\" rel=\"noopener noreferrer\">\u201copen<\/a>\u201d LG Optimus phone while I was in Florida. I rooted it, installed a custom ROM with the latest security patch level, hardened it in every feasible way, and kept it as FLOSS as possible. It worked out great for my needs and traveled with me quite a bit. A few weeks ago, I got a new OnePlus One and decided to turn the LG phone into a development device \/ playdough.<\/p>\n<p id=\"ed3d\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">\u201cWhy don\u2019t I turn this phone into a full-blown Linux server and run web services on it as if it were a Raspberry Pi?\u201d The thought kept popping into my head. So I spent much of the first week of September investigating the possibilities.<\/p>\n<p id=\"4db9\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">There are numerous tutorials on how to run a Linux OS in a <em class=\"md\">chroot<\/em> environment on an Android device, and there are countless apps (e.g., Servers Ultimate, PAW Server) which allow you to run web servers (e.g., VNC, VPN, SIP, FTP, proxy) directly from an Android device. However, I wanted a real full-blown Linux server (e.g., Debian) running seamlessly on my Android phone, where I could access the Android OS from Debian without restrictions and at the same time make no modifications to the Android system itself.<\/p>\n<p id=\"571f\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">I was thinking that perhaps I could implement a new <code class=\"\" data-line=\"\">init<\/code> procedure mounting a new root file system at boot, which then transfers control to the Android <code class=\"\" data-line=\"\">&lt;em class=&quot;md&quot;&gt;init&lt;\/em&gt;<\/code> in a <code class=\"\" data-line=\"\">chroot<\/code> environment.<\/p>\n<p id=\"e5d7\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">The advantages of this approach over the others:<\/p>\n<ul class=\"\">\n<li id=\"dd83\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly me mf mg\" data-selectable-paragraph=\"\">Full Debian installation with lots of <code class=\"\" data-line=\"\">apt-get<\/code>-able packages<\/li>\n<li id=\"5ac8\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Full control of the Android environment from Debian<\/li>\n<li id=\"089d\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Simultaneous use of Debian and Android<\/li>\n<li id=\"120c\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Access the Android file system from my desktop via SSH\/SFTP<\/li>\n<li id=\"74cf\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">No need to unmount\/remount the SD card; simply access it via SSH\/SFTP<\/li>\n<li id=\"6ba6\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Easy to backup both the Android and the Debian systems<\/li>\n<li id=\"3e65\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Android system remains untouched and unaware of any modifications<\/li>\n<li id=\"cbce\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Android root file system is no longer volatile; edits are kept between reboots<\/li>\n<li id=\"df13\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Critical file systems could be kept on SD card for easy access in case of major mess-up<\/li>\n<li id=\"1b3d\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Graphic X11 user interface, on both client and server, local and remote, natively, over SSH or VNC<\/li>\n<li id=\"fc65\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Zero performance impact<\/li>\n<li id=\"59e4\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Easy to modify the Android ROM selectively, without the need to reflash the entire device<\/li>\n<li id=\"e35e\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">Manage the Android device just like any other Linux system<\/li>\n<\/ul>\n<\/div>\n<\/section>\n<hr class=\"mm dz gg mn mo he mp mq mr ms mt\" \/>\n<section class=\"iz ja jb jc jd\">\n<div class=\"cp je af cy cu cv\">\n<p id=\"de3d\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Below are my notes on this project.<\/p>\n<h1 id=\"09b2\" class=\"mu mv an bv bu gf mw mx my mz na nb nc nd ne nf ng\" data-selectable-paragraph=\"\">Hardware<\/h1>\n<h2 id=\"7703\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">Device:<\/h2>\n<p id=\"def4\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">LG Optimus L90 D415 w7 (T-Mobile)<\/p>\n<h2 id=\"c2ab\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\"><strong class=\"bk\">Condition<\/strong>:<\/h2>\n<ul class=\"\">\n<li id=\"51e2\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly me mf mg\" data-selectable-paragraph=\"\">rooted<\/li>\n<li id=\"a36d\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">bootloader unlocked<\/li>\n<\/ul>\n<h2 id=\"c192\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\"><strong class=\"bk\">CPU<\/strong>:<\/h2>\n<p id=\"4b09\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">Qualcomm Snapdragon 400 MSM8226 (Snapdragon S4)<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"4189\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">~ # uname -a<\/span><span id=\"c518\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Linux localhost 3.4.1-AeroKernel+ #1 SMP PREEMPT Tue Oct 21 20:19:09 EDT 2014 armv7l GNU\/Linux<\/span><span id=\"0bbc\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">~ # cat \/proc\/cpuinfo<\/span><span id=\"ff2c\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Processor : ARMv7 Processor rev 3 (v7l)<\/span><span id=\"841d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">processor : 0<\/span><span id=\"646c\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">BogoMIPS : 38.40<\/span><span id=\"41a7\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">processor : 1<\/span><span id=\"9564\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">BogoMIPS : 38.40<\/span><span id=\"d400\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">processor : 2<\/span><span id=\"fbbd\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">BogoMIPS : 38.40<\/span><span id=\"66fb\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">processor : 3<\/span><span id=\"78d4\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">BogoMIPS : 38.40<\/span><span id=\"451e\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt<\/span><span id=\"ffd6\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">CPU implementer : 0x41<\/span><span id=\"33b1\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">CPU architecture: 7<\/span><span id=\"f1c4\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">CPU variant : 0x0<\/span><span id=\"0d6c\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">CPU part : 0xc07<\/span><span id=\"6228\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">CPU revision : 3<\/span><span id=\"d65c\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Hardware : Qualcomm MSM 8226 (Flattened Device Tree)<\/span><span id=\"a2c9\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Revision : 0006<\/span><span id=\"c30d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Serial : 0000000000000000<\/span><\/pre>\n<\/div>\n<\/section>\n<hr class=\"mm dz gg mn mo he mp mq mr ms mt\" \/>\n<section class=\"iz ja jb jc jd\">\n<div class=\"cp je af cy cu cv\">\n<h1 id=\"8742\" class=\"mu mv an bv bu gf mw oh my oi na oj nc ok ne ol ng\" data-selectable-paragraph=\"\">Steps<\/h1>\n<h2 id=\"b49f\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">1. Partition SD Card<\/h2>\n<p id=\"d79a\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">On my Linux desktop, I will partition an SD card (at least 8GB) into two:<\/p>\n<ul class=\"\">\n<li id=\"6115\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly me mf mg\" data-selectable-paragraph=\"\">one FAT partition, and<\/li>\n<li id=\"6024\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\">one <code class=\"\" data-line=\"\">ext3\/ext4<\/code> partition for Linux.<\/li>\n<\/ul>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"7c17\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\"># fdisk -cu \/dev\/sdc # mkfs -t vfat \/dev\/sdc1 <\/span><span id=\"d809\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># mkfs -t ext4 \/dev\/sdc2<\/span><\/pre>\n<h2 id=\"70fd\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">2. Create a new initramfs and boot image<\/h2>\n<p id=\"d011\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">Replace the <code class=\"\" data-line=\"\">initramfs<\/code> shipped with the Android device with your own modified. Then use an <code class=\"\" data-line=\"\">init<\/code> to mount a new root file system from the SD card\u2019s Linux partition and transfer control to this.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"0c73\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ adb shell shell@w7:\/ <\/span><span id=\"ace3\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ mount \n...<\/span><span id=\"92eb\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/dev\/block\/vold\/public:179_65 on \/mnt\/media_rw\/F409-DD80 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)<\/span><span id=\"4251\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">...\n\/dev\/block\/vold\/public:179_66 on \/mnt\/media_rw\/e0c17d6f-efcd-47eb-9f4e-bc5530f76269 type ext4 (rw,dirsync,context=u:object_r:sdcard_posix:s0,nosuid,nodev,noatime,data=ordered)\n...<\/span><span id=\"d591\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">shell@w7:\/ $ ls -la \/dev\/block <\/span><span id=\"b632\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">...\nbrw------- 1 root root 179, 64 1970-02-14 03:33 mmcblk1 \nbrw------- 1 root root 179, 65 1970-02-14 03:33 mmcblk1p1 \nbrw------- 1 root root 179, 66 1970-02-14 03:33 mmcblk1p2\n...<\/span><\/pre>\n<p id=\"ae9a\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Here on the LG L90, the FAT partition <code class=\"\" data-line=\"\">\/mnt\/media_rw\/F409-DD80<\/code> is device <code class=\"\" data-line=\"\">179_65<\/code>, so the next partition must be <code class=\"\" data-line=\"\">179_66<\/code> and it\u2019s named <code class=\"\" data-line=\"\">mmcblk1p2<\/code>.<\/p>\n<p id=\"79e9\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Here is an example of the <code class=\"\" data-line=\"\">\/init<\/code> in my new <code class=\"\" data-line=\"\">initramfs<\/code> file system. It must be named <code class=\"\" data-line=\"\">\/init<\/code> because this is hard-coded into the Android kernel to execute on boot.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"155f\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">#!\/sbin\/busybox sh<\/span><span id=\"f742\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># initramfs pre-boot init script<\/span><span id=\"bd9a\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Mount the \/proc and \/sys filesystems<\/span><span id=\"85a9\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -t proc none \/proc<\/span><span id=\"9caf\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -t sysfs none \/sys<\/span><span id=\"5774\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -t tmpfs none \/dev<\/span><span id=\"ba49\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Something (what?) needs a few cycles here<\/span><span id=\"ec16\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox sleep 1<\/span><span id=\"4eaa\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Populate \/dev<\/span><span id=\"c1cc\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mdev -s<\/span><span id=\"4c05\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Mount the root filesystem, second partition on micro SDcard<\/span><span id=\"d140\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -t ext4 -o noatime,nodiratime,errors=panic \/dev\/mmcblk1p2 \/mnt\/root<\/span><span id=\"07a8\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Clean up<\/span><span id=\"651a\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox umount \/proc<\/span><span id=\"0473\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox umount \/sys<\/span><span id=\"5894\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox umount \/dev<\/span><span id=\"f0a4\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Transfer root to SDcard<\/span><span id=\"ce20\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">exec \/sbin\/busybox switch_root \/mnt\/root \/etc\/init<\/span><\/pre>\n<p id=\"ae31\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">This <code class=\"\" data-line=\"\">initramfs<\/code> has a very minimalist filesystem and only contains the <code class=\"\" data-line=\"\">\/sbin\/busybox<\/code> and the mount points <code class=\"\" data-line=\"\">\/proc<\/code>, <code class=\"\" data-line=\"\">\/sys<\/code>, <code class=\"\" data-line=\"\">\/dev<\/code> and <code class=\"\" data-line=\"\">\/mnt\/root<\/code>. To be on the safe side, you can use the original <code class=\"\" data-line=\"\">initramfs<\/code> and just add <code class=\"\" data-line=\"\">\/sbin\/busybox<\/code> and a mount point <code class=\"\" data-line=\"\">\/mnt\/root<\/code>, and replace <code class=\"\" data-line=\"\">init<\/code> with the script above. You can download pre-compiled busybox <a class=\"be cr lz ma mb mc\" href=\"https:\/\/busybox.net\/downloads\/binaries\/latest\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> or elsewhere on the Internet.<\/p>\n<p id=\"8cdd\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">We\u2019ll need the system\u2019s base address, i.e. where the RAM begins. To get it from your original kernel <code class=\"\" data-line=\"\">zImage<\/code>, check for <code class=\"\" data-line=\"\">\/proc\/config.gz<\/code> in your running kernel or use the <code class=\"\" data-line=\"\">extract-ikconfig<\/code> script on the kernel binary. If neither exists \/ applies, try looking for \u201cSystem RAM\u201d in <code class=\"\" data-line=\"\">\/proc\/iomem<\/code> on the Android device for a clue of the base address.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"bc9b\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # cat \/proc\/iomem <\/span><span id=\"ae10\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">00000000-083fffff : System RAM \n    00008000-0108c71b : Kernel code \n    0120c000-014fd9eb : Kernel data \n0c400000-0d1fffff : System RAM \n0f500000-0f9fffff : System RAM \n0ff00000-3f7fffff : System RAM<\/span><\/pre>\n<p id=\"f7c7\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Here, the base address is <code class=\"\" data-line=\"\">00000000<\/code>.<\/p>\n<p id=\"80de\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Now, create the new boot image. I will get the original boot image for this phone and modify it. First, get the CM13 ROM for L90w7 and unzip the image. Then grab the <code class=\"\" data-line=\"\">unmkbootimg<\/code> tool which helps you unpack the boot image.<\/p>\n<p id=\"2250\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">On the desktop, run<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"84b0\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ wget <a class=\"be cr lz ma mb mc\" href=\"http:\/\/whiteboard.ping.se\/uploads\/Android\/unmkbootimg.gz\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/whiteboard.ping.se\/uploads\/Android\/unmkbootimg.gz<\/a> <\/span><span id=\"15fa\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ gunzip unmkbootimg.gz<\/span><\/pre>\n<p id=\"d5b1\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Next, place <code class=\"\" data-line=\"\">unmkbootimg<\/code> in the same directory as the unzipped CM13 image. To unpack the boot image:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"4e90\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">.\/unmkbootimg boot.img<\/span><span id=\"bbd9\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">unmkbootimg version 1.2 - Mikael Q Kuisma &lt;kuisma@ping.se&gt;<\/span><span id=\"aecd\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Kernel size 8019648<\/span><span id=\"6ec0\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Kernel address 0x8000<\/span><span id=\"8def\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Ramdisk size 872992<\/span><span id=\"c942\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Ramdisk address 0x1000000<\/span><span id=\"8802\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Secondary size 0<\/span><span id=\"0aa4\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Secondary address 0xf00000<\/span><span id=\"b853\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Kernel tags address 0x100<\/span><span id=\"7360\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Flash page size 2048<\/span><span id=\"28c9\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Board name is \"\"<\/span><span id=\"7e42\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Command line \"console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 user_debug=31 msm_rtb.filter=0x37 androidboot.hardware=qcom androidboot.selinux=enforcing\"<\/span><span id=\"ce09\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">This image is built using standard mkbootimg<\/span><span id=\"5de6\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Extracting kernel to file zImage ...<\/span><span id=\"1cc5\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Extracting root filesystem to file initramfs.cpio.gz ...<\/span><span id=\"5905\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">All done.<\/span><span id=\"9b15\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">---------------<\/span><span id=\"dde0\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">To recompile this image, use:<\/span><span id=\"6afa\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x0 --cmdline 'console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 user_debug=31 msm_rtb.filter=0x37 androidboot.hardware=qcom androidboot.selinux=enforcing' -o new_boot.img<\/span><span id=\"016d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">---------------<\/span><\/pre>\n<p id=\"d6ae\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Make a new <code class=\"\" data-line=\"\">initramfs<\/code> directory:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"6ea3\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ mkdir initramfs &amp;&amp; cd initramfs<\/span><\/pre>\n<p id=\"d923\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Unpack the contents of the ramdisk (un-gzip it and then un-cpio it) into the new <code class=\"\" data-line=\"\">initramfs<\/code> directory<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"8dbd\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ gzip -cd ..\/initramfs.cpio.gz | cpio -i<\/span><\/pre>\n<p id=\"083c\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">This will place all of the files from the ramdisk in your current working directory. Now you can alter <code class=\"\" data-line=\"\">init<\/code> as discussed above.<\/p>\n<p id=\"3a06\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Re-create the ramdisk. Re-<code class=\"\" data-line=\"\">cpio<\/code> and then re-gzip these files. Remember, <code class=\"\" data-line=\"\">cpio<\/code> will include everything in the current working directory, so you probably want to remove any other cruft you might have in there.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"2dae\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ find . | cpio --quiet -H newc -o | gzip &gt; ..\/initramfs.cpio.gz<\/span><span id=\"a3f4\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ cd ..<\/span><\/pre>\n<p id=\"0b53\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Clean the directory so that only <code class=\"\" data-line=\"\">initramfs.cpio.gz<\/code> and <code class=\"\" data-line=\"\">zImage<\/code> remain. There\u2019s no official tool to split the image, but it\u2019s quite trivial and lots of scripts available to do this. The image is basically just a concatenation of the kernel <code class=\"\" data-line=\"\">zImage<\/code> and <code class=\"\" data-line=\"\">initramfs.cpio.gz<\/code>.<\/p>\n<p id=\"9284\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Combine the kernel and your new ramdisk into the full image, using the Android OS build kit <code class=\"\" data-line=\"\">mkbootimg<\/code> which can be found pre-compiled at various site. Alternatively, you can compile it from source as follow:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"cbb7\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ cd \/path\/to\/android-src<\/span><span id=\"6a14\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ cd system\/core\/libmincrypt\/<\/span><span id=\"74ad\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ gcc -c *.c -I..\/include<\/span><span id=\"bcc6\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ ar rcs libmincrypt.a *.o<\/span><span id=\"56c0\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ cd ..\/mkbootimg<\/span><span id=\"c0b8\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ ls -la<\/span><span id=\"dfba\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">total 36<\/span><span id=\"a2cf\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">drwxrwxr-x 2 abc abc 4096 Sep 7 16:51 .<\/span><span id=\"1967\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">drwxrwxr-x 45 abc abc 4096 Sep 7 16:51 ..<\/span><span id=\"b7ce\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 1186 Sep 7 16:51 Android.mk<\/span><span id=\"d8d4\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 3266 Sep 7 16:51 bootimg.h<\/span><span id=\"4baf\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 9507 Sep 7 16:51 mkbootimg.c<\/span><span id=\"d480\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 6379 Sep 7 16:51 unpackbootimg.c<\/span><span id=\"a44d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ gcc mkbootimg.c -o mkbootimg -I..\/include ..\/libmincrypt\/libmincrypt.a<\/span><span id=\"189e\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ cd ..\/cpio<\/span><span id=\"d2ed\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ $ ls -la<\/span><span id=\"cc54\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">total 24<\/span><span id=\"7ad8\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">drwxrwxr-x 2 abc abc 4096 Sep 7 16:51 .<\/span><span id=\"ea24\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">drwxrwxr-x 45 abc abc 4096 Sep 7 16:51 ..<\/span><span id=\"9704\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 313 Sep 7 16:51 Android.mk<\/span><span id=\"4ee1\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 8946 Sep 7 16:51 mkbootfs.c<\/span><span id=\"2003\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ gcc mkbootfs.c -o mkbootfs -I..\/include<\/span><\/pre>\n<p id=\"917b\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Now copy <code class=\"\" data-line=\"\">system\/core\/mkbootimg\/mkbootimg<\/code> and <code class=\"\" data-line=\"\">system\/core\/cpio\/mkbootfs <\/code>to a directory in your path (e.g., <code class=\"\" data-line=\"\">~\/bin<\/code>). After the compilation, you should see only 3 files in the current working directory:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"bcb2\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ ls -la<\/span><span id=\"9dad\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">total 17876<\/span><span id=\"d107\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">drwxrwxr-x 2 abc abc 4096 Sep 7 17:41 .<\/span><span id=\"91e5\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">drwxr-xr-x 5 abc abc 4096 Sep 7 17:40 ..<\/span><span id=\"0225\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 1125169 Sep 7 17:39 initramfs.cpio.gz<\/span><span id=\"8f49\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-r--r-- 1 abc abc 9148416 Sep 7 17:41 my-boot.img<\/span><span id=\"20f8\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">-rw-rw-r-- 1 abc abc 8019648 Sep 7 13:42 zImage<\/span><\/pre>\n<p id=\"c9c2\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Finally, you can make the new boot image<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"5d90\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x0 --cmdline 'console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 user_debug=31 msm_rtb.filter=0x37 androidboot.hardware=qcom androidboot.selinux=enforcing' -o my-boot.img<\/span><\/pre>\n<p id=\"9d9d\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">The kernel <code class=\"\" data-line=\"\">zImage<\/code> is your original kernel. Now sit on newly created image <code class=\"\" data-line=\"\">my-boot.img<\/code> for a while, while finishing the rest. Do not flash it yet.<\/p>\n<h2 id=\"2157\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">3. Create the Debian root file system<\/h2>\n<p id=\"0d0b\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">On the desktop, mount the SD card as <code class=\"\" data-line=\"\">\/mnt\/debian<\/code>.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"5c1d\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\"># mount -t ext4 \/dev\/sdc2 \/mnt\/debian<\/span><span id=\"b36a\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># apt install debootstrap<\/span><span id=\"e5be\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># debootstrap --verbose --arch armel --foreign jessie \/mnt\/debian <a class=\"be cr lz ma mb mc\" href=\"http:\/\/ftp.se.debian.org\/debian\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/ftp.se.debian.org\/debian<\/a><\/span><\/pre>\n<p id=\"6aae\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">As we are creating a Debian system for a different architecture than an x86 system in which <code class=\"\" data-line=\"\">debootstrap<\/code> is run, the <code class=\"\" data-line=\"\">\u2013arch armel<\/code> argument is used to instruct <code class=\"\" data-line=\"\">debootstrap<\/code> to create the Debian base system for the ARM architecture. <code class=\"\" data-line=\"\">\u2013foreign<\/code> instructs it to do initial unpacking only, and a second stage install will be done later on the actual hardware. <code class=\"\" data-line=\"\">jessie<\/code> instructs it to download the packages to directory named \u201cjessie\u201d in the current directory from where <code class=\"\" data-line=\"\">debootstrap<\/code> is run. And finally a repository url to fetch the packages from. You can use your local repository here, but make sure it has packages for the architecture <code class=\"\" data-line=\"\">armel<\/code>. See man page of <code class=\"\" data-line=\"\">debootstrap<\/code> if you need more information.<\/p>\n<p id=\"f6cc\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Once this is done, unmount the SD card and insert it back into the Android phone.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"2973\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\"># umount \/mnt\/debian<\/span><\/pre>\n<p id=\"d004\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Boot phone into Recovery Mode and start <code class=\"\" data-line=\"\">adb<\/code>.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"71d4\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # mount \/dev\/block\/mmcblk1p2 \/root<\/span><span id=\"bb87\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # export PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/usr\/sbin:\/bin:\/usr\/bin:\/system\/bin:$PATH<\/span><span id=\"361f\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # echo 'deb <a class=\"be cr lz ma mb mc\" href=\"http:\/\/ftp.se.debian.org\/debian\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/ftp.se.debian.org\/debian<\/a> jessie main contrib non-free' &gt; \/root\/etc\/apt\/sources.list<\/span><span id=\"f21f\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # for f in dev dev\/pts proc sys ; do mount -o bind \/$f \/root\/$f ; done<\/span><span id=\"9da8\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # export TMPDIR=\/tmp<\/span><span id=\"39da\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # export HOME=\/root<\/span><span id=\"0c65\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">root@w7:\/ # busybox chroot \/root \/bin\/bash -l<\/span><span id=\"7865\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">bash-4.3# debootstrap\/debootstrap --second-stage<\/span><span id=\"2e37\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">...<\/span><span id=\"a371\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">I: Base system installed successfully.<\/span><\/pre>\n<p id=\"ad90\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">This takes a while to complete. Once it\u2019s done, your Debian system is ready.<\/p>\n<p id=\"6246\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Now refresh repo data and install <code class=\"\" data-line=\"\">openssh-server<\/code>:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"bebb\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">bash-4.3# apt-get update<\/span><span id=\"a969\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">bash-4.3# apt-get install openssh-server<\/span><span id=\"f933\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">...<\/span><span id=\"f07e\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">Setting up openssh-server (1:6.7p1-5+deb8u2) ...<\/span><span id=\"4785\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">[ ok ] Starting OpenBSD Secure Shell server: sshd.<\/span><span id=\"62c1\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">bash-4.3# passwd root<\/span><span id=\"d227\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">bash-4.3# exit<\/span><span id=\"f5e1\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">bash-4.3# sync<\/span><\/pre>\n<p id=\"3177\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Here you\u2019ve actually run Debian on your Android device! But it\u2019s <code class=\"\" data-line=\"\">chroot<\/code>ed below Android, and we want the reverse. But now we got a complete Debian system with SSH server and all. Still some tinkering needs to be done. (If <code class=\"\" data-line=\"\">apt-get update<\/code> didn\u2019t work, check your <code class=\"\" data-line=\"\">\/etc\/named.conf<\/code>.)<\/p>\n<h2 id=\"b626\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">4. Create the new Android root file system<\/h2>\n<p id=\"2409\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">Mount the SD card on the desktop again. Unpack the original boot image <code class=\"\" data-line=\"\">initramfs<\/code> to <code class=\"\" data-line=\"\">\/android<\/code> on the SD card\u2019s Linux partition. This is the new Android root \u2014 in the Debian filesystem tree. Create directory called <code class=\"\" data-line=\"\">\/android\/log<\/code>. Note that since the new Android root here isn\u2019t a mount point but a subdirectory, Android will not succeed re-mounting it as read-only. If you believe this will cause a problem, you can instead create the Android root on a separate partition on the SD card and mount it as <code class=\"\" data-line=\"\">\/mnt\/root\/android<\/code> in the <code class=\"\" data-line=\"\">init<\/code> on the <code class=\"\" data-line=\"\">initramfs<\/code> above, right after mounting <code class=\"\" data-line=\"\">\/mnt\/root<\/code>. However, in this case, <code class=\"\" data-line=\"\">\/android\/log<\/code> is read-only and may not be used for boot logs by <code class=\"\" data-line=\"\">\/etc\/init<\/code> below. You may solve this by mounting a <code class=\"\" data-line=\"\">tmpfs<\/code> or simply remove logging by <code class=\"\" data-line=\"\">\/etc\/init<\/code>.<\/p>\n<p id=\"a14f\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Android normally only accepts 4 partitions on the SD card due to vold limitations. If you don\u2019t want to waste one of them for the small root file system, you can loopback mount (using the <code class=\"\" data-line=\"\">\u2013bind<\/code> option) <code class=\"\" data-line=\"\">\/android<\/code> to <code class=\"\" data-line=\"\">\/mnt\/android<\/code> to make it a mount point. You then can set this mount point to read-only using <code class=\"\" data-line=\"\">remount<\/code>. Note that you must do a <code class=\"\" data-line=\"\">remount<\/code>, because a <code class=\"\" data-line=\"\">bind-mount<\/code> cannot change the flags of the original file system initially. You\u2019ll have to do this remount explicitly yourself in <code class=\"\" data-line=\"\">init.stage2<\/code> using <code class=\"\" data-line=\"\">\/bin\/mount<\/code> in this case. For now, just let the root be writable until you get everything up and running. This can be done later \u2014 or not at all.<\/p>\n<h2 id=\"cd71\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">5. Finish it up<\/h2>\n<p id=\"7d77\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">The new initramfs transfer init control to <code class=\"\" data-line=\"\">\/etc\/init<\/code> on the Linux partition.<\/p>\n<p id=\"27fd\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">A sample Debian boot init script looks like this:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"87d6\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">#!\/sbin\/busybox sh<\/span><span id=\"f6a9\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"755d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Debian environment boot init script<\/span><span id=\"83df\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"aff2\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Leave all the initialization process to the Android init to handle<\/span><span id=\"fd2d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"1b71\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Launch delayed init script<\/span><span id=\"4476\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/etc\/init.stage2 &gt; \/android\/log\/boot.log 2&gt;&amp;1 &amp;<\/span><span id=\"2f1f\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Transfer control to Android init - never returns<\/span><span id=\"79b0\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">exec \/sbin\/busybox chroot \/android \/init<\/span><\/pre>\n<p id=\"98db\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Make sure to copy <code class=\"\" data-line=\"\">busybox<\/code> to <code class=\"\" data-line=\"\">\/sbin<\/code>. Note that log from <code class=\"\" data-line=\"\">init.stage2<\/code> is stored in the Android file tree so you can access it from Android in case the Debian-level SSH server doesn\u2019t start due to some mistake in <code class=\"\" data-line=\"\">\/etc\/rc.local<\/code>, for example.<\/p>\n<p id=\"e6c4\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Then create the second script called <code class=\"\" data-line=\"\">init.stage2<\/code> \u2014 a forking of a secondary delayed script the Debian environment executes once the Android <code class=\"\" data-line=\"\">init<\/code> is done. It then transfers control to Android\u2019s original <code class=\"\" data-line=\"\">init<\/code>, still running as <code class=\"\" data-line=\"\">pid 1<\/code>, of course.<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"c0e4\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">#!\/sbin\/busybox sh<\/span><span id=\"200d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"7dd6\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Delayed Debian environment boot init script<\/span><span id=\"35d9\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Not really init (not pid 1) but a fork of it.<\/span><span id=\"5f1a\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># The real init is right now executing in Android chroot<\/span><span id=\"5218\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"880c\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox echo \"`\/sbin\/busybox date` Debian init stage2 started\"<\/span><span id=\"0c9e\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Wait for Android init to set up everything<\/span><span id=\"0148\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># wait for dev to be mounted by Android init<\/span><span id=\"b886\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox echo \"`\/sbin\/busybox date` Waiting on Android to mount \/dev\"<\/span><span id=\"5556\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">while [ ! -e \/android\/dev\/.coldboot_done ]; do<\/span><span id=\"d420\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox sleep 1<\/span><span id=\"f287\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">done<\/span><span id=\"e8e1\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># wait for Android init to signal all done<\/span><span id=\"b16b\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox echo \"`\/sbin\/busybox date` Waiting on Android init to finish\"<\/span><span id=\"4691\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">while [ -e \/android\/dev\/.booting ]; do<\/span><span id=\"845a\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox sleep 1<\/span><span id=\"e504\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">done<\/span><span id=\"8198\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Mount the \/proc, \/sys etc filesystems<\/span><span id=\"be39\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox echo \"`\/sbin\/busybox date` Mounting \/proc \/sys and \/dev\"<\/span><span id=\"9e09\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -t proc none \/proc<\/span><span id=\"6c21\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -t sysfs none \/sys<\/span><span id=\"15bd\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Mount \/dev from the Android world<\/span><span id=\"4e8b\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -o bind \/android\/dev \/dev<\/span><span id=\"c69e\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -o bind \/android\/dev\/pts \/dev\/pts<\/span><span id=\"8609\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox mount -o bind \/android\/dev\/socket \/dev\/socket<\/span><span id=\"8fe9\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># All done, now we can start running stuff<\/span><span id=\"fae0\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">export PATH=\/sbin:\/usr\/sbin:\/bin:\/usr\/bin<\/span><span id=\"4dd0\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox echo \"`\/sbin\/busybox date` Running \/etc\/rc.local\"<\/span><span id=\"8745\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Start selected servers<\/span><span id=\"c136\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/etc\/init.d\/rc.local start<\/span><span id=\"5e46\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/sbin\/busybox echo \"`\/sbin\/busybox date` All done\"<\/span><span id=\"116c\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">exit 0<\/span><\/pre>\n<p id=\"5d3e\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Basically, this only waits on Android init and then sets up everything necessary for Debian such as <code class=\"\" data-line=\"\">dev<\/code>, <code class=\"\" data-line=\"\">proc<\/code> and <code class=\"\" data-line=\"\">sys<\/code> mounts, and executes <code class=\"\" data-line=\"\">\/etc\/rc.local<\/code>.<\/p>\n<p id=\"8a6d\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Because we mount <code class=\"\" data-line=\"\">\/dev loopback<\/code> from the Android root, we must remove any devices in <code class=\"\" data-line=\"\">\/dev<\/code> populated by <code class=\"\" data-line=\"\">debootstrap<\/code>, or else this mount will fail.<\/p>\n<p id=\"35ce\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">My <code class=\"\" data-line=\"\">\/etc\/rc.local<\/code> looks like this:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"60ed\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">#!\/bin\/sh -e<\/span><span id=\"401d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"0802\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># rc.local<\/span><span id=\"64c2\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"3883\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Executed at the end of each multiuser runlevel.<\/span><span id=\"a8ef\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># Make sure the script will \"exit 0\" on success or print<\/span><span id=\"d735\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># any other value on error.<\/span><span id=\"0cca\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"fe89\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># To enable or disable this script, just change the execution<\/span><span id=\"f9c1\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># bits.<\/span><span id=\"a58e\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">#<\/span><span id=\"a97c\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># By default this script does nothing.<\/span><span id=\"af64\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/etc\/init.d\/hostname.sh start<\/span><span id=\"1d73\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">\/etc\/init.d\/ssh start<\/span><span id=\"594f\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">exit 0<\/span><\/pre>\n<p id=\"a5f3\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Note that init make sure everything here is logged to <code class=\"\" data-line=\"\">\/android\/log\/boot.log<\/code>. This is in the case the ssh-server does not start, you may see why in the file <code class=\"\" data-line=\"\">\/log\/boot.log<\/code> by <code class=\"\" data-line=\"\">adb shell<\/code> to Android.<\/p>\n<h2 id=\"779a\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">6. Install the new boot image<\/h2>\n<p id=\"8708\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">If everything went well, it\u2019s time to install the customized boot image. Here the LG L90 phone has an unlocked bootloader supporting <code class=\"\" data-line=\"\">fastboot<\/code>.<\/p>\n<p id=\"cdb7\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Enter Fastboot Mode on the phone using a key combination (holding VolumeUp while the phone is off and connecting it via a USB wire to the desktop).<\/p>\n<p id=\"49a7\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">On the desktop, run<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"361a\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\"># fastboot devices<\/span><span id=\"b18b\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># fastboot flash boot my-boot.img<\/span><span id=\"4c4d\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\"># fastboot reboot<\/span><\/pre>\n<p id=\"949f\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">All done! You\u2019re now running Debian integrated with Android the Matrix Way. <code class=\"\" data-line=\"\">ssh<\/code> to it as user root with the password you specified.<\/p>\n<\/div>\n<\/section>\n<hr class=\"mm dz gg mn mo he mp mq mr ms mt\" \/>\n<section class=\"iz ja jb jc jd\">\n<div class=\"cp je af cy cu cv\">\n<h1 id=\"84bd\" class=\"mu mv an bv bu gf mw oh my oi na oj nc ok ne ol ng\" data-selectable-paragraph=\"\">After setup<\/h1>\n<h2 id=\"71b2\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">Additional tinkering<\/h2>\n<p id=\"c260\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\"><code class=\"\" data-line=\"\">&lt;strong class=&quot;ln om&quot;&gt;\/etc\/group&lt;\/strong&gt;<\/code><\/p>\n<p id=\"bf7f\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">The Android environment is quite restricted. If you plan to run as non-root in the Debian environment, you\u2019ll need to add yourself to some Android groups to get access to network and such. The groups of the Android user shell serves as a template. Most important are the <code class=\"\" data-line=\"\">inet<\/code> group <code class=\"\" data-line=\"\">3003<\/code> to get network access and <code class=\"\" data-line=\"\">1015<\/code> to write to the SD card.<\/p>\n<p id=\"42fe\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">On an Android device running Termux:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"87ca\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">shell@android:\/ $ id<\/span><span id=\"bb84\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),1007(log),1009(mount), 1011(adb),1015(sdcard_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)<\/span><\/pre>\n<p id=\"b0d6\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">The complete set of Android user uid and group gid can be found online. Yes, it\u2019s hard-coded.<\/p>\n<p id=\"e53e\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><code class=\"\" data-line=\"\">&lt;strong class=&quot;ln om&quot;&gt;\/etc\/mtab&lt;\/strong&gt;<\/code><\/p>\n<p id=\"b34b\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">To make <code class=\"\" data-line=\"\">df<\/code> happy, make a symlink to <code class=\"\" data-line=\"\">\/proc\/mounts<\/code>:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"46f4\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">ln -s \/proc\/mounts \/etc\/mtab<\/span><\/pre>\n<p id=\"779f\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Still, <code class=\"\" data-line=\"\">df <\/code>will produce a somewhat confusing output due to the double mounts of devices in the different roots. Don\u2019t worry, this is only cosmetic.<\/p>\n<p id=\"ee51\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><code class=\"\" data-line=\"\">&lt;strong class=&quot;ln om&quot;&gt;locales&lt;\/strong&gt;<\/code><\/p>\n<p id=\"11ba\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">You don\u2019t get any localized locale installed by default. If you\u2019d like that, run <code class=\"\" data-line=\"\">apt-get install locales<\/code>, edit <code class=\"\" data-line=\"\">\/etc\/locale.gen<\/code> to select what locale you want, then run <code class=\"\" data-line=\"\">locale-gen<\/code>. Just like how you configure a new Debian system.<\/p>\n<p id=\"fc63\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">Setting the system default time zone<\/strong><\/p>\n<p id=\"163f\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Simply run<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"4e75\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\"># dpkg-reconfigure tzdata<\/span><\/pre>\n<h2 id=\"03d0\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">Use the Debian environment<\/h2>\n<p id=\"00f3\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">Connectivity<\/strong><\/p>\n<p id=\"de03\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">To get a Debian native terminal, download the ConnectBot app and <code class=\"\" data-line=\"\">ssh-connect<\/code> to <code class=\"\" data-line=\"\">localhost<\/code>.<\/p>\n<p id=\"6b7f\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Note that if you use the \u201clocal\u201d connection in ConnectBot, you\u2019ll enter The Matrix, i.e. the <code class=\"\" data-line=\"\">chroot<\/code> Android environment, and can see no signs of the Debian environment whatsoever.<\/p>\n<p id=\"0a4e\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">X11<\/strong><\/p>\n<p id=\"d394\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">If you want to run X11 on your device, <code class=\"\" data-line=\"\">apt-get install tightvncserver<\/code> and get the free app VNC Viewer for Android.<\/p>\n<p id=\"cdf4\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">First, install some desktop environment. LXDE is great for such a small system. On your Android device in the Debian system via SSH:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"4906\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">$ sudo apt-get install tightvncserver<\/span><span id=\"7a00\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">$ vncserver -geometry 1280x752 -display :1<\/span><\/pre>\n<p id=\"1e53\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">You should be able to view the Debian desktop environment using VNC Viewer for Android. For better ergonomics, <code class=\"\" data-line=\"\">ssh<\/code> (optionally with X11 forwarding) from your desktop. Running the mouse pointer with the index finger over the touch screen can be somewhat challenging.<\/p>\n<p id=\"a4f3\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">File access<\/strong><\/p>\n<p id=\"9670\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">With this setup, you can access the Android files without have to unmount\/remount the SD card.<\/p>\n<p id=\"824a\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">As a user in the <code class=\"\" data-line=\"\">sdcard_rw<\/code> group, you have full access to the SD card. As the root user, you have access to all the files in the filesystem. This also makes backups easy (e.g., nightly automated backup via Duplicity running tar over ssh.)<\/p>\n<p id=\"4e62\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">The Android Media Scanner normally runs automatically each time Android remounts the SD card. Since you are now transferring the media to the SD card using SSH\/SFTP instead of remounting the card, the media scanner won\u2019t run except for boot time. Download an app to start the Media Scanner manually if needed \u2014 there are lots of them.<\/p>\n<p id=\"c7e6\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">The Media Scanner is an index service used to catalog media files such as MP3s and images for Android apps. If you transfer a media file using SSH\/SFTP but can\u2019t find it in your app, initiate a Media Scan.<\/p>\n<p id=\"462e\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">Modify the system<\/strong><\/p>\n<p id=\"f7c8\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">With the real Linux distribution on top, it\u2019s trivial to customize the device to your likings. For example, you can simply move <code class=\"\" data-line=\"\">\/data<\/code> from the internal partition to a new partition on the SD card, edit Android\u2019s <code class=\"\" data-line=\"\">init.rc<\/code> (or <code class=\"\" data-line=\"\">init.vendor.rc<\/code>) to mount the new one instead, and then restart. Now you have extra storage without having to re-flash the device or anything.<\/p>\n<p id=\"d0e6\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">Root<\/strong><\/p>\n<p id=\"eb72\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">With this setup, the Android environment is not \u201crooted\u201d. This is trivial to achieve, but very much less needed, unless you have some app needing root privileges you still need to use.<\/p>\n<p id=\"2b75\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">To enter the Android Matrix from the Debian world, use <code class=\"\" data-line=\"\">chroot<\/code>:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"6ed4\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">root@tf101:\/home\/user # PATH=\/system\/bin \/usr\/sbin\/chroot \/android sh<\/span><span id=\"e2b1\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">root@android:\/ #<\/span><\/pre>\n<p id=\"2931\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">This is seldom needed, since you\u2019ll perform all the work (e.g. edits) of the Android file system directly from the Debian environment, using the full set of tools Linux provides you.<\/p>\n<h2 id=\"d097\" class=\"nh mv an bv bu gf ni nj nk nl nm nn no np nq nr ns\" data-selectable-paragraph=\"\">Performance<\/h2>\n<p id=\"f622\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\">Note that this is not emulation or virtualization but a <strong class=\"ln om\">runtime<\/strong> environment. Because of this, no performance penalty whatsoever occurs in either the Android or the Debian environment \u2014 not counting the extra 1.5 seconds to boot the device.<\/p>\n<p id=\"82ff\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">If you move partitions (e.g., <code class=\"\" data-line=\"\">\/system<\/code> and\/or <code class=\"\" data-line=\"\">\/data<\/code>) to the SD card for safety or extra storage, the speed of the SD card may affect the performance. Benchmarks shows that a Class 10 SD card gives about the same I\/O performance as the internal NAND disk, though. Don\u2019t except more than 15\u201320 MB\/s. USBs may offer you more.<\/p>\n<p id=\"5b14\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Don\u2019t expect laptop performance, though. If it\u2019s primarily a GNU\/Linux workstation you want, get an x86 based machine instead. The Android platform is design with resource conservation in mind, not high performance.<\/p>\n<\/div>\n<\/section>\n<hr class=\"mm dz gg mn mo he mp mq mr ms mt\" \/>\n<section class=\"iz ja jb jc jd\">\n<div class=\"cp je af cy cu cv\">\n<h1 id=\"ba38\" class=\"mu mv an bv bu gf mw oh my oi na oj nc ok ne ol ng\" data-selectable-paragraph=\"\">Caveats<\/h1>\n<p id=\"d0f4\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">Environment variables and file descriptors<\/strong><\/p>\n<p id=\"ea49\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">When <code class=\"\" data-line=\"\">ssh<\/code>ing into the device, remember that neither the SSH server nor your login shell is a child of Android\u2019s init. Therefore you have no access to either file descriptors or environment variables created by <code class=\"\" data-line=\"\">init<\/code>, especially not <code class=\"\" data-line=\"\">ANDROID_PROPERTY_WORKSPACE<\/code> with corresponding file descriptor. Because of this, you can\u2019t use <code class=\"\" data-line=\"\">getprop<\/code> \/ <code class=\"\" data-line=\"\">setprop<\/code> or any command relying on Android properties from the ssh session (e.g. <code class=\"\" data-line=\"\">restart adb<\/code>). In order to accomplish this, you must enter the Android world via a child of <code class=\"\" data-line=\"\">init<\/code>, e.g., <code class=\"\" data-line=\"\">adb<\/code> or a local <code class=\"\" data-line=\"\">ssh-server<\/code> in the Android root (e.g. <code class=\"\" data-line=\"\">dropbear<\/code>).<\/p>\n<p id=\"2365\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">You can always enter the Android world only to <code class=\"\" data-line=\"\">adb shell<\/code> back to itself:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"eb29\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">root@w7:\/home\/user# chroot \/android \/system\/bin\/adb shell<\/span><span id=\"d748\" class=\"nh mv an bv ke b ea oc od oe of og oa l ob\" data-selectable-paragraph=\"\">shell@android:\/ $<\/span><\/pre>\n<p id=\"e139\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">If the device is not rooted (<code class=\"\" data-line=\"\">ro.secure<\/code> is <code class=\"\" data-line=\"\">1<\/code>), you end up as the shell user.<\/p>\n<p id=\"1497\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><code class=\"\" data-line=\"\">&lt;strong class=&quot;ln om&quot;&gt;apt-get upgrade&lt;\/strong&gt;<\/code><\/p>\n<p id=\"014a\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">When you run <code class=\"\" data-line=\"\">apt-get upgrade<\/code>, many installation scripts restart their corresponding daemons. Since no daemons except for those you explicitly start in <code class=\"\" data-line=\"\">\/etc\/rc.local<\/code> are supposed to be running in the Debian environment, it might be a good idea to restart the system after the upgrade.<\/p>\n<p id=\"e699\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">Backup<\/strong><\/p>\n<p id=\"c5d8\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Although Debian is the root, both systems are heavily dependent on the Android system and its <code class=\"\" data-line=\"\">init<\/code>, since it\u2019s the \u201cowner\u201d of the hardware (i.e. runs <code class=\"\" data-line=\"\">init<\/code>). If Android <code class=\"\" data-line=\"\">init<\/code> fails, you will not be able to <code class=\"\" data-line=\"\">ssh<\/code> into the Debian system. Even if the root is transferred to the SD card, the Android <code class=\"\" data-line=\"\">init<\/code> mounts internal partitions, most importantly, <code class=\"\" data-line=\"\">\/system<\/code> . Certain changes you make to this partition might get yourself locked out. This can be solved by restoring a backup copy of the Android system to the SD card and editing <code class=\"\" data-line=\"\">\/android\/init.*.rc<\/code> to not mount <code class=\"\" data-line=\"\">\/system<\/code> from internal flash but instead use the one you just restored to the SD card. Running<code class=\"\" data-line=\"\"> \/system<\/code> from the SD card, to begin with, may be a good idea if you plan to change it frequently. This way the original system partition can be left untouched. This, of course, goes for all the Android partitions. For example, you can easily increase the space for your apps by moving <code class=\"\" data-line=\"\">\/data<\/code> to a much bigger partition on the SD card.<\/p>\n<p id=\"5bde\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><strong class=\"ln om\">Always keep a backup<\/strong><\/p>\n<p id=\"4177\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Alternatively, you can implement some fail-safe in the <code class=\"\" data-line=\"\">init<\/code> scripts, e.g., populating <code class=\"\" data-line=\"\">\/dev<\/code>, mounting <code class=\"\" data-line=\"\">\/proc<\/code>, <code class=\"\" data-line=\"\">\/sys<\/code>, setting IP address, etc. if the Android <code class=\"\" data-line=\"\">init<\/code> fails, but I find it more practical to just run<code class=\"\" data-line=\"\"> \/system<\/code> from SD card instead.<\/p>\n<p id=\"36dd\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">The Android Java virtual machine (Dalvik), on the other hand, is quite non-critical at the OS level, so removing bundled apps (bloatware) on the <code class=\"\" data-line=\"\">\/data<\/code> partition is quite harmless. If you happen to remove the Home Application, you\u2019ll still be able to <code class=\"\" data-line=\"\">ssh<\/code> into the Debian system to restore it from your backup.<\/p>\n<p id=\"9a38\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\"><code class=\"\" data-line=\"\">&lt;strong class=&quot;ln om&quot;&gt;pstree&lt;\/strong&gt;<\/code><\/p>\n<p id=\"d0b3\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">A typical <code class=\"\" data-line=\"\">ps<\/code> tree shows the following process hierarchy:<\/p>\n<pre class=\"kr ks kt ku kv hc el ny\"><span id=\"9201\" class=\"nh mv an bv ke b ea nz oa l ob\" data-selectable-paragraph=\"\">init\u2500\u252c\u2500adbd\u2500\u2500\u2500{adbd}\n     \u251c\u2500dbus-daemon\n     \u251c\u2500debuggerd\n     \u251c\u2500dhcpcd\n     \u251c\u2500drmserver\u2500\u2500\u2500{drmserver}\n     \u251c\u2500dropbear\n     \u251c\u2500glgps\n     \u251c\u2500installd\n     \u251c\u2500keystore\n     \u251c\u2500mediaserver\u2500\u2500\u25006*[{mediaserver}]\n     \u251c\u2500netd\u2500\u2500\u25004*[{netd}]\n     \u251c\u2500sdcard\n     \u251c\u2500servicemanager\n     \u251c\u2500sshd\u2500\u252c\u2500sshd\u2500\u2500\u2500sshd\u2500\u2500\u2500sftp-server\n     |      \u2514\u2500sshd\u2500\u2500\u2500sshd\u2500\u2500\u2500bash\u2500\u2500\u2500pstree\n     \u251c\u2500surfaceflinger\u2500\u2500\u25005*[{surfaceflinger}]\n     \u251c\u2500ueventd\n     \u251c\u2500vold\u2500\u2500\u25002*[{vold}]\n     \u251c\u2500wpa_supplicant2\n     \u2514\u2500zygote\u2500\u252c\u2500LocationService\u2500\u2500\u250018*[{LocationServic}]\n              \u251c\u2500android.browser\u2500\u2500\u250014*[{android.browse}]\n              \u251c\u2500android.vending\u2500\u2500\u250026*[{android.vendin}]\n              \u251c\u2500com.asus.cm\u2500\u2500\u25009*[{com.asus.cm}]\n              \u251c\u2500d.process.acore\u2500\u2500\u25008*[{d.process.acor}]\n              \u251c\u2500d.process.media\u2500\u2500\u25009*[{d.process.medi}]\n              \u251c\u2500droid.apps.maps\u2500\u2500\u250031*[{droid.apps.map}]\n              \u251c\u2500droid.gallery3d\u2500\u2500\u25009*[{droid.gallery3}]\n              \u251c\u2500droid.gsf.login\u2500\u2500\u250011*[{droid.gsf.logi}]\n              \u251c\u2500e.process.gapps\u2500\u2500\u250035*[{e.process.gapp}]\n              \u251c\u2500ing.android.tsm\u2500\u2500\u250016*[{ing.android.ts}]\n              \u251c\u2500m.android.phone\u2500\u2500\u250016*[{m.android.phon}]\n              \u251c\u2500m.asus.keyboard\u2500\u2500\u25008*[{m.asus.keyboar}]\n              \u251c\u2500ndroid.launcher\u2500\u2500\u250015*[{ndroid.launche}]\n              \u251c\u2500ndroid.settings\u2500\u2500\u250016*[{ndroid.setting}]\n              \u251c\u2500ndroid.systemui\u2500\u2500\u250011*[{ndroid.systemu}]\n              \u251c\u2500oid.hostmonitor\u2500\u2500\u25008*[{oid.hostmonito}]\n              \u251c\u2500onFriendService\u2500\u2500\u250011*[{onFriendServic}]\n              \u251c\u2500putmethod.latin\u2500\u2500\u25009*[{putmethod.lati}]\n              \u251c\u2500s:FriendService\u2500\u2500\u25008*[{s:FriendServic}]\n              \u251c\u2500system_server\u2500\u2500\u250067*[{system_server}]\n              \u251c\u2500uance.xt9.input\u2500\u2500\u250012*[{uance.xt9.inpu}]\n              \u2514\u25003*[{zygote}]<\/span><\/pre>\n<p id=\"3478\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Note the <code class=\"\" data-line=\"\">sshd<\/code> running this <code class=\"\" data-line=\"\">pstree<\/code> and a <code class=\"\" data-line=\"\">sftp<\/code> server in the Debian root. All the other processes are <code class=\"\" data-line=\"\">chroot<\/code>ed to the Android root.<\/p>\n<p id=\"3449\" class=\"ll lm an bv ln b lo lp lq lr ls lt lu lv lw lx ly\" data-selectable-paragraph=\"\">Remember there is no connection between the process tree and the <code class=\"\" data-line=\"\">chroot<\/code> filesystem structure. Here the <code class=\"\" data-line=\"\">init<\/code> process lives in the <code class=\"\" data-line=\"\">chroot<\/code> environment despite being top of the process tree, and the <code class=\"\" data-line=\"\">ssh-server<\/code> and <code class=\"\" data-line=\"\">sshd<\/code> reside in the genuine top root, although they are shown below <code class=\"\" data-line=\"\">init<\/code> in the process tree.<\/p>\n<\/div>\n<\/section>\n<hr class=\"mm dz gg mn mo he mp mq mr ms mt\" \/>\n<section class=\"iz ja jb jc jd\">\n<div class=\"cp je af cy cu cv\">\n<h1 id=\"e332\" class=\"mu mv an bv bu gf mw oh my oi na oj nc ok ne ol ng\" data-selectable-paragraph=\"\">Useful Links<\/h1>\n<ul class=\"\">\n<li id=\"f7b3\" class=\"ll lm an bv ln b lo nt lq nu ls nv lu nw lw nx ly me mf mg\" data-selectable-paragraph=\"\"><a class=\"be cr lz ma mb mc\" href=\"http:\/\/android-dls.com\/wiki\/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images\" target=\"_blank\" rel=\"noopener noreferrer\">Unpack, edit, and repack boot images<\/a><\/li>\n<li id=\"d383\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\"><a class=\"be cr lz ma mb mc\" href=\"https:\/\/wiki.cyanogenmod.org\/w\/Build_for_w7\" target=\"_blank\" rel=\"noopener noreferrer\">Build CM13 for L90w7 from source<\/a><\/li>\n<li id=\"9590\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\"><a class=\"be cr lz ma mb mc\" href=\"http:\/\/www.elinux.org\/Android_Booting\" target=\"_blank\" rel=\"noopener noreferrer\">Android boot process<\/a><\/li>\n<li id=\"07b5\" class=\"ll lm an bv ln b lo mh lq mi ls mj lu mk lw ml ly me mf mg\" data-selectable-paragraph=\"\"><a class=\"be cr lz ma mb mc\" href=\"https:\/\/blulin.wordpress.com\/2014\/12\/07\/installing-debian-wheezy-on-android-chroot-method\/\" target=\"_blank\" rel=\"noopener noreferrer\">Debian on Android chroot<\/a><\/li>\n<\/ul>\n<\/div>\n<\/section>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Now I know I&#8217;ve done the-right-thing supporting Librem5. I knew that almost all phones comes with a proprietary OS, either the prison-ware iOS or proprietary derivative of Android. Yet I wasn&#8217;t aware that the situation is SO bad. Read this. Android is not open source &#8211; The Quantified VC &#8211; Medium &nbsp;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2019\/10\/09\/android-is-not-open-source\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[171,53,14],"tags":[],"class_list":["post-6167","post","type-post","status-publish","format-standard","hentry","category-ethics","category-proprietary-software","category-software-libero"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1Bt","jetpack-related-posts":[{"id":10634,"url":"https:\/\/monodes.com\/predaelli\/2023\/07\/16\/extracting-totp-keys-from-a-proprietary-android-2fa-app\/","url_meta":{"origin":6167,"position":0},"title":"Extracting TOTP keys from a proprietary Android 2FA app","author":"Paolo Redaelli","date":"2023-07-16","format":"link","excerpt":"Source: Extracting TOTP keys from a proprietary Android 2FA app","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4979,"url":"https:\/\/monodes.com\/predaelli\/2018\/12\/02\/4979\/","url_meta":{"origin":6167,"position":1},"title":"Not only WhatsApp is proprietary\u2026","author":"Paolo Redaelli","date":"2018-12-02","format":false,"excerpt":"Not only WhatsApp is proprietary software but it doesn't even like to run on a pure Android release which I have to remind you is Free Software. Sadly its freedom is not persistent so it can be turned and it is too often turned into proprietary. Telegram happily runs on\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/monodes.com\/predaelli\/category\/smartphones\/android\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/12\/Screenshot_20181201-132200-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/12\/Screenshot_20181201-132200-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/12\/Screenshot_20181201-132200-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/12\/Screenshot_20181201-132200-1.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/12\/Screenshot_20181201-132200-1.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":10308,"url":"https:\/\/monodes.com\/predaelli\/2023\/03\/18\/dont-trust-proprietary\/","url_meta":{"origin":6167,"position":2},"title":"Don&#8217;t trust proprietary","author":"Paolo Redaelli","date":"2023-03-18","format":false,"excerpt":"Microsoft Is Testing a Built-In Cryptocurrency Wallet For the Edge Browser (source Slashdot).I strongly, strongly suggest everyone to avoid using this functionality because it is proprietary software. Not having the sources you can't be sure what it really does. It can easily have a backdoor to let some external entities\u2026","rel":"","context":"In &quot;Proprietary software&quot;","block_context":{"text":"Proprietary software","link":"https:\/\/monodes.com\/predaelli\/category\/software\/proprietary-software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10931,"url":"https:\/\/monodes.com\/predaelli\/2023\/11\/01\/beeper-all-your-chats-in-one-app-yes-really\/","url_meta":{"origin":6167,"position":3},"title":"Beeper, all your chats in one app. Yes, really.","author":"Paolo Redaelli","date":"2023-11-01","format":false,"excerpt":"Beeper is a universal chat app. built on the open source chat protocol Matrix, Available on Linux and Android (and also on most widespread proprietary systems).Beeper contributes back to the Matrix community. All of their Matrix bridges are open source on our Github. Don't want to pay for Beeper? Self-host\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/monodes.com\/predaelli\/category\/smartphones\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":624,"url":"https:\/\/monodes.com\/predaelli\/2015\/08\/06\/both-arent-liberi\/","url_meta":{"origin":6167,"position":4},"title":"Both aren&#8217;t &#8220;liberi&#8221;","author":"Paolo Redaelli","date":"2015-08-06","format":false,"excerpt":"Chrome - one of the most widespread browser - is proprietary software with Chromium being is \"open source\" base. According to Debian #Debian Bug report logs for \"786909 - chromium: unconditionally downloads binary blob\" Chromium even when built from source code still try to inject binary blobs - proprietary software\u2026","rel":"","context":"In &quot;Proprietary software&quot;","block_context":{"text":"Proprietary software","link":"https:\/\/monodes.com\/predaelli\/category\/software\/proprietary-software\/"},"img":{"alt_text":"1000px-Chromium_11_Logo.svg","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/08\/1000px-Chromium_11_Logo.svg_-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4619,"url":"https:\/\/monodes.com\/predaelli\/2018\/10\/08\/the-mobile-version\/","url_meta":{"origin":6167,"position":5},"title":"&#8220;the Mobile Version&#8221;","author":"Paolo Redaelli","date":"2018-10-08","format":"link","excerpt":"\u00abMicrosoft Is Embracing Android As the Mobile Version of Windows\u00bb reports Slashdot and most of the times it is as proprietary as Windows plus it tries to known everything about you and tell it to the great G that doesn't want anymore \"not to be evil\".","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/monodes.com\/predaelli\/category\/android-2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/6167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=6167"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/6167\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=6167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=6167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=6167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}