Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lgsm/modules/fix_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,25 @@ if [ ! -f "${steamclientsdk32}" ]; then
fn_fix_msg_end
fi

# Helps fix: WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5.
# On distros that ship libtinfo.so.6 (e.g. Ubuntu 22.04+, Debian 12+) but not
# libtinfo.so.5, SteamCMD prints this warning and loses readline support.
# Creating a symlink from .so.5 -> .so.6 resolves the warning without root.
libtinfo32dir="${HOME}/.steam/steamcmd"
libtinfo32so="${libtinfo32dir}/libtinfo.so.5"
if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guard if [ ! -f ... ] && [ ! -L ... ] skips the fix when libtinfo.so.5 exists as a broken symlink (-L true but target missing). Using an existence check like ! -e (or explicitly handling -L + ! -e) would let the script repair broken links and still avoid overwriting valid files.

Suggested change
if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then
if [ ! -e "${libtinfo32so}" ]; then

Copilot uses AI. Check for mistakes.
# Find the .so.6 in the system 32-bit lib paths
for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do
if [ -f "${libtinfo32so6}" ]; then
fixname="libtinfo.so.5 32-bit symlink"
fn_fix_msg_start
ln -sf "${libtinfo32so6}" "${libtinfo32so}"
Comment on lines +127 to +128
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The symlink creation can fail if ${HOME}/.steam/steamcmd does not exist yet (fresh install / before SteamCMD has run). Consider mkdir -p "${libtinfo32dir}" before ln, and capture exitcode=$? after ln so fn_fix_msg_end reports failures correctly.

Suggested change
fn_fix_msg_start
ln -sf "${libtinfo32so6}" "${libtinfo32so}"
fn_fix_msg_start
if [ ! -d "${libtinfo32dir}" ]; then
mkdir -p "${libtinfo32dir}"
fi
ln -sf "${libtinfo32so6}" "${libtinfo32so}"
exitcode=$?

Copilot uses AI. Check for mistakes.
fn_fix_msg_end
break
fi
done
fi
Comment on lines +120 to +133
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new libtinfo fix hard-codes ${HOME}/.steam/steamcmd, but elsewhere in this module SteamCMD artifacts are searched in multiple locations (e.g. ${steamcmddir} and ${HOME}/.local/share/Steam/steamcmd). To ensure the warning is actually resolved in all supported setups, consider applying the symlink fix to the active SteamCMD directory (or iterating through the same candidate directories used for steamclient.so).

Suggested change
libtinfo32dir="${HOME}/.steam/steamcmd"
libtinfo32so="${libtinfo32dir}/libtinfo.so.5"
if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then
# Find the .so.6 in the system 32-bit lib paths
for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do
if [ -f "${libtinfo32so6}" ]; then
fixname="libtinfo.so.5 32-bit symlink"
fn_fix_msg_start
ln -sf "${libtinfo32so6}" "${libtinfo32so}"
fn_fix_msg_end
break
fi
done
fi
for libtinfo32dir in "${HOME}/.steam/steamcmd" "${steamcmddir}" "${HOME}/.local/share/Steam/steamcmd"; do
if [ -d "${libtinfo32dir}" ]; then
libtinfo32so="${libtinfo32dir}/libtinfo.so.5"
if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then
# Find the .so.6 in the system 32-bit lib paths
for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do
if [ -f "${libtinfo32so6}" ]; then
fixname="libtinfo.so.5 32-bit symlink"
fn_fix_msg_start
ln -sf "${libtinfo32so6}" "${libtinfo32so}"
fn_fix_msg_end
break
fi
done
fi
fi
done

Copilot uses AI. Check for mistakes.

# steamclient.so fixes
if [ "${shortname}" == "bo" ]; then
fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86"
Expand Down
Loading