Magellan Linux

Diff of /trunk/busybox-initscripts/sbin/modules-update

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1278 by niro, Mon Jun 2 22:14:35 2008 UTC revision 1279 by niro, Thu May 12 18:29:59 2011 UTC
# Line 31  export PATH=/sbin:${PATH} Line 31  export PATH=/sbin:${PATH}
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
# Line 49  while [ -n "$1" ] ; do Line 51  while [ -n "$1" ] ; do
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.1 $ $Date: 2008-06-02 22:14:35 $";;   -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
# Line 117  for x in modprobe.conf modules.conf ; do Line 119  for x in modprobe.conf modules.conf ; do
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
# Line 173  create_header() { Line 176  create_header() {
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  }  }
# Line 206  generate_config() { Line 209  generate_config() {
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}"
# Line 214  generate_config() { Line 217  generate_config() {
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
# Line 297  if ! type -P generate-modprobe.conf > /d Line 300  if ! type -P generate-modprobe.conf > /d
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
# Line 370  else Line 377  else
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

Legend:
Removed from v.1278  
changed lines
  Added in v.1279