2016-08-06 13:04:44 +00:00
|
|
|
#!/bin/bash
|
2016-08-05 21:02:44 +00:00
|
|
|
|
2016-08-06 13:04:44 +00:00
|
|
|
#
|
|
|
|
# Make errors visible upon `docker logs -f steam` command
|
|
|
|
#
|
2016-08-05 21:02:44 +00:00
|
|
|
exec 2>&1
|
|
|
|
|
2016-10-25 11:32:32 +00:00
|
|
|
service dnsmasq start
|
|
|
|
|
2016-08-05 21:02:44 +00:00
|
|
|
#
|
2016-08-06 13:04:44 +00:00
|
|
|
# Befriend with grsecurity patched Linux kernel
|
2016-08-05 21:02:44 +00:00
|
|
|
#
|
|
|
|
# TODO: find a way how to set these attributes dynamically,
|
2016-08-06 13:04:44 +00:00
|
|
|
# since this currently requires a Steam restart
|
|
|
|
# when new content is obtained.
|
2016-08-05 21:02:44 +00:00
|
|
|
if [ -f /proc/sys/kernel/grsecurity/tpe_gid ]; then
|
|
|
|
groupadd -r -g $(cat /proc/sys/kernel/grsecurity/tpe_gid) grsec-tpe
|
|
|
|
usermod -aG grsec-tpe $USER
|
|
|
|
setfattr -n user.pax.flags -v "m" \
|
|
|
|
/lib/i386-linux-gnu/ld-2.19.so \
|
|
|
|
$HOME/.local/share/Steam/ubuntu12_32/steam \
|
|
|
|
$HOME/.local/share/Steam/ubuntu12_32/steamwebhelper \
|
2016-08-05 23:34:36 +00:00
|
|
|
$HOME/.local/share/Steam/ubuntu12_32/gameoverlayui \
|
2016-08-07 10:47:59 +00:00
|
|
|
$HOME/.local/share/Steam/steamapps/common/Half-Life/hl_linux \
|
|
|
|
$HOME/.local/share/Steam/steamapps/common/Counter-Strike\ Global\ Offensive\csgo_linux64
|
2016-08-05 21:02:44 +00:00
|
|
|
# paxctl -c -v -m /lib/i386-linux-gnu/ld-2.19.so
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
2016-08-06 13:04:44 +00:00
|
|
|
# Add a user to a detected "video" group
|
|
|
|
# so that it can access the nvidia devices
|
|
|
|
#
|
|
|
|
if [ -e /dev/nvidiactl ]; then
|
|
|
|
GID=$(stat -c '%g' /dev/nvidiactl)
|
|
|
|
groupadd -r -g $GID nvidia1
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
usermod -aG nvidia1 $USER
|
|
|
|
else
|
|
|
|
GROUP=$(stat -c '%G' /dev/nvidiactl)
|
|
|
|
usermod -aG $GROUP $USER
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-08-07 11:34:03 +00:00
|
|
|
# Use libgcrypt provided by the Steam docker image (needed by HL1 engine games)
|
2016-12-12 20:52:38 +00:00
|
|
|
LD_PRELOAD="$LD_PRELOAD:/lib/i386-linux-gnu/libgcrypt.so.11:/lib/x86_64-linux-gnu/libgcrypt.so.11"
|
|
|
|
export LD_PRELOAD
|
2016-08-07 11:34:03 +00:00
|
|
|
|
2016-08-06 13:04:44 +00:00
|
|
|
#
|
2016-08-06 16:55:35 +00:00
|
|
|
# Try to load host's libGL (generic or Nvidia 32/64-bit) drivers
|
2016-08-05 21:02:44 +00:00
|
|
|
#
|
2016-12-12 20:52:38 +00:00
|
|
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(echo /h{1..20}_{32,64} | tr ' ' ':')"
|
|
|
|
export LD_LIBRARY_PATH
|
2016-08-06 16:20:55 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# In order to avoid the inconsistency error, when launching `csgo_linux64`
|
|
|
|
# Inconsistency detected by ld.so: dl-open.c: 689: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
|
|
|
|
# Hint: to find out what's wrong, use `strace`
|
|
|
|
#
|
2016-08-06 16:55:35 +00:00
|
|
|
# 1) Try to load host's Pulse library instead of the one from this image
|
2016-08-07 11:57:54 +00:00
|
|
|
export LD_PRELOAD="$LD_PRELOAD:$(find /h{1..20}_{32,64} -type f -name "*libpulsecommon*" -print0 2>/dev/null| tr '\0' ':')"
|
2016-08-05 21:02:44 +00:00
|
|
|
|
2016-08-05 23:34:36 +00:00
|
|
|
su -p user -c "steam $@"
|