Skip to content

Commit 1c290db

Browse files
authored
Merge pull request #17 from flatcar/dongsu/glibc-2.34-ld
flatcar-postinst: check also /lib64/ld-linux-*.so.2 for glibc 2.34
2 parents 748eb99 + ed33203 commit 1c290db

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

flatcar-postinst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
set -eo pipefail
6+
set -euo pipefail
77
umask 0022
88

99
OEM_MNT="/usr/share/oem"
@@ -396,9 +396,20 @@ call_cgpt() {
396396

397397
# locate the dynamic linker
398398
LDSO=
399-
for l in "${INSTALL_MNT}"/lib*/ld-2.??.so; do
399+
400+
# While glibc 2.33 has /lib64/ld-2.33.so, glibc 2.34 does not have
401+
# that, but only /lib64/ld-linux-x86-64.so.2. So we should also check
402+
# ld-linux-* as well.
403+
#
404+
# glibc 2.35 installs a symlink to the dynamic linker under
405+
# /usr/bin/ld.so. Check this one too.
406+
#
407+
# Since we derive library path from the linker path, make sure we are
408+
# dealing with the actual executable, not with a symlink. We do it by
409+
# using realpath on the found file.
410+
for l in "${INSTALL_MNT}"/{,usr/}bin/ld.so "${INSTALL_MNT}"/lib*/ld-2.??.so "${INSTALL_MNT}"/lib*/ld-linux-*.so.?; do
400411
if [[ -x "$l" ]]; then
401-
LDSO="$l"
412+
LDSO=$(realpath "$l")
402413
break
403414
fi
404415
done

0 commit comments

Comments
 (0)