31 |
# Setup some variables |
# Setup some variables |
32 |
# |
# |
33 |
|
|
34 |
HEADER="### This file is automatically generated by update-modules" |
HEADER="### This file is automatically generated by modules-update" |
35 |
|
HEADER_OLD="### This file is automatically generated by update-modules" |
36 |
|
VERSION="1.5" |
37 |
|
|
38 |
# |
# |
39 |
# Parse command-line |
# Parse command-line |
51 |
-f|--force|force) FORCE="true";; |
-f|--force|force) FORCE="true";; |
52 |
-v|--verbose) ((VERBOSE+=1));; |
-v|--verbose) ((VERBOSE+=1));; |
53 |
-d|--debug) ((DEBUG+=1));; |
-d|--debug) ((DEBUG+=1));; |
54 |
-V|--version) exec echo "${argv0}$Revision: 1.4 $ $Date: 2008-03-25 21:41:22 $";; |
-V|--version) exec echo "${argv0}: ${VERSION}";; |
55 |
-h|--help) |
-h|--help) |
56 |
cat <<-EOF |
cat <<-EOF |
57 |
Usage: update-modules [options] |
Usage: modules-update [options] |
58 |
|
|
59 |
Options: |
Options: |
60 |
--assume-kernel=KV Assume the kernel is at least version KV |
--assume-kernel=KV Assume the kernel is at least version KV |
119 |
x="./etc/${x}" |
x="./etc/${x}" |
120 |
[ -r ${x} ] || continue |
[ -r ${x} ] || continue |
121 |
|
|
122 |
if [ "$(sed -ne 1p ${x})" != "${HEADER}" ] ; then |
_header="$(sed -ne 1p ${x})" |
123 |
|
if [ "${_header}" != "${HEADER}" ] && [ "${_header}" != "${HEADER_OLD}" ]; then |
124 |
echo "Warning: ${x#.} has not been automatically generated" |
echo "Warning: ${x#.} has not been automatically generated" |
125 |
|
|
126 |
if ${FORCE} ; then |
if ${FORCE} ; then |
127 |
echo "--force specified, (re)generating file anyway" |
echo "--force specified, (re)generating file anyway" |
128 |
else |
else |
129 |
echo "Use \"update-modules force\" to force (re)generation" |
echo "Use \"modules-update force\" to force (re)generation" |
130 |
exit 1 |
exit 1 |
131 |
fi |
fi |
132 |
fi |
fi |
176 |
# |
# |
177 |
# Please do not edit this file directly. If you want to change or add |
# Please do not edit this file directly. If you want to change or add |
178 |
# anything please take a look at the files in ${moddir} and read |
# anything please take a look at the files in ${moddir} and read |
179 |
# the manpage for update-modules(8). |
# the manpage for modules-update(8). |
180 |
# |
# |
181 |
EOF |
EOF |
182 |
} |
} |
209 |
[ -n "${refdir}" ] && [ -e "${refdir}/${cfg##*/}" ] && continue |
[ -n "${refdir}" ] && [ -e "${refdir}/${cfg##*/}" ] && continue |
210 |
|
|
211 |
( |
( |
212 |
echo "### update-modules: start processing ${cfg#.}" |
echo "### modules-update: start processing ${cfg#.}" |
213 |
if [ -x "${cfg}" ] ; then |
if [ -x "${cfg}" ] ; then |
214 |
# $cfg can be executable; nice touch, Wichert! :) |
# $cfg can be executable; nice touch, Wichert! :) |
215 |
"${cfg}" |
"${cfg}" |
217 |
cat "${cfg}" |
cat "${cfg}" |
218 |
fi |
fi |
219 |
echo |
echo |
220 |
echo "### update-modules: end processing ${cfg#.}" |
echo "### modules-update: end processing ${cfg#.}" |
221 |
echo |
echo |
222 |
) >> "${tmpfile}" |
) >> "${tmpfile}" |
223 |
done |
done |
300 |
elif ! ${FORCE} && ! is_older_than ./etc/modprobe.conf ./etc/modules.d ./etc/modprobe.d ; then |
elif ! ${FORCE} && ! is_older_than ./etc/modprobe.conf ./etc/modules.d ./etc/modprobe.d ; then |
301 |
veinfo "modprobe.conf: already up-to-date nutness" |
veinfo "modprobe.conf: already up-to-date nutness" |
302 |
|
|
303 |
|
elif [ ! -e ./etc/modules.conf -a ! -e ./etc/modules.d ] ; then |
304 |
|
veinfo "No need to generate modprobe.conf :)" |
305 |
|
rm -f ./etc/modprobe.conf |
306 |
|
|
307 |
else |
else |
308 |
# |
# |
309 |
# First, bitch like crazy |
# First, bitch like crazy |
377 |
|
|
378 |
( |
( |
379 |
echo |
echo |
380 |
echo "### update-modules: start processing ${cfg#.}" |
echo "### modules-update: start processing ${cfg#.}" |
381 |
cat "${cfg}" |
cat "${cfg}" |
382 |
echo "### update-modules: end processing ${cfg#.}" |
echo "### modules-update: end processing ${cfg#.}" |
383 |
) >> "./etc/modprobe.conf" |
) >> "./etc/modprobe.conf" |
384 |
done |
done |
385 |
fi |
fi |