SELF=${0##*/}
READELF="${READELF:-readelf}"
+OBJCOPY="${OBJCOPY:-objcopy}"
TARGETS=$*
XARGS="${XARGS:-xargs -r}"
$XARGS -n1 readelf -d | \
awk '$2 ~ /NEEDED/ && $NF !~ /interpreter/ && $NF ~ /^\[?lib.*\.so/ { gsub(/[\[\]]/, "", $NF); print $NF }' | \
sort -u
+
+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" }'
+done