7 for p
in $MODULES_ORDERED; do
10 *) paths_list
="$paths_list,$p";;
14 MODULES_ORDERED
="${paths_list#,*}"
17 modules_ordered_build
()
22 if modinfo
$kmod_option_basedir -k $kernel_release $m >/dev
/null
2>&1;then
23 echo "module $m found, adding..."
25 echo "module $m not found, skipping..."
28 deps
=$
(modinfo
$kmod_option_basedir -k $kernel_release \
30 if test -n "$deps"; then
31 modules_ordered_build
$deps
33 MODULES_ORDERED
="$MODULES_ORDERED,$(modinfo $kmod_option_basedir \
34 -k $kernel_release --field filename $m)"
37 MODULES_ORDERED
="${MODULES_ORDERED#,*}"
40 #recursive emiting of cpio dir entries for the module
43 local cur
=$
(dirname $1)
44 if test "$cur" = "/lib/modules/$kernel_release"; then
48 for p
in $DIRS_EMITED; do
49 if test "$p" = "$cur"; then
54 echo "dir $cur 0755 0 0" >>$cpio
55 DIRS_EMITED
=$DIRS_EMITED,$cur
58 cpio_kmod_files
='modules.alias.bin,modules.builtin.bin,modules.dep.bin'
64 for f
in $cpio_kmod_files; do
65 echo "file /lib/modules/$kernel_release/$f \
66 $kernel_modules_base_dir/lib/modules/$kernel_release/$f \
70 for m
in $MODULES_ORDERED; do
72 echo "file $m $kernel_modules_base_dir$m 0644 0 0" >>$cpio
76 ################################################################################
78 kernel_modules_base_dir
=$1
83 DIRS_EMITED
=/lib
/modules
/$kernel_release
85 if test "$kernel_modules_base_dir" = '/'; then
87 kernel_modules_base_dir
=
89 kmod_option_basedir
="--basedir=$kernel_modules_base_dir"
93 modules_ordered_build
$3