#!/bin/bash if [ -z "$1" ]; then echo "Usage: $0 /path/to/tree" exit 1 fi p=$1 STRIP=strip ARCH=`uname -m | sed -e 's/i.86/i386/'` if [ $ARCH = ia64 ]; then STRIP="strip --strip-debug" fi # Must create ld.so.conf, because ldconfig does not cache # dirs specified on the command line. touch $p/etc/ld.so.conf [ -d $p/usr/X11R6/lib ] && echo /usr/X11R6/lib > $p/etc/ld.so.conf (cd $p; /usr/sbin/chroot $p usr/sbin/ldconfig ) rm -f $p/usr/sbin/ldconfig $p/etc/ld.so.conf (cd $p/usr/bin; ./collage | $p/usr/lib/anaconda-runtime/mkcollagelinks ./collage) for l in `find $p -type f -perm +100 | grep -v "usr/X11R6/lib/modules" | xargs file | sed -n 's/^\([^:]*\):.*ELF.*$/\1/p'`; do $STRIP $l -R .comment -R .note `objdump -h $l | \ sed -n 's/^.*\(\.gnu\.warning\.[^ ]*\) .*$/-R \1/p'` done