X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=scripts%2Fgen-dependencies.sh;h=0aa01b78ec375d963d449dbee2ee070a0e0e28c2;hb=f5db5742e4c6008b5bdb4e788cb4b44c6e420f43;hp=53c80cd837146353ac634da79be8b9ffb69c15ff;hpb=ccebc5a091d95af723c5545dd7b071d3b7027531;p=openwrt%2Fopenwrt.git diff --git a/scripts/gen-dependencies.sh b/scripts/gen-dependencies.sh index 53c80cd837..0aa01b78ec 100755 --- a/scripts/gen-dependencies.sh +++ b/scripts/gen-dependencies.sh @@ -19,8 +19,8 @@ XARGS="${XARGS:-xargs -r}" } find $TARGETS -type f -a -exec file {} \; | \ - sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.* stripped/\1/p' | \ - $XARGS -n1 readelf -d | \ + sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.*/\1/p' | \ + $XARGS -n1 $READELF -d | \ awk '$2 ~ /NEEDED/ && $NF !~ /interpreter/ && $NF ~ /^\[?lib.*\.so/ { gsub(/[\[\]]/, "", $NF); print $NF }' | \ sort -u @@ -28,7 +28,6 @@ tmp=`mktemp $TMP_DIR/dep.XXXXXXXX` for kmod in `find $TARGETS -type f -name \*.ko`; do $OBJCOPY -O binary -j .modinfo $kmod $tmp sed -e 's,\x00,\n,g' $tmp | \ - egrep -a '^depends=' | \ - sed -e 's,^depends=,,' -e 's/,/\n/g' | \ - awk '{ print $1 ".ko" }' + sed -ne '/^depends=.\+/ { s/^depends=//; s/,/.ko\n/g; s/$/.ko/p; q }' done | sort -u +rm -f $tmp