The GameMode package provides a daemon, utilities, and libraries which allows games to request optimizations which then get applied to the host temporarily.
For the lib32 installation instructions, they require new Meson
cross files from
MLFS, as --libdir=/usr/lib32 has been moved
to the cross files and no longer appear in the instructions.
Install the new cross files so that 32-bit libraries don't get
installed in /usr/lib.
Install GameMode by running the following commands:
mkdir build &&
cd build &&
meson setup --prefix=/usr \
--libexecdir=/usr/libexec/gamemode \
--buildtype=release \
-D with-sd-bus-provider=elogind \
.. &&
ninja
Now, as the root user:
ninja install
Install lib32-GameMode by running the following commands:
rm -rf * &&
meson setup --prefix=/usr \
--buildtype=release \
--cross-file=lib32 \
-D with-sd-bus-provider=no-daemon \
.. &&
ninja
Now, as the root user:
DESTDIR=$PWD/DESTDIR ninja install && cp -vR DESTDIR/usr/lib32/* /usr/lib32 && rm -rf DESTDIR && ldconfig
Inspect meson_options.txt or
meson.options for a full list of
options.
--libexecdir=/usr/libexec/gamemode:
This parameter ensures there are no binary conflicts in
/usr/libexec.
--buildtype=release:
Specify a buildtype suitable for stable releases of the package, as
the default may produce unoptimized binaries.
-D
with-sd-bus-provider=elogind: This parameter ensures
that elogind gets used instead of systemd-logind, as Systemd is the
default in this package. You can override the requirement for
logind altogether via the next parameter.
-D
with-sd-bus-provider=no-daemon: This parameter disables
building the daemon which requires elogind-255.22 and inih. This is used
in the lib32 build since the daemon doesn't provide any libraries.
To automatically start the gamemoded daemon when the system is rebooted, install and the OpenRC service:
install -vDm755 /dev/stdin /etc/user/init.d/gamemoded << "EOF"
#!/sbin/openrc-run
# Starts the gamemoded daemon
# Authors: Zeckma - zeckma@linuxfromscratch.com
# Version: LFS #80a88
description="starts the gamemoded daemon"
supervisor=supervise-daemon
command_background=yes
command="/usr/bin/gamemoded"
EOF
As a regular user, enable the service:
mkdir -pv ~/.config/rc/{init,conf}.d &&
mkdir -pv ~/.config/rc/env &&
mkdir -pv ~/.config/rc/runlevels/{sysinit,boot,default,shutdown} &&
rc-update --user add gamemoded default