home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / etc / init.d / udev-finish < prev    next >
Encoding:
Text File  |  2009-04-08  |  1.2 KB  |  53 lines

  1. #!/bin/sh -e
  2. ### BEGIN INIT INFO
  3. # Provides:          udev-finish
  4. # Required-Start:    mountall-bootclean udev
  5. # Required-Stop:
  6. # Should-Start:
  7. # Default-Start:     S
  8. # Default-Stop:
  9. # Short-Description: Finish up udev.
  10. # Description:       Copies the udev log into /var/log and copies any rules
  11. #                    generated while the root filesystem was read-only into
  12. #                    /etc/udev/rules.d
  13. ### END INIT INFO
  14.  
  15. # init script to finish up udev
  16.  
  17. # Check the package is still installed
  18. [ -x /sbin/udevd ] || exit 0
  19.  
  20. # Get LSB functions
  21. . /lib/lsb/init-functions
  22. . /etc/default/rcS
  23.  
  24.  
  25. case "$1" in
  26.     start)
  27.         # Save udev log in /var/log/udev
  28.     if [ -e /dev/.udev.log ]; then
  29.         mv -f /dev/.udev.log /var/log/udev
  30.     fi
  31.  
  32.     # Make sure the root filesystem is actually writable
  33.     # (script is set -e, so this will abort)
  34.     touch /etc/udev/rules.d
  35.  
  36.     # Copy any rules generated while the root filesystem was read-only
  37.     for file in /dev/.udev/tmp-rules--*; do
  38.         dest=${file##*tmp-rules--}
  39.         [ "$dest" = '*' ] && break
  40.         cat $file >> /etc/udev/rules.d/$dest
  41.         rm -f $file
  42.     done
  43.     ;;
  44.     stop|restart|reload|force-reload)
  45.     ;;
  46. *)
  47.     echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload}"
  48.     exit 1
  49.     ;;
  50. esac
  51.  
  52. exit 0
  53.