[BACK]Return to MAKEDEV.tmpl CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/etc/MAKEDEV.tmpl between version 1.113 and 1.113.2.7

version 1.113, 2008/09/14 13:59:54 version 1.113.2.7, 2009/09/26 19:52:09
Line 236 
Line 236 
 #       fb*     PMAX generic framebuffer pseudo-device  #       fb*     PMAX generic framebuffer pseudo-device
 #       fd      file descriptors  #       fd      file descriptors
 #       grf*    graphics frame buffer device  #       grf*    graphics frame buffer device
   #       hdaudio* High Definition audio control device
 #       hil     HP300 HIL input devices  #       hil     HP300 HIL input devices
 #       icp     ICP-Vortex/Intel RAID control interface  #       icp     ICP-Vortex/Intel RAID control interface
 #       iic*    IIC bus device  #       iic*    IIC bus device
Line 288 
Line 289 
   
   
 #  #
 # Apart from a few lines right at the end, this file should consist  # NOTE:
 # entirely of function definitions.  
 #  #
 # This file is used both as a standalone script (via "sh ./MAKEDEV all"  # * MAKEDEV is used both as a standalone script (via "sh ./MAKEDEV
 # or similar), and as a function library (via "MAKEDEV_AS_LIBRARY=1 .  #   all" or similar), and as a function library for MAKEDEV.local (via
 # MAKEDEV" from MAKEDEV.local).  #   "MAKEDEV_AS_LIBRARY=1 . MAKEDEV").  Because of this, the script
   #   should consist almost entirely of function definitions, apart from a
   #   few lines right at the end.
   #
   # * MAKEDEV may be executed in an environment that is missing some
   #   common commands.  For example, it may be executed from a minimal
   #   system used during installation, or it may be executed early in the
   #   boot sequence before most file systems have been mounted.  It may
   #   also be executed in a cross-build environment on a non-NetBSD host.
 #  #
   
 usage()  usage()
Line 477  setup()
Line 485  setup()
         # only allow read&write for owner by default          # only allow read&write for owner by default
         umask 077          umask 077
   
         # Check if we have fdesc mounted          # Set fdesc_mounted=true if the fdesc file system is mounted
           # on the current directory (typically "/dev").
           # Later, this will be used to suppress creation of device nodes
           # that are supplied by the fdesc file system.
           #
           fdesc_mounted=false
         if [ -d fd ]; then          if [ -d fd ]; then
                 case "$(df fd)" in                  # Parse the output from "mount -u -o nosuchoption .".
                 *fdesc*)        nofdesc=false;;                  # We don't parse the output from df(1) because that's
                 *)              nofdesc=true;;                  # less likely to be available on install media.
                   #
                   # If the current directory is a mount point for the
                   # fdesc file system, then the expected output (whether
                   # or not the current user is root) is:
                   #       mount_fdesc: -o suchoption: option not supported.
                   #
                   # If the current directory is not a mount point, then
                   # the expected output is:
                   #       mount: .: unknown special file or file system.
                   #
                   # If we are not running on NetBSD, or mount(8) is not
                   # found, then we should get some other error message.
                   #
                   case "$({ LC_ALL=C mount -u -o nosuchoption . ; } 2>&1)" in
                   *mount_fdesc*)  fdesc_mounted=true ;;
                 esac                  esac
         else  
                 nofdesc=true  
         fi          fi
   
         # do_force requires mknod          # do_force requires mknod
Line 716  all)
Line 742  all)
         makedev bthub          makedev bthub
         makedev putter          makedev putter
         makedev drvctl          makedev drvctl
         makedev audio          makedev video
         makedev local # do this last          makedev local # do this last
         ;;          ;;
   
Line 728  init)
Line 754  init)
 %MI_DEVICES_BEGIN%  %MI_DEVICES_BEGIN%
 audio)  audio)
         makedev audio0 audio1 audio2 audio3          makedev audio0 audio1 audio2 audio3
           makedev hdaudio0 hdaudio1 hdaudio2 hdaudio3
         lndev sound0 sound          lndev sound0 sound
         lndev audio0 audio          lndev audio0 audio
         lndev mixer0 mixer          lndev mixer0 mixer
Line 783  std)
Line 810  std)
         mkdev           zero    c %mem_chr% 12  666          mkdev           zero    c %mem_chr% 12  666
         mkdev           klog    c %log_chr% 0   600          mkdev           klog    c %log_chr% 0   600
         mkdev           ksyms   c %ksyms_chr% 0 444          mkdev           ksyms   c %ksyms_chr% 0 444
         if $nofdesc; then          if ! $fdesc_mounted; then
                 mkdev   tty     c %ctty_chr% 0          666                  mkdev   tty     c %ctty_chr% 0          666
                 mkdev   stdin   c %filedesc_chr% 0      666                  mkdev   stdin   c %filedesc_chr% 0      666
                 mkdev   stdout  c %filedesc_chr% 1      666                  mkdev   stdout  c %filedesc_chr% 1      666
Line 909  wskbd*)
Line 936  wskbd*)
         ;;          ;;
   
 fd)  fd)
         if $nofdesc; then          if ! $fdesc_mounted; then
                 makedir fd 755                  makedir fd 755
                 n=0                  n=0
                 while [ $n -lt 64 ]                  while [ $n -lt 64 ]
Line 1274  audio*)
Line 1301  audio*)
         mkdev $audioctl c %audio_chr% $(($unit + 192))  666          mkdev $audioctl c %audio_chr% $(($unit + 192))  666
         ;;          ;;
   
   hdaudio*)
           unit=${i#hdaudio}
           mkdev hdaudio$unit c %hdaudio_chr% $unit 644
           ;;
   
 gpio*)  gpio*)
         unit=${i#gpio}          unit=${i#gpio}
         mkdev gpio$unit c %gpio_chr% $unit 644          mkdev gpio$unit c %gpio_chr% $unit 644
Line 1916  local)
Line 1948  local)
                         sh "$0.local" $opts all                          sh "$0.local" $opts all
                 fi                  fi
                 umask 077                  umask 077
         else  
                 warn "missing $0.local"  
         fi          fi
         ;;          ;;
   
Line 2067  create_mfs_dev()
Line 2097  create_mfs_dev()
         # Add 2 reserved inodes (needed for both mfs and tmpfs), and round          # Add 2 reserved inodes (needed for both mfs and tmpfs), and round
         # up to a multiple of 32 (needed for mfs, not needed for tmpfs).          # up to a multiple of 32 (needed for mfs, not needed for tmpfs).
         ninode=$(( (ninode + 2 + 31) / 32 * 32 ))          ninode=$(( (ninode + 2 + 31) / 32 * 32 ))
         # This file system size calculation is exact for mount_mfs(8)  
         # with 512-byte sectors; it's larger than necessary  
         # for mount_tmpfs(8).  40960 bytes (80 blocks) is the minimum size  
         # allowed by mount_mfs.  
         fs_bytes=$((8192 + 2 * 8192 + 4096 + ninode*(128+18) + 8192))  
         [ "$fs_bytes" -lt 40960 ] && fs_bytes=40960  
         fs_blocks=$((fs_bytes/512))  
   
         # Try tmpfs; if that fails try mfs.          # Try tmpfs; if that fails try mfs.
           #
           # For tmpfs, allocate 16KB and 512 byte per node.
           # Actual requirements are much lower, but the size limit
           # is only intended to avoid accidental writing to /dev.
           fs_bytes=$((16384 + ninode * 512))
         if mount_tmpfs -s $fs_bytes -n $ninode -m 0755 \          if mount_tmpfs -s $fs_bytes -n $ninode -m 0755 \
                 -o union tmpfs "$dev_mountpoint"                  -o union tmpfs "$dev_mountpoint"
         then          then
             fstype=tmpfs                  fstype=tmpfs
         elif mount_mfs -b 4096 -f 512 -s $fs_blocks -n $ninode -p 0755 \  
                 -o union swap "$dev_mountpoint"  
         then  
             fstype=mfs  
         else          else
             die "Failed to create memory file system"                  # This file system size calculation is exact for mount_mfs(8)
                   # with 512-byte sectors.  40960 bytes (80 blocks) is the
                   # minimum size allowed by mount_mfs.
                   fs_bytes=$((8192 + 2 * 8192 + 4096 + ninode*512 + 8192))
                   [ "$fs_bytes" -lt 40960 ] && fs_bytes=40960
                   fs_blocks=$((fs_bytes/512))
                   if mount_mfs -b 4096 -f 512 -s $fs_blocks -n $ninode -p 0755 \
                       -o union swap "$dev_mountpoint"
                   then
                           fstype=mfs
                   else
                           die "Failed to create memory file system"
                   fi
         fi          fi
   
         # Our current directory was in the lower file system; change it to          # Our current directory was in the lower file system; change it to
Line 2100  create_mfs_dev()
Line 2135  create_mfs_dev()
         fi          fi
   
         echo "Created $fstype $dev_mountpoint" \          echo "Created $fstype $dev_mountpoint" \
                 "($fs_blocks blocks, $ninode inodes)"                  "($fs_bytes byte, $ninode inodes)"
 }  }
   
 #  #

Legend:
Removed from v.1.113  
changed lines
  Added in v.1.113.2.7

CVSweb <webmaster@jp.NetBSD.org>