Explorar o código

fix(bf1942,bfv): run on Ubuntu 24.04+ by providing 32-bit ncurses 5 (#5043)

* fix(bf1942,bfv): provide 32-bit ncurses 5 libraries on newer distros

Ubuntu 24.04+, Debian 13 and RHEL 9 no longer package the i386
libncurses.so.5 and libtinfo.so.5 that the Battlefield 1942 and
Battlefield: Vietnam server binaries need. The new fix modules download
them into serverfiles when the system does not provide them, and add
serverfiles to LD_LIBRARY_PATH.

The static binaries only need ncurses 5 and the 32-bit libc, so the
libstdc++5 dependency and the Ubuntu 22.04 / Debian 12 support block in
check_deps are removed.

* feat(bf1942,bfv): move Docker images to Ubuntu 26.04

* fix(bf1942,bfv): install the LinuxGSM default serversettings.con

The server archives ship their own serversettings.con with
gameSpyPort 0. install_config skips copying the LinuxGSM default when
the file already exists, so a fresh install had no query port and
monitor failed with "queryport is not set". The bundled file is removed
first so the default config is copied. install_config only runs on
install, right after the archive has been extracted, so no user
settings are lost.

* fix(bf1942,bfv): preserve configs by repacking server archives

* fix(bf1942,bfv): document shared module variables for ShellCheck
Daniel Gibbs hai 4 días
pai
achega
d310a7f851

+ 1 - 1
lgsm/data/almalinux-8.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 1 - 1
lgsm/data/almalinux-9.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 1 - 1
lgsm/data/centos-7.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 1 - 1
lgsm/data/centos-8.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 1 - 1
lgsm/data/centos-9.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 2 - 2
lgsm/data/debian-10.csv

@@ -10,8 +10,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/debian-11.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/debian-12.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

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

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/debian-9.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 1 - 1
lgsm/data/rhel-7.csv

@@ -13,7 +13,7 @@ pw
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 1 - 1
lgsm/data/rhel-8.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

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

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 1 - 1
lgsm/data/rocky-8.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 1 - 1
lgsm/data/rocky-9.csv

@@ -12,7 +12,7 @@ bb
 bb2,libcurl.i686
 bd
 bf1942,ncurses-libs.i686
-bfv,compat-libstdc++-33.i686,glibc.i686
+bfv,glibc.i686
 bmdm,ncurses-libs.i686
 bo
 bs

+ 2 - 2
lgsm/data/serverlist.csv

@@ -10,8 +10,8 @@ av,avserver,Avorion,ubuntu-26.04
 bb,bbserver,BrainBread,ubuntu-26.04
 bb2,bb2server,BrainBread 2,ubuntu-26.04
 bd,bdserver,Base Defense,ubuntu-26.04
-bf1942,bf1942server,Battlefield 1942,ubuntu-22.04
-bfv,bfvserver,Battlefield: Vietnam,ubuntu-22.04
+bf1942,bf1942server,Battlefield 1942,ubuntu-26.04
+bfv,bfvserver,Battlefield: Vietnam,ubuntu-26.04
 bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-26.04
 bo,boserver,Ballistic Overkill,ubuntu-26.04
 bs,bsserver,Blade Symphony,ubuntu-26.04

+ 2 - 2
lgsm/data/ubuntu-16.04.csv

@@ -12,8 +12,8 @@ bb
 pw
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/ubuntu-18.04.csv

@@ -12,8 +12,8 @@ pw
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/ubuntu-20.04.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/ubuntu-22.04.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/ubuntu-23.04.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/ubuntu-23.10.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942,libncurses5:i386,libtinfo5:i386
-bfv,libncurses5:i386,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm,libncurses5:i386
 bo
 bs

+ 2 - 2
lgsm/data/ubuntu-24.04.csv

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942
-bfv,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm
 bo
 bs

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

@@ -11,8 +11,8 @@ av
 bb
 bb2,libcurl4-gnutls-dev:i386
 bd
-bf1942
-bfv,libstdc++5:i386
+bf1942,libc6:i386
+bfv,libc6:i386
 bmdm
 bo
 bs

+ 0 - 9
lgsm/modules/check_deps.sh

@@ -395,15 +395,6 @@ if [ -n "${distrosupport}" ]; then
 	fi
 fi
 
-# These titles are only supported up to Ubuntu 22.04 (Jammy) and Debian 12 (Bookworm).
-if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then
-	if [ "${shortname}" == "bf1942" ] || [ "${shortname}" == "bfv" ]; then
-		fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 22.04 or Debian <= 12)."
-		fn_script_log_fail "${gamename} is not supported on ${distroname}."
-		core_exit.sh
-	fi
-fi
-
 # These titles are only supported up to Ubuntu 20.04 and Debian 11.
 if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then
 	if [ "${shortname}" == "onset" ] || [ "${shortname}" == "btl" ]; then

+ 10 - 0
lgsm/modules/core_modules.sh

@@ -378,6 +378,16 @@ fix_av.sh() {
 	fn_fetch_module
 }
 
+fix_bf1942.sh() {
+	modulefile="${FUNCNAME[0]}"
+	fn_fetch_module
+}
+
+fix_bfv.sh() {
+	modulefile="${FUNCNAME[0]}"
+	fn_fetch_module
+}
+
 fix_bo.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 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 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_post_install_fix=(av kf kf2 nd ro ut2k4 ut ut3)
 
 # validate registered fixes for safe development

+ 21 - 0
lgsm/modules/fix_bf1942.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+# LinuxGSM fix_bf1942.sh module
+# Author: Daniel Gibbs
+# Contributors: https://linuxgsm.com/contrib
+# Website: https://linuxgsm.com
+# Description: Resolves issues with Battlefield 1942.
+
+# 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}/bf1942_lnxded.static" 2>&1 | grep -qE "lib(ncurses|tinfo)\.so\.5 => not found"; then
+	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
+	fixname="libncurses5 i386"
+	fn_fix_msg_start_nl
+	fn_fetch_file "http://linuxgsm.download/libraries/libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "" "" "" "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "nochmodx" "norun" "noforce" "ee141cb3a843e4201786b6f188347666"
+	fn_dl_extract "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "${serverfiles}"
+	fn_clear_tmp
+	fn_fix_msg_end
+fi

+ 21 - 0
lgsm/modules/fix_bfv.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+# LinuxGSM fix_bfv.sh module
+# Author: Daniel Gibbs
+# Contributors: https://linuxgsm.com/contrib
+# Website: https://linuxgsm.com
+# Description: Resolves issues with Battlefield: Vietnam.
+
+# 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}/bfv_linded.static" 2>&1 | grep -qE "lib(ncurses|tinfo)\.so\.5 => not found"; then
+	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
+	fixname="libncurses5 i386"
+	fn_fix_msg_start_nl
+	fn_fetch_file "http://linuxgsm.download/libraries/libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "" "" "" "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "nochmodx" "norun" "noforce" "ee141cb3a843e4201786b6f188347666"
+	fn_dl_extract "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "${serverfiles}"
+	fn_clear_tmp
+	fn_fix_msg_end
+fi

+ 6 - 6
lgsm/modules/install_server_files.sh

@@ -17,21 +17,21 @@ fn_install_server_files() {
 		force="noforce"
 		md5="61d7b79fd714888b6d65944fdaafa94a"
 	elif [ "${shortname}" == "bf1942" ]; then
-		remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"
+		remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full-linuxgsm.tar.xz"
 		local_filedir="${tmpdir}"
-		local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"
+		local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full-linuxgsm.tar.xz"
 		chmodx="nochmodx"
 		run="norun"
 		force="noforce"
-		md5="4223bf4ed85f5162c24b2cba51249b9e"
+		md5="d58016b3c45f86a71bb56c39749ce941"
 	elif [ "${shortname}" == "bfv" ]; then
-		remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz"
+		remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch-linuxgsm.tar.xz"
 		local_filedir="${tmpdir}"
-		local_filename="bfv_linded-v1.21-20041207_patch.tar.xz"
+		local_filename="bfv_linded-v1.21-20041207_patch-linuxgsm.tar.xz"
 		chmodx="nochmodx"
 		run="norun"
 		force="noforce"
-		md5="e3b4962cdd9d41e23c6fed65101bccde"
+		md5="9a8117732b8abd99cc59f1f0fa92adfa"
 
 	elif [ "${shortname}" == "cod" ]; then
 		remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"