2019-02-15 10:39:41 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
KREL=$1
|
|
|
|
|
|
|
|
{ cat /lib/modules/$KREL/modules.dep ;
|
|
|
|
cat /lib/modules/$KREL/modules.softdep | grep : | sed -e 's/^softdep //' -e 's/ \(pre\|post\):/:/' ; } \
|
|
|
|
| \
|
|
|
|
while read l ; do
|
|
|
|
MOD=$(echo "$l" | sed -e 's/:.*//')
|
2021-09-03 07:05:56 +02:00
|
|
|
MOD=$(basename $MOD)
|
|
|
|
case $MOD in
|
|
|
|
*.ko.xz|*.ko.gz|*.ko.zst)
|
|
|
|
MOD=${MOD%.*};;
|
|
|
|
esac
|
|
|
|
MOD=${MOD%.ko}
|
2019-02-15 10:39:41 +01:00
|
|
|
DEPS="$(echo "$l" | sed -e 's/.*://')"
|
|
|
|
moddeps=""
|
|
|
|
for dep in $DEPS ; do
|
2021-09-03 07:05:56 +02:00
|
|
|
dep=$(basename $dep)
|
|
|
|
case $dep in
|
|
|
|
*.ko.xz|*.ko.gz|*.ko.zst)
|
|
|
|
dep=${dep%.*};;
|
|
|
|
esac
|
|
|
|
dep=${dep%.ko}
|
2019-02-15 10:39:41 +01:00
|
|
|
moddeps="$moddeps $dep"
|
|
|
|
done
|
|
|
|
[ -n "$moddeps" ] && echo $MOD:$moddeps ||:
|
|
|
|
done
|