home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / etc / init.d / modutils < prev    next >
Text File  |  1998-11-01  |  981b  |  46 lines

  1. #! /bin/sh
  2. # /etc/init.d/modules: loads the appropriate modules in `boot'.
  3.  
  4.  
  5. PATH="/sbin:/bin:/usr/sbin:/usr/bin"
  6.  
  7.     echo -n "Calculating module dependencies... "
  8.     depmod -a > /dev/null
  9.     echo "done."
  10.  
  11. # First test if we have a kernel with kmod
  12. if [ -f /proc/sys/kernel/modprobe ]; then
  13. #    We have, so don't start kerneld
  14.     startkerneld=1
  15. else
  16.     startkerneld=0;
  17. fi
  18.  
  19. # Loop over every line in /etc/modules.
  20. echo -n 'Loading modules: '
  21. (cat /etc/modules; echo) | # make sure there is a LF at the end
  22. while read module args
  23. do
  24.     case "$module" in
  25.         auto)    [ ${startkerneld} -eq 0 -a -x /sbin/kerneld ] && \
  26.             echo && /etc/init.d/kerneld start && startkerneld=1;
  27.             continue ;;
  28.         noauto) continue ;;
  29.         \#*|"") continue ;;
  30.     esac
  31.     echo -n "$module "
  32.     modprobe $module $args
  33. done
  34.  
  35. echo
  36.  
  37. #
  38. # Just in case a sysadmin prefers generic symbolic links in
  39. # /lib/modules/boot for boot time modules we will load these modules
  40. #
  41. if [ -n "`modprobe -l -t boot`" ]
  42. then
  43.         modprobe -a -t boot \*
  44. fi
  45.  
  46.