summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-01-29 21:59:10 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-01-29 21:59:10 +0000
commit2e5411518fa6a5bed67aa9ea7e8ca87b273ab509 (patch)
treeee8031909cdc845250be25bffbad2686b2ec4d50 /scripts
parent46b1577bfc903fcd8c301124e62a61d85e42e0cd (diff)
downloadmtk-20170518-2e5411518fa6a5bed67aa9ea7e8ca87b273ab509.zip
mtk-20170518-2e5411518fa6a5bed67aa9ea7e8ca87b273ab509.tar.gz
mtk-20170518-2e5411518fa6a5bed67aa9ea7e8ca87b273ab509.tar.bz2
scripts: gen-dependencies.sh: fix kmod dependency generation
Do not output faulty ".ko" dependency if a scanned .ko file has an empty "depends=" specification, also replace the `grep | sed | awk` chain with a single sed program. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44206
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen-dependencies.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/gen-dependencies.sh b/scripts/gen-dependencies.sh
index 85962e7..567fe15 100755
--- a/scripts/gen-dependencies.sh
+++ b/scripts/gen-dependencies.sh
@@ -28,8 +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/gp; q }'
done | sort -u
rm -f $tmp