1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/sh -eu
# dummy depmod implementation for use in tests. We can't reasonably
# include binary modules as test data, and the real depmod will fail
# if we give it fake module files.
#
# This needs to print some module dependencies rather than just doing
# nothing, because copy-modules reasonably treats that as an error.
basedir=
dry_run=
installedname=
while [ $# -gt 0 ]; do
case "$1" in
-b)
basedir="$2"
shift 2
;;
-n)
dry_run=y
shift
;;
-*)
echo >&2 "$0: unsupported option $1"
exit 2
;;
*)
if [ "$installedname" ]; then
echo >&2 "$0: multiple versions given"
exit 2
fi
installedname="$1"
shift
;;
esac
done
if [ -z "$dry_run" ]; then
echo >&2 "%0: missing option -n"
exit 2
fi
lastpath=
find "$basedir/lib/modules/$installedname" -name '*.ko*' -printf '%P\n' \
| LC_COLLATE=C.UTF-8 sort \
| while read path; do
echo "$path: $lastpath"
lastpath="$path"
done
|