kernel-source/moddep

22 lines
404 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh
dependencies=$1
modules=$2
result=$3
cat $modules | tr ' ' '\n' > $result
echo > $result~
while ! diff -q $result~ $result > /dev/null ; do
cp $result $result~
while read MOD ; do
moddeps="$(grep ^$MOD: $dependencies | sed -e 's/.*://' ||:)"
for DEP in $moddeps ; do
if ! grep -q ^$DEP\$ $result ; then
echo $DEP >> $result
echo $MOD: $DEP
fi
done
done < $result
done