From: Jo-Philipp Wich Date: Thu, 29 Jan 2015 21:59:10 +0000 (+0000) Subject: scripts: gen-dependencies.sh: fix kmod dependency generation X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2e5411518fa6a5bed67aa9ea7e8ca87b273ab509;p=openwrt%2Fstaging%2Fmkresin.git 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 SVN-Revision: 44206 --- diff --git a/scripts/gen-dependencies.sh b/scripts/gen-dependencies.sh index 85962e74b2..567fe151a0 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