summaryrefslogtreecommitdiffstats
path: root/scripts/scrubtree
blob: 61a3ff77c5f97b1b28a342d9b3271788ce57372b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash -x

p=$1

# 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; chroot $p usr/sbin/ldconfig )
rm -f $p/usr/sbin/ldconfig $p/etc/ld.so.conf

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