* Thomas Heil <h...@terminal-consulting.de> [12.04.2013 17:10]:
> package/base-files/files/sbin/recursive_insmod:
> 
> recursive_insmod() {
>     local moddir="/lib/modules/$(uname -r)"
>     local modname=${1%.ko}
> 
>     [ -f "$moddir/$modname.ko" ] || echo modprobe: FATAL: Module
> "$moddir/$modname.ko" not found
>     [ -f "$moddir/$modname.ko" ] || return

why have this test 2 times?

>     #echo "strings "$moddir/$modname.ko" | sed -ne '/^depends=/ {
> s/.*=//; s/,/ /g; p; q }'"
>     local depends="$(/bin/busybox strings "$moddir/$modname.ko" | sed
> -ne '/^depends=/ { s/.*=//; s/,/ /g; p; q }')"

why enforcing busybox-strings?
also i dont like the sed contruct.
IMHO a typical lines looks like:

depends=name1,name2,name3

so do it please with shell builtins:


OLDIFS="$IFS"
IFS=,
set -- $( grep ^"depends=" "$moddir/$modname.ko" | cut -d'=' -f2 )
echo $@
IFS="$OLDIFS"


the other things are fine, i also like the idea.

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to