* [gentoo-soc] Project Idea: Gentoo On Android
@ 2013-03-30 14:50 heroxbd
2013-03-30 15:51 ` Rich Freeman
0 siblings, 1 reply; 4+ messages in thread
From: heroxbd @ 2013-03-30 14:50 UTC (permalink / raw
To: gentoo-soc
Dear all,
I am trying to form a project idea to make Gentoo Available on Android.
The thoughts collected so far are as follows. I am not sure if it is
good to mix too much android things here in the second half. Maybe it is
better only to do the first half with a couple of other more Gentoo
related work?
Cheers,
Benda
Gentoo On Android
=================
Author: heroxbd
Date: 2013-03-30 23:49:33 JST
Table of Contents
=================
1 Abstract
2 Libc in Gentoo Prefix
3 Root privilege in Gentoo Prefix
4 GNU on Android
5 Display sharing
6 Integration of GNU and Android
7 Deliverables
7.1 Until Mid-Term
7.1.1 Libc of Gentoo Prefix
7.1.2 Root privilege in Gentoo Prefix
7.1.3 Gentoo Prefix on Android
7.1.4 Timeline
7.2 Until Final
7.2.1 Display sharing
7.2.2 Integration of GNU and Android
7.2.3 Timeline
8 Reference
1 Abstract
===========
This project is about running Gentoo natively on Android devices.
I am going to develop libc support and root permission handling in
Gentoo Prefix, and deploy the enhanced Gentoo Prefix in parallel to
Android userland in mobile devices, such as smart phone and
tablet. This will provide a full-featured native GNU userland to
Android system.
A framebuffer switch mechanism will be developed to share the
display between GNU and Android userland. This will be very useful
to dockable tablets like ASUS transformer to run native X and
SurfaceFlinger.
Optionally, data exchange between Gentoo and Android userland will
also be investigated and provided as an integration between the two.
2 Libc in Gentoo Prefix
========================
Gentoo Prefix is variant of Gentoo meta-distribution which installs
under normal user privilege a full Gentoo in a directory offset of
a Unix-like OS, such as HPUX, AIX, GNU/Linux, Interix, Mac OS X,
Solaris and Cygwin.
Traditionally, Gentoo Prefix uses kernel/libc and in some cases
compiler/linker from host OS. Problem arises in Linux/glibc based OS
when the version of glibc is too old, like RHEL/CentOS 5 and many
ancient GNU/Linux still in duty[1][2][3]. Therefore it has
been a dream of Gentoo Prefix community to have bleeding edge libc
to further reduce dependence on host while still being a Prefix (as
opposed to a virtual machine). It is technically accessible as
Debian multi-arch[4] and patchelf from nixOS[5] demonstrated
the use of /interp/ field of ELF to locate dynamic linker.
Around late 2012, Ruud Koolen (redlizard) made a first attempt to
have libc in Gentoo Prefix[6], and successfully made a functional
system[7]. It is, however, still calls for much work of
maintenance designs to co-exist with the present /rpath/ mechanism.
3 Root privilege in Gentoo Prefix
==================================
One of the amazing feature of Gentoo Prefix is not needing root
privilege to use portage, the Gentoo package manager. However in
some cases, the user do have root privilege and still want to
install a Gentoo Prefix as normal user and give it root privilege
when necessary, such as setting suid root to some tools. At present
it is will result in a failure as portage run as a normal user will
refuse to do anything requiring root.
We want to add such a feature to portage: call sudo/su before
performing things requiring root. And such feature can be disabled
by configuration or USE flags.
4 GNU on Android
=================
Android is a Linux-based mobile operating system developed by
Google. It features a Java engine Dalvik as the central. The purpose
of Bionic, libc of Android, is to get Java engine compiled out.
Therefore Bionic is very thin and lacks of many features expected in
a GNU/Linux system. As a consequence, though Android has Linux
kernel, it is non-trivial to have a GNU environment along with it.
Mobile devices is getting more and more powerful. At the time of
writing (March 2013), dual/quadro-core Ghz-clocked ARM driven mobile
devices are widely available in the market. To unleash the full
potential, a complete GNU userland would be very useful and crucial
to provide desktop level user experience, with laptop docks
(Motorola Lapdock[8], ASUS Transformer[9]) and/or desktop
monitor via HDMI[10].
Several attempts exist and are surveyed as followed.
1. busybox. It uses static linked busybox to provide main tools
expected in a GNU environment[11]. It is straight forward to
deploy and accessible as App in Google Play[12]. But the
features provided is limited.
2. chrooted full distribution. We could install full GNU/Linux
distribution in a chroot environment, and even have a desktop
environment within a VNC server. We could access the local VNC
server with a VNC client from Android. It is well-received and
also available as App in Google Play[13][14]. The drawback of this
solution, however, is the overhead imposed by chroot and VNC
server. Furthermore, this approach will need root permission to
Android system.
3. native full distribution. Because Android system lies in /system
directory, top directories like /usr, /lib, /var, /etc required
by a typical GNU/Linux distribution are available. We can install
a full distribution to / in parallel to Android. This approach,
for example, Motorola Webtop and Debian[15][16], is not yet
wide spread yet, but it is at present the best solution we
have. It needs root permission to operate.
Gentoo Prefix, if powered with its own glibc, will give another
native solution here, and (surprise!) without the need of root
permission. It is also clean in the sense that all the GNU are
installed in a subdirectory.
It could be hard to bootstrap Gentoo Prefix on Android. One possible
way is to install a native full distribution and then bootstrap a
Gentoo Prefix with libc. We could distribute precompiled Gentoo
Prefix on Google Play for the general public.
5 Display sharing
==================
Webtop 2.0 and prospective /Ubuntu for Android/, makes use of the
HDMI output for its X server. In such system SurfaceFlinger of
Android and X independently use two framebuffers, which in turn,
relies on two independent graphics outputs, namely local display and
HDMI.
It, however, would very helpful to have local display shared between
SurfaceFlinger and X. HDMI output with an external monitor is not
always available, and X on local display becomes killer application
on a Android tablet.
The feature can be realized by hacking framebuffer in kernel. Write
a void framebuffer driver, which can either drop the data written
into it or forward the data to another framebuffer. Controlling this
void framebuffer device via sysfs will allow userland to select real
source of framebuffer.
6 Integration of GNU and Android
=================================
Motorola has demonstrated a revolutional concept to have GNU and
Android integrated together. Its Webtop product, until version 2.0,
features a Ubuntu running aside Android and introduced a
data-exchange mechanism. In Webtop, user is presented with a Ubuntu
environment and have access to Android system as the same time.
Canonical claimed to carry on this concept further under the project
/Ubuntu for Android/[17] after Motorola has abandoned the
idea. Canonical does not give any technical details except
advertising. (The advertisement by Canaical itself is nice because
it presents the concept in a easy to understand way.) The author
personally suspect it would be only available on some special smart
phone models.
The Webtop 2.0 system, has several closed-source components to carry
out data-exchange between GNU and Android[18]. It would very nice
to have tools with the same purpose and available as free software.
7 Deliverables
===============
7.1 Until Mid-Term
-------------------
7.1.1 Libc of Gentoo Prefix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Merge redlizard's work of libc into mainstream Gentoo Prefix,
and work with Gentoo Prefix community for anything left.
2. Give user an option to choose and switch between host libc and
Prefix libc on Linux.
7.1.2 Root privilege in Gentoo Prefix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Patch of portage for the feature of being able to escalate
itself to root privilege.
7.1.3 Gentoo Prefix on Android
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Distribute a native Gentoo installer (requiring root) as App on
Google Play.
2. Distribute a Gentoo Prefix installer (not needing root) as App
on Google Play.
Both being able to use HDMI output of Android device to run
Xorg. For Gentoo Prefix, this feature will require root privilege.
7.1.4 Timeline
~~~~~~~~~~~~~~~
TBD
7.2 Until Final
----------------
7.2.1 Display sharing
~~~~~~~~~~~~~~~~~~~~~~
1. A void kernel framebuffer driver either drop the data written
into it or forward the data to another framebuffer.
- Document how to use it on a bootloader unlocked Android device.
2. Tools for both Android and GNU to switch which to display.
- Include the tools in Gentoo distributions at Google Play.
3. Clients to read the void framebuffer and display it as a stream
of video.
7.2.2 Integration of GNU and Android
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This part is uncertain. We have no idea if Motorola or Canonical
would help. If not, reverse engineer the closed-source components
in Webtop 2.0. No estimation of time needed though.
7.2.3 Timeline
~~~~~~~~~~~~~~~
TBD
8 Reference
============
1. GenTop2 [http://forum.xda-developers.com/showthread.php?t=1617684]
2. linux-on-android: Port linux distributions to android-based phones [http://code.google.com/p/linux-on-android/]
[1] problems with bootstrapping in Gentoo-prefix [http://thread.gmane.org/gmane.linux.gentoo.alt/6459]
[2] emerge gcc 4.4.x/4.5.x fails on CentOS 5.5 [http://thread.gmane.org/gmane.linux.gentoo.alt/6110]
[3] >=sys-devel/gcc-4.3 fails with USE="-vanilla fortran" with some glibc's due to fortify patch [https://bugs.gentoo.org/289757]
[4] Multiarch [http://wiki.debian.org/Multiarch]
[5] PatchELF [http://nixos.org/patchelf.html]
[6] An expermental version of gentoo-prefix that uses a local libc [https://github.com/redlizard/gentoo-prefix-libc]
[7] glibc with prefix [http://article.gmane.org/gmane.linux.gentoo.alt/6543]
[8] Android Smart Phone Lapdock [http://www.motorola.com/us/consumers/Motorola-Lapdock-100/73945,en_US,pd.html]
[9] Transformer Pad Infinity [http://eee.asus.com/en/transformer-infinity/features]
[10] Webtop Achieved On Atrix Via HDMI Without A Dock [http://www.xda-developers.com/android/webtop-achieved-on-atrix-via-hdmi-without-a-dock/]
[11] A Busybox binary that is ready to be integrated into your Android project [https://github.com/Gnurou/busybox-android]
[12] BusyBox [https://play.google.com/store/apps/details?id=stericson.busybox]
[13] Linux Deploy [https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy]
[14] Linux on Android [http://linuxonandroid.org/]
[15] Debian Kit for Android [http://sven-ola.dyndns.org/repo/debian-kit-en.html]
[16] Debian Kit for Android [https://play.google.com/store/apps/details?id=org.dyndns.sven_ola.debian_kit]
[17] Ubuntu for Android [http://www.ubuntu.com/devices/android]
[18] analysis of webtop [https://sites.google.com/site/androidnothize/nebtop/webtop]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-soc] Project Idea: Gentoo On Android
2013-03-30 14:50 [gentoo-soc] Project Idea: Gentoo On Android heroxbd
@ 2013-03-30 15:51 ` Rich Freeman
2013-03-31 5:14 ` heroxbd
0 siblings, 1 reply; 4+ messages in thread
From: Rich Freeman @ 2013-03-30 15:51 UTC (permalink / raw
To: gentoo-soc
On Sat, Mar 30, 2013 at 10:50 AM, heroxbd <heroxbd@gmail.com> wrote:
> The thoughts collected so far are as follows. I am not sure if it is
> good to mix too much android things here in the second half. Maybe it is
> better only to do the first half with a couple of other more Gentoo
> related work?
Sounds very exciting, but perhaps a bit ambitious as well.
Sounds almost like two projects worth, if not three.
However, I'd certainly love to see this happen!
Rich
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-soc] Project Idea: Gentoo On Android
2013-03-30 15:51 ` Rich Freeman
@ 2013-03-31 5:14 ` heroxbd
2013-04-08 4:24 ` heroxbd
0 siblings, 1 reply; 4+ messages in thread
From: heroxbd @ 2013-03-31 5:14 UTC (permalink / raw
To: gentoo-soc
Dear Rich,
Rich Freeman <rich0@gentoo.org> writes:
> Sounds very exciting, but perhaps a bit ambitious as well.
>
> Sounds almost like two projects worth, if not three.
>
> However, I'd certainly love to see this happen!
Thank you very much for the encouragement!
Yes, I do think will need to split it into two. Now the question is how
much time I need to achieve the first part. I will figure out a timeline
with Prefix guys and come back with a revised project proposal.
Cheers,
Benda
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-soc] Project Idea: Gentoo On Android
2013-03-31 5:14 ` heroxbd
@ 2013-04-08 4:24 ` heroxbd
0 siblings, 0 replies; 4+ messages in thread
From: heroxbd @ 2013-04-08 4:24 UTC (permalink / raw
To: gentoo-soc
Dear All,
heroxbd <heroxbd@gmail.com> writes:
> Yes, I do think will need to split it into two. Now the question is how
> much time I need to achieve the first part. I will figure out a timeline
> with Prefix guys and come back with a revised project proposal.
I have come up with a revised draft of ideas.
http://www.awa.tohoku.ac.jp/~benda/projects/android.html
Details of how glibc is included in Gentoo Prefix are discussed. A new
section of bootstraping by cross-compilation is added.
Cheers,
Benda
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-08 4:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30 14:50 [gentoo-soc] Project Idea: Gentoo On Android heroxbd
2013-03-30 15:51 ` Rich Freeman
2013-03-31 5:14 ` heroxbd
2013-04-08 4:24 ` heroxbd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox