Hybris based Puppy for Smartphones & Watches?

What features/apps/bugfixes needed in a future Puppy
Post Reply
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Hybris based Puppy for Smartphones & Watches?

#1 Post by s243a »

Puppy already has arm version so is to some extent compatible with smartphones. However, as is noted on the termux wiki because android uses "Bionic C" rather than "GlibC" any binaries on puppy are likely not compatible with android unless they are statically compiled.
Termux uses Bionic libc

To have best compatibility with Android OS and remove the need of maintaining custom toolchains we compile all our packages with Android NDK. Resulting binaries are linked against Bionic libc (files libc.so, libm.so, libdl.so from /system/lib or /system/lib64).

Usage of libc provided by Android and FHS incompatibility disables ability to execute native packages copied from Linux distributions:

Dynamically linked programs will not run due to linker expected in nonexistent location (/lib) and libc ABI mismatch.
Statically linked programs (only networking ones) will not be able to resolve DNS names. GNU libc normally doesn't allow static linking with resolver. Also, the file /etc/resolv.conf is not exist on Android.
On non-rooted Android 8 or newer, statically linked programs will not run due to issues with seccomp filter.

However, these restrictions can be bypassed with proot.
https://wiki.termux.com/wiki/Differences_from_Linux
Manual installation of *.deb files

If you have a *.deb package file, you can install it with dpkg. Note that packages downloaded from Ubuntu or from repositories of other Linux distributions will not work due to incompatible libc ABI, however statically compiled binaries may work.
https://wiki.termux.com/wiki/Package_Management

If one wants puppy to run alongside android then the binaries must be built with "Bionic C" and this is probably easiest to do with the android development kit. However, if puppy is to replace android then we don't have to worry about building with "bionic c" and can use regular deb files.

I saw a video where someone has claimed to have done this on their phone with tahrpup. The problem is that there might be hardware on the phone which has no open source hardware driver.
There are two ways to solve this issue:

Open Source GPU drivers. This would be the ideal solution, as you would just be able to cross-compile the drivers for the proper, as well as fix bugs without having to ask the silicon manufacturer to fix the driver for you.
Bionic to Glibc library. Such library acts like libdl, and allows to load Bionic library and overrides some symbols from bionic with glibc based ones. This is exactly what libhybris does.
https://www.cnx-software.com/2013/04/08 ... -in-linux/

Android drives can be used on linux by using a compatibility midleware called libhybris. Some instruction for porting the android drivers to linux (using libhbris) can be found on the asteroids site:

https://asteroidos.org/wiki/porting-guide/

AsteroidOS is an opern source operating system used in smart watches. One interesting thing about it is that it uses OpenEmbeded, which BarryK also used in one version of easyOS. Another operating system which uses libhybris is Ubuntu Touch.

AsteroidOS and UbuntuTouch are two operating system which could be used as a basis for a version of puppylinux that is built for mobile devices. I'm not in any rush for a libhybris version of puppy but I wanted to start the discussion in case this idea inspires someone and also to help me remember this info in case I wanted to use it in the future. Also since such an operating system have simmilar CPU architecture with an arm based version of puppy, there could be some repo sharing between arm based versions of puppy with libhbris based versions.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#2 Post by s243a »

As a side note the halium project is trying to become the common middleware for libhybris based projects such as Ubuntu Touch and AsteroidOS. I don't know if halium is the bast way to utilize libhybris or not but there are instructions for using it with Ubuntu Touch at:

https://docs.ubports.com/en/latest/port ... ction.html
https://docs.halium.org/en/latest/porti ... index.html

Looking at the ubports.com link above, I think that going forward Ubuntu Touch is utilizing halium. I'm not sure what other hybris based projects are going to use halium going forward.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#3 Post by s243a »

On another note, I think that in a proot environment you can use normal deb files on android, since the proot environment will be using a different c library than the host OS. Perhaps this also applies to chroot (root required) on android.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

lmemsm
Posts: 51
Joined: Wed 27 Jun 2012, 15:01

#4 Post by lmemsm »

Biggest issue I've seen with Android development is that if you're doing anything in C/C++, it has to be in console mode. If you're okay with using some form of Puppy with no X Windows support (command line and ncurses support only) then porting programs should be fairly easy. Termux uses a Java based terminal emulator designed for Android and runs the various console programs through it. If you really want X Windows, there's an X server available from ( https://sourceforge.net/projects/libsdl-android/ ). I've read about some issues with usability but it is a way to run X based applications on Android. Any GUI applications that don't use some workaround like the XSDL XServer would need to be written in Java in order to run on the Android operating system. You can use C libraries like SDL, but to get a program with C/C++ code working, you're basically creating C/C++ libraries that are called from a Java program. The simplest programs can use minimal Java and do most of the work in C/C++, but they still require some Java code. Also, unless you're using a work-around like the XSDL XServer or a Terminal Emulator, applications are all sandboxed from each other. That can limit file space sharing and communication between applications.

You could completely replace the Android OS and use a Linux distribution on a watch or smartphone. There are products like Librem 5 that use a Linux operating system. It would be easier to port Puppy in a case like that.

Debian has a list of apps and scripts that run Debian chroot on Android: https://wiki.debian.org/ChrootOnAndroid
Haven't checked all of them but this one uses XSDL:
https://github.com/CypherpunkArmory/Use ... n-UserLAnd

Post Reply