"Ordinary" ARM linux port?


(Alastair Pharo) #1

Hello,

I’ve been watching with some interest the progress that the KDE Plasma Mobile team have been making with their mobile OS efforts. In particular, their approach to Android compatibility. As I understand it, their favoured approach is now to create a bare stripped down CyanogenMod build that supports LXC containers, then to launch an “ordinary” linux (in their case, Ubuntu) inside the container, which gets access to the device hardware using libhybris. Using libhyrbis enables the linux in the container to be completely FOSS.

I gather Ubuntu Touch previously did something similar as well.

This setup may sound complicated, but I think it has some benefits too. Namely:

  • no(?) legal issues around distributing “complete” builds of B2G, provided users can get their own bare-bones LXC-enabled Android base somewhere (big if, of course)
  • easy compatibility with any phone that can run CM
  • a potentially much reduced set of responsibilities for the community B2G effort, reduced from trying to manage an entire operating system environment to just making a single program (b2g) run. This could make things like the mooted switch to C++11 easier to manage.
  • if B2G can run on any ordinary Linux, it would open it up to being run in lots of new environments.
  • this may be personal taste, but I can’t say I find the Android build environment very pleasant to work with.

My question is: Is this sort of approach feasible for B2G (the b2g executable, in particular)? If so, what would need to happen?


(Fabrice) #2

I haven’t look at libhybris at all, but what do we get in terms of graphics stack?

You can easily do a “standard” linux build of b2g (they used to be called b2g desktop builds), but on a phone we’ll need things like the telephony stack and this needs access to the Hardware Abstraction Layer.

In any case this is an interesting idea, worth exploring a bit more to see if this has some potential.


(Alastair Pharo) #3

Hmm, yes I originally thought telephony came for free with hybris, but it appears I was wrong about that.

My very limited understanding of the graphics situation is that hybris provides a set of OpenGL libraries that one can link against, which ferry instructions through to the android driver somehow.


(Sai Karthik) #4

Well, this is interesting :slight_smile:


(Alastair Pharo) #5

Subsequently, I’ve been playing around quite a bit with OpenEmbedded/Yocto. These projects specialise in Linux distros for embedded systems, and are used by a few other smartphone projects already, namely LuneOS/WebOS and OpenMoko/SHR.

The major benefit I’ve discovered from using this setup is that it has very good creating compact OS images for ARM devices, and it seems to be much easier to compose pieces together than in the android build system. Also, there are heaps of recipes available for compiling pretty much any open source software you can think of and then bundling it into an OS image. There’s even a package management system somewhat akin to apt in debian, though I haven’t tried using that at all.

Each platform/device that one wants to compile for needs a board suport package or BSP.
For me as a Nexus 4 user, this was extremely easy to come by, as one had already been developed by the SHR project. They’ve apparently put a lot of effort into connecting their distro to the phone hardware via libhybris, etc.; though so far I’ve not tried to make use of that.

The chroot environment has however been very good for running web server apps from! I’ve managed to get the following running so far:

  • Nginx
  • PHP-FPM
  • SQLite
  • Owncloud (using the above three technologies)
  • NodeJS
  • MySQL

I’ve also got an SSH server server running, which is quite a bit more plesant than using ADB :slight_smile:

I was interested to get owncloud running as I thought it might be a suitable intermediate solution for a WebDAV/CardDAV/CalDAV service on the phone. Here’s a screenshot of the app running – haven’t done much beyond that …

If anyone is interested in trying to experiment with this stuff from another device, I’m happy to chat! I see this as an interesting experiment more than anything else, but it might be that using an environment like this could make the job of developing/running server software on the device easier.


(Lissyx) #6

Looking at your screenshot there is no SIM :-/

Is it because you have none in your device or your yocto bsp does not
handle it?

While I like the idea of pure Linux I cannot get convinced this can work on
phones because of how much the ecosystem depends on Android specifics :-/

<
https://ci5.googleusercontent.com/proxy/XSIrEwXEGm__lJ4Aejv1lbvS0x9FR_9HcneQYjLVeAg9reIB0VSHPbK8wIWFe5gYdmDSe-DLoUy08pY4z4qOkq0y472OdXrbZzuoKLMY5xlo_OflsoXmardMkyeO9IzCNbE5toiEVPqkz3C8816xdF4Tn5EHm_RjdJXIkw7T=s0-d-e1-ft#https://discourse.mozilla-community.org/user_avatar/discourse.mozilla-community.org/asppsa/45/5057_1.png>
asppsa Alastair Pharo
September 8

Subsequently, I’ve been playing around quite a bit with
OpenEmbedded/Yocto. These projects specialise in Linux distros for embedded
systems, and are used by a few other smartphone projects already, namely
LuneOS/WebOS and OpenMoko/SHR.

The major benefit I’ve discovered from using this setup is that it has
very good creating compact OS images for ARM devices, and it seems to be
much easier to compose pieces together than in the android build system.
Also, there are heaps of recipes available for compiling pretty much any
open source software you can think of and then bundling it into an OS
image. There’s even a package management system somewhat akin to apt in
debian, though I haven’t tried using that at all.

Each platform/device that one wants to compile for needs a board suport
package or BSP.
For me as a Nexus 4 user, this was extremely easy to come by, as one had
already been developed by the SHR project. They’ve apparently put a lot of
effort into connecting their distro to the phone hardware via libhybris,
etc.; though so far I’ve not tried to make use of that.

The chroot environment has however been very good for running web server
apps from! I’ve managed to get the following running so far:

Nginx
PHP-FPM
SQLite
Owncloud (using the above three technologies)
NodeJS
MySQL

I’ve also got an SSH server server running, which is quite a bit more
plesant than using ADB <
https://ci4.googleusercontent.com/proxy/WXb7N19ymmSjQefzE6_DMhC7WlvMLvTzF_d-xpixnAW2xonFpj0ouJSL5EEFo3qKpy393sIX7TX4NIGY5ZvxpotgugqQUVeKIwjRFdw2Q2lD8LmfQvs1fCzhXHIWDSTtOurmKFdniNA_=s0-d-e1-ft#https://discourse.mozilla-community.org/images/emoji/emoji_one/slight_smile.png?v=2

I was interested to get owncloud running as I thought it might be a
suitable intermediate solution for a WebDAV/CardDAV/CalDAV service on the
phone. Here’s a screenshot of the app running – haven’t done much beyond
that …

<
https://ci6.googleusercontent.com/proxy/GacxykGYeYC2fhd8NPqf8Q1PeRcYQYrdhqogpbze9XTDqMu0rTVYgpJmeUE5poFhPHgBqC6yp-_U2KkDaeXzzrAYfsIHV3ZkQrXdSJQprLvgYHplcLTLojwIglgfZxBrS47h26rj7xWMjjvw_Z5csSvLHR_wwsH8NBB2EcCeR1pieorUTWdKlyTB7raCJh-OjNDA0g=s0-d-e1-ft#https://csa-discourse-uploads.s3-us-west-1.amazonaws.com/optimized/2X/5/53d23d372e15684a1a2b55f193fd8bfd0a4a25ce_1_300x500.png

If anyone is interested in trying to experiment with this stuff from
another device, I’m happy to chat! I see this as an interesting experiment
more than anything else, but it might be that using an environment like
this could make the job of developing/running server software on the device
easier.


(Alastair Pharo) #7

The phone has no SIM in it - that’s the reason for that. Actually the phone is running Firefox OS 2.5, and B2G itself is not running inside the openembedded chroot, so things in B2G are as normal – only the web server software is running in the chroot in the screenshot there.


(Lissyx) #8

Sure bit running into a chroot does not helps us.

I very much like the basic idea as I said but I think we should hack this
on hardware that supports clean Linux.

Rpi3 is really a good fit IMHO

<
https://ci5.googleusercontent.com/proxy/XSIrEwXEGm__lJ4Aejv1lbvS0x9FR_9HcneQYjLVeAg9reIB0VSHPbK8wIWFe5gYdmDSe-DLoUy08pY4z4qOkq0y472OdXrbZzuoKLMY5xlo_OflsoXmardMkyeO9IzCNbE5toiEVPqkz3C8816xdF4Tn5EHm_RjdJXIkw7T=s0-d-e1-ft#https://discourse.mozilla-community.org/user_avatar/discourse.mozilla-community.org/asppsa/45/5057_1.png>
asppsa Alastair Pharo
September 8

The phone has no SIM in it - that’s the reason for that. Actually the
phone is running Firefox OS 2.5, and B2G itself is not running inside the
openembedded chroot, so things in B2G are as normal – only the web server
software is running in the chroot in the screenshot there.


Visit Topic or reply to this email to respond.


In Reply To

<
https://ci5.googleusercontent.com/proxy/awzTLeZSQ4NoIfBlGZA3lo26kZQVVC_BjmANCNdQ4J3ntLbC3OZJIeAQFM53I2NXMRdNwx5dc_wrzQauIPOWKNBxCWTk2WOuGwsP5-7iO_OBAvvokOOWFV5k6nWiczuxCcFLpgrVlO3SS2U=s0-d-e1-ft#https://discourse.mozilla-community.org/letter_avatar_proxy/v2/letter/l/ecb155/45.png>
lissyx
September 8
Looking at your screenshot there is no SIM :-/ Is it because you have
none in your device or your yocto bsp does not handle it? While I like the
idea of pure Linux I cannot get convinced this can work on phones because
of how much the ecosystem depends on Android specifics :-/ < https://ci5.g