[Question] Building Arch on top of Android HAL - OS Porting

So if my understanding is correct, Ubuntu Touch was at it's core Ubuntu on top of the android OpenGL ES2.0 HAL and drivers, stagefright, RILD, and Android HAl for camera and imagge processing. Am I correct so far? If so, would it be possible to build another operating system off this platform say Arch for example, locate/code the apps needed to access radios, and then have a full linux distro in your pocket? I'm asking this because I want more from my device (Nexus 6, Nexus 7 2013, and Zenfone2) Are any projects similar to this already in development?

Related

[Q] Pure Linux Phone OS ROM Possible on ZF2?

Hey all. Ever since I learned about the ZF2 and it running on an Intel CPU/SoC vs a typical ARMv7 or ARMv9-based CPU/SoC this idea came to mind. Would it possible to develop a pure Linux (non-Android) based OS/ROM for this device? I run Funtoo Linux (a Gentoo derivative) on one of my desktops and now on a laptop I'm sharing with my brother, and it works great. Having this (or something Ubuntu-based to ease on pkg installs via binaries vs compiling from source for everything) on a phone this powerful would be awesome as well. Besides drivers for baseband / bootloader (of which I know is currently locked at the moment I'm posting this thread) how difficult would this be to accomplish? Does this device boot with EFI? I'd think compiling a kernel for it would be easier than a typical Android kernel since Intel spec is easier to compile for... I'm no developer, but that's my take on it.
Thoughts?

Nexus 5x 32-bit kernel?

I just got my Nexus 5x in! I've never developed for Android before, so this is all a new experience for me. I managed to get a 6.0.1_r30 generic arm build compiled (forgot to `lunch` for bullhead), so I know my environment is finally sane. However, I'd like to get some clarification on the Snapdragon 808.
I know the Snapdragon 808 is based on the ARMv8-a architecture, which means that it should, in theory, be both arm and arm64 compatible. And, from the look of devices/lge/bullhead/BoardConfig.mk, it appears that the default kernel is dual-arch arm and arm64. However, the primary arch is arm64. I'd like to attempt to build a kernel that's arm (armv7-a-neon) only. You might ask, "Why would you want to do that?" Well, I would like to build Ubuntu Touch for the device. Ubuntu touch is using the KitKat dev tree, so is only 32-bit compatible. Attempts to expand the KitKat tree with an arm64 cross-compilation toolchain were fruitless after spending countless hours attempting it.
At this point, I don't even know if it's worth trying for a couple of reasons:
Hardware drivers are Lollipop, Ubuntu Touch is KitKat
I don't know if ARMv8-a will boot a 32-bit kernel out-right or it has to start in 64-bit mode and drop to 32-bit (if that's the case, would the kernel know to do that? Or does the CPU start in 32 bit mode and bump up to 64 bit mode)?
It's probably pretty unlikely that dropping in a pre-built Lollipop kernel into the Ubuntu Touch dev tree would work -- different ABI's (That's the ever-changing kernel/Android-specific API/syscalls, right?)
So, I'm looking for some help clarifying any of these issues. Is there anybody here really familiar with ARM that could answer these questions? Heck, if these are non-issues, I might even attempt a build.

[ROM] [DEV] Archlinux Phone - GNU/Linux for Android devices project

Archlinux Phone for Sony Xperia S
Part of GNU/Linux for Android devices project
First of all, this project is not ready for end users but everything is provided to build an archlinux system for the Sony Xperia S. So you will be able to have a complete system with GPU hardware acceleration, support of vibrator, sensors, GPS, wifi etc (everything is not yet tested like bluetooth, nfc...). Graphical applications are already able to display (Qt/Kwin tested but GTK3/kwin should be ok too).
This project is not just for this device and is really open to support multiple devices and GNU/Linux distributions. So you can share this project everywhere (xda, distributions forum...) ! Contribution are welcome and can be discussed directly on this thread to share efforts.
Introduction
This is a project to create a convergence between the desktop and the mobile/phablet/TV... so to build new mobile OS based on existing GNU/Linux distributions with the most common parts possible. We share some common base between mer-hybris (SailfishOS) and Ubuntu Touch but the architecture and integration are different (refer to Architecture).
Cell phone are powerful and expensive for flag ship so why just use it as a phone ?
Imagine that your cell phone can become your core device ! Plug it to a big screen and this is your workstation ! Plug it to an 'empty' laptop (no CPU, no RAM needed ...) and this is your laptop ! Move everywhere and this is just your mobile phone !
This is what motivate this project.
Applications
Applications are critical on a mobile platform and we hope to support Android application as soon as possible (need further studies to complete the architecture).
GNU/Linux applications are already compatible but not always adapted for a mobile phone for now but... We hope a lot of plasma mobile and KDE convergence guideline for Application developers
Source code
There is few projects and some fork available under my github but if you want to start to port a new distribution or a new device, everything is documented in the gnulinux_support project.
Android needs to be modified but we deliver a solution that permit to be integrated upstream and so to compile Android or Android for GNU/Linux with the same code.
For now we have only Android 5.1.1 patches available but 6.0 will come soon. CyanogenMod 12.1 and 13.0 can be a good target to support a lot of devices in the future (or at least to simplify the portage process per device).
manifest for Sony Xperia S
manifest for Pure AOSP 5.1.1 (can be used for Nexus devices)
Documentations
Architecture schema
Main documentation
Archlinux installation
Videos
https://vimeo.com/177893595
Distributions supported
archlinux (archlinuxarm)
Project status
This project is in an early stage and for developers but we created solid base of works and the portage of plasma mobile, ofono, ... and amazing features will start over those solid base to provide an end user product
Todo :
pulseaudio support for GNU/Linux - Android Hw (and maybe for Android to support sound from Android application)
fix libinput/kwin environment
ofono (or maybe an alternative/hybrid solution that can use the Android Telephony Framework ? no study yet on this point)
flashing after boot.img package update + generation of a custom initramfs
security with crypto, firewall and SELinux (SELinux or equivalent integration will mainly depend of the distribution support but for now this is disabled)
plasma mobile or other ?
localisation framework (see freedesktop project)
OMX
merge everything possible to every upstream projects used to create GNU/Linux for Android devices
overlayfs into kernel ? (not mandatory but can be a great solution for the Android rootfs and schroot)
... (a lot that I forget)
BUT despite this long list of todo... We already did :
New architecture (GNU/Linux and Android integration, systemd, libhybris, chroot, wayland ...)
SurfaceFlinger Composer supported by Qt and Kwin
schroot for Android (Android can run into a chroot and we can interact easily with it)
systemd integration (with reboot to bootloader and recovery, Android /init support, etc)
libhybris_ext (compatibility version with support of Android 5+)
Android integration with GNULINUX_SUPPORT (rc, init, busybox, ramdisk, OTA ... adaptation)
clean rootfs with only 2 symlinks that permit to see that we are on an Android device (nothing more)
OpenGL support (with backend hwcomposer or SurfaceFlinger)
Archlinux support (OTA and packaging)
Design a possible solution for a lot of other GNU/Linux distributions (share architecture and Android adaptation)
Documentation
Download
Binaries will be available when really usable for end user. For now everything can be compiled from source code
Devices supported
Sony Xperia S (nozomi): work in progress (this is our reference device)
RESERVED
I will provide OTA file, binaries (archlinux packages), images and video to show what is working and how really soon
Very interested in this,is HDMI out working?
Στάλθηκε από το 6045Y μου χρησιμοποιώντας Tapatalk
Demetris said:
Very interested in this,is HDMI out working?
Στάλθηκε από το 6045Y μου χρησιμοποιώντας Tapatalk
Click to expand...
Click to collapse
Multi screen is not yet supported on kwin_wayland so for now I have just focused to render on the main screen (0) but it will be possible to do it for hdmi (1). But for sure I hope to support hdmi output.
For now I will focus to port plasma-mobile/ofono/pulseaudio.
Impatient to try another gift from genius mickybart.
Waiting............
wow something new
waiting eagerly...
lovely, cannot wait to try it
finally there is hope to ditch android, ios and windows
I have not a lot of time to work on this project with the release of nAOSP b11 but once done I will rework on it and provides binaries for Devs.
But, I think that this "new OS" powered with plasma is a good choice and I'm happy to see that plasma 5.7 integrate such kind of features :
https://www.kde.org/announcements/plasma-5.7.0.php
https://blog.martin-graesslin.com/blog/2016/05/virtual-keyboard-support-in-kwinwayland-5-7/
Great improvement have been done on Wayland support too.
If some of you are interesting to do some packaging with Archlinux, I'm really interested to get some help to provide a usable system for end user. The work for now is more too package/install user tools (so integration of components). I miss pulseaudio and ofono patching but I'm optimist to solve every issues.
finally nAOSP 6.0 b11 and b12 took me more time than expected but I'm back on this project.
For information, I updated everything to Qt 5.7.x support.
Some pull request have been done and are in discussion for at least qt5-qpa-hwcomposer-plugin (mer-hybris).
I decided to don't provide binaries for now as there is not a lot of sense to do it except if you are interesting to help the project (mainly to package some stuffs, integrate tools for GPS, ofono, pulseaudio etc).
I just finalized to record a small video. I will cut it and upload it to prove that archlinux arm phone can be a reality with the proposed new architecture (and on our Xperia S).
I will work again on the kwin/libinput issue. Maybe just a logind/dbus/kwin discussion issue. Once fixed that should permit to have a graphical keyboard by default (I know that for iOS or Android this is normal... but not really on a GNU/Linux desktop) !
I continue to look for help on this project and if you can create some packages like the one for plasma-mobile and derived repo let me know in PM or in the thread.
small video of the project
https://vimeo.com/177893595
Great achievement today
libinput is working and so I'm now able to move windows, plug a keyboard to write a text file, plug the mouse (pointer is not visible) ...
Menus are well displayed now with the good size.
Next steps : pulseaudio, wifi, plasma-mobile... (and bug fix on the kwin backend).
wow mickybart !. u just struck my interest in coming back to this phone! amazing work. my phone was unusable and parts needed replacement. looking at the activity of yours in this section made me repair the device and try out your work.. cheers mate! keep going with ur awesome work!
OnePlus X (onyx) port
I'd like to port this to OnePlus X (onyx). What's a preferable Android OS that I should use? The device comes with manufacturer's OxygenOS, which was made open source. OxygenOS was based on Android 5.1.1. I've also used Cyanogenmod 13 on this device. Out of these 3 options, I prefer CM. Any considerations I should keep in mind making this choice?
latgarf1 said:
I'd like to port this to OnePlus X (onyx). What's a preferable Android OS that I should use? The device comes with manufacturer's OxygenOS, which was made open source. OxygenOS was based on Android 5.1.1. I've also used Cyanogenmod 13 on this device. Out of these 3 options, I prefer CM. Any considerations I should keep in mind making this choice?
Click to expand...
Click to collapse
I have a Sony Xperia S and a OnePlus One and I'd like this port!
On my OnePlus One I'm using Ubuntu Touch that is very cool but apt-get doesn't work so I can't install other apps.
I really like this on my "old" Xperia S !
latgarf1 said:
I'd like to port this to OnePlus X (onyx). What's a preferable Android OS that I should use? The device comes with manufacturer's OxygenOS, which was made open source. OxygenOS was based on Android 5.1.1. I've also used Cyanogenmod 13 on this device. Out of these 3 options, I prefer CM. Any considerations I should keep in mind making this choice?
Click to expand...
Click to collapse
Hi @latgarf1,
Sorry for my late answer. I'm busy with Android 7.
That would be nice to have another device on this project to have a better view and maybe have a real alternative in the future .
I will ask a moderator if we can move this thread to a general one.
Advantage to use Android 5.1.1, is that every patches are available and tested to run Archlinux with android Hw support.
But as OxygenOS is not pure AOSP you will maybe need to cherry-pick those patches.
So it is preferable to maybe try to use CM-13 but everything need to be done on that side. I have now a device (Samsung S3) that is able to run CM-13.0 so I will be able to help in case of an issue to port the code to CM-13.0.
The big advantage to try to do it on CM-13.0 is that we can touch a lot of device in the future ! If CM is open, we will be able to push the patches upstream because those patches will not interfere with Android build as this is the case for Ubuntu Touch and mer-hybris patches.
I have not take a lot of time to continue this project since a while but I'm able to run desktop applications with windows management + opengl acceleration etc... I need to work on audio part (in progress), modules to integrates sensors (but sensors are already working). The last video posted do not show those progress.
Let me know your advice and if you thing to base your work on CM 13.0, I will probably switch the development to the Samsung S3 instead of Xperia S (but I will try to keep Xperia S in sync ).
I'm really interested to have some help to speed up this project and to have more motivation for it
You can take a look on the documentation and let me know if you need some help (that will permit me to improve the documentation too).
nik012003 said:
I have a Sony Xperia S and a OnePlus One and I'd like this port!
On my OnePlus One I'm using Ubuntu Touch that is very cool but apt-get doesn't work so I can't install other apps.
I really like this on my "old" Xperia S !
Click to expand...
Click to collapse
Here I really want to don't do any difference between a PC and a smartphone. So every tools used on a PC should work on the smartphone (update the kernel and manage initrd should be, at the end, possible to do in the same way than on the desktop ).
Do you know if you are using pulseaudio on Ubuntu Touch ? And do you know in which way it is done ?
For now I'm following mer-hybris and Sailfish to implement it by creating a droid module for pulseaudio.
mickybart said:
...
Advantage to use Android 5.1.1, is that every patches are available and tested to run Archlinux with android Hw support.
But as OxygenOS is not pure AOSP you will maybe need to cherry-pick those patches.
So it is preferable to maybe try to use CM-13 but everything need to be done on that side. I have now a device (Samsung S3) that is able to run CM-13.0 so I will be able to help in case of an issue to port the code to CM-13.0.
The big advantage to try to do it on CM-13.0 is that we can touch a lot of device in the future !
Let me know your advice and if you thing to base your work on CM 13.0...
I'm really interested to have some help to speed up this project and to have more motivation for it
You can take a look on the documentation and let me know if you need some help (that will permit me to improve the documentation too).
Click to expand...
Click to collapse
I've not tried arch but have attempted similar to this project with Debian (raspbian) on ancient hardware with partial success.
As free time rears its rare head I'll be trying to adapt your project for my newer HTC based on cm13.
By the way, your work on N ril from github is great, allows my cm14 to get/make calls without rebooting. Now if I can just figure out why rild takes forever to stop dying and respawing and start actually running...
mickybart said:
Hi @latgarf1,
Sorry for my late answer. I'm busy with Android 7.
That would be nice to have another device on this project to have a better view and maybe have a real alternative in the future .
I will ask a moderator if we can move this thread to a general one.
Advantage to use Android 5.1.1, is that every patches are available and tested to run Archlinux with android Hw support.
But as OxygenOS is not pure AOSP you will maybe need to cherry-pick those patches.
So it is preferable to maybe try to use CM-13 but everything need to be done on that side. I have now a device (Samsung S3) that is able to run CM-13.0 so I will be able to help in case of an issue to port the code to CM-13.0.
The big advantage to try to do it on CM-13.0 is that we can touch a lot of device in the future ! If CM is open, we will be able to push the patches upstream because those patches will not interfere with Android build as this is the case for Ubuntu Touch and mer-hybris patches.
I have not take a lot of time to continue this project since a while but I'm able to run desktop applications with windows management + opengl acceleration etc... I need to work on audio part (in progress), modules to integrates sensors (but sensors are already working). The last video posted do not show those progress.
Let me know your advice and if you thing to base your work on CM 13.0, I will probably switch the development to the Samsung S3 instead of Xperia S (but I will try to keep Xperia S in sync ).
I'm really interested to have some help to speed up this project and to have more motivation for it
You can take a look on the documentation and let me know if you need some help (that will permit me to improve the documentation too).
Here I really want to don't do any difference between a PC and a smartphone. So every tools used on a PC should work on the smartphone (update the kernel and manage initrd should be, at the end, possible to do in the same way than on the desktop ).
Do you know if you are using pulseaudio on Ubuntu Touch ? And do you know in which way it is done ?
For now I'm following mer-hybris and Sailfish to implement it by creating a droid module for pulseaudio.
Click to expand...
Click to collapse
I don't know how the audio works but I know that it works.
This is the ubports repo https://github.com/ubports?tab=repositories
If you want me to type some commands on the ubuntu touch terminal let me know.
EDIT : I searched and I think that the Oneplus port is using pulseaudio but I don't know how does it work.
https://wiki.ubuntu.com/Touch/Core/PulseaudioProfiles
nik012003 said:
I don't know how the audio works but I know that it works.
This is the ubports repo https://github.com/ubports?tab=repositories
If you want me to type some commands on the ubuntu touch terminal let me know.
EDIT : I searched and I think that the Oneplus port is using pulseaudio but I don't know how does it work.
https://wiki.ubuntu.com/Touch/Core/PulseaudioProfiles
Click to expand...
Click to collapse
Thanks. I will give it a try but to have a more automatic process I will maybe follow what is done in mer-hybris :
https://github.com/mer-hybris/pulseaudio-modules-droid

KVM Kernel

Hello everyone.
As in subject, I'm looking for a KVM Enabled Kernel, to flash on my device.
I'm looking for:
1) File to download
2) Commands to FastBoot
3) A way to ensure it works
Thanks in advance for any help.
Bye, Ivano.
P.S.: I forgot to mention, it's a ZE551ML Z00AD
P.P.S.: Nevermind, I successfully flashed KVM on device, but I can't use it on Limbo yet (I get an error about missing modules, but they're there).
Any help greatly appreciated.
I never got limbo to work, I have exact same model you have (Z00AD) and I've got kvm working with QEMU.. Limbo doesnt detect kvm properly it doesn't see the kernel modules loaded..
Theres a few guides on here how to use QEMU but as a VERY rough idea on what you need to do is:
Install a chroot linux on the phone (I used Linux Deploy to set up Ubuntu with Xterm)
After chroot setup, install qemu-kvm with apt. And on the Android OS install aSpice client from play store
Move the install images/hdd images to the phone storage (if preinstalled os hdd with Virtualbox or something)
Launch qemu with --enable-kvm and -cpu host to get kvm working, adjust other options as needed
Sorry for such a quick write up I'm busy atm, can help more later
My problem is that gpu won't work with chroot
You wont get gpu access with chroot, some devices have GPU's that have some support but unfortunately our
specific PowerVR chips dont have support.. using QEMU with kvm will allow you to still use all other parts of your hardware, and using spice will allow the use of the QXL video driver that provides some basic acceleration in the guest.
Either that or in the chroot compile and build your own version of qemu with -virglrenderer enabled, but the virgl option is very beta and may not work
Edit: Limbo is just a front end to QEMU so you wont have any new features that qemu doesn't have.. just Limbo is a port of qemu that's stripped down to work on Android
In this case, I don't need this anymore.
Thanks for your help.
What kind of 3D software/GPU needy task are you needing? Because in theory I've read that a linux chroot may still have some graphics acceleration on android devices due to some linux device firmware has OpenGL ES support (which is what runs on android devices, a subset of standard OpenGL) but how I personally am not sure.. I know there is GL4ES that supposed to allow OpenGL calls to be converted/linked to OpenGL ES calls but you would have to compile it from source as it's aimed at arm hardware..

Upgrading kernel versions on HD10 Suez

I've been trying to update the kernel version on the HD 10 Suez 2017. I am using the sources from this link https://github.com/chaosmaster/android_kernel_amazon_suez/tree/lineage-16.0 on the master Branch I cannot get the the device to boot when building a kernel. However if I use the Android 16 branch, I can get the device to boot but I have an irregularity that I cannot seem to figure out. The screen will go black. It doesn't turn off it just goes black that's if you stop touching the screen or you stop moving the device. aside from that I have not been able to see if anything else is affected but I can get the kernel versions updated at least two 3.18.22 but I haven't continue further because of this the weirdness. I have not tried any other sources as of the moment but was wondering if anybody is run into this problem.
Would this help at all? It’s the googlesource for MTK kernel 3.18
Have you tried building lineage 17 or 18 yet?
https://android.googlesource.com/kernel/mediatek/
https://www.xda-developers.com/alldocube-x-10-5-inch-android-8-1-oreo/
Mt8176 running Oreo 8.1. Supposedly project treble compatable too. Could this mean 8.1 for the HD10 and/or treble support too?
Fix MediaTek no display bug
MediaTek has a family of SoCs that are used in (among other devices) several Chromebooks, such as the MT8173 used in the Lenovo N23 Chromebook and Acer Chromebook R13, plus the MT8183 in the Lenovo IdeaPad Duet Chromebook. We are working hard to have better upstream support for these devices, especially Enric Balletbo, who has been involved in kernel and Chromebook upstream support for a long time. The displays on MT8173 based devices were not functional when using the mainline kernel, this has been rectified with this kernel release.
The cause of this defect was a conflict between the clock and DRM drivers. He found that two different drivers - the MT8173 clocks controller driver, and the MT8173 DRM driver were using the same compatible string mediatek,mt8173-mmsys. This is a problem since in such cases only the first matched driver will be probed. The other one, in this case the DRM driver, never gets probed and so the display was not made available for use. In a collaborative effort between Enric Balletbo and the MediaTek SoC maintainer Matthias Brugger, a top level mmsys driver (Multi-Media subsystem) was introduced to register the clock and DRM drivers. See 1, 2.
Linux 5.8 probably fixed your display bug. What is the chance of moving this tablet up to android 10/11?
source:
https://www.collabora.com/news-and-blog/news-and-events/kernel-5.8.html

Categories

Resources