@@ -26,3 +26,41 @@ if [ ! -f "$DEB_FILE" ]; then
2626fi
2727
2828sudo dpkg -i " $DEB_FILE " || sudo apt-get install -f -y
29+
30+ # Arc 25.12+ links against GLIBC_2.38 (Debian/Ubuntu 24.04+ build
31+ # environment); on a 22.04 host (glibc 2.35) the daemon dies with
32+ # "libm.so.6: version `GLIBC_2.38' not found". Pull a newer libc6
33+ # into a sysroot and wrap /usr/bin/arc so it boots via that loader,
34+ # instead of bumping the whole base image to noble.
35+ HAVE_GLIBC=$( ldd --version | head -1 | awk ' {print $NF}' )
36+ if dpkg --compare-versions " $HAVE_GLIBC " lt 2.38; then
37+ NOBLE_DIR=/opt/glibc-noble
38+ if [ ! -x " $NOBLE_DIR /lib64/ld-linux-x86-64.so.2" ]; then
39+ # Noble's libc6, statically pinned. Source URL: launchpad mirror.
40+ # Plain `pool.ubuntu.com` redirects via HTTPS and works with
41+ # curl --location.
42+ LIBC_URL=" https://launchpad.net/ubuntu/+archive/primary/+files/libc6_2.39-0ubuntu8.6_amd64.deb"
43+ sudo mkdir -p " $NOBLE_DIR "
44+ tmp=$( mktemp --suffix=.deb)
45+ curl -fsSL " $LIBC_URL " -o " $tmp "
46+ sudo dpkg-deb -x " $tmp " " $NOBLE_DIR "
47+ rm -f " $tmp "
48+ fi
49+ if [ ! -f /usr/bin/arc.bin ]; then
50+ sudo mv /usr/bin/arc /usr/bin/arc.bin
51+ # dpkg-deb -x preserves the package's internal paths under
52+ # $NOBLE_DIR, i.e. NOBLE_DIR/usr/lib64/ld-linux-x86-64.so.2
53+ # (NOT NOBLE_DIR/lib64/...).
54+ sudo tee /usr/bin/arc > /dev/null << EOF
55+ #!/bin/bash
56+ # Launch arc.bin via noble's ld-linux + libc, leaving the rest of the
57+ # system unchanged. --library-path scopes the override to this
58+ # invocation only.
59+ exec ${NOBLE_DIR} /usr/lib64/ld-linux-x86-64.so.2 \\
60+ --library-path ${NOBLE_DIR} /usr/lib/x86_64-linux-gnu:${NOBLE_DIR} /usr/lib:/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu \\
61+ /usr/bin/arc.bin "\$ @"
62+ EOF
63+ sudo chmod +x /usr/bin/arc
64+ fi
65+ sudo systemctl daemon-reload
66+ fi
0 commit comments