![在 armhf chroot 中的 BOX86 上运行 steamcmd](https://linux22.com/image/1182940/%E5%9C%A8%20armhf%20chroot%20%E4%B8%AD%E7%9A%84%20BOX86%20%E4%B8%8A%E8%BF%90%E8%A1%8C%20steamcmd.png)
我想使用 steamcmd 在我的 raspberry pi 4 (4GB) 上运行游戏服务器。我已经设置了 chroot 和 box86 来运行 teamspeak 3 服务器。
我正在关注这些说明我停留在第 8 步,即运行 steamcmd.sh。
我已经修改了文件以运行 box86,但是每当我运行 shell 脚本时,它似乎都会在执行之前自行更新,从而恢复我的编辑。
#!/usr/bin/env bash
STEAMROOT="$(cd "${0%/*}" && echo $PWD)"
STEAMCMD=`basename "$0" .sh`
UNAME=`uname`
if [ "$UNAME" == "Linux" ]; then
STEAMEXE="${STEAMROOT}/linux32/${STEAMCMD}"
PLATFORM="linux32"
export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH"
else # if [ "$UNAME" == "Darwin" ]; then
STEAMEXE="${STEAMROOT}/${STEAMCMD}"
if [ ! -x ${STEAMEXE} ]; then
STEAMEXE="${STEAMROOT}/Steam.AppBundle/Steam/Contents/MacOS/${STEAMCMD}"
fi
export DYLD_LIBRARY_PATH="$STEAMROOT:$DYLD_LIBRARY_PATH"
export DYLD_FRAMEWORK_PATH="$STEAMROOT:$DYLD_FRAMEWORK_PATH"
fi
ulimit -n 2048
MAGIC_RESTART_EXITCODE=42
if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then
ARGSFILE=$(mktemp $USER.steam.gdb.XXXX)
# Set the LD_PRELOAD varname in the debugger, and unset the global version.
if [ "$LD_PRELOAD" ]; then
echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE"
echo show env LD_PRELOAD >> "$ARGSFILE"
unset LD_PRELOAD
fi
$DEBUGGER -x "$ARGSFILE" --args /usr/local/bin/box86 "$STEAMEXE" "$@"
rm "$ARGSFILE"
else
$DEBUGGER /usr/local/bin/box86 "$STEAMEXE" "$@"
fi
STATUS=$?
if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then
exec "$0" "$@"
fi
exit $STATUS
当我运行这个修改后的文件时,我得到以下信息:
Box86 with Dynarec v0.2.1 7c0b11e built on May 6 2021 17:03:01
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/Steam/logs/stderr.txt'
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[ 0%] Checking for available updates...
[----] Verifying installation...
[ 0%] Downloading update...
[ 0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
/opt/steamcmd/steamcmd.sh: line 37: /opt/steamcmd/linux32/steamcmd: cannot execute binary file: Exec format error
如果我使用不同的文件名,例如steamcmd_custom.sh
我得到这个:
Box86 with Dynarec v0.2.1 7c0b11e built on May 6 2021 17:03:01
Error: file is not found (check BOX86_PATH)
./steamcmd_custom.sh: line 38: 71730 Segmentation fault (core dumped) $DEBUGGER /usr/local/bin/box86 "$STEAMEXE" "$@"
并且运行
box86 steamcmd
从/opt/steamcmd/linux32
给我
Box86 with Dynarec v0.2.1 7c0b11e built on May 6 2021 17:03:01
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/Steam/logs/stderr.txt'
[ 0%] Checking for available updates...
[----] Verifying installation...
[----] !!! Fatal Error: Failed to load steamconsole.so
答案1
运行它
LD_LIBRARY_PATH="/opt/steamcmd/linux32/:$LD_LIBRARY_PATH" box86 linux32/steamcmd
这将使库路径可供 steamcmd 使用。