247 Commits

Author SHA1 Message Date
Ikey Doherty 10d3be6a38 redirect: Split all Unity code out to fix linking problems
This should fix our linking issues that appeared once we opted to include
the `fcntl.h` header, which adds `#define`s for the exact symbols that
we are trying to override.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-12-19 15:35:48 +00:00
Ikey Doherty 1b932e94fa redirect: Demote debug to info
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-12-19 14:21:59 +00:00
Ikey Doherty f12643039a common: Return realpath'd config dir where possible
This ensures we only use a sane realpath and collapse the slashes where
we can to allow trivial string matching.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-12-19 12:23:20 +00:00
Ikey Doherty 7cfdd41c7c redirect: Reduce error to info
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-12-18 18:55:16 +00:00
Ikey Doherty 889a4a7b7b Allow disabling Unity hack by the lsi-settings UI
By default we will keep this enabled now.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-12-18 18:54:46 +00:00
Ikey Doherty 4f810bfe97 redirect: Add workaround for the Unity Black Screen Of Nope
If we detect access to a unity3D configuration file, we'll enter the
unity3d workaround mode. Through this mode we'll abstract the real
"prefs" file away into `/dev/shm` so that Unity games do not directly
access that file again.

If no original prefs file exists, we'll write a new prefs file with the
absolute minimum requirement, i.e. disabling of fullscreen mode by default.
If one DOES exist, we'll copy all of the prefs file **except** for the
fullscreen option, and again, disabling it.

Upon library exit, again, we'll duplicate the unity config to the real
target file from the shm file, with the rewritten fullscreen option.

The net effect is that we create a circle of consumption that forcibly
disables unity games of a particular age (using `prefs` file) to not
start in fullscreen mode, which almost always means one of two things:

 - Missing UI text elements
 - Unity3D clamps resolution to 0x0

Many ports aren't going to see updates to their Unity build for a long time,
or indeed, ever. Instead we work around this in LSI and sit in between the
game and the configuration file.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-12-18 18:26:09 +00:00
Ikey Doherty 97e5813e4c intercept: Allow html5app_steam to load widevine
This should permit the encrypted playback to work correctly once more.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-12-15 18:35:52 +00:00
Ikey Doherty 0faa29aecd intercept: Handle /steamapps paths for #41
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-24 17:47:55 +00:00
Ikey Doherty 383b6492b5 shim: Fix vdpau for potential issues with not breaking the path
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-24 06:06:21 +00:00
Ikey Doherty f8b583bc0b intercept: Handle override of libudev.so.0 -> libudev.so.1
This should help with issue #38 but will need validation.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-15 14:34:37 +00:00
Ikey Doherty 00ee48ee22 data: If we're using snap mode, configure frontend to use lsi-exec
This will ensure that the settings UI will always work, which will
somewhat perversely use lsi-exec through the config that it sets to
launch itself to set the config of lsi-exec..

This will allow us to actually expose lsi-settings as a usable thing
within the snap, where it is currently omitted. If we're not using snapd
mode, we'll just keep the file how it used to look.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-15 00:15:05 +00:00
Ikey Doherty 947654d9d3 shim: Read config AFTER setting up the environment
Under snapd we forcibly change XDG_CONFIG_HOME away from the "norm", and
read before the variable is set. Thus, the config written by lsi-settings
is correct, but under snapd the wrong file would be read all the time.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 23:16:09 +00:00
Ikey Doherty c59949cf0e frontend: Fix copy/paste and actually update liblsi-intercept config
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 22:58:31 +00:00
Ikey Doherty 1d339cab05 shim: Drop derpy errno based checks
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 22:23:33 +00:00
Ikey Doherty a518fc6720 shim: Use a less derpy error dialog.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 22:09:50 +00:00
Ikey Doherty 03758879ab shim: Allow lsi-exec to use the system path (execvp) instead
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 22:07:10 +00:00
Ikey Doherty 7131fd9771 shim: Add a new lsi-exec binary
This binary will allow us to run any command using the full LSI environment
and fully set it up as we would for Steam, greatly simplifying the testing
of the snap (and even for non-steam games!)

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 22:03:44 +00:00
Ikey Doherty 5013e0d747 shim: Split majority of the code into shim.c
This helps separate the main launch entry from the bulk of the bootstrap
code, and will also allow us to build a new lsi-exec tool that will just
execute whatever you tell it to, with the full shim setup routine.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 21:53:18 +00:00
Ikey Doherty 05bd0e0dac common: Fix broken ikey mind - correctly build Steam path
Thanks to @TingPing for bailing me out of my own insanity.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 21:17:47 +00:00
Ikey Doherty aa1b7374db common: Respect XDG specification for directories
If `XDG_{DATA,CONFIG}_HOME` variables are set in the environment, use
those to ensure portability and integration with the platform. This ensures
we always use the right locations for accessing config files and the Steam
root.

This fixes #34.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 21:13:27 +00:00
Ikey Doherty 82130bfbe8 shim: Use SNAP_USER_COMMON for our home tree
LSI enables Steam, which will invariably have massive games on disk.
We do NOT want this large data being moved around between upgrades,
and need this data to be "sticky" and unversioned.

To alleviate le huge pains of upgrades, start using this directory before
we go into production. This will mean only one last switch of the games
tree.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 05:58:19 +00:00
Ikey Doherty d73b7e7381 shim: Support Ubuntu ICD files
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 04:43:53 +00:00
Ikey Doherty 9f57d0ebf0 intercept: Fix one of the Ubuntu crashes
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 03:58:41 +00:00
Ikey Doherty f8d12b9800 intercept: Fix compiler warnings
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 01:32:04 +00:00
Ikey Doherty b3a562f4f9 intercept: Remove old snapd paths
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 01:31:26 +00:00
Ikey Doherty 94e5d09eba intercept: When in Steam mode, try to find host libraries ourselves
This gives help when LD_LIBRARY_PATH is a bit busted, as the "normal"
operational mode gets more help than we currently give to games.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 01:30:37 +00:00
Ikey Doherty 04e32cd5c5 intercept: Attempt using existing code-paths for all snapd libgl work
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-14 00:24:16 +00:00
Ikey Doherty cd5a1e6f97 intercept: Clamp down that intercept properly
Again for #38

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 18:45:59 +00:00
Ikey Doherty 287781356c intercept: Help Fedora by redirecting bzip2 automatically
Fedora doesn't seem to have `libbbz2.so.1` so let's intercept requests for
this guy and send them to the proper `libbz2.so.1.0.6`.

This fixes #38.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 18:44:32 +00:00
Ikey Doherty 80603598af Only use the new "gl32" location from now on, drop old guy
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 03:46:24 +00:00
Ikey Doherty e81f379882 shim: Make the vdpau code handle biarch, multiarch, and host
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 03:03:56 +00:00
Ikey Doherty 8d7b56f68c shim: Get ready for the new Vulkan snapd changes
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 02:14:54 +00:00
Ikey Doherty 87fab0c747 shim: Prepare for gl32 snapd paths
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 01:35:46 +00:00
Ikey Doherty 208585eebc shim: Fix broken shim_export_ld_dir, export VDPAU_DRIVER_PATH
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 01:33:47 +00:00
Ikey Doherty 01237d30c6 shim: Take a far more robust approach to LD_LIBRARY_PATH
This ensures we correctly set up `LD_LIBRARY_PATH` with required extra
directories inside the snap environment - only if they actually exist.
This allows us to expand that search path to ensure that tls and vdpau
bits are available on multiarch systems, and things continue to tick
over as normal on biarch systems.

This is part of tackling issue #35.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-13 00:07:17 +00:00
Ikey Doherty 4b6ec38bbf intercept: Don't match non-cuda files
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-12 11:06:20 +00:00
Ikey Doherty 393d335af4 shim: Add initial support for Vulkan under snapd
This will require modifications to snapd, but at the moment we'll attempt
to look for vulkan icd (`10*.json`) passed from the hostfs from their
proprietary NVIDIA driver within the GL shared directory.

If we find these files, we'll insert the `VK_ICD_FILENAMES` variable into
the environment, taking care to preserve the original glob order by doing
this part in reverse.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-11 22:26:52 +00:00
Ikey Doherty 02ccceae42 intercept: Fix swiftshader
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-11 05:39:04 +00:00
Ikey Doherty 2462f93f39 intercept: Never deal with /var/lib/snapd in DRI requests
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-11 05:05:13 +00:00
Ikey Doherty b34e3f928d shim: When Solus d-bus is used, silence endless D-BUS warnings.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-11 04:37:09 +00:00
Ikey Doherty 9da279eeda intercept: Redirect all curl.so.3 to curl.so.4
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-11 00:19:32 +00:00
Ikey Doherty 8effde3adf Whoops.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 23:27:06 +00:00
Ikey Doherty c7882a9ac7 shim: Ensure XDG_RUNTIME_DIR always exists
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 23:16:42 +00:00
Ikey Doherty 3e15d71936 shim: Make sure the user directories are set up under snapd
This fixes up the `XDG_*` variables and locations to be correct and
present when running under snapd.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 23:14:48 +00:00
Ikey Doherty 8d50a4f289 shim: Add some more bootstrap variables
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 23:07:39 +00:00
Ikey Doherty 589dda31a5 shim: Add new simplified variable management code
This will allow us to extend the number of bootstrap variables we need
to set up for snapd, and actually makes the existing code much simpler
to follow when dealing with existing environmental variables.

With this change we also introduce initial bootstrap for setting the PATH,
as it's incorrect on entering the snap.

This is part of the ongoing issue #30.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 23:00:17 +00:00
Ikey Doherty c2ba77b5ab Revert "intercept: Add initial test workaround for libpdf.so"
This reverts commit aa485def04.
We'll look elsewhere until this is solved..
2017-11-10 07:21:00 +00:00
Ikey Doherty aa485def04 intercept: Add initial test workaround for libpdf.so
We're seeing some games ship libpdf.so as a directory in their bin
directory with the real library in the lib directory, so this workaround
will hopefully alleviate the crash on start.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 07:11:08 +00:00
Ikey Doherty 492d7d02f9 intercept: Add initial test fixes for open source drivers on snapd
This will forcibly perform redirects for "missing" DRI libraries to
help open source drivers actually work. This is as yet untested.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 03:46:56 +00:00
Ikey Doherty 8efc9a6b76 intercept: Use very explicit SDL blacklisting approach
This solves #31 by ensuring we only blacklist known library names that
we intend to override, and prevent ourselves from matching completely
moody names like "libSDL2_locale" by accident.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-10 02:23:00 +00:00