When you said you did a recursive otool -L
what do you mean? There are a lot of shared libraries needed to make this work, for example:
otool -L /bin/bash
/bin/bash:
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
Then you have to run otool -L
on those (then otool -L
on those):
otool -L /usr/lib/libSystem.B.dylib
/usr/lib/libSystem.B.dylib:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/usr/lib/system/libcache.dylib (compatibility version 1.0.0, current version 62.0.0)
/usr/lib/system/libcommonCrypto.dylib (compatibility version 1.0.0, current version 60049.0.0)
/usr/lib/system/libcompiler_rt.dylib (compatibility version 1.0.0, current version 35.0.0)
/usr/lib/system/libcopyfile.dylib (compatibility version 1.0.0, current version 103.0.0)
/usr/lib/system/libcorecrypto.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/system/libdispatch.dylib (compatibility version 1.0.0, current version 339.1.9)
/usr/lib/system/libdyld.dylib (compatibility version 1.0.0, current version 239.3.0)
/usr/lib/system/libkeymgr.dylib (compatibility version 1.0.0, current version 28.0.0)
/usr/lib/system/liblaunch.dylib (compatibility version 1.0.0, current version 842.1.4)
/usr/lib/system/libmacho.dylib (compatibility version 1.0.0, current version 845.0.0)
/usr/lib/system/libquarantine.dylib (compatibility version 1.0.0, current version 71.0.0)
/usr/lib/system/libremovefile.dylib (compatibility version 1.0.0, current version 33.0.0)
/usr/lib/system/libsystem_asl.dylib (compatibility version 1.0.0, current version 217.1.4)
/usr/lib/system/libsystem_blocks.dylib (compatibility version 1.0.0, current version 63.0.0)
/usr/lib/system/libsystem_c.dylib (compatibility version 1.0.0, current version 997.1.1)
/usr/lib/system/libsystem_configuration.dylib (compatibility version 1.0.0, current version 596.12.0)
/usr/lib/system/libsystem_dnssd.dylib (compatibility version 1.0.0, current version 522.1.11)
/usr/lib/system/libsystem_info.dylib (compatibility version 1.0.0, current version 449.1.3)
/usr/lib/system/libsystem_kernel.dylib (compatibility version 1.0.0, current version 2422.1.72)
/usr/lib/system/libsystem_m.dylib (compatibility version 1.0.0, current version 3047.16.0)
/usr/lib/system/libsystem_malloc.dylib (compatibility version 1.0.0, current version 23.1.10)
/usr/lib/system/libsystem_network.dylib (compatibility version 1.0.0, current version 241.3.0)
/usr/lib/system/libsystem_notify.dylib (compatibility version 1.0.0, current version 121.0.0)
/usr/lib/system/libsystem_platform.dylib (compatibility version 1.0.0, current version 24.1.4)
/usr/lib/system/libsystem_pthread.dylib (compatibility version 1.0.0, current version 53.1.4)
/usr/lib/system/libsystem_sandbox.dylib (compatibility version 1.0.0, current version 278.10.0)
/usr/lib/system/libsystem_stats.dylib (compatibility version 1.0.0, current version 93.1.26)
/usr/lib/system/libunc.dylib (compatibility version 1.0.0, current version 28.0.0)
/usr/lib/system/libunwind.dylib (compatibility version 1.0.0, current version 35.3.0)
/usr/lib/system/libxpc.dylib (compatibility version 1.0.0, current version 300.1.17)
I did a quick test with:
mkdir -p /Users/chroot/bin /Users/chroot/usr/lib/system
cp /bin/bash /Users/chroot/bin
cp /usr/lib/* /Users/chroot/usr/lib
cp /usr/lib/system/* /Users/chroot/usr/lib/system
chroot /Users/chroot /bin/bash
This worked, so I assume you are missing a shared library you needed. You could probably write a script to fully do a recursive otool -L
and just get the exact shared libraries you need, but it's probably easier just to do a bulk copy.
strace
ing the command to see what it's trying toopen(1)
– Undershirtchroot
ing since macOS 11.0.1 by not shipping plain system library files; see discussion on Apple SE. – Trudytrue