Explorar el Código

fix(cod,cod2,coduo,mohaa): provide 32-bit libstdc++5 on newer distros (#5069)

* fix(cod,cod2,coduo,mohaa): provide 32-bit libstdc++5 on newer distros

Debian 13, Ubuntu 26.04 and RHEL 9 no longer package the i386
libstdc++.so.5 that the Call of Duty, Call of Duty 2, Call of Duty:
United Offensive and Medal of Honor: Allied Assault server binaries
need, so check_deps failed and the servers could not start.

New pre-start fix modules check the binary with ldd and, when
libstdc++.so.5 is missing, download it into serverfiles and add
serverfiles to LD_LIBRARY_PATH, the same approach used for the
Battlefield ncurses 5 fix (#5043). The library is taken unmodified from
Debian bookworm's libstdc++5_3.3.6-34_i386.deb and its download is
pinned by md5.

The libstdc++5:i386 dependency is replaced with libc6:i386 in the
Debian 13 and Ubuntu 26.04 lists, and the unavailable
compat-libstdc++-33.i686 is dropped from the RHEL 9 list (glibc.i686
and libstdc++.i686 are already in its base list). Older distros still
install the system package, which the fix then detects and skips.

Fixes #5026

* fix(cod,cod2,coduo,mohaa): download libstdc++5 over HTTPS

Matches the other linuxgsm.download URLs, which moved to HTTPS in #5070.
Daniel Gibbs hace 2 días
padre
commit
6c9e5d1692

+ 4 - 4
lgsm/data/debian-13.csv

@@ -21,10 +21,10 @@ btl
 cc
 ck,xvfb,libxi6
 cmw
-cod,libstdc++5:i386
-cod2,libstdc++5:i386
+cod,libc6:i386
+cod2,libc6:i386
 cod4
-coduo,libstdc++5:i386
+coduo,libc6:i386
 codwaw
 col
 cs
@@ -72,7 +72,7 @@ mc,openjdk-25-jre
 mcb
 mcv
 mh
-mohaa,libstdc++5:i386
+mohaa,libc6:i386
 mta,libncursesw6,libxml2
 nd
 nec

+ 4 - 4
lgsm/data/rhel-9.csv

@@ -21,10 +21,10 @@ btl
 cc
 ck,xorg-x11-server-Xvfb
 cmw
-cod,compat-libstdc++-33.i686
-cod2,compat-libstdc++-33.i686
+cod
+cod2
 cod4
-coduo,compat-libstdc++-33.i686
+coduo
 codwaw
 col
 cs
@@ -72,7 +72,7 @@ mc,java-21-openjdk
 mcb,libnsl
 mcv
 mh
-mohaa,compat-libstdc++-33.i686
+mohaa
 mta,ncurses-compat-libs,libxml2
 nd
 nec

+ 4 - 4
lgsm/data/ubuntu-26.04.csv

@@ -21,10 +21,10 @@ btl
 cc
 ck,xvfb,libxi6
 cmw
-cod,libstdc++5:i386
-cod2,libstdc++5:i386
+cod,libc6:i386
+cod2,libc6:i386
 cod4
-coduo,libstdc++5:i386
+coduo,libc6:i386
 codwaw
 col
 cs
@@ -72,7 +72,7 @@ mc,openjdk-25-jre
 mcb
 mcv
 mh
-mohaa,libstdc++5:i386
+mohaa,libc6:i386
 mta,libxml2-utils
 nd
 nec

+ 20 - 0
lgsm/modules/core_modules.sh

@@ -403,6 +403,21 @@ fix_cmw.sh() {
 	fn_fetch_module
 }
 
+fix_cod.sh() {
+	modulefile="${FUNCNAME[0]}"
+	fn_fetch_module
+}
+
+fix_cod2.sh() {
+	modulefile="${FUNCNAME[0]}"
+	fn_fetch_module
+}
+
+fix_coduo.sh() {
+	modulefile="${FUNCNAME[0]}"
+	fn_fetch_module
+}
+
 fix_csgo.sh() {
 	modulefile="${FUNCNAME[0]}"
 	fn_fetch_module
@@ -443,6 +458,11 @@ fix_mcb.sh() {
 	fn_fetch_module
 }
 
+fix_mohaa.sh() {
+	modulefile="${FUNCNAME[0]}"
+	fn_fetch_module
+}
+
 fix_mta.sh() {
 	modulefile="${FUNCNAME[0]}"
 	fn_fetch_module

+ 1 - 1
lgsm/modules/fix.sh

@@ -53,7 +53,7 @@ fn_apply_fix() {
 	fi
 }
 
-apply_pre_start_fix=(arma3 armar ark av bf1942 bfv bt bo csgo cmw dst hw ins ios kf nd nmrih onset pvr ro rust rw samp sdtd sfc sm sof2 squad st tf2 terraria ts3 mcb mta unt vh wurm xnt zmr)
+apply_pre_start_fix=(arma3 armar ark av bf1942 bfv bt bo csgo cmw cod cod2 coduo dst hw ins ios kf nd nmrih onset pvr ro rust rw samp sdtd sfc sm sof2 squad st tf2 terraria ts3 mcb mohaa mta unt vh wurm xnt zmr)
 apply_post_install_fix=(av kf kf2 nd ro ut2k4 ut ut3)
 
 # validate registered fixes for safe development

+ 21 - 0
lgsm/modules/fix_cod.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+# LinuxGSM fix_cod.sh module
+# Author: Daniel Gibbs
+# Contributors: https://linuxgsm.com/contrib
+# Website: https://linuxgsm.com
+# Description: Resolves issues with Call of Duty.
+
+# shellcheck disable=SC2034 # Used by the module loader.
+moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"
+
+if ldd "${executabledir}/cod_lnxded" 2>&1 | grep -q "libstdc++\.so\.5 => not found"; then
+	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
+	fixname="libstdc++5 i386"
+	fn_fix_msg_start_nl
+	fn_fetch_file "https://linuxgsm.download/libraries/libstdc++5-i386-3.3.6-34.tar.xz" "" "" "" "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "nochmodx" "norun" "noforce" "288a4cc9d6b7647f28c702028437e0f3"
+	fn_dl_extract "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "${serverfiles}"
+	fn_clear_tmp
+	fn_fix_msg_end
+fi

+ 21 - 0
lgsm/modules/fix_cod2.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+# LinuxGSM fix_cod2.sh module
+# Author: Daniel Gibbs
+# Contributors: https://linuxgsm.com/contrib
+# Website: https://linuxgsm.com
+# Description: Resolves issues with Call of Duty 2.
+
+# shellcheck disable=SC2034 # Used by the module loader.
+moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"
+
+if ldd "${executabledir}/cod2_lnxded" 2>&1 | grep -q "libstdc++\.so\.5 => not found"; then
+	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
+	fixname="libstdc++5 i386"
+	fn_fix_msg_start_nl
+	fn_fetch_file "https://linuxgsm.download/libraries/libstdc++5-i386-3.3.6-34.tar.xz" "" "" "" "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "nochmodx" "norun" "noforce" "288a4cc9d6b7647f28c702028437e0f3"
+	fn_dl_extract "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "${serverfiles}"
+	fn_clear_tmp
+	fn_fix_msg_end
+fi

+ 21 - 0
lgsm/modules/fix_coduo.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+# LinuxGSM fix_coduo.sh module
+# Author: Daniel Gibbs
+# Contributors: https://linuxgsm.com/contrib
+# Website: https://linuxgsm.com
+# Description: Resolves issues with Call of Duty: United Offensive.
+
+# shellcheck disable=SC2034 # Used by the module loader.
+moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"
+
+if ldd "${executabledir}/coduo_lnxded" 2>&1 | grep -q "libstdc++\.so\.5 => not found"; then
+	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
+	fixname="libstdc++5 i386"
+	fn_fix_msg_start_nl
+	fn_fetch_file "https://linuxgsm.download/libraries/libstdc++5-i386-3.3.6-34.tar.xz" "" "" "" "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "nochmodx" "norun" "noforce" "288a4cc9d6b7647f28c702028437e0f3"
+	fn_dl_extract "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "${serverfiles}"
+	fn_clear_tmp
+	fn_fix_msg_end
+fi

+ 21 - 0
lgsm/modules/fix_mohaa.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+# LinuxGSM fix_mohaa.sh module
+# Author: Daniel Gibbs
+# Contributors: https://linuxgsm.com/contrib
+# Website: https://linuxgsm.com
+# Description: Resolves issues with Medal of Honor: Allied Assault.
+
+# shellcheck disable=SC2034 # Used by the module loader.
+moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"
+
+if ldd "${executabledir}/mohaa_lnxded" 2>&1 | grep -q "libstdc++\.so\.5 => not found"; then
+	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
+	fixname="libstdc++5 i386"
+	fn_fix_msg_start_nl
+	fn_fetch_file "https://linuxgsm.download/libraries/libstdc++5-i386-3.3.6-34.tar.xz" "" "" "" "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "nochmodx" "norun" "noforce" "288a4cc9d6b7647f28c702028437e0f3"
+	fn_dl_extract "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "${serverfiles}"
+	fn_clear_tmp
+	fn_fix_msg_end
+fi