2 DEPMOD24_RCSID='$Revision$ $Date:: $'
4 # geninitrd mod: depmod for 2.4 kernel
6 # Finds module dependencies
9 # @param $mode [silent]
11 # Outputs each dependant module full path.
16 typeset mods module f level depfile first
18 depfile=/lib/modules/$kernel/modules.dep
20 if [ ! -f $depfile ]; then
21 die "No $depfile! Run depmod and rerun $PROGRAM."
24 # prepend / if no path given, append $modext.gz if not given,
27 module=$(echo "$2" | \
28 awk '/\// {print;next} {print "/" $0}' | \
29 awk '/\./ {print;next} {print $0 "'$modext'.gz"}' |
30 awk '{gsub("/","\\/");print}')
33 /'"$module"':(.*)/ { gsub(/:/," "); gsub(/\\/," "); print; here = 1; next }
35 /(.*)/ { gsub(/\\/," "); if (here) print }
39 if [ "$mods" = "" ]; then
40 module=$(echo "$module" | awk '{gsub("\'$modext'\.gz$","\'$modext'",$0);print}')
46 /'"$module"':(.*)/ { gsub(/:/," "); gsub(/\\/," "); print; here = 1; next }
48 /(.*)/ { gsub(/\\/," "); if (here) print }
51 if [ "$mods" = "" ]; then
52 if [ "$1" != silent ]; then
53 warn "$origmodule: module not found in $depfile"
55 if ! is_no "$EXIT_IF_MISSING"; then
58 warn "If $origmodule isn't compiled in kernel then this initrd may not start your system."
63 if [ "$level" = "" ]; then
67 if [ $level -gt 20 ]; then
68 die "$origmodule: cycle in $depfile"
73 if [ "$first" = "" ]; then
76 find_depmod $1 $f $level