Hello, i am trying some testing about Linux chroot under FreeBSD, if i use debottstrap to obtain Linux system it works without problem:
But if i try it with a Gentoo system seems that dynamic linker configuration is not updated:
Library is located in chroot system:
And chroot system is configured to search for libraries in the correct directory:
Why chroot is not reading /etc/ld.so.conf configuration when its chrooted? Why debootstrap system works?
Code:
debootstrap --arch=amd64 --no-check-gpg focal ./test
mount -o nocover -t linprocfs linprocfs ./test/proc
mount -o nocover -t linsysfs linsysfs ./test/sys
mount -o nocover -t devfs devfs ./test/dev
mount -o nocover,linrdlnk -t fdescfs fdescfs ./test/dev/fd
mount -o nocover,mode=1777 -t tmpfs tmpfs ./test/dev/shm
chroot ./test /bin/bash
root@Garrus:/# uname -a
Linux Garrus.alfaexploit.com 3.17.0 FreeBSD 13.0-RELEASE-p3 #0: Tue Jun 29 19:46:20 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
But if i try it with a Gentoo system seems that dynamic linker configuration is not updated:
Code:
mkdir /compat/gentoo
cd /compat/gentoo
fetch https://bouncer.gentoo.org/fetch/root/all/releases/amd64/autobuilds/20210725T170534Z/stage3-amd64-openrc-20210725T170534Z.tar.xz
tar xpvf stage3-*.tar.xz --xattrs --numeric-owner
mount -o nocover -t linprocfs linprocfs /compat/gentoo/proc
mount -o nocover -t linsysfs linsysfs /compat/gentoo/sys
mount -o nocover -t devfs devfs /compat/gentoo/dev
mount -o nocover,linrdlnk -t fdescfs fdescfs /compat/gentoo/dev/fd
mount -o nocover,mode=1777 -t tmpfs tmpfs /compat/gentoo/dev/shm
chroot /compat/gentoo /bin/bash
/bin/bash: error while loading shared libraries: libreadline.so.8: cannot stat shared object: Invalid argument
Library is located in chroot system:
Code:
ls -la /compat/gentoo/lib64/libreadline.so.8*
lrwxrwxrwx 1 root wheel 18 Jul 18 20:14 /compat/gentoo/lib64/libreadline.so.8 -> libreadline.so.8.1
-rwxr-xr-x 1 root wheel 346104 Jul 18 20:14 /compat/gentoo/lib64/libreadline.so.8.1
And chroot system is configured to search for libraries in the correct directory:
Code:
cat /compat/gentoo/etc/ld.so.conf
# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
include ld.so.conf.d/*.conf
/lib64
/usr/lib64
/usr/local/lib64
/lib
/usr/lib
/usr/local/lib
Why chroot is not reading /etc/ld.so.conf configuration when its chrooted? Why debootstrap system works?