Comment 41 for bug 1768610

Revision history for this message
Iain Lane (laney) wrote :

This is the solution that I proposed to you in private. It is a fix to mesa (a "common" package) and a followup to nux-tools.

It needs some testing. In particular I don't think I picked the right mesa package to use, and we also need to check with the mesa maintainer. There are various version numbers in there that need to be correct for the target release.

A basic test worked OK though (libegl1-mesa is because I had it in an even more wrong package at the time). Remove nux-tools, broken conffile is left around, upgrade mesa, it's fixed, install new nux-tools and it's installed with the right content and no prompt:

root@nux-tools-test:~# apt remove nux-tools
...
root@nux-tools-test:~# ls /etc/X11/Xsession.d/50_check_unity_support
/etc/X11/Xsession.d/50_check_unity_support
root@nux-tools-test:~# sudo apt full-upgrade
...
Broken /etc/X11/Xsession.d/50_check_unity_support and removed nux-tools found, moving aside...
root@nux-tools-test:~# sudo apt install nux-tools
Found saved /etc/X11/Xsession.d/50_check_unity_support.mesa-save file, moving it back in place...
Unpacking nux-tools (4.0.8+18.04.20180613.5-0ubuntu2) ...
Setting up nux-tools (4.0.8+18.04.20180613.5-0ubuntu2) ...
Installing new version of config file /etc/X11/Xsession.d/50_check_unity_support ...
root@nux-tools-test:~# cat /etc/X11/Xsession.d/50_check_unity_support
# This file is sourced by Xsession(5), not executed.
# If the hardware does not pass unity_support_test, fall back to LLVMpipe
# which does.

if [ "x$DESKTOP_SESSION" = "xubuntu" ] && [ -x "/usr/lib/nux/unity_support_test" ]; then
    (
        IFS=':'
        for d in $XDG_CURRENT_DESKTOP; do
            if [ "x$d" = "xUnity" ] || [ "x$d" = "xUnity7" ]; then
                return 0
            fi
        done
        return 1
    )

    if [ $? = 0 ]; then
        /usr/lib/nux/unity_support_test || export LIBGL_ALWAYS_SOFTWARE=1
    fi
fi