@@ -51,6 +51,10 @@ git config --global --add safe.directory /workspace
5151if [ " ${CROSS_COMPILE} " = " true" ]; then
5252 echo " === Setting up cross-compilation for ${TARGET_ARCH} ==="
5353
54+ # Detect Ubuntu codename dynamically
55+ UBUNTU_CODENAME=$( . /etc/os-release && echo " $VERSION_CODENAME " )
56+ echo " Detected Ubuntu codename: ${UBUNTU_CODENAME} "
57+
5458 # Restrict default sources to amd64 (Ubuntu 24.04+ DEB822 format)
5559 for sources_file in /etc/apt/sources.list.d/* .sources; do
5660 [ -f " $sources_file " ] && sed -i ' /^Types: deb$/a Architectures: amd64' " $sources_file "
@@ -62,7 +66,7 @@ if [ "${CROSS_COMPILE}" = "true" ]; then
6266Types: deb
6367Architectures: ${DEBIAN_ARCH}
6468URIs: http://ports.ubuntu.com/ubuntu-ports
65- Suites: noble noble -updates noble -backports noble -security
69+ Suites: ${UBUNTU_CODENAME} ${UBUNTU_CODENAME} -updates ${UBUNTU_CODENAME} -backports ${UBUNTU_CODENAME} -security
6670Components: main restricted universe multiverse
6771Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
6872EOF
@@ -133,6 +137,8 @@ if [ "${CROSS_COMPILE}" = "true" ]; then
133137 export PKG_CONFIG_LIBDIR=" /usr/lib/${CROSS_TRIPLE} /pkgconfig:/usr/share/pkgconfig"
134138
135139 # Create CMake toolchain file (based on ReaPack's approach)
140+ # NOTE: CMAKE_SYSTEM_PROCESSOR is hardcoded to arm64 as that's currently the only
141+ # cross-compile target. If adding other architectures, use ${CMAKE_SYSTEM_PROCESSOR} instead.
136142 cat > /tmp/toolchain.cmake << EOF
137143set(CMAKE_SYSTEM_NAME Linux)
138144set(CMAKE_SYSTEM_PROCESSOR arm64)
0 commit comments