We have moved to a new Sailfish OS Forum. Please start new discussions there.
7

Has anyone tried installing Gentoo Prefix? [answered]

asked 2019-07-29 18:38:19 +0300

Raksura gravatar image

Hi,

I'll soon be buying a phone that is expected to support Sailfish OS (the community edition). I really like the idea of having something close to a standard UNIX-like OS on my phone, but I have concerns about the userland. From what I understand, Sailfish OS is likely to support Linux programs as long as their dependencies are met, but they still have to be ported manually.

I was wondering if Gentoo Prefix could be used to mitigate this. You would basically have to port Gentoo Prefix manually (and likely some of its dependencies as well), configure it to match Sailfish (e.g. use Wayland, systemd), and then you would be able to access most of the Gentoo userland by compiling it through your phone (or remotely using distcc) instead of having to port the rest manually.

Has anyone tried running a Gentoo Prefix install under Sailfish OS? If so, what are your results?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by molan
close date 2019-12-13 14:04:43.635352

Comments

2

In theory, you should have no problems running Gentoo in a prefix, or any other ARM GNU/Linux distro in either a chroot, or using LXC (in fact, Aliendalvik on the XA2 is basically AOSP 8.1 running inside LXC).

In practice the problems are going to be:

  • Nearly all usual GNU/Linux software expects an X11 server, whereas Sailfish uses Wayland instead. (Though there have been some successes using XWayland on Sailfish)
  • The Linux kernel in Sailfish is rather oldish: it's whatever was proposed by the manufacturer for android back when Jolla wrote the adaptation layer ("Baseport"). e.g.: Xperia X is stuck with an old 3.8, Xperia XA2 is 4.4. Also some drivers might be missing and the Xperia X has blocked modules support. So forget about NFS in Sailfish X. And user namespace won't work in LXC on Xperia X (root inside your LXC is going to be root on the device).

If all you want is just compiling software:

  • Some distro (specially old stable like CentOS and SUSE) have RPMs for ARM, they might work as-is. (I've been doing that for a couple of stuff, and other community member rely on Fedora's mksquashfs to support LZ4).
  • Mer Project has an Open Build System instance that can build packages for you. In my experience, lifting the SPEC files from SuSE is a good starting point.

Oh, and last tip: If you're going the "full distro" route (LXC, chroot, or Gentoo Prefix), buy a large microSD card, preferably one with "high endurance" (available from Transcend, Samsung, or most of the "industrial" product range).

DrYak ( 2019-07-29 20:44:04 +0300 )edit

1 Answer

Sort by » oldest newest most voted
6

answered 2019-12-13 00:20:47 +0300

vimja gravatar image

Hi

I have built a Gentoo prefix on my XA2. It works pretty well. Using the right USE flags I am able to launch applications in Wayland and have them interact with the native SailfishOS userland tools through the likes of dbus and pulseaudio.

I have uploaded a copy of my prefix for everyone to download and run. On my website you can find documentation on the build process, usage hints, the download link and a patched version of the bootstrap-prefix.sh script.

https://vimja.website/prefix/

edit flag offensive delete publish link more

Comments

Great! Thank you for sharing all of that.

Raksura ( 2019-12-13 11:36:57 +0300 )edit

Thanks a lot for your work, can't wait to test it on my Pro¹ when I get it (I'm afraid my Jolla C is too slow). The Pro¹ port is based on the XA2 too, so your prefix might work out of the box without the need to build it again (?).

Kabouik ( 2019-12-15 00:41:40 +0300 )edit

@Kabouik you should give it a try. I have since had time to do some more testing. It turns out that device compatibility is much better than I anticipated. It runs on the Jolla 1 and even a RaspberryPi 2. This is great since it enables binary package creation on the RaspberryPi, offloading the heavy lifting from the phone.

It may even be possible to build a new prefix on a RaspberryPi and then copy it over to your SailfishOS device once it's ready. I have not tested that though.

I have amended the article on my website accordingly.

vimja ( 2019-12-15 04:36:11 +0300 )edit

Excellent news @vimja. I failed to extract the .tar.gz, could you please add some instructions? I see instructions for building but not detailed steps to use your own build. Also, is there a mirror for your webpage?

Kabouik ( 2019-12-15 13:59:18 +0300 )edit

HI @Kabouik

I have added a section with rather extensive installation instructions, just for you ;) I hope this works for you.

There is no mirror for my webpage. Is the download very slow for you?

vimja ( 2019-12-16 00:18:25 +0300 )edit

Question tools

Follow
5 followers

Stats

Asked: 2019-07-29 18:38:19 +0300

Seen: 635 times

Last updated: Dec 13 '19