1 |
slords |
1.1 |
--- mkinitrd-5.1.19.6/mkinitrd.218452 2007-07-09 15:02:31.000000000 -0400 |
2 |
|
|
+++ mkinitrd-5.1.19.6/mkinitrd 2007-07-09 15:03:35.000000000 -0400 |
3 |
|
|
@@ -127,6 +127,24 @@ moduledep() { |
4 |
|
|
[ -n "$deps" ] && vecho ": $deps" || vecho |
5 |
|
|
} |
6 |
|
|
|
7 |
|
|
+locatemodule() { |
8 |
|
|
+ fmPath=$(modprobe --set-version $kernel --show-depends $1 2>/dev/null | awk '/^insmod / { print $2; }' | tail -1) |
9 |
|
|
+ if [ -n "$fmPath" -a -f "$fmPath" ]; then |
10 |
|
|
+ return 0 |
11 |
|
|
+ fi |
12 |
|
|
+ for modExt in o.gz o ko ; do |
13 |
|
|
+ for modDir in /lib/modules/$kernel/updates /lib/modules/$kernel ; do |
14 |
|
|
+ if [ -d $modDir ]; then |
15 |
|
|
+ fmPath=$(findone $modDir -name $1.$modExt) |
16 |
|
|
+ if [ -n "$fmPath" -a -f "$fmPath" ]; then |
17 |
|
|
+ return 0 |
18 |
|
|
+ fi |
19 |
|
|
+ fi |
20 |
|
|
+ done |
21 |
|
|
+ done |
22 |
|
|
+ return 1 |
23 |
|
|
+} |
24 |
|
|
+ |
25 |
|
|
findone() { |
26 |
|
|
echo nash-find "$@" | /sbin/nash --force --quiet \ |
27 |
|
|
| /bin/awk '{ print $1; exit; }' |
28 |
|
|
@@ -212,20 +230,7 @@ findmodule() { |
29 |
|
|
findmodule $i |
30 |
|
|
done |
31 |
|
|
|
32 |
|
|
- for modExt in o.gz o ko ; do |
33 |
|
|
- fmPath=$(/sbin/modinfo -F filename -k $kernel $modName 2> /dev/null) |
34 |
|
|
- if [ -f "$fmPath" ]; then |
35 |
|
|
- break |
36 |
|
|
- fi |
37 |
|
|
- for modDir in /lib/modules/$kernel/updates /lib/modules/$kernel ; do |
38 |
|
|
- if [ -d $modDir ]; then |
39 |
|
|
- fmPath=$(findone $modDir -name $modName.$modExt) |
40 |
|
|
- if [ -f "$fmPath" ]; then |
41 |
|
|
- break 2 |
42 |
|
|
- fi |
43 |
|
|
- fi |
44 |
|
|
- done |
45 |
|
|
- done |
46 |
|
|
+ locatemodule $modName |
47 |
|
|
|
48 |
|
|
if [ ! -f "$fmPath" ]; then |
49 |
|
|
if [ -n "$skiperrors" ]; then |