Easy button for putting all the dependency files into the chroot:

# for f in `ldd /usr/local/bin/jq  | grep '00000' | awk '{print $7}'`; do  
        d=`dirname $f | sed 's#^/##’`                                           
 
        mkdir -p /var/www/$d                                                    
 
        cp $f /var/www/$d/                                                      
 
done

K.


> On Jul 16, 2021, at 6:24 PM, Kent Watsen <k...@watsen.net> wrote:
> 
> I’ve spent a few hours on this and am lost.  I have plenty experience moving 
> executables into a chroot environments, but `jq` is proving to be 
> exceptionally difficult.
> 
> The executable is found when chrooted to ‘/‘ but not ' /var/www’.  Yes, of 
> course I copied all the files referenced from `ldd` into the chroot, and set 
> their file permissions to 777 (and likewise all the parent directories):
> 
> # pkg_add jq
> 
> # chroot / /usr/local/bin/jq --version         
> jq-1.6
> 
> *** COPY `ldd /usr/local/bin/jq` DEPENDENCIES INTO  /var/www/ HERE ***
> 
> # chroot /var/www /usr/local/bin/jq --version  
> ld.so: jq: can't load library 'libonig.so.7.1’
> Killed
> 
> Any ideas?
> 
> K.
> 

Reply via email to