Wikia

coLinux

Linux From Scratch/devprep

< Linux From Scratch

238pages on
this wiki
Talk0
  1. !/bin/sh
  2. Begin devprep
  3. Description : /dev preparation script
  4. Authors  : Aaron Mason - simplersolution@gmail.com
  5. Version  : LFS 7.2
      1. BEGIN INIT INFO
  1. Provides: devprep $time
  2. Required-Start:
  3. Should-Start: modules
  4. Required-Stop:
  5. Should-Stop:
  6. Default-Start: S
  7. Default-Stop:
  8. Short-Description: Populates /dev with device nodes.
  9. Description: Mounts a tempfs on /dev and starts the udevd daemon.
  10. Device nodes are created as defined by udev.
  11. X-LFS-Provided-By: LFS
      1. END INIT INFO

. /lib/lsb/init-functions

case "${1}" in

  start)
     log_info_msg "Populating /dev with device nodes... "
     for i in /sys/dev/block/*; do
           . $i/uevent
           mkdir -p $(dirname /dev/$DEVNAME)
           mknod /dev/$DEVNAME b $MAJOR $MINOR
     done
     for i in /sys/dev/char/*; do
           . $i/uevent
           mkdir -p $(dirname /dev/$DEVNAME)
           mknod /dev/$DEVNAME c $MAJOR $MINOR
     done
     log_success_msg2 
     ;;
  *)
     echo "Usage ${0} {start}"
     exit 1
     ;;

esac

exit 0

  1. End devprep

Around Wikia's network

Random Wiki