BINARIES="/bin/sh \ /bin/bash \ /bin/ls \ /bin/cat \ /bin/mount \ /bin/umount \ /bin/mkdir \ /bin/chroot \ /bin/tar \ /bin/gzip \ /sbin/pivot_root \ /usr/bin/beep \ /usr/bin/feh"for BIN in $BINARIES; do deps=`ldd $BIN |sed 's/.*=>\(.*\) (.*/\1/'` # Trace all symbolic libary links to the actual library file. for dep in $deps; do # Add this dependency to the list Final="$Final $dep" # While this dependency is a link, recurse (until we hit a real file) while [ -L $dep ]; do # Find what the link points to dep_new=`readlink $dep` # Since many links are reliative, find the base dir prefix=`echo $dep |sed 's/\(.*\)\/.*$/\1/'` # Set $dep to the fully qualified path to what link points to dep=$prefix/$dep_new # Add this to the $Final Final="$Final $dep" done donedone