Difference between revisions of "Hybris"

From postmarketOS
Jump to: navigation, search
(Using libhybris with your device)
(Install the hybris related packages: libhybris-7.1-caf if no more, X11 support is optional)
(3 intermediate revisions by one other user not shown)
Line 12: Line 12:
  
 
The way to do attain this, is:
 
The way to do attain this, is:
* Port halium (https://docs.halium.org , https://halium.org) to your device. This may take a while.
+
* Port halium 7.1 (https://docs.halium.org , https://halium.org) to your device. This may take considerable effort. Note that we only have hybris 7.1 packaged at the moment.
 
* Get it running to a point where you have at least graphics operational
 
* Get it running to a point where you have at least graphics operational
 
* It works if you run the same kernel source for both, and apply all defconfig changes needed for the halium port to your postmarketos port
 
* It works if you run the same kernel source for both, and apply all defconfig changes needed for the halium port to your postmarketos port
 
* Boot your halium-running device into android recovery, and download the <code>/data/system.img</code> file from it. This is the systemimage you've built for halium, with the modifications that the installation script has done.
 
* Boot your halium-running device into android recovery, and download the <code>/data/system.img</code> file from it. This is the systemimage you've built for halium, with the modifications that the installation script has done.
* Flash postmarketOS to your device
+
* Flash postmarketOS to your device, where you've included the necessary changes for halium
 
* Upload the system.img file to <code>/var/lib/lxc/android/system.img</code>
 
* Upload the system.img file to <code>/var/lib/lxc/android/system.img</code>
  
Line 23: Line 23:
 
<syntaxhighlight lang="shell-session">
 
<syntaxhighlight lang="shell-session">
 
$ sudo apk add lxc-android \
 
$ sudo apk add lxc-android \
              xf86-video-hwcomposer \
 
 
               libhybris \
 
               libhybris \
 +
              libhybris-7.1 \
 
               libhybris-egl \
 
               libhybris-egl \
 
               libhybris-gles \
 
               libhybris-gles \
Line 32: Line 32:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Depending if you need software which is built for Code Aurora Forum’s Android for MSM (generally nicknamed “CAF” for short):
+
For X11 support, install the following, depending if you need software which is built for Code Aurora Forum’s Android for MSM (generally nicknamed “CAF” for short):
 
<syntaxhighlight lang="shell-session">
 
<syntaxhighlight lang="shell-session">
$ sudo apk add libhybris-7.1-caf \
+
$ sudo apk add xf86-video-hwcomposer xf86-video-hwcomposer-7.1-caf               
              xf86-video-hwcomposer-7.1-caf               
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
For all the other devices:
 
For all the other devices:
 
<syntaxhighlight lang="shell-session">
 
<syntaxhighlight lang="shell-session">
$ sudo apk add libhybris-7.1 \
+
$ sudo apk add xf86-video-hwcomposer xf86-video-hwcomposer-7.1               
              xf86-video-hwcomposer-7.1               
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 08:25, 25 May 2019

Libhybris allows devices lacking FLOSS drivers to make full use of their hardware by using the proprietary drivers from Android. Mainlining and using free software drivers is of course the better approach, but it is not possible for all devices. We will not list devices that need hybris as featured devices (see postmarketos.org#83).

Using libhybris with your device

libhybris current usage

It is used for the Gemini PDA (non-CAF) and Samsung s4 mini duos (CAF) device ports.

Android system image

First thing to do is convert the halium generated system.img to a mountable image (basically what the halium install script does) and the new system.img to the device, to /var/lib/lxc/android/system.img

The way to do attain this, is:

  • Port halium 7.1 (https://docs.halium.org , https://halium.org) to your device. This may take considerable effort. Note that we only have hybris 7.1 packaged at the moment.
  • Get it running to a point where you have at least graphics operational
  • It works if you run the same kernel source for both, and apply all defconfig changes needed for the halium port to your postmarketos port
  • Boot your halium-running device into android recovery, and download the /data/system.img file from it. This is the systemimage you've built for halium, with the modifications that the installation script has done.
  • Flash postmarketOS to your device, where you've included the necessary changes for halium
  • Upload the system.img file to /var/lib/lxc/android/system.img

Install the hybris related packages

$ sudo apk add lxc-android \
               libhybris \
               libhybris-7.1 \
               libhybris-egl \
               libhybris-gles \
               libhybris-libwayland-egl \
               wayland-libs-client \
               wayland-libs-server

For X11 support, install the following, depending if you need software which is built for Code Aurora Forum’s Android for MSM (generally nicknamed “CAF” for short):

$ sudo apk add xf86-video-hwcomposer xf86-video-hwcomposer-7.1-caf

For all the other devices:

$ sudo apk add xf86-video-hwcomposer xf86-video-hwcomposer-7.1

Start the android container

$ sudo rc-service lxc-android start

Configure Xorg

You need to create the /etc/X11/xorg.conf.d/10-<device>.conf with the following:

Section "Device"
  Identifier "Card0"
  Driver "hwcomposer"
EndSection

Run hardware composer test (to verify it all works)

For a CAF device, use this command:

$ EGL_PLATFORM=hwcomposer test_hwcomposer_7_caf

For a non-CAF device, use this command:

$ EGL_PLATFORM=hwcomposer test_hwcomposer

See also