home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / etc / init.d / mountkernfs.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2006-08-23  |  1.6 KB  |  69 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          mountkernfs
  4. # Required-Start:
  5. # Required-Stop:
  6. # Default-Start:     S
  7. # Default-Stop:
  8. # Short-Description: Mount kernel virtual file systems.
  9. # Description:       Mount initial set of virtual filesystems the kernel
  10. #                    provides and that are required by everything.
  11. ### END INIT INFO
  12.  
  13. PATH=/lib/init:/sbin:/bin
  14.  
  15. . /lib/lsb/init-functions
  16. . /lib/init/mount-functions.sh
  17.  
  18. do_start () {
  19.     #
  20.     # Mount proc filesystem on /proc
  21.     #
  22.     domount proc "" /proc -onodev,noexec,nosuid
  23.  
  24.     #
  25.     # Mount sysfs on /sys
  26.     #
  27.     domount sysfs "" /sys -onodev,noexec,nosuid
  28.  
  29.     # Mount /var/run and /var/lock as tmpfs.
  30.     domount tmpfs "" /var/run -omode=0755,nodev,noexec,nosuid
  31.     domount tmpfs "" /var/lock -omode=1777,nodev,noexec,nosuid
  32.  
  33.     #
  34.     # Mount usbfs/usbdevfs if /proc/bus/usb is present.
  35.     #
  36.     # Usbfs/usbdevfs is used for USB related binaries/libraries.
  37.     # "usbfs" and "usbdevfs" are the exact same filesystem.
  38.     # "usbdevfs" was renamed to "usbfs" by linux usb developers,
  39.     # because people sometimes mistook it as a part of devfs. Usbfs
  40.     # will be superseded by other filesystems (e.g. sysfs), and when
  41.     # it becomes obsolete the mount action below should be removed.
  42.     #
  43.     #if [ -d /proc/bus/usb ]
  44.     #then
  45.     #    domount usbfs usbdevfs /proc/bus/usb
  46.     #fi
  47. }
  48.  
  49. case "$1" in
  50.   "")
  51.     echo "Warning: mountvirtfs should be called with the 'start' argument." >&2
  52.     do_start
  53.     ;;
  54.   start)
  55.     do_start
  56.     ;;
  57.   restart|reload|force-reload)
  58.     echo "Error: argument '$1' not supported" >&2
  59.     exit 3
  60.     ;;
  61.   stop)
  62.     # No-op
  63.     ;;
  64.   *)
  65.     echo "Usage: mountvirtfs [start|stop]" >&2
  66.     exit 3
  67.     ;;
  68. esac
  69.