2 # geninitrd mod: depmod for 2.4 kernel
4 # Finds module dependencies
7 # @param $mode [silent]
9 # Outputs each dependant module full path.
14 typeset mods module f level depfile first
16 depfile=/lib/modules/$kernel/modules.dep
18 if [ ! -f $depfile ]; then
19 die "No $depfile! Run depmod and rerun $PROGRAM."
22 # prepend / if no path given, append $modext.gz if not given,
25 module=$(echo "$2" | \
26 awk '/\// {print;next} {print "/" $0}' | \
27 awk '/\./ {print;next} {print $0 "'$modext'.gz"}' |
28 awk '{gsub("/","\\/");print}')
31 /'"$module"':(.*)/ { gsub(/:/," "); gsub(/\\/," "); print; here = 1; next }
33 /(.*)/ { gsub(/\\/," "); if (here) print }
37 if [ "$mods" = "" ]; then
38 module=$(echo "$module" | awk '{gsub("\'$modext'\.gz$","\'$modext'",$0);print}')
44 /'"$module"':(.*)/ { gsub(/:/," "); gsub(/\\/," "); print; here = 1; next }
46 /(.*)/ { gsub(/\\/," "); if (here) print }
49 if [ "$mods" = "" ]; then
50 if [ "$1" != silent ]; then
51 warn "$origmodule: module not found in $depfile"
53 if ! is_no "$EXIT_IF_MISSING"; then
56 warn "If $origmodule isn't compiled in kernel then this initrd may not start your system."
61 if [ "$level" = "" ]; then
65 if [ $level -gt 20 ]; then
66 die "$origmodule: cycle in $depfile"
71 if [ "$first" = "" ]; then
74 find_depmod $1 $f $level