Kernel Fun on Nexus 7 & Nexus 4 – part 1



So as someone who likes the idea of having Ubuntu Touch UT (soon Ubuntu Personal) on my mobile devices, I follow developement on those topics. Currently, the biggest problem in supporting older mobile devices (even the ones which were sold with UT) is that the kernels are outdated and certain parts of snappy need e.g. Apparmor 2.4 (can’t seem to find the link, somewhere in a Ubuntu mailing list…) or something. The oldest kernel they try to backport all this stuff to is (to my knowledge) the 3.10.x kernel for the BQ Aquaris M10 (M10 kernel @ launchpad), however this seems to be a lot of work and it is not the ideal way.

The best thing would be, that with time the mainline kernel has all the stuff we need and therefor i consider it a nice idea to try once in a while whether we can get up a mainline kernel to run on older devices (of course this will not work flawlessly out-of-the-box but something that boots is a first step)

Current Situation

For e.g. the allwinner chips, the sunxi community is putting a lot of effort into mainlining (LINK), however, for GPUs there are only a few which have open-source drivers. Freedreno is one of the best working solutions so far (for Adreno GPUs) and John Stultz (google+) is making big leaps in getting a mainline kernel running on Nexus 7 (2013) (flo.git).

I unfortunately don’t have a Nexus 7 and money is short, however, I got a Nexus 4 which is kind of similar. This leads to what I’m trying to accomplish:

  1. Get a kernel with John Stultzes patches working on Nexus 4 (AOSP)
  2. Patch this kernel with Ubuntu specific stuff
  3. Try to get a Ubuntu Touch/Personal Up and Running with this kernel
  4. Snap up the whole thing

First Step – Comparing Nexii

All of the following is coming from wikipedia. Both have Qualcomm Snapdragon S4 Pro APQ8064 with a 1.5 GHz quad-core Krait 300 (although for Nexus 4 it only says “Krait”) CPU, an Adreno 320 GPU but cooming to the differences: Memory –  DDR3L (N7) vs. LPDDR2 (N4) each 2Gb, Displays – 7″, 16:10 with 323 ppi (N7) vs. 4.7″, with 318 ppi (N4) also, their speaker, touchscreens, battery chargers and all the sensor stuff might be different

So all of this may not be too important if there are open-source drivers available or the flo (N7) parts may be reused for the mako (N4) kernel. The official “google made” android kernels (latest is 3.4) can be found here.(btw nice doku by AOSP) Further down the road we will have a (a) close look at their differences and if the commits are commented nicely we may also understand what each diff does ;-P. Then (b) we will check what patches to the original 3.4 mainline kernel were made and (c) which of them prevail in John Stultzes stable 4.9 kernel (or if i don’t get to it until 4.10 is stable, 4.10). Just doing a quick dig into this:

(a) we will be comparing the android-msm-flo/mako-3.4-lollipop-release kernels with each other as mako wasn’t supported for newer releases. I think I’ll try out the visual diff tool meld for this purpose. – Update: a quick first look shows some changes in the two kernels but nothing that is not manageable i guess. It looks more than it is because everything inside “mako”/drivers/media/video/msm/* has gone into “flo”/drivers/media/platform/msm/camera_v1. If we don’t count the camera specific stuff, there are about 50 files difference between flo and mako (and many more differences in files)

(b) checking manually the dts parts of 3.4.113 and 4.9.10 reveals that somewhere in between, the dts for nexus 7 and nexus 5 have been added. Sadly, no sign of nexus 4 (also not in 4.

(c) has to be done after a… TBD in a future post.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s