So I have googled a lot with different search terms, but didn't find anything usable, only that intead of ldd I have to use otool -L to see the used libraries of a programm.

I tried to copy bash into ~/chroot/bin and used above named tool to find it's dependcies and stored them there as well (well, of course, i made it look like the real path. /usr became ~/chroot/usr etc).

But when I try to use sudo chroot ~/chroot, it tells me that there is no file or directory of my shell. Wat.

I need to chroot into a "save" environment to compile a package that will be run in a chrooted environment as well. Specificately, I can not get php to compile static:

Kevins-MacBook-Air:System Ingwie$ otool -L ./bin/php
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/local/lib/libmcrypt.4.dylib (compatibility version 9.0.0, current version 9.8.0)
    /usr/local/lib/libltdl.3.dylib (compatibility version 5.0.0, current version 5.0.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/local/lib/libpng16.16.dylib (compatibility version 20.0.0, current version 20.0.0)
    /usr/local/lib/libcurl.4.dylib (compatibility version 8.0.0, current version 8.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.8.0)
    /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 47.1.0)
    /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 47.1.0)
    /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)

Changing the makefile from -export-dynamic to -all-static and such tricks didnt do a thing. It'll still compile like that. So to get aorund this, I want to chroot. the package will use an entrence script to reproduce the chroot and will operate from there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.