Installing and uninstalling hybris mesa packages kills device

Long story short:

I’m facing this problem and am looking for a solution:

https://together.jolla.com/question/229060/hybrismesa-package-replacement-maybe-screwed-up-my-system/

Part of the problem is similar to this:

https://together.jolla.com/question/224803/no-access-to-jolla-store-xt9-and-adaptation0-repos-after-incomplete-update-to-330-rokua/

Long story long:

I have the unhealthy habit on building apps and other programs directly on the SFOS device.

I have found previously, and just now, that installing and later removing dependencies of certain packages leaves the OS in an unstable state (up to the point that it will not boot).

Just now I installed the following packages, and upon realizing the build I wanted to do would not work, removed them again.

All this was done using pkcon install and pkcon remove.

libdrm-devel-2.4.97-1.3.1.jolla.armv7hl        Direct Rendering Manager development package
libdrm-nouveau-2.4.97-1.3.1.jolla.armv7hl      Direct Rendering Manager nouveau api
libdrm-omap-2.4.97-1.3.1.jolla.armv7hl Direct Rendering Manager omap api
libdrm-radeon-2.4.97-1.3.1.jolla.armv7hl       Direct Rendering Manager radeon api
mesa-llvmpipe-libEGL-19.3.3+git2-1.5.1.jolla.armv7hl   Mesa libEGL runtime libraries and DRI drivers
mesa-llvmpipe-libEGL-devel-19.3.3+git2-1.5.1.jolla.armv7hl     Mesa libEGL development package
mesa-llvmpipe-libGLESv2-19.3.3+git2-1.5.1.jolla.armv7hl        Mesa libGLESv2 runtime libraries
mesa-llvmpipe-libGLESv2-devel-19.3.3+git2-1.5.1.jolla.armv7hl  Mesa libGLESv2 development package
mesa-llvmpipe-libgbm-19.3.3+git2-1.5.1.jolla.armv7hl   Generic buffer management API
mesa-llvmpipe-libglapi-19.3.3+git2-1.5.1.jolla.armv7hl Mesa shared gl api library
qml-rpm-macros-0.0.5-1.1.12.jolla.armv7hl      Macros for handling QML
qt5-qtdeclarative-devel-5.6.3+git13-1.8.1.jolla.armv7hl        Qt Declarative - development files
qt5-qtdeclarative-qtquick-devel-5.6.3+git13-1.8.1.jolla.armv7hl        Qt Declarative - QtQuick development files
qt5-qtgui-devel-5.6.3+git17.1-1.13.1.jolla.armv7hl     Development files for QtGui
qt5-qtnetwork-devel-5.6.3+git17.1-1.13.1.jolla.armv7hl Development files for QtNetwork
qt5-qtsql-devel-5.6.3+git17.1-1.13.1.jolla.armv7hl     Development files for QtSql
qt5-qtdeclarative-qtquick-devel
dbus-devel-1.13.12+git5-1.6.1.jolla.armv7hl    Libraries and headers for D-Bus
expat-devel-2.2.9+git1-1.4.1.jolla.armv7hl     Libraries and header files to develop applications using expat
fontconfig-devel-2.13.1+git2-1.5.1.jolla.armv7hl       Font configuration and customization library
freetype-devel-2.10.0+git2-1.3.1.jolla.armv7hl FreeType development libraries and header files
libnemotransferengine-qt5-devel-1.0.5-1.7.1.jolla.armv7hl      Development headers for transfer engine library.
libuuid-devel-2.33+git2-1.6.1.jolla.armv7hl    Universally unique ID library
qt5-default-5.6.3+git17.1-1.13.1.jolla.armv7hl Qt5 development defaults packafge
qt5-qmake-5.6.3+git17.1-1.13.1.jolla.armv7hl   QMake
qt5-qtcore-devel-5.6.3+git17.1-1.13.1.jolla.armv7hl    Development files for QtCore
qt5-qtdbus-devel-5.6.3+git17.1-1.13.1.jolla.armv7hl    Development files for QtDBus
qt5-tools-5.6.3+git17.1-1.13.1.jolla.armv7hl   Development tools for qtbase
qtchooser-26-1.2.1.jolla.armv7hl       Qt Chooser
libsailfishapp-devel-1.2.10-1.6.1.jolla.armv7hl        Development library for Sailfish apps
mapplauncherd-qt5-devel-1.1.14-1.3.3.jolla.armv7hl     Development files for launchable applications

Problem:

After uninstalling, the app launcher does not work any more. Launching apps results in:

mapplauncherd[12287]: Booster: Failed to invoke: Booster: Loading invoked application failed: 'libEGL.so.1: cannot open shared object file: No such file or directory'

or

   error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory

Analysis and trying to fix it:

Now I can find out where those libs are supposed to be coming from with:

 # rpm -qf /usr/lib/libEGL.so.1
libhybris-libEGL-0.0.5.34-1.3.1.jolla.armv7hl
# rpm -qf /usr/lib/libGLESv2.so.2
libhybris-libGLESv2-0.0.5.34-1.3.1.jolla.armv7hl

However, trying to reinstall them gives:

# pkcon refresh && pkcon install libhybris-libGLESv2
Refreshing cache
Refreshing software list
Finished
Resolving                                                                                                        [                                                        ] (0%)  Package not found: libhybris-libGLESv2
Command failed: This tool could not find any available package: No packages were found

# pkcon search libGLESv2
Searching by details
Refreshing software list
Querying
Finished
Installed       libhybris-libGLESv2-0.0.5.34-1.3.1.jolla.armv7hl (installed)    OpenGL ES 2.0 for libhybris
Available       mesa-llvmpipe-libGLESv2-19.3.3+git2-1.5.1.jolla.armv7hl (jolla) Mesa libGLESv2 runtime libraries
Available       mesa-llvmpipe-libGLESv2-devel-19.3.3+git2-1.5.1.jolla.armv7hl (jolla)   Mesa libGLESv2 development package

# pkcon install libhybris-libGLESv2
Resolving                                                                                                        [                                                        ] (0%)  Package not found: libhybris-libGLESv2
Command failed: This tool could not find any available package: No packages were found

Using zypper does not help either:

# zypper install -f  libhybris-libGLESv2  libhybris-libEGL
Loading repository data...
Reading installed packages...
Forcing installation of 'libhybris-libEGL-0.0.5.34-1.3.1.jolla.armv7hl' from repository 'adaptation0'.
Forcing installation of 'libhybris-libGLESv2-0.0.5.34-1.3.1.jolla.armv7hl' from repository 'adaptation0'.
Resolving package dependencies...

The following 2 packages are going to be reinstalled:
  libhybris-libEGL libhybris-libGLESv2

2 packages to reinstall.
Overall download size: 57.9 KiB. Already cached: 0 B. No additional space will be used or freed after the operation.
Continue? [y/n/...? shows all options] (y): y
Retrieving package libhybris-libEGL-0.0.5.34-1.3.1.jolla.armv7hl                                                                               (1/2),  38.1 KiB ( 77.8 KiB unpacked)
Failed to provide Package libhybris-libEGL-0.0.5.34-1.3.1.jolla.armv7hl (adaptation0). Do you want to retry retrieval?

[adaptation0|plugin:/ssu?repo=adaptation0] Can't provide file './armv7hl/libhybris-libEGL-0.0.5.34-1.3.1.jolla.armv7hl.rpm' from repository 'adaptation0'
History:
 - Store credentials not received. Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
 - Can't provide ./armv7hl/libhybris-libEGL-0.0.5.34-1.3.1.jolla.armv7hl.rpm

Abort, retry, ignore? [a/r/i] (a):

Conclusions:

  1. What does lead to this?
    Answer: the two packages, mesa-llvmpipe-libEGL and mesa-llvmpipe-libGLESv2 install the same files (in part) as libhybris-libEGL and libhybris-libGLESv2, but they do NOT conflict. Installing the mesa packages will replace the library files, uninstalling the RPM will simply remove them.
    It appears the missing libraries ALSO prevent the store application to provide credential to the official/licensed repos, so neither pkcon nor zypper can retrieve the correct packages to fix it (I have not verified this latter part, but zypper did start to work again after they were replaced.)

  2. How to recover from this?
    Answer: not trivial. See the post below on how I did it.

1 Like

Right, so I have restored the missing two library files. Not terribly easy to do.

Prerequisites

  • a Linux machine
  • some storage space on that (about 8G)
  • root or sudo access to mount filesystem images
  • the simg2img tool, e.g. from https://github.com/anestisb/android-simg2img. There might be a android-tools package in your distribution which has that

Howto

  1. Download the SFOS install image from https://shop.jolla.com/. In my case, that was Sailfish_OS-Jolla-3.3.0.16-i4113-0.0.4.6.zip (for the Xperia 10 DualSIM). make sure to get the correct image for your device and SFOS version!
  2. Unzip the package
  3. inside, you find fimage.img001, which is an android-formatted filesystem image
  4. using the tool simg2img, convert it to a regular linux image: simg2img fimage.img001 fimage.img001.raw
  5. mount it somewhere: mount -oloop,ro fimage.img001.raw /mnt/image
  6. At the mounted location you will find Sailfish_OS-Jolla-3.3.0.16-i4113-0.0.4.6/root.img.gz, another filesystem image.
  7. uncompress and store the image somewhere: gunzip -c Sailfish_OS-Jolla-3.3.0.16-i4113-0.0.4.6/root.img.gz > /var/tmp/root.img
  8. unmount fimage.img001.raw
  9. mount the root image somewhere: mount it somewhere: mount -oloop,ro /var/tmp/root.img /mnt/image
  10. dig around the root fs in /mnt/image to find the missing files.
  11. Copy the files onto the broken device.
  12. Put them in the right place (/usr/lib) and run ldconfig
  13. Now applications should work again
  14. Reinstall the rpms to make sure ownerships etc are alright: pkcon install libhybris-lib{EGL,GLESv2}
1 Like

For those interested, I have made a simple RPM which should prevent this from happening in the future:

3 Likes