20110811

copy modules needed for chroot environment commands from real root

echo '#!/bin/bash' > /tmp/cp2chroot.sh

mkdir -p /www/chroot/newchuser/usr/lib64 /www/chroot/newchuser/lib64

ldd /usr/bin/scp | \
perl -ne 'my $dest_dir = "/www/chroot/newchuser"; \
my @line = split(/\n/, $_); \
foreach (@line) { $_ =~ s/.*=>(.*)/$1/; $_ =~ s/^\s+(.*) \(.*\)/$1/; \ 
print "cp $_ $dest_dir$_\n"; }' \
>> /tmp/cp2chroot.sh

Keine Kommentare:

Kommentar veröffentlichen