From 45e80934a8afa3af2f45a285cb65e23cd1f7e931 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 3 Aug 2009 21:44:57 -0700 Subject: [PATCH] DEVFS - rollup - Userland, nrelease, and installer * Remove MAKEDEV and MAKEDEV use in the build system. * Add a new libc function fdevname() taking a file descriptor and returning the device name. * Remove the MFS /dev for the CD and adjust the nrelease build system to use devfs. * Installer adjustments: PFI search path, remove device node maker (it is non-applicable with devfs). * Add mount_devfs to the build Makefile. * Change dhclient to use an auto-cloning bpf. * The VN device now uses labels by default, and no longer supports non-label configurations (though you can of course ignore the label area and just r/w the raw device anyway). Submitted-by: Alex Hornung , and Matthew Dillon --- UPDATING | 3 +- etc/MAKEDEV | 2271 ----------------- etc/MAKEDEV.local | 51 - etc/Makefile | 18 +- include/stdlib.h | 2 + lib/libc/gen/Makefile.inc | 6 +- lib/libc/gen/fdevname.3 | 88 + lib/libc/gen/fdevname.c | 115 + nrelease/Makefile | 4 + nrelease/gui/etc/fstab | 2 - nrelease/installer/etc/fstab | 2 - nrelease/installer/etc/rc.d/pfi | 10 +- nrelease/root/README | 9 - nrelease/root/README.USB | 8 - nrelease/root/etc/fstab | 2 - sbin/Makefile | 1 + sbin/dhclient/bpf.c | 31 +- sbin/mount_devfs/mount_devfs.8 | 153 ++ .../installer/dfuibe_installer/fn_configure.c | 4 +- usr.sbin/installer/libinstaller/commands.c | 4 +- usr.sbin/vnconfig/vnconfig.8 | 6 +- usr.sbin/vnconfig/vnconfig.c | 2 +- 22 files changed, 398 insertions(+), 2394 deletions(-) delete mode 100644 etc/MAKEDEV delete mode 100644 etc/MAKEDEV.local create mode 100644 lib/libc/gen/fdevname.3 create mode 100644 lib/libc/gen/fdevname.c create mode 100644 sbin/mount_devfs/mount_devfs.8 diff --git a/UPDATING b/UPDATING index 34b9cfc52f..ab9cb9f398 100644 --- a/UPDATING +++ b/UPDATING @@ -71,7 +71,8 @@ intervention: In 1.9 major changes to the disk management infrastructure have taken place. make upgrade may not catch all of your disk devices in /dev, so after upgrading be sure to cd /dev; ./MAKEDEV where -are all of your disk devices. +are all of your disk devices. HOWEVER, from late 2.3 on we run devfs +and MAKEDEV no longer exists. The biggest changes in 1.9 are: diff --git a/etc/MAKEDEV b/etc/MAKEDEV deleted file mode 100644 index 0fffde3ce0..0000000000 --- a/etc/MAKEDEV +++ /dev/null @@ -1,2271 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 1990 The Regents of the University of California. -# All rights reserved. -# -# Written and contributed by W. Jolitz 12/90 -# -# Redistribution and use in source and binary forms are permitted provided -# that: (1) source distributions retain this entire copyright notice and -# comment, and (2) distributions including binaries display the following -# acknowledgement: ``This product includes software developed by the -# University of California, Berkeley and its contributors'' in the -# documentation or other materials provided with the distribution and in -# all advertising materials mentioning features or use of this software. -# Neither the name of the University nor the names of its contributors may -# be used to endorse or promote products derived from this software without -# specific prior written permission. -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# @(#)MAKEDEV 5.2 (Berkeley) 6/22/90 -# $FreeBSD: src/etc/MAKEDEV,v 1.243.2.57 2003/02/10 11:35:53 simokawa Exp $ -# $DragonFly: src/etc/MAKEDEV,v 1.43 2008/11/19 07:46:05 hasso Exp $ -# -# Device "make" file. Valid arguments: -# all makes all known devices, standard number of units (or close) -# std standard devices -# jail suitable for a jail(8) -# local configuration specific devices -# mach-4 mach4&lites+devices for Mach's XFree86 distribution -# (see http://www.cs.hut.fi/lites.html for more info on LITES) -# -# Tapes: -# ast* ATAPI tape drives -# wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape -# sa* SCSI Sequential Access Devices -# -# Disks: -# aac* Adaptec FSA RAID controllers -# aacd* Adaptec FSA RAID -# acd* ATAPI CD-ROM disks -# ad* ATA disks -# afd* ATAPI floppy disks -# amrd* AMI MegaRAID -# ccd* CCD disks -# cd* SCSI CD-ROM disks -# da* SCSI Direct Access Devices -# fd* floppy disk drives (3 1/2", 5 1/4") -# idad* Compaq Smart-2 RAID arrays -# ips* IBM ServeRAID controller -# ipsd* IBM ServeRAID -# md* Memory (or malloc) disk -# mlx* Mylex DAC960 RAID controllers -# mlxd* Mylex DAC960 RAID disk volumes -# pst* Promise SuperTrak RAID disks -# vn* vnode disks -# vkd* virtual kernel disk -# -# Console ports: -# vty* virtual console devices for syscons -# -# Pointing devices: -# mse* Logitech and ATI Inport bus mouse -# psm* PS/2 mouse -# jogdial Sony VAIO Jogdial -# sysmouse Mousesystems mouse emulator for syscons -# -# Terminal ports: -# tty* general purpose serial ports -# cua* dialout serial ports -# ttyA* Specialix SI/XIO dialin ports ('*' = number of devices) -# cuaA* Specialix SI/XIO dialout ports -# ttyD* Digiboard - 16 dialin ports -# cuaD* Digiboard - 16 dialout ports -# ttyE* Stallion EasyIO (stl) dialin ports -# cuaE* Stallion EasyIO (stl) dialout ports -# ttyF* Stallion Brumby (stli) dialin ports -# cuaF* Stallion Brumby (stli) dialout ports -# ttyR* Rocketport dialin ports -# cuaR* Rocketport dialout ports -# -# stlN Stallion EasyIO board N dialin and dialout -# stliN Stallion Brumby board N dialin and dialout -# -# Pseudo terminals: -# pty* set of 32 master and slave pseudo terminals -# vty* virtual terminals using syscons console -# -# Parallel port: -# lpt* Printer -# ppi* Parallel port i/o -# pps* Pulse per second timing interface -# pcfclock* Parallel time sync interface -# -# I2C and SMBus: -# iic* I2C devices -# smb* SMBUS devices -# -# USB devices: -# usb* USB bus control device -# ucom* USB serial devices -# ugen* generic USB device -# uhid* Human Interface Device (HID) -# ulpt* printer -# umodem* modems -# ums* mouse -# urio* Diamond Rio 500 -# uscanner* USB scanners -# -# SCSI devices (other than CD-ROM, tape and disk): -# ch* SCSI Media-Changer (juke box) driver -# pt* Processor Type (HP scanner, as one example) -# pass* CAM Passthrough device -# ses* SES (SCSI Environmental Services) and -# SAF-TE (SCSI Accessible Fault-Tolerant Enclosures) device -# -# PC-CARD (previously called PCMCIA) support -# card* PC-CARD slots -# -# ISDN devices: -# i4b isdnd call control device -# i4bctl debugging control device -# i4btrc* trace data interface(s), one per passive card -# i4btel* telephony interface(s) -# i4bteld* telephony dialout interface(s) -# i4brbch* raw b channel access device(s) -# -# Special purpose devices: -# acpi ACPI control device -# apm Advanced Power Management BIOS -# apmctl APM BIOS control device -# bpf* packet filter -# crypto crypto interface -# speaker pc speaker -# tw* xten power controller -# snd* various sound cards -# pcaudio PCM audio driver -# socksys iBCS2 socket system driver -# vat VAT compatibility audio driver (requires snd*) -# gsc Genius GS-4500 hand scanner -# joy pc joystick -# tun* Tunneling IP device -# tap* Ethernet Tunneling device -# snp* tty snoop devices -# spigot Video Spigot video acquisition card -# ctx* Cortex-I video acquisition card -# meteor* Matrox Meteor video acquisition card (pci) -# bktr* Bt848 based video acquisition card (pci) -# cxm* Conexant iTVC MPEG Coder -# labpc* National Instrument's Lab-PC and LAB-PC+ -# perfmon CPU performance-monitoring counters -# pci PCI configuration-space access from user mode -# ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth) -# kbd keyboard devices -# elan-mmcr AMD Elan support (e.g. mmap MMCR) -# agpgart AGP interface -# nsmb* SMB/CIFS protocol interface -# pf PF packet filter -# cmx Omnikey CardMan 4040 smartcard reader -# devctl devctl(4) interface -# -############################################################################## -# -# To override the default ownership and/or permissions, you now have the -# /etc/devices.conf file (create it if it's not there). Entries in this file -# should look like: -# -# ad0s1c root:staff 666 # Override ad0s1c -# ad0* root:wheel 641 # Override the entire ad0 family -# sa0.ctl heinz:ketchup 444 # Override device control node -# sa*.ctl heinz:ketchup 666 # Override all sa* control nodes -# fd/4 ihate:floppies 000 # Override /dev/fd/4 -# -# See the devices.conf(5) man page for further information. -# -# J.Anslik (joerg@anslik.de) -# -############################################################################## - - - -#----------------------------------------------------------------------------- -# Where all device special files are built. -#----------------------------------------------------------------------------- - -DEVDIR=dev - - -#----------------------------------------------------------------------------- -# File containing local ownership and permissions override entries. -#----------------------------------------------------------------------------- - -DEVPERMS_LOCAL="/etc/devices.conf" - - -#----------------------------------------------------------------------------- -# Some useful programs. -#----------------------------------------------------------------------------- - -cut=/usr/bin/cut -grep=/usr/bin/grep -mknod=/sbin/mknod -sed=/usr/bin/sed -tr=/usr/bin/tr - - -#----------------------------------------------------------------------------- -# Set up a default search path. -#----------------------------------------------------------------------------- - -if [ -n "$MAKEDEVPATH" ] -then - PATH="$MAKEDEVPATH" -else - PATH=/sbin:/bin -fi - - -#----------------------------------------------------------------------------- -# Print error message $2 and exit this script, returning $1. -#----------------------------------------------------------------------------- - -die() -{ - echo $2 - - exit $1 -} - - -#----------------------------------------------------------------------------- -# Convert integer to partition name. -#----------------------------------------------------------------------------- - -dkitop() -{ - local p - - case $1 in - 0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; - 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;; - 8) p=i;; 9) p=j;; 10) p=k;; 11) p=l;; - 12) p=m;; 13) p=n;; 14) p=o;; 15) p=p;; - *) p="?";; - esac - - echo $p -} - - -#----------------------------------------------------------------------------- -# Convert integer to slice name. -#----------------------------------------------------------------------------- - -dkitos() -{ - local s - - case $1 in - 0) s="s0" ;; - 1) s="" ;; - *) s=s$(($1-1)) ;; - esac - - echo $s -} - -#----------------------------------------------------------------------------- -# Convert unit, slice, partition to minor number. -#----------------------------------------------------------------------------- -# -# ndkminor(unit, slice, partition) - -ndkminor() -{ - echo $(( (($1 & 31) << 3) | (($1 & 480) << 16) | \ - (($2 & 15) << 16) | (($2 & 112) << 25) | \ - ($3 & 7) | (($3 & 8) << 17) | (($3 & 240) << 21) )) -} - - -#----------------------------------------------------------------------------- -# Create the device node. -#----------------------------------------------------------------------------- - -mknod() { - - local dev=$1 - local unit=$2 - - #--------------------------------------------------------------------- - # Remove old device node, if any. - #--------------------------------------------------------------------- - - rm -f "$dev$unit" || exit 1 - - - #--------------------------------------------------------------------- - # Supply default ownership and/or permissions according to the - # number of parameters passed to this function. - #--------------------------------------------------------------------- - - case $# in - 5) owner=root:wheel; perms=600;; - 6) owner=$6; perms=600;; - 7) owner=$6; perms=$7;; - *) die 2 "Bad call: mknod $@";; - esac - - - #--------------------------------------------------------------------- - # Get rid of first two parameters (no longer needed) - #--------------------------------------------------------------------- - - shift; shift - - - #--------------------------------------------------------------------- - # If there's a /etc/devices.conf file, check for local overrides. - #--------------------------------------------------------------------- - - if [ -s $DEVPERMS_LOCAL ] - then - #------------------------------------------------------------- - # Temporarily prepend the device portion with a subdir name - # if we're not in $DEVDIR. We need to do this to distinguish - # between device nodes that live in /dev, and device nodes - # that live in /dev/subdir, like /dev/fd. This way, we can - # have "fd*" entries in the permission files, as well as - # "fd/*" stuff. - #------------------------------------------------------------- - - tmpdev=$dev - pwd=`/usr/bin/basename $PWD` - - [ "$pwd" = "$DEVDIR" ] || dev="${pwd}/$dev" - - - #------------------------------------------------------------- - # Check /etc/devices.conf for local overrides - #------------------------------------------------------------- - - match=`$grep ^$dev$unit[[:space:]] $DEVPERMS_LOCAL | \ - $sed 's/\*/\\\*/'` - - [ "$match" ] || - if [ `expr "$unit" : '\(.*\)\.ctl$'` ] - then - match=`$grep ^$dev\\\*\\\.ctl[[:space:]] \ - $DEVPERMS_LOCAL | $sed 's/\*/\\\*/'` - else - match=`$grep ^$dev\\\*[[:space:]] $DEVPERMS_LOCAL | \ - $sed 's/\*/\\\*/'` - fi - - if [ "$match" ] - then - # Separate each field by one space character... - match=`echo $match | $tr -s "[:space:]" " "` - - # ...and extract owenership and permissions. - owner=`echo $match | $cut -d' ' -f2` - perms=`echo $match | $cut -d' ' -f3` - fi - - #------------------------------------------------------------- - # Restore "plain" device name (no prepending subdir name). - #------------------------------------------------------------- - - dev=$tmpdev - fi - - #--------------------------------------------------------------------- - # Finally, set ownership and permissions. - #--------------------------------------------------------------------- - - $mknod $dev$unit $1 $2 $3 $owner - chmod $perms $dev$unit -} - - -#----------------------------------------------------------------------------- -# Convert tape (ctrl, unit, mode, access) to device minor number. -#----------------------------------------------------------------------------- - -saminor() -{ - echo $(($1 << 29 | ($2 / 16) << 16 | ($2 % 16) << 4 | $3 << 2 | $4)) -} - - -#----------------------------------------------------------------------------- -# Convert the last character of a tty name to a device minor number. -#----------------------------------------------------------------------------- - -ttyminor() -{ - case $1 in - [0-9]) m=$1;; - a) m=10;; b) m=11;; c) m=12;; d) m=13;; - e) m=14;; f) m=15;; g) m=16;; h) m=17;; - i) m=18;; j) m=19;; k) m=20;; l) m=21;; - m) m=22;; n) m=23;; o) m=24;; p) m=25;; - q) m=26;; r) m=27;; s) m=28;; t) m=29;; - u) m=30;; v) m=31;; - *) m="?";; - esac - - echo $m -} - - -#----------------------------------------------------------------------------- -# Convert a unit number to a device minor number. -#----------------------------------------------------------------------------- - -unit2minor() -{ - echo $(((($1 >> 8) << 16) | ($1 % 256))) -} - - -#----------------------------------------------------------------------------- -# Stallion devices need some (weird) special treatment. -#----------------------------------------------------------------------------- - -stallion() -{ - major=$1 - letter=$2 - card=$3 - iscallout=$4 - - port=0 - maxport=8 - pref=tty - owner= - minorbase=0 - - if [ $iscallout -gt 0 ] - then - pref=cua - owner=uucp:dialer - minorbase=128 - fi - - case "$card" in - [0-7]);; - *) die 1 "Invalid stl card number $card";; - esac - - # Make the mem interface for extracting stats & loading microcode. - # 0x1000000 + card number - mknod staliomem $card c $major 0x0100000$card - - while [ $port -lt $maxport ] - do - minor=$(($minorbase + $card * 1048576 + $port)) - - [ $port -lt 32 ] || minor=$(($minor + 65504)) - - unit=$(($card * 64 + $port)) - - mknod ${pref}${letter} $unit c $major $minor $owner - mknod ${pref}i${letter} $unit c $major $(($minor + 32)) $owner - mknod ${pref}l${letter} $unit c $major $(($minor + 64)) $owner - - port=$(($port + 1)) - done -} - - -#----------------------------------------------------------------------------- -# Do it. -#----------------------------------------------------------------------------- - -for i in $*; do -case $i in - -all) - rm -f *.compat - sh MAKEDEV std # standard - sh MAKEDEV fd0 fd1 # bdev, floppy disk - sh MAKEDEV da0 da1 da2 da3 da4 da5 da6 da7 # bdev, SCSI disk - sh MAKEDEV da8 da9 da10 da11 da12 da13 da14 # bdev, SCSI disk - sh MAKEDEV da15 # bdev, SCSI disk - sh MAKEDEV ccd0 ccd1 ccd2 ccd3 # ccd disk - sh MAKEDEV ata # cdev, ATA control - sh MAKEDEV ad0 ad1 ad2 ad3 ad4 ad5 ad6 ad7 # bdev, ATA disk - sh MAKEDEV ar0 ar1 # bdev, ATA RAID disk - sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices - sh MAKEDEV vn0 vn1 vn2 vn3 # bdev, virtual disk - sh MAKEDEV vkd0 # bdev, virtual disk - sh MAKEDEV cd0 # bdev, cdrom - sh MAKEDEV sa0 wt0 # bdev, tape - sh MAKEDEV vty12 # cdev, virtual tty - sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty - sh MAKEDEV pty0 # cdev, pseudo tty - sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty - sh MAKEDEV kbd0 kbd1 # cdev, keyboard - sh MAKEDEV mse0 psm0 jogdial sysmouse # cdev, mouse - sh MAKEDEV pcaudio speaker snd0 # cdev, noise - sh MAKEDEV ipsd0 # cdev, ServeRAID disk - sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer - sh MAKEDEV ppi0 ppi1 ppi2 # cdev, parallel port - sh MAKEDEV iic0 iic1 # cdev, I2C device - sh MAKEDEV smb0 smb1 # cdev, SMBus device - sh MAKEDEV usb usb0 uhid0 ums0 ulpt0 ugen0 # cdev, USB devices - sh MAKEDEV usb1 uhid1 ums1 ulpt1 ugen1 # cdev, USB devices - sh MAKEDEV usb2 usb3 usb4 usb5 usb6 usb7 # cdev, USB devices - sh MAKEDEV urio0 uscanner0 umodem0 # cdev, USB devices too - sh MAKEDEV ucom0 ucom1 ucom2 ucom3 # cdev, USB serial devices - sh MAKEDEV bpf0 bpf1 bpf2 bpf3 # cdev, network - sh MAKEDEV ipl tun0 tun1 tun2 tun3 # cdev, network - sh MAKEDEV tap0 tap1 tap2 tap3 # cdev, network - sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous - sh MAKEDEV acpi # cdev, laptop - sh MAKEDEV apm apmctl card0 card1 card2 card3 # cdev, laptop - sh MAKEDEV pass4 xpt2 # cdev, CAM - sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN - sh MAKEDEV i4btel0 i4btel1 i4bteld0 i4bteld1 # cdev, ISDN - sh MAKEDEV i4brbch0 i4brbch1 # cdev, ISDN - sh MAKEDEV agpgart # cdev, AGP - sh MAKEDEV nsmb0 # cdev, SMB/CIFS - sh MAKEDEV twed0 # 3ware - sh MAKEDEV crypto # cdev, crypto - sh MAKEDEV fw0 # cdev, firewire - sh MAKEDEV dcons # cdev, dcons - sh MAKEDEV pf # pf - sh MAKEDEV devctl # cdev, devctl - ;; - - -#----------------------------------------------------------------------------- -# A much restricted set of the above, to save precious i-nodes on the -# fixit floppy -#----------------------------------------------------------------------------- - -fixit) - sh MAKEDEV std # standard - sh MAKEDEV fd0 # bdev, floppy disk - sh MAKEDEV da0 # bdev, SCSI disk - sh MAKEDEV ad0 # bdev, ATA disk - sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices - sh MAKEDEV vn0 # bdev, virtual disk - sh MAKEDEV vkd0 # bdev, virtual disk - sh MAKEDEV cd0 # bdev, cdrom - sh MAKEDEV sa0 # bdev, tape - sh MAKEDEV vty2 # cdev, virtual tty - sh MAKEDEV cuaa0 # cdev, serial tty - sh MAKEDEV pty0 # cdev, pseudo tty - sh MAKEDEV ttyd0 # cdev, serial tty - sh MAKEDEV kbd0 # cdev, keyboard - sh MAKEDEV mse0 psm0 sysmouse # cdev, mouse - sh MAKEDEV lpt0 # cdev, printer - sh MAKEDEV ppi0 # cdev, parallel port - sh MAKEDEV iic0 # cdev, I2C device - sh MAKEDEV smb0 # cdev, SMBus device - sh MAKEDEV ums0 # cdev, USB devices - sh MAKEDEV tun0 # cdev, network - sh MAKEDEV tap0 # cdev, network - sh MAKEDEV ch0 # cdev, miscellaneous - sh MAKEDEV apm apmctl card0 # cdev, laptop - sh MAKEDEV pass1 xpt1 # cdev, CAM - sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN - sh MAKEDEV i4btel0 i4bteld0 # cdev, ISDN - sh MAKEDEV i4brbch0 # cdev, ISDN - rm -f fd/[1-9]? - ;; - -#----------------------------------------------------------------------------- -# Upgrade existing node set. -# -# 1.9 - disk devices have changed -#----------------------------------------------------------------------------- -upgrade) - echo -n "upgrading... " - for i in aacd ad ar afd amrd ccd da fd idad ipsd md \ - mlxd pst twed vn vkd - do - for j in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - do - if [ -c $i$j ]; then - rm -f $i$j - rm -f $i${j}[a-p] - echo -n " $i$j $i${j}s0[a-p] $i${j}s1[a-p]" - sh MAKEDEV $i$j - # s0 and s1 handled by base - for k in s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 \ - s12 s13 s14 s15 - do - if [ -c $i$j${k}c ]; then - rm -f ${i}${j}${k}* - echo -n " $i$j$k" - sh MAKEDEV $i$j$k - echo -n " $i$j$k[a-p]" - sh MAKEDEV $i$j${k}a - elif [ -c $i$j$k ]; then - rm -f ${i}${j}${k}* - echo -n " $i$j$k" - sh MAKEDEV $i$j$k - fi - done - fi - done - done - for i in acd cd vcd - do - for j in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - do - if [ -c $i$j ]; then - rm -f ${i}${j}* - echo -n " $i$j $i${j}s0 $i${j}[a-p]" - sh MAKEDEV $i$j - elif [ -c $i${j}c ]; then - rm -f ${i}${j}* - echo -n " $i$j $i${j}s0 $i${j}[a-p]" - sh MAKEDEV $i$j - fi - done - done - echo "" - ;; - -#----------------------------------------------------------------------------- -# Basic device node set. -#----------------------------------------------------------------------------- - -std) - mknod console "" c 0 0 - mknod kmem "" c 2 1 root:kmem 640 - mknod mem "" c 2 0 root:kmem 640 - mknod null "" c 2 2 root:wheel 666 - mknod random "" c 2 3 root:wheel 644 - mknod urandom "" c 2 4 root:wheel 644 - mknod zero "" c 2 12 root:wheel 666 - mknod io "" c 2 14 - mknod tty "" c 1 0 root:wheel 666 - mknod klog "" c 7 0 - mknod stdin "" c 22 0 root:wheel 666 - mknod stdout "" c 22 1 root:wheel 666 - mknod stderr "" c 22 2 root:wheel 666 - mknod pci "" c 78 0 root:wheel 644 - - - #--------------------------------------------------------------------- - # Create floppy disk nodes in /dev/fd - #--------------------------------------------------------------------- - - mkdir -p fd - - (cd fd && - i=0 && - while [ $i -lt 64 ] - do - mknod $i "" c 22 $i root:wheel 666 - - i=$(($i + 1)) - done) - - chmod 555 fd - ;; - -#----------------------------------------------------------------------------- - -jail) - sh MAKEDEV std pty0 - - rm mem kmem pci io klog console - - ln -sf null mem - ln -sf null kmem - ln -sf null console - ;; - -#----------------------------------------------------------------------------- - -mach-4) - mknod iopl "" c 22 0 - mknod kbd "" c 23 0 - mknod mouse "" c 24 0 - mknod time "" c 25 0 - mknod timezone "" c 26 0 - ;; - -#----------------------------------------------------------------------------- - -wt*) - u=`expr $i : '..\(.*\)'` - - [ "$u" ] || u=0 - - # Default density, 512b blocks - mknod rwt $u c 10 $((0 + $u)) root:operator 660 - mknod nrwt $u c 10 $((4 + $u)) root:operator 660 - - # Default density, 1024b blocks -# mknod rWt $u c 10 $((64 + $u)) root:operator 660 -# mknod nrWt $u c 10 $((68 + $u)) root:operator 660 - mknod rwt ${u}b c 10 $((16 + $u)) root:operator 660 # 60 MB - mknod nrwt ${u}b c 10 $((20 + $u)) root:operator 660 - mknod rwt ${u}c c 10 $((24 + $u)) root:operator 660 # 120 MB - mknod nrwt ${u}c c 10 $((28 + $u)) root:operator 660 - mknod rwt ${u}d c 10 $((32 + $u)) root:operator 660 # 150 MB - mknod nrwt ${u}d c 10 $((36 + $u)) root:operator 660 -# mknod rwt ${u}e c 10 $((40 + $u)) root:operator 660 # 300 MB? -# mknod nrwt ${u}e c 10 $((44 + $u)) root:operator 660 -# mknod rwt ${u}f c 10 $((48 + $u)) root:operator 660 # 600 MB? -# mknod nrwt ${u}f c 10 $((52 + $u)) root:operator 660 - ;; - -#----------------------------------------------------------------------------- - -aacd*s*|acd*s*|ad*s*|ar*s*|afd*s*|amrd*s*|ccd*s*|da*s*|fd*s*|idad*s*|ipsd*s*|md*s*|mlxd*s*|pst*s*|twed*s*|vn*s*|vkd*s*) - case $i in - aacd*s*) name=aacd; chr=151;; - acd*s*) name=acd; chr=117;; - ad*s*) name=ad; chr=116;; - ar*s*) name=ar; chr=157;; - afd*s*) name=afd; chr=118;; - amrd*s*) name=amrd; chr=133;; - ccd*s*) name=ccd; chr=74;; - da*s*) name=da; chr=13;; - fd*s*) name=fd; chr=9;; - idad*s*) name=idad; chr=109;; - ipsd*s*) name=ipsd; chr=176;; - md*s*) name=md; chr=95;; - mlxd*s*) name=mlxd; chr=131;; - pst*s*) name=pst; chr=168;; - twed*s*) name=twed; chr=147;; - vn*s*) name=vn; chr=43;; - vkd*s*) name=vkd; chr=97;; - esac - - case $i in - aacd*s*|amrd*s*|idad*s*|ipsd*s*|mlxd*s*|twed*s*) - unit=`expr $i : '....\([0-9]*\)s'` - slice=`expr $i : '....[0-9]*s\([0-9]*\)'` - part=`expr $i : '....[0-9]*s[0-9]*\(.*\)'` - ;; - - acd*s*|afd*s*|ccd*s*|pst*s*|wfd*s*|vkd*s*) - unit=`expr $i : '...\([0-9]*\)s'` - slice=`expr $i : '...[0-9]*s\([0-9]*\)'` - part=`expr $i : '...[0-9]*s[0-9]*\(.*\)'` - ;; - *) - unit=`expr $i : '..\([0-9]*\)s'` - slice=`expr $i : '..[0-9]*s\([0-9]*\)'` - part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'` - ;; - esac - - case $unit in - [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1]) - case $slice in - [0-9]|[0-9][0-9]|1[0-1][0-9]|12[0-6]) - # [no s*] == whole-disk slice (slice #1 in minor) - # s0 == slice #0 in minor (compatibility slice) - # s1 == slice #2 in minor - # s2 == slice #3 in minor - # etc.. - # - # set slice to slice-in-minor-number - oldslice=$slice - if [ $oldslice -eq 0 ]; then - slice=$(($oldslice)) - else - slice=$(($slice+1)) - fi - slicename=`dkitos $slice` - minor=`ndkminor $unit $slice 255` - mknod ${name} $unit$slicename c $chr $minor \ - root:operator 640 - - # raw device names are extinct - rm -f r$name$unit$slicename - - # get rid of old compatibility devices, the new - # ones use 's0', e.g. da0s0a - for i in a b c d e f g h i j k l m n o p - do - rm -f $name$unit$i - done - - case $part in - [a-p]) - - for part in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - do - minor=`ndkminor $unit $slice $part` - partname=`dkitop $part` - mknod $name $unit$slicename$partname \ - c $chr $minor root:operator 640 - rm -f r$name$unit$slicename$partname - done - ;; - - "") ;; - *) echo bad partition for disk in: $i - ;; - esac - ;; - *) - echo bad slice for disk in: $i - ;; - esac - ;; - *) - echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)" - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -control-fd*) - unit=`expr $i : '..........\(.*\)'` - name=fd; chr=9 - - case $unit in - 0|1|2|3) - minor=`ndkminor $unit 1 129` - mknod $name ${unit}.1720 c $chr $minor - rm -f r${name}${unit}.1720 - - minor=`ndkminor $unit 1 130` - mknod $name ${unit}.1480 c $chr $minor - rm -f r${name}${unit}.1480 - - minor=`ndkminor $unit 1 131` - mknod $name ${unit}.1440 c $chr $minor - rm -f r${name}${unit}.1440 - - minor=`ndkminor $unit 1 132` - mknod $name ${unit}.1200 c $chr $minor - rm -f r${name}${unit}.1200 - - minor=`ndkminor $unit 1 133` - mknod $name ${unit}.820 c $chr $minor - rm -f r${name}${unit}.820 - - minor=`ndkminor $unit 1 134` - mknod $name ${unit}.800 c $chr $minor - rm -f r${name}${unit}.800 - - minor=`ndkminor $unit 1 135` - mknod $name ${unit}.720 c $chr $minor - rm -f r${name}${unit}.720 - - minor=`ndkminor $unit 1 136` - mknod $name ${unit}.360 c $chr $minor - rm -f r${name}${unit}.360 - - minor=`ndkminor $unit 1 137` - mknod $name ${unit}.640 c $chr $minor - rm -f r${name}${unit}.640 - - minor=`ndkminor $unit 1 138` - mknod $name ${unit}.1232 c $chr $minor - rm -f r${name}${unit}.1232 - ;; - *) - echo bad unit for disk in: $i - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -acd*t*) - units=`expr $i : '...\(.*\)t'`; - tracks=`expr $i : '.*t\(.*\)'`; - name=acd; - chr=117; - - [ "$units" ] || units=0 - [ "$tracks" ] || tracks=100 - - if [ "$units" -le 31 -a "$tracks" -le 169 ] - then - i=0 - while [ $i -le $units ] - do - dname=$name$i - rm -rf ${dname}t* - - j=1 - while [ $j -le $tracks ] - do - # cd unit tracks use the compatibility slice - # and partition numbers 129+ for tracks 1+. - # - minor=`ndkminor $i 1 $(($j + 128))` - mknod ${dname}t $j c $chr $minor \ - root:operator 640 - j=$(($j + 1)) - done - - i=$(($i + 1)) - done - else - echo "$i is invalid -- can't have more than 32 cd devices or 169 tracks" - fi - ;; - -#----------------------------------------------------------------------------- - -aacd*|acd*|ad*|ar*|afd*|amrd*|cd*|ccd*|da*|fd*|idad*|ipsd*|md*|mlxd*|pst*|twed*|vcd*|vn*|vkd*) - doslices=1 - directraw=0 - case $i in - aacd*) name=aacd; chr=151;; - acd*) name=acd; chr=117; doslices=0; directraw=1;; - ad*) name=ad; chr=116;; - ar*) name=ar; chr=157;; - afd*) name=afd; chr=118;; - amrd*) name=amrd; chr=133;; - cd*) name=cd; chr=15; doslices=0;; - da*) name=da; chr=13;; - fd*) name=fd; chr=9;; - ccd*) name=ccd; chr=74;; - idad*) name=idad; chr=109;; - ipsd*) name=ipsd; chr=176;; - md*) name=md; chr=95;; - mlxd*) name=mlxd; chr=131;; - pst*) name=pst; chr=168;; - twed*) name=twed; chr=147;; - vcd*) name=vcd; chr=98; doslices=0;; - vn*) name=vn; chr=43;; - vkd*) name=vkd; chr=97;; - esac - - case $i in - aacd*|amrd*|idad*|ipsd*|mlxd*|twed*) - unit=`expr $i : '....\(.*\)'` - ;; - acd*|afd*|ccd*|pst*|wfd*|vcd*|vkd*) - unit=`expr $i : '...\(.*\)'` - ;; - *) - unit=`expr $i : '..\(.*\)'` - ;; - esac - - case $i in - fd*) - sh MAKEDEV control-$name$unit - ;; - esac - - case $unit in - [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1]) - if [ "$doslices" -gt 0 ]; then - minor=`ndkminor $unit 1 255` - mknod ${name} ${unit} c $chr $minor \ - root:operator 640 - for slicepartname in s0h s1h s2 s3 s4 - do - sh MAKEDEV $name$unit$slicepartname - done - else - if [ "$directraw" -gt 0 ]; then - minor=`ndkminor $unit 1 128` - mknod ${name} ${unit} c $chr $minor \ - root:operator 640 - else - minor=`ndkminor $unit 1 255` - mknod ${name} ${unit} c $chr $minor \ - root:operator 640 - fi - minor=`ndkminor $unit 1 255` - mknod ${name} ${unit}s0 c $chr $minor \ - root:operator 640 - minor=`ndkminor $unit 0 0` - mknod ${name} ${unit}a c $chr $minor \ - root:operator 640 - minor=`ndkminor $unit 0 2` - mknod ${name} ${unit}c c $chr $minor \ - root:operator 640 - fi - ;; - *) - echo bad unit for disk in: $i - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -pt[0-9]*) - chr=61 - name=pt - unit=`expr $i : 'pt\([0-9][0-9]*\)'` - - [ "$unit" ] || unit=0 - - unit=$(($unit + 1 - 1)) - mknod $name $unit c $chr `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -ses[0-9]*) - chr=110 - name=ses - unit=`expr $i : 'ses\([0-9][0-9]*\)'` - - [ "$unit" ] || unit=0 - - unit=$(($unit + 1 - 1)) - mknod $name $unit c $chr `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -targ[0-9]*) - chr=65 - name=targ - unit=`expr $i : 'targ\([0-9][0-9]*\)'` - - [ "$unit" ] || unit=0 - - unit=$(($unit + 1 - 1)) - - mknod $name $unit c $chr `unit2minor $unit` - mknod ${name}.ctl "" c $chr 0xffff00ff - ;; - -#----------------------------------------------------------------------------- - -# CAM transport layer device -xpt*) - # This major number is temporary - chr=104 - name=xpt - units=`expr $i : 'xpt\(.*\)'` - - [ "$units" ] || units=1 - - i=0 - while [ $i -lt $units ] - do - rm -rf $name$i - - mknod $name $i c $chr `unit2minor $i` root:operator - - i=$(($i + 1)) - done - ;; - -#----------------------------------------------------------------------------- - -pass*) - # This major number is temporary - chr=31 - name=pass - units=`expr $i : 'pass\(.*\)'` - - [ "$units" ] || units=1 - - i=0 - while [ $i -lt $units ] - do - rm -rf $name$i - - mknod $name $i c $chr `unit2minor $i` root:operator - - i=$(($i + 1)) - done - ;; - -#----------------------------------------------------------------------------- - -pty*) - class=`expr $i : 'pty\(.*\)'` - case $class in - 0) offset=0 name=p;; - 1) offset=32 name=q;; - 2) offset=64 name=r;; - 3) offset=96 name=s;; - 4) offset=128 name=P;; # Note that xterm (at least) only look at p-s. - 5) offset=160 name=Q;; - 6) offset=192 name=R;; - 7) offset=224 name=S;; - *) echo bad unit for pty in: $i;; - esac - - case $class in - 0|1|2|3|4|5|6|7) - i=0 - while [ $i -lt 32 ] - do - c=$(echo 0123456789abcdefghijklmnopqrstuv | - dd bs=1 skip=$i count=1 2>/dev/null) - - mknod tty$name $c c 5 $(($offset + $i)) root:wheel 666 - mknod pty$name $c c 6 $(($offset + $i)) root:wheel 666 - - i=$(($i + 1)) - done - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -sa*) - unit=`expr $i : '..\(.*\)'` - chr=14 - - case $unit in - [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]) - mknod sa ${unit}.ctl c $chr `saminor 1 ${unit} 0 0` \ - root:wheel 660 - ln -f sa${unit}.ctl rsa${unit}.ctl - - for m in 0 1 2 3 - do - mknod sa ${unit}.$m c $chr \ - `saminor 0 $unit $m 0` root:operator 660 - ln -f sa${unit}.$m rsa${unit}.$m - - mknod nsa ${unit}.$m c $chr \ - `saminor 0 $unit $m 1` root:operator 660 - ln -f nsa${unit}.$m nrsa${unit}.$m - - mknod esa ${unit}.$m c $chr \ - `saminor 0 $unit $m 2` root:operator 660 - ln -f esa${unit}.$m ersa${unit}.$m - done - - ln -f sa${unit}.0 sa$unit - ln -f sa${unit}.0 rsa${unit}.0 - ln -f sa${unit}.0 rsa$unit - ln -f nsa${unit}.0 nsa$unit - ln -f nsa${unit}.0 nrsa${unit}.0 - ln -f nsa${unit}.0 nrsa$unit - ln -f esa${unit}.0 esa$unit - ln -f esa${unit}.0 ersa${unit}.0 - ln -f esa${unit}.0 ersa$unit - ;; - *) - echo bad unit for tape in: $i - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -ch*) - unit=`expr $i : '..\(.*\)'` - - case $i in - ch*) name=ch; chr=17;; - esac - - case $unit in - 0|1|2|3|4|5|6) - mknod $name $unit c $chr $unit root:operator 640 - ;; - *) - echo bad unit for media changer in: $i - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -ata) - mknod ata "" c 159 0 root:operator - ;; - -#----------------------------------------------------------------------------- - -ast*) - unit=`expr $i : '...\(.*\)'` - chr=119 - - case $unit in - 0|1|2|3) - mknod ast $unit c $chr $(($unit * 8 + 0)) root:operator 640 - mknod nast $unit c $chr $(($unit * 8 + 1)) root:operator 640 - ;; - *) - echo bad unit for tape in: $i - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -iic*) - unit=`expr $i : 'iic\(.*\)'` - - mknod iic $unit c 105 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -smb*) - unit=`expr $i : 'smb\(.*\)'` - - mknod smb $unit c 106 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -pcfclock*) - unit=`expr $i : 'pcfclock\(.*\)'` - - mknod pcfclock $unit c 140 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -ppi*) - unit=`expr $i : 'ppi\(.*\)'` - - mknod ppi $unit c 82 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -pps*) - unit=`expr $i : 'pps\(.*\)'` - - mknod pps $unit c 89 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -usb) - mknod usb "" c 108 255 root:operator 0660 - ;; - -#----------------------------------------------------------------------------- - -usb*) - unit=`expr $i : 'usb\(.*\)'` - - mknod usb $unit c 108 `unit2minor $unit` root:operator 660 - ;; - -#----------------------------------------------------------------------------- - -ucom*) - unit=`expr $i : 'ucom\(.*\)'` - - minor=$(($unit + 128)) - minor=`unit2minor $(($unit + 128))` - - mknod ucom $unit c 138 $minor uucp:dialer 660 - ;; - -#----------------------------------------------------------------------------- - -uhid*) - unit=`expr $i : 'uhid\(.*\)'` - - mknod uhid $unit c 122 `unit2minor $unit` root:operator 660 - ;; - -#----------------------------------------------------------------------------- - -ums*) - unit=`expr $i : 'ums\(.*\)'` - - mknod ums $unit c 111 `unit2minor $unit` root:operator 660 - ;; - -#----------------------------------------------------------------------------- - -ulpt*) - unit=`expr $i : 'ulpt\(.*\)'` - - minor=`unit2minor $unit` - mknod ulpt $unit c 113 $minor - - minor=`unit2minor $(($unit + 64))` - mknod unlpt $unit c 113 $minor # and the 'no prime' version - ;; - -#----------------------------------------------------------------------------- - -ugen*) - unit=`expr $i : 'ugen\([0-9][0-9]*\)'` - endpoint=`expr $i : 'ugen.*\.\([0-9][0-9]*\)'` - - [ "$unit" ] || echo $i - Invalid unit number - - if [ -z "${endpoint}" ] # ugen0 & ugen0.1 - ugen0.15 - then - mknod ugen $unit c 114 `unit2minor $(($unit * 16))` \ - root:operator 660 - i=1 - while [ $i -lt 16 ] - do - mknod ugen $unit.$i c 114 `unit2minor \ - $(($unit * 16 + $i))` root:operator 660 - - i=$(($i + 1)) - done - else - minor=`unit2minor $(($unit * 16 + $endpoint))` - mknod ugen $unit.$endpoint c 114 $minor root:operator 660 - fi - ;; - -#----------------------------------------------------------------------------- - -urio*) - unit=`expr $i : 'urio\(.*\)'` - - mknod urio $unit c 143 `unit2minor $unit` root:operator 660 - ;; - -#----------------------------------------------------------------------------- - -uscanner*) - unit=`expr $i : 'uscanner\(.*\)'` - - mknod uscanner $unit c 156 `unit2minor $unit` root:operator 660 - ;; - -#----------------------------------------------------------------------------- - -umodem*) - unit=`expr $i : 'umodem\(.*\)'` - - mknod umodem $unit c 124 `unit2minor $unit` uucp:dialer 660 - ;; - -#----------------------------------------------------------------------------- - -lpt*) - unit=`expr $i : 'lpt\(.*\)'` - - mknod lpt $unit c 16 `unit2minor $unit` - mknod lpctl $unit c 16 `unit2minor $(($unit + 128))` - ;; - -#----------------------------------------------------------------------------- - -vty*) - chr=12 - units=`expr $i : 'vty\(.*\)'` - - i=0 - while [ $i -lt $units ] - do - mknod ttyv $(printf %01x $i) c $chr `unit2minor $i` - - i=$(($i + 1)) - done - - ln -fs ttyv0 vga - ;; - -#----------------------------------------------------------------------------- - -nmdm*) - units=`expr $i : 'nmdm\(.*\)'` - chr=18 - - i=0 - while [ $i -lt $units ] - do - minor=`unit2minor $i` - minor=$(($minor + $minor)) - mknod nmdm ${i}A c $chr $minor - mknod nmdm ${i}B c $chr $(($minor + 1)) - - i=$(($i + 1)) - done - ;; - -#----------------------------------------------------------------------------- - -bpf*) - nbpf=`expr $i : 'bpf\(.*\)$'` - - unit=0 - while [ $unit -le $nbpf ] - do - mknod bpf $unit c 23 `unit2minor $unit` - - unit=$(($unit + 1)) - done - ;; - -#----------------------------------------------------------------------------- - -speaker) - mknod speaker "" c 26 0 - ;; - -#----------------------------------------------------------------------------- - -cua?|cuaa?|cuaa??) - unit_low=`expr $i : 'cua.*\(.\)$'` - - case $i in - cua?|cuaa?) - unit_high="" - m_high=0 - ;; - cuaa??) - unit_high=`expr $i : 'cuaa\(.\).$'` - m_high=`ttyminor $unit_high` - ;; - esac - - unit=$unit_high$unit_low - m=$(($m_high << 16 | `ttyminor $unit_low`)) - - mknod cuaa $unit c 28 $(($m | 128)) uucp:dialer 660 - mknod cuaia $unit c 28 $(($m | 32 | 128)) uucp:dialer 660 - mknod cuala $unit c 28 $(($m | 64 | 128)) uucp:dialer 660 - ;; - -#----------------------------------------------------------------------------- - -crypto) - mknod crypto "" c 70 0 root:operator 666 - ;; - -#----------------------------------------------------------------------------- - -pf) - mknod pf "" c 73 0 root:operator 600 - ;; - -#----------------------------------------------------------------------------- - -fw?) - unit=`expr $i : 'fw\(.\)$'` - - for sub in 0 1 2 3 - do - minor=$(($unit << 16 | $sub)) - mknod fw $unit.$sub c 127 $minor root:operator 660 - mknod fwmem $unit.$sub c 127 $((1<<24 | $minor)) \ - root:operator 660 - done - - ln -sf fw$unit.0 fw$unit - ln -sf fwmem$unit.0 fwmem$unit - ;; - -#----------------------------------------------------------------------------- - -dcons) - mknod dcons "" c 184 0 root:wheel 600 - ;; - -#----------------------------------------------------------------------------- - -tty?|tty0?|ttyd?|ttyd??) - unit_low=`expr $i : 'tty.*\(.\)$'` - - case $i in - tty?|tty0?|ttyd?) - unit_high="" - m_high=0 - ;; - ttyd??) - unit_high=`expr $i : 'ttyd\(.\).$'` - m_high=`ttyminor $unit_high` - ;; - esac - - unit=$unit_high$unit_low - m=$(($m_high << 16 | `ttyminor $unit_low`)) - - mknod ttyd $unit c 28 $m - mknod ttyid $unit c 28 $(($m | 32)) - mknod ttyld $unit c 28 $(($m | 64)) - ;; - -#----------------------------------------------------------------------------- - -cuac?) - portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f - g h i j k l m n o p q r s t u v" - major=48 - card=`expr $i : 'cua.*\(.\)$'` - - for unit in $portlist - do - minor=`ttyminor $unit` - minor=$(($card * 65536 + $minor)) - name=$card$unit - - mknod cuac $name c $major $(($minor + 128)) uucp:dialer 660 - mknod cuaic $name c $major $(($minor + 32 + 128)) \ - uucp:dialer 660 - mknod cualc $name c $major $(($minor + 64 + 128)) \ - uucp:dialer 660 - done - ;; - -#----------------------------------------------------------------------------- - -ttyc?) - portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f - g h i j k l m n o p q r s t u v" - major=48 - card=`expr $i : 'tty.*\(.\)$'` - - for unit in $portlist - do - minor=`ttyminor $unit` - minor=$(($card * 65536 + $minor)) - name=$card$unit - - mknod ttyc $name c $major $minor - mknod ttyic $name c $major $(($minor + 32)) - mknod ttylc $name c $major $(($minor + 64)) - done - ;; - -#----------------------------------------------------------------------------- - -cuam?) - unit=`expr $i : 'cua.*\(.\)$'` - - m=`ttyminor $unit` - - mknod cuam $unit c 63 $(($m + 128)) uucp:dialer 660 - ;; - -#----------------------------------------------------------------------------- - -ttym?) - unit=`expr $i : 'tty.*\(.\)$'` - - m=`ttyminor $unit` - - mknod ttym $unit c 63 $m - ;; - -#----------------------------------------------------------------------------- - -ttyA*) - major=68 - nports=`expr $i : 'ttyA\(.*\)$'` - port=1 - - while [ $port -le $nports ] - do - minor=$(($port - 1)) - name=$(printf %02d $port) - - mknod ttyA $name c $major $minor - mknod ttyiA $name c $major $(($minor + 65536)) - mknod ttylA $name c $major $(($minor + 131072)) - - port=$(($port + 1)) - done - - # For the user-mode control program, 'sicontrol' - mknod si_control "" c 68 262144 - ;; - -#----------------------------------------------------------------------------- - -cuaA*) - major=68 - nports=`expr $i : 'cuaA\(.*\)$'` - port=1 - - while [ $port -le $nports ] - do - minor=$(($port - 1)) - name=$(printf %02d $port) - - mknod cuaA $name c $major $(($minor + 128)) uucp:dialer 660 - mknod cuaiA $name c $major $(($minor + 128 + 65536)) \ - uucp:dialer 660 - mknod cualA $name c $major $(($minor + 128 + 131072)) \ - uucp:dialer 660 - - port=$(($port + 1)) - done - ;; - -#----------------------------------------------------------------------------- - -ttyD?) - portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f" - major=58 - card=`expr $i : 'tty.*\(.\)$'` - - for unit in $portlist - do - minor=`ttyminor $unit` - minor=$(($card * 65536 + $minor)) - name=$card$unit - - mknod ttyD $name c $major $minor - mknod ttyiD $name c $major $(($minor + 32)) - mknod ttylD $name c $major $(($minor + 64)) - done - ;; - -#----------------------------------------------------------------------------- - -cuaD?) - portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f" - major=58 - card=`expr $i : 'cua.*\(.\)$'` - - for unit in $portlist - do - minor=`ttyminor $unit` - minor=$(($card * 65536 + $minor)) - name=$card$unit - - mknod cuaD $name c $major $(($minor + 128)) uucp:dialer 660 - mknod cuaiD $name c $major $(($minor + 32 + 128)) \ - uucp:dialer 660 - mknod cualD $name c $major $(($minor + 64 + 128)) \ - uucp:dialer 660 - done - ;; - -#----------------------------------------------------------------------------- - -ttyE*) - stallion 72 E `expr $i : 'tty.*\(.\)$'` 0 - ;; -cuaE*) - stallion 72 E `expr $i : 'cua.*\(.\)$'` 1 - ;; -stl*) - card=`expr $i : 'stl\(.\)$'` - stallion 72 E $card 0 - stallion 72 E $card 1 - ;; - -ttyF*) - stallion 75 F `expr $i : 'tty.*\(.\)$'` 0 - ;; -cuaF*) - stallion 75 F `expr $i : 'cua.*\(.\)$'` 1 - ;; -stli*) - card=`expr $i : 'stl\(.\)$'` - stallion 75 F $card 0 - stallion 75 F $card 1 - ;; - -ttyM*) - portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f" - modulelist="a b c d" - major=101 - card=`expr $i : 'tty.*\(.\)$'` - - for unit in $modulelist - do - moduleminor=`ttyminor $unit` - moduleminor=$(($moduleminor % 10 * 16)) - modulename=$unit - - for unit in $portlist - do - minor=`ttyminor $unit` - minor=$(($card * 65536 + $minor + $moduleminor)) - name=$card$modulename$unit - - rm -f tty*M$name - - mknod ttyM $name c $major $minor - mknod ttyiM $name c $major $(($minor + 64)) - mknod ttylM $name c $major $(($minor + 128)) - done - done - ;; - -cuaM?) - portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f" - modulelist="a b c d" - major=101 - card=`expr $i : 'cua.*\(.\)$'` - - for unit in $modulelist - do - moduleminor=`ttyminor $unit` - moduleminor=$(($moduleminor % 10 * 16)) - modulename=$unit - - for unit in $portlist - do - minor=`ttyminor $unit` - minor=$(($card * 65536 + $minor + $moduleminor)) - name=$card$modulename$unit - - rm -f cua*M$name - - mknod cuaM $name c $major $(($minor + 262144)) \ - uucp:dialer 660 - mknod cuaiM $name c $major $(($minor + 64 + 262144)) \ - uucp:dialer 660 - mknod cualM $name c $major $(($minor + 128 + 262144)) \ - uucp:dialer 660 - done - done - ;; - -ttyR?) - major=81 - BOARD=1; Rnum=0 - MINOR=$(($BOARD * 65536)) - controllers=$( - dmesg | while read first rest - do - case "$first" in - RocketPort[0-4]) echo "$first" - ;; - esac - done) - - rm -f ttyR* ttyiR* ttylR* - - for i in $controllers - do - ndevices=$( - dmesg | while read first bar ports rest - do - case "$first" in - $i*) echo "$ports" - ;; - esac - done) - - echo -n "Creating $ndevices devices for $i: " - dev=0 - - while [ $dev -lt $ndevices ] - do - mknod ttyR $Rnum c $major $MINOR - mknod ttyiR $Rnum c $major $(($MINOR + 32)) - mknod ttylR $Rnum c $major $(($MINOR + 64)) - - Rnum=$(($Rnum + 1)) - MINOR=$(($MINOR + 1)) - - dev=$(($dev + 1)) - done - - BOARD=$(($BOARD + 1)) - MINOR=$(($BOARD * 65536)) - echo " " - done - ;; - -cuaR?) - major=81 - BOARD=1; Rnum=0 - MINOR=$(($BOARD * 65536)) - controllers=$( - dmesg | while read first rest - do - case "$first" in - RocketPort[0-4]) echo "$first" - ;; - esac - done) - - rm -f cuaR* cuaiR* cualR* - - for i in $controllers - do - ndevices=$( - dmesg | while read first bar ports rest - do - case "$first" in - $i*) echo "$ports" - ;; - esac - done) - - echo -n "Creating $ndevices devices for $i: " - dev=0 - - while [ $dev -lt $ndevices ] - do - mknod cuaR $Rnum c $major $(($MINOR + 128)) \ - uucp:dialer 660 - mknod cuaiR $Rnum c $major $(($MINOR + 128 + 32)) \ - uucp:dialer 660 - mknod cualR $Rnum c $major $(($MINOR + 128 + 64)) \ - uucp:dialer 660 - - Rnum=$(($Rnum + 1)) - MINOR=$(($MINOR + 1)) - - dev=$(($dev + 1)) - done - - BOARD=$(($BOARD + 1)) - MINOR=$(($BOARD * 65536)) - echo " " - done - ;; - -#----------------------------------------------------------------------------- - -mse*) - unit=`expr $i : 'mse\(.*\)'` - chr=27 - - # Non-blocking for X11 - mknod mse $unit c $chr `unit2minor $(($unit * 2 + 1))` - ;; - -#----------------------------------------------------------------------------- - -psm*) - unit=`expr $i : 'psm\(.*\)'` - chr=21 - - # Non-blocking for X11 - mknod psm $unit c $chr `unit2minor $(($unit * 2 + 1))` - ;; - -#----------------------------------------------------------------------------- - -mouse*) - name=`expr $i : 'mouse\(.*\)'` - - [ -c $name ] || $0 $name # Make the appropriate device - - ln -fs $name mouse - ;; - -#----------------------------------------------------------------------------- - -pcaudio) - mknod pcaudio "" c 24 0 - mknod pcaudioctl "" c 24 128 - ;; - -#----------------------------------------------------------------------------- - -socksys) - mknod socksys "" c 41 0 root:wheel 666 - mknod spx "" c 41 1 root:wheel 666 - - ln -fs socksys nfsd - ;; - -#----------------------------------------------------------------------------- - -snd*) - - unit=`expr $i : 'snd\(.*\)'` - chr=30 - - ln -fs mixer$unit mixer - ln -fs sequencer$unit sequencer - ln -fs dsp$unit dsp - ln -fs dspW$unit dspW - ln -fs music$unit music - ln -fs pss$unit pss - ln -fs dsp$unit.0 dsp$unit - ln -fs dspW$unit.0 dspW$unit - - ln -fs dsp audio - ln -fs dsp$unit audio$unit - - mknod mixer $unit c $chr `unit2minor $(($unit * 16 + 0))` \ - root:wheel 666 - mknod sequencer $unit c $chr `unit2minor $(($unit * 16 + 1))` \ - root:wheel 666 - mknod midi $unit c $chr `unit2minor $(($unit * 16 + 2))` \ - root:wheel 666 - - for chn in 0 1 2 3 - do - minor=$(($chn * 65536 + $unit * 16)) - - mknod dsp $unit.$chn c $chr $(($minor + 3)) root:wheel 666 - mknod dspW $unit.$chn c $chr $(($minor + 5)) root:wheel 666 - ln -fs dsp$unit.$chn audio$unit.$chn - done - - mknod sndstat "" c $chr 6 root:wheel 666 - mknod music $unit c $chr `unit2minor $(($unit * 16 + 8))` root:wheel 666 - mknod pss $unit c $chr `unit2minor $(($unit * 16 + 9))` root:wheel 666 - ;; - -#----------------------------------------------------------------------------- - -vat) - mknod vatio "" c 25 128 root:wheel 660 - ;; - -#----------------------------------------------------------------------------- - -gsc*) - unit=`expr $i : 'gsc\(.*\)'` - - mknod gsc $unit c 47 `unit2minor $unit` root:wheel 666 - mknod gsc ${unit}p c 47 `unit2minor $(($unit + 8))` root:wheel 666 - mknod gsc ${unit}d c 47 `unit2minor $(($unit + 32))` root:wheel 666 - mknod gsc ${unit}pd c 47 `unit2minor $(($unit + 40))` root:wheel 666 - ;; - -#----------------------------------------------------------------------------- - -acpi) - mknod acpi "" c 152 0 root:operator 664 - ;; - -#----------------------------------------------------------------------------- - -apm) - mknod apm "" c 39 0 root:operator 664 - ;; - -#----------------------------------------------------------------------------- - -apmctl) - mknod apmctl "" c 39 8 root:operator 660 - ;; - -#----------------------------------------------------------------------------- - -card*) - unit=`expr $i : 'card\(.*\)'` - chr=50 - - mknod card $unit c $chr `unit2minor $unit` root:wheel 644 - ;; - -#----------------------------------------------------------------------------- - -ttyx?|ttyy?|ttyz?) - case $i in - *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;; - *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;; - *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;; - *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;; - esac - - case $i in - ttyy?) unit=$(($unit + 16));; - ttyz?) unit=$(($unit + 32));; - esac - - mknod $i "" c 42 $unit - ;; - -#----------------------------------------------------------------------------- - -cronyx) - mknod cronyx "" c 42 63 - ;; - -#----------------------------------------------------------------------------- - -joy) - mknod joy 0 c 51 0 root:operator 640 - mknod joy 1 c 51 1 root:operator 640 - ;; - -#----------------------------------------------------------------------------- - -spigot) - mknod spigot "" c 11 0 root:wheel 444 - ;; - -#----------------------------------------------------------------------------- - -ctx?) - unit=`expr $i : 'ctx\(.*\)'` - - mknod ctx $unit c 40 `unit2minor $unit` root:wheel 444 - ;; - -#----------------------------------------------------------------------------- - -meteor?) - unit=`expr $i : 'meteor\(.*\)'` - - mknod meteor $unit c 67 `unit2minor $unit` root:wheel 444 - ;; - -#----------------------------------------------------------------------------- - -bktr?) - unit=`expr $i : 'bktr\(.*\)'` - - mknod bktr $unit c 92 `unit2minor $unit` root:wheel 444 - mknod tuner $unit c 92 `unit2minor $((16 + $unit))` root:wheel 444 - mknod vbi $unit c 92 `unit2minor $((32 + $unit))` root:wheel 444 - ;; - -#----------------------------------------------------------------------------- - -cxm?) - unit=`expr $i : 'cxm\(.*\)'` - - mknod cxm $unit c 93 `unit2minor $unit` root:wheel 444 - ;; - -#----------------------------------------------------------------------------- - -tun*) - ntun=`expr $i : 'tun\(.*\)$'` - unit=0 - - while [ $unit -le $ntun ] - do - mknod tun $unit c 52 `unit2minor $unit` - - unit=$(($unit + 1)) - done - ;; - -#----------------------------------------------------------------------------- - -tap*) - ntap=`expr $i : 'tap\(.*\)$'` - unit=0 - - while [ $unit -le $ntap ] - do - mknod tap $unit c 149 `unit2minor $unit` root:network - - unit=$(($unit + 1)) - done - ;; - -#----------------------------------------------------------------------------- - -sysmouse) - mknod sysmouse "" c 12 128 - mknod consolectl "" c 12 255 - ;; - -#----------------------------------------------------------------------------- - -jogdial) - mknod jogdial "" c 160 0 - ;; - -#----------------------------------------------------------------------------- - -snp?) - unit=`expr $i : 'snp\(.*\)'` - - mknod snp $unit c 53 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -labpc*) - case $i in - labpcaio*) - name=labpcaio - unit=`expr $i : 'labpcaio\(.*\)'` - all="0 1 2 3 4 5 6 7" - offset=0 - ;; - - labpcdio*) - name=labpcdio - unit=`expr $i : 'labpcdio\(.*\)'` - all="0 1 2 3" - offset=8 - ;; - - *) - die 3 "Don't know LabPC type $i" - ;; - esac - - [ "${unit}" ] || unit=all - - case $unit in - 0|1|2|3|4|5|6|7) - mknod $name $unit c 66 $(($offset + $unit)) \ - root:wheel 660 - ;; - - all) - for i in $all - do - mknod $name $i c 66 $(($offset + $i)) \ - root:wheel 660 - done - ;; - - *) - echo "No such LabPC unit: $unit" - ;; - esac - ;; - -#----------------------------------------------------------------------------- - -perfmon) - mknod perfmon "" c 2 32 root:kmem 640 - ;; - -#----------------------------------------------------------------------------- - -ipl) - mknod ipl "" c 79 0 - mknod ipnat "" c 79 1 - mknod ipstate "" c 79 2 - mknod ipauth "" c 79 3 - ;; - -#----------------------------------------------------------------------------- - -elan*) - mknod elan-mmcr "" c 100 0 root:wheel 600 - ;; - -#----------------------------------------------------------------------------- - -kbd*) - unit=`expr $i : 'kbd\(.*\)'` - chr=112 - - mknod kbd $unit c $chr `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -i4b) - mknod i4b "" c 60 0 - ;; - -i4bctl) - mknod i4bctl "" c 55 0 - ;; - -i4brbch*) - unit=`expr $i : 'i4brbch\(.*\)'` - - mknod i4brbch $unit c 57 `unit2minor $unit` - ;; - -i4bteld*) - offset=64 - unit=`expr $i : 'i4bteld\(.*\)'` - - mknod i4bteld $unit c 56 `unit2minor $(($offset + $unit))` - ;; - -i4btel*) - unit=`expr $i : 'i4btel\(.*\)'` - - mknod i4btel $unit c 56 `unit2minor $unit` - ;; - -i4btrc*) - unit=`expr $i : 'i4btrc\(.*\)'` - - mknod i4btrc $unit c 59 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -aac*) - unit=`expr $i : 'aac\(.*\)'` - - mknod aac $unit c 150 `unit2minor $unit` - - ln -fs aac$unit afa$unit - ln -fs aac$unit hpn$unit - ;; - -#----------------------------------------------------------------------------- - -mlx*) - unit=`expr $i : 'mlx\(.*\)'` - - mknod mlx $unit c 130 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -amr*) - unit=`expr $i : 'amr\(.*\)'` - - mknod amr $unit c 132 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -ips*) - unit=`expr $i : 'ips\(.*\)'` - - mknod mlx $unit c 175 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -ciss*) - unit=`expr $i : 'ciss\(.*\)'` - - mknod ciss $unit c 166 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -agpgart) - mknod agpgart "" c 148 0 - ;; - -#----------------------------------------------------------------------------- - -twe*) - unit=`expr $i : 'twe\(.*\)'` - - mknod twe $unit c 146 `unit2minor $unit` - ;; - -#----------------------------------------------------------------------------- - -tw*) - unit=`expr $i : 'tw\(.*\)'` - - mknod tw $unit c 19 `unit2minor $unit` root:operator - ;; - -#----------------------------------------------------------------------------- - -nsmb*) - unit=`expr $i : 'nsmb\(.*\)'` - - mknod nsmb $unit c 144 $unit - ;; - -#----------------------------------------------------------------------------- - -cmx*) - unit=`expr $i : 'cmx\(.*\)'` - - mknod cmx $unit c 185 $unit - ;; - -#----------------------------------------------------------------------------- - -devctl) - mknod devctl "" c 188 0 root:wheel 600 - ;; - -#----------------------------------------------------------------------------- - -local) - umask 0 - sh MAKEDEV.local - umask 77 - ;; - -#----------------------------------------------------------------------------- - -*) - echo $i - no such device name - ;; - -esac -done diff --git a/etc/MAKEDEV.local b/etc/MAKEDEV.local deleted file mode 100644 index 7e10bb84d8..0000000000 --- a/etc/MAKEDEV.local +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 1991 The Regents of the University of California. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the University of -# California, Berkeley and its contributors. -# 4. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# $FreeBSD: src/etc/MAKEDEV.local,v 1.3 1999/08/27 23:23:40 peter Exp $ -# $DragonFly: src/etc/MAKEDEV.local,v 1.2 2003/06/17 04:24:45 dillon Exp $ -# @(#)MAKEDEV.local 5.1 (Berkeley) 3/22/91 -# - -# Local device MAKEDEV script. - -PATH=/sbin:/bin:/usr/bin -umask 77 -for i -do -case $i in - -*) - echo 'MAKEDEV.local: no such device.' - ;; -esac -done diff --git a/etc/Makefile b/etc/Makefile index feefaa6fbf..f149375f82 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -227,15 +227,7 @@ upgrade_etc: preupgrade remove-obsolete-files .endif .endif ldconfig -R -.if !defined(BINARY_UPGRADE) # binary upgrade just copies these nodes -.if !defined(NO_MAKEDEV) - cd ${UPGRADE_SRCDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \ - MAKEDEV.local MAKEDEV ${DESTDIR}/dev -.if !defined(NO_MAKEDEV_RUN) - cd ${DESTDIR}/dev; sh MAKEDEV upgrade -.endif -.endif -.endif + mkdir -p ${DESTDIR}/dev # The existence of cleartext_pass_ok means pam config files are out of date. @set - `fgrep cleartext_pass_ok ${DESTDIR}/etc/pam.d/*`; \ @@ -284,13 +276,7 @@ distribution: cd ${.CURDIR}/../${dir}; ${MAKE} -f Makefile.etc install .endif .endfor -.if !defined(NO_MAKEDEV) - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \ - MAKEDEV.local MAKEDEV ${DESTDIR}/dev -.if !defined(NO_MAKEDEV_RUN) - cd ${DESTDIR}/dev; sh MAKEDEV all -.endif -.endif + mkdir -p ${DESTDIR}/dev cd ${.CURDIR}/root; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.cshrc ${DESTDIR}/root/.cshrc; \ diff --git a/include/stdlib.h b/include/stdlib.h index b596fbee56..5fa5925ac4 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -256,6 +256,8 @@ int cgetstr(char *, const char *, char **); int cgetustr(char *, const char *, char **); int daemon(int, int); +char *fdevname(int); +int fdevname_r(int, char *, size_t); char *devname(dev_t, mode_t); char *devname_r(dev_t, mode_t, char *, size_t); int getloadavg(double [], int); diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index ec0a7fe34e..c0483a5bff 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -9,8 +9,8 @@ SRCS+= _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \ alarm.c arc4random.c assert.c basename.c \ clock.c closedir.c confstr.c \ ctermid.c ctype.c daemon.c devname.c dirname.c disklabel.c disktab.c \ - dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c \ - exec.c fmtcheck.c fmtmsg.c fnmatch.c fpclassifyd.c fpclassifyf.c \ + dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c exec.c \ + fdevname.c fmtcheck.c fmtmsg.c fnmatch.c fpclassifyd.c fpclassifyf.c \ frexp.c fstab.c ftok.c fts.c ftw.c getbootfile.c getbsize.c \ getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \ gethostname.c getloadavg.c getlogin.c getmntinfo.c getmntvinfo.c \ @@ -50,7 +50,7 @@ MAN+= alarm.3 arc4random.3 clock.3 \ confstr.3 ctermid.3 ctype.3 daemon.3 \ devname.3 directory.3 dirname.3 \ dladdr.3 dlinfo.3 dlopen.3 \ - err.3 exec.3 \ + err.3 exec.3 fdevname.3 \ fmtcheck.3 fmtmsg.3 fnmatch.3 fpclassify.3 frexp.3 ftok.3 fts.3 ftw.3 \ getbootfile.3 getbsize.3 getcap.3 getcontext.3 getcwd.3 \ getdiskbyname.3 getdisktabbyname.3 getdomainname.3 getfsent.3 \ diff --git a/lib/libc/gen/fdevname.3 b/lib/libc/gen/fdevname.3 new file mode 100644 index 0000000000..3683e5c632 --- /dev/null +++ b/lib/libc/gen/fdevname.3 @@ -0,0 +1,88 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)devname.3 8.2 (Berkeley) 4/29/95 +.\" $FreeBSD: src/lib/libc/gen/devname.3,v 1.7.2.7 2003/03/15 15:11:05 trhodes Exp $ +.\" $DragonFly: src/lib/libc/gen/devname.3,v 1.5 2007/05/17 08:19:00 swildner Exp $ +.\" +.Dd July 18, 1999 +.Dt DEVNAME 3 +.Os +.Sh NAME +.Nm devname , +.Nm devname_r +.Nd get device name +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/stat.h +.In stdlib.h +.Ft char * +.Fn devname "dev_t dev" "mode_t type" +.Ft char * +.Fn devname_r "dev_t dev" "mode_t type" "char *buf" "size_t len" +.Sh DESCRIPTION +The +.Fn devname +function returns a pointer to the name of the block or character +device in +.Pa /dev +with a device number of +.Fa dev , +and a file type matching the one encoded in +.Fa type +which must be one of +.Dv S_IFBLK +or +.Dv S_IFCHR . +To find the right name, +.Fn devname +first searches the device database created by +.Xr dev_mkdb 8 ; +if that fails, it will format the information encapsulated in +.Fa dev +and +.Fa type +in a human-readable format. +.Pp +.Fn devname +returns a pointer to an internal static object; thus, subsequent calls will +modify the same buffer. +.Fn devname_r +avoids this problem by taking a buffer and buffer length as arguments. +.Sh SEE ALSO +.Xr stat 2 , +.Xr dev_mkdb 8 +.Sh HISTORY +The +.Fn devname +function appeared in +.Bx 4.4 . diff --git a/lib/libc/gen/fdevname.c b/lib/libc/gen/fdevname.c new file mode 100644 index 0000000000..58803fec60 --- /dev/null +++ b/lib/libc/gen/fdevname.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2009 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Alex Hornung + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "reentrant.h" +#include "un-namespace.h" + +#include "libc_private.h" + +static char fdevname_buf[sizeof(_PATH_DEV) + NAME_MAX]; + +static once_t fdevname_init_once = ONCE_INITIALIZER; +static thread_key_t fdevname_key; +static int fdevname_keycreated = 0; + +int +fdevname_r(int fd, char *buf, size_t len) +{ + struct stat sb; + struct fiodname_args fa; + size_t used; + + *buf = '\0'; + + /* Must be a character device. */ + if (_fstat(fd, &sb) || !S_ISCHR(sb.st_mode)) + return (ENOTTY); + + /* Must have enough room */ + if (len <= sizeof(_PATH_DEV)) + return (ERANGE); + + strcpy(buf, _PATH_DEV); + used = strlen(buf); + fa.len = len - used; + fa.name = buf + used; + if (_ioctl(fd, FIODNAME, &fa) == -1) { + return ERANGE; + } + return (0); +} + +static void +fdevname_keycreate(void) +{ + fdevname_keycreated = (thr_keycreate(&fdevname_key, free) == 0); +} + +char * +fdevname(int fd) +{ + char *buf; + + if (thr_main() != 0) + buf = fdevname_buf; + else { + if (thr_once(&fdevname_init_once, fdevname_keycreate) != 0 || + !fdevname_keycreated) + return (NULL); + if ((buf = thr_getspecific(fdevname_key)) == NULL) { + if ((buf = malloc(sizeof fdevname_buf)) == NULL) + return (NULL); + if (thr_setspecific(fdevname_key, buf) != 0) { + free(buf); + return (NULL); + } + } + } + + if (fdevname_r(fd, buf, sizeof fdevname_buf) != 0) + return (NULL); + return (buf); +} diff --git a/nrelease/Makefile b/nrelease/Makefile index 7cf65a4531..606aada4a4 100644 --- a/nrelease/Makefile +++ b/nrelease/Makefile @@ -329,6 +329,7 @@ customizeiso: ${CHROOT_CMD} "ldconfig -elf /usr/lib /usr/lib/gcc* /usr/lib/compat" -@umount ${ISOROOT}/usr/pkgsrc/distfiles -@umount ${ISOROOT}/usr/pkgsrc + -@umount ${ISOROOT}/dev mkdir -p ${ISODIR}/distfiles rm -rf ${ISOROOT}/usr/pkgobj # @@ -338,6 +339,7 @@ customizeiso: mkdir -p ${ISOROOT}/usr/pkgobj/bootstrap mkdir -p ${ISOROOT}/usr/pkgsrc mount_null ${PKGSRC_PATH} ${ISOROOT}/usr/pkgsrc + mount_devfs ${ISOROOT}/dev cp /etc/shells ${ISOROOT}/usr/pkgsrc/distfiles/.test > /dev/null 2>&1 \ || mount_null ${ISODIR}/distfiles ${ISOROOT}/usr/pkgsrc/distfiles # @@ -379,6 +381,7 @@ customizeiso: # ${CHROOT_CMD} "pkg_leaves | xargs pkg_delete -R" -umount ${ISOROOT}/usr/pkgsrc/distfiles + umount ${ISOROOT}/dev umount ${ISOROOT}/usr/pkgsrc rmdir ${ISOROOT}/usr/pkgsrc rm -rf ${ISOROOT}/usr/pkgobj @@ -443,6 +446,7 @@ mkimg: clean: -umount ${ISOROOT}/usr/pkgsrc/distfiles > /dev/null 2>&1 -umount ${ISOROOT}/usr/pkgsrc > /dev/null 2>&1 + -umount ${ISOROOT}/dev if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi rm -rf ${ISOROOT} rm -rf ${NRLOBJDIR}/nrelease diff --git a/nrelease/gui/etc/fstab b/nrelease/gui/etc/fstab index b92b8c75a4..06c40ef820 100644 --- a/nrelease/gui/etc/fstab +++ b/nrelease/gui/etc/fstab @@ -1,4 +1,3 @@ -# $DragonFly: src/nrelease/gui/etc/fstab,v 1.2 2008/06/01 08:54:18 swildner Exp $ # # Device Mountpoint FStype Options Dump Pass# /dev/acd0a / cd9660 ro,noauto 0 0 @@ -6,7 +5,6 @@ swap /root mfs rw,-C,-s=32768 0 0 swap /var mfs rw,-C,-s=262144,-i=4096 0 0 swap /tmp mfs rw,-C,-s=16384 0 0 swap /etc mfs rw,-C,-s=24576 0 0 -swap /dev mfs rw,-C,-s=8192,-i=512 0 0 swap /usr/local/etc mfs rw,-C,-s=8192 0 0 swap /usr/pkg/share/X11/xkb/compiled mfs rw,-C,-s=8192 0 0 proc /proc procfs rw 0 0 diff --git a/nrelease/installer/etc/fstab b/nrelease/installer/etc/fstab index d54aed3a39..b00b1fc158 100644 --- a/nrelease/installer/etc/fstab +++ b/nrelease/installer/etc/fstab @@ -1,4 +1,3 @@ -# $DragonFly: src/nrelease/installer/etc/fstab,v 1.3 2008/06/01 08:54:18 swildner Exp $ # # Device Mountpoint FStype Options Dump Pass# /dev/acd0a / cd9660 ro,noauto 0 0 @@ -6,6 +5,5 @@ swap /root mfs rw,-C,-s=8192 0 0 swap /var mfs rw,-C,-s=8192 0 0 swap /tmp mfs rw,-C,-s=8192 0 0 swap /etc mfs rw,-C,-s=24576 0 0 -swap /dev mfs rw,-C,-s=8192,-i=512 0 0 swap /usr/local/etc mfs rw,-C,-s=8192 0 0 proc /proc procfs rw 0 0 diff --git a/nrelease/installer/etc/rc.d/pfi b/nrelease/installer/etc/rc.d/pfi index d86995877e..eaecac3541 100755 --- a/nrelease/installer/etc/rc.d/pfi +++ b/nrelease/installer/etc/rc.d/pfi @@ -52,11 +52,8 @@ look_for_pfi_config_msdos() { [ -r /etc/pfi.conf ] && return 0 - for try_device in da0s1 da1s1 fd0 fd1; do + for try_device in da0s1 da1s1 da8s1 fd0 fd1; do echo -n "Looking for pfi.conf on /dev/${try_device}..." - if [ ! -e /dev/${try_device} ]; then - ( cd /dev && ./MAKEDEV ${try_device} ) - fi if mount_msdos -o rdonly /dev/$try_device /mnt ; then echo -n " /dev/$try_device ok..." if get_pfi_config /mnt /dev/$try_device; then @@ -75,11 +72,8 @@ look_for_pfi_config_cd9660() { [ -r /etc/pfi.conf ] && return 0 - for try_device in acd0c; do + for try_device in acd0 cd0 acd1 cd1; do echo -n "Looking for pfi.conf on /dev/${try_device}..." - if [ ! -e /dev/${try_device} ]; then - ( cd /dev && ./MAKEDEV ${try_device} ) - fi if mount_cd9660 /dev/$try_device /mnt ; then echo -n " /dev/$try_device ok..." if get_pfi_config /mnt /dev/$try_device; then diff --git a/nrelease/root/README b/nrelease/root/README index 70f6d55cf8..97c3048925 100644 --- a/nrelease/root/README +++ b/nrelease/root/README @@ -124,15 +124,6 @@ # disklabel -e ad0s1 - # If you are not using ad0s1 as in the previous commands, you will - # need to create the device nodes for that slice. Change the - # slice number (ad0s2a) to match the disk slice you are using. - # - # The device nodes are automatically created for ad0s1, so you can - # safely skip this step if you are using that disk slice. - # - cd /dev && MAKEDEV ad0s2a - # Newfs (format) the various filesystems. Softupdates is not # normally enabled on the root filesystem because large kernel or # world installs/upgrades can run it out of space due to softupdate's diff --git a/nrelease/root/README.USB b/nrelease/root/README.USB index 2ddf9c29b9..b2420cf1bb 100644 --- a/nrelease/root/README.USB +++ b/nrelease/root/README.USB @@ -12,14 +12,6 @@ kldload ehci.ko rcforce usbd - If you have a lot of UMASS storage devices /dev may not have device - entries for all of them. DragonFly uses a pseudo SCSI layer to access - USB mass storage devices so if /dev/daX does not exist you can create - it with MAKEDEV: - - cd /dev - ./MAKEDEV da4 da5 - To enable USBD after installing on a hard disk, simply set usbd_enable="YES" in /etc/rc.conf. diff --git a/nrelease/root/etc/fstab b/nrelease/root/etc/fstab index 3b978d246a..17d751aa2d 100644 --- a/nrelease/root/etc/fstab +++ b/nrelease/root/etc/fstab @@ -1,10 +1,8 @@ -# $DragonFly: src/nrelease/root/etc/fstab,v 1.3 2008/06/01 08:54:18 swildner Exp $ # # Device Mountpoint FStype Options Dump Pass# /dev/acd0a / cd9660 ro,noauto 0 0 swap /var mfs rw,-C,-s=8192 0 0 swap /tmp mfs rw,-C,-s=8192 0 0 swap /etc mfs rw,-C,-s=24576 0 0 -swap /dev mfs rw,-C,-s=8192,-i=512 0 0 swap /usr/local/etc mfs rw,-C,-s=8192 0 0 proc /proc procfs rw 0 0 diff --git a/sbin/Makefile b/sbin/Makefile index bb4f3074ff..8c9a46262c 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -45,6 +45,7 @@ SUBDIR= adjkerntz \ mountctl \ mount \ mount_cd9660 \ + mount_devfs \ mount_ext2fs \ mount_hammer \ mount_msdos \ diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c index e73780f728..757f58e5f7 100644 --- a/sbin/dhclient/bpf.c +++ b/sbin/dhclient/bpf.c @@ -52,8 +52,6 @@ #include "dhcpd.h" -#define BPF_FORMAT "/dev/bpf%d" - /* * Called by get_interface_list for each interface that's discovered. * Opens a packet filter for each interface and adds it to the select @@ -65,17 +63,24 @@ if_register_bpf(void) char filename[50]; int sock, b; - /* Open a BPF device */ - for (b = 0; 1; b++) { - snprintf(filename, sizeof(filename), BPF_FORMAT, b); - sock = open(filename, O_RDWR, 0); - if (sock < 0) { - if (errno == EBUSY) - continue; - else - error("Can't find free bpf: %m"); - } else - break; + /* + * Open a BPF device. Try auto-clone first (newer kernels), + * otherwise iterate (older kernels). + */ + sock = open("/dev/bpf", O_RDWR, 0); + if (sock < 0) { + for (b = 0; 1; b++) { + snprintf(filename, sizeof(filename), "/dev/bpf%d", b); + sock = open(filename, O_RDWR, 0); + if (sock < 0) { + if (errno == EBUSY) + continue; + else + error("Can't find free bpf: %m"); + } else { + break; + } + } } /* Set the BPF device to point at this interface. */ diff --git a/sbin/mount_devfs/mount_devfs.8 b/sbin/mount_devfs/mount_devfs.8 new file mode 100644 index 0000000000..cf462a463a --- /dev/null +++ b/sbin/mount_devfs/mount_devfs.8 @@ -0,0 +1,153 @@ +.\" +.\" Copyright (c) 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" All rights reserved. +.\" +.\" This code is derived from software donated to Berkeley by +.\" Jan-Simon Pendry. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)mount_portal.8 8.3 (Berkeley) 3/27/94 +.\" $FreeBSD: src/sbin/mount_portal/mount_portal.8,v 1.8.2.2 2001/12/20 16:41:47 ru Exp $ +.\" $DragonFly: src/sbin/mount_portal/mount_portal.8,v 1.2 2003/06/17 04:27:33 dillon Exp $ +.\" +.Dd March 27, 1994 +.Dt MOUNT_PORTAL 8 +.Os +.Sh NAME +.Nm mount_portal +.Nd mount the portal daemon +.Sh SYNOPSIS +.Nm +.Op Fl o Ar options +.Ar /etc/portal.conf +.Ar mount_point +.Sh DESCRIPTION +The +.Nm +command attaches an instance of the portal daemon +to the global filesystem namespace. +The conventional mount point is +.Pa /p . +.\" .PA /dev . +This command is normally executed by +.Xr mount 8 +at boot time. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl o +Options are specified with a +.Fl o +flag followed by a comma separated string of options. +See the +.Xr mount 8 +man page for possible options and their meanings. +.El +.Pp +The portal daemon provides an +.Em open +service. +Objects opened under the portal mount point are +dynamically created by the portal daemon according +to rules specified in the named configuration file. +Using this mechanism allows descriptors such as sockets +to be made available in the filesystem namespace. +.Pp +The portal daemon works by being passed the full pathname +of the object being opened. +The daemon creates an appropriate descriptor according +to the rules in the configuration file, and then passes the descriptor back +to the calling process as the result of the open system call. +.Sh NAMESPACE +By convention, the portal daemon divides the namespace into sub-namespaces, +each of which handles objects of a particular type. +.Pp +The following sub-namespaces are currently implemented: +.Pa tcplisten , +.Pa tcp +and +.Pa fs . +The +.Pa tcplisten +namespace takes a slash separated hostname and port and creates a TCP/IP +socket bound to the given hostname-port pair. +The hostname may be +specified as "ANY" to allow any other host to connect to the socket. +A +port number of 0 will dynamically allocate a port, this can be +discovered by calling +.Xr getsockname 2 +with the returned file descriptor. +Privileged ports can only be bound to +by the super-user. +The +.Pa tcp +namespace takes a hostname and a port (slash separated) and +creates an open TCP/IP connection. +The +.Pa fs +namespace opens the named file, starting back at the root directory. +This can be used to provide a controlled escape path from +a chrooted environment. +.Sh "CONFIGURATION FILE" +The configuration file contains a list of rules. +Each rule takes one line and consists of two or more +whitespace separated fields. +A hash (``#'') character causes the remainder of a line to +be ignored. Blank lines are ignored. +.Pp +The first field is a pathname prefix to match +against the requested pathname. +If a match is found, the second field +tells the daemon what type of object to create. +Subsequent fields are passed to the creation function. +.Bd -literal +# @(#)portal.conf 5.1 (Berkeley) 7/13/92 +tcplisten/ tcplisten tcplisten/ +tcp/ tcp tcp/ +fs/ file fs/ +.Ed +.Sh FILES +.Bl -tag -width /p/* -compact +.It Pa /p/* +.El +.Sh SEE ALSO +.Xr mount 2 , +.Xr unmount 2 , +.Xr fstab 5 , +.Xr mount 8 +.Sh CAVEATS +This filesystem may not be NFS-exported. +.Sh HISTORY +The +.Nm +utility first appeared in +.Bx 4.4 . diff --git a/usr.sbin/installer/dfuibe_installer/fn_configure.c b/usr.sbin/installer/dfuibe_installer/fn_configure.c index 455b86a0d5..d8e1782c15 100644 --- a/usr.sbin/installer/dfuibe_installer/fn_configure.c +++ b/usr.sbin/installer/dfuibe_installer/fn_configure.c @@ -1395,7 +1395,7 @@ mount_target_system(struct i_fn_args *a) free(cvtoptions); } else { if (use_hammer == 0) { - command_add_ensure_dev(a, cmds, device); + /* command_add_ensure_dev(a, cmds, device); */ command_add(cmds, "%s%s -o %s %s%s %s%s%s", a->os_root, cmd_name(a, "MOUNT"), @@ -1403,7 +1403,7 @@ mount_target_system(struct i_fn_args *a) a->os_root, device, a->os_root, a->cfg_root, mtpt); } else { - command_add_ensure_dev(a, cmds, device); + /* command_add_ensure_dev(a, cmds, device); */ command_add(cmds, "%s%s -o %s %s%s%s %s%s%s", a->os_root, cmd_name(a, "MOUNT_NULL"), diff --git a/usr.sbin/installer/libinstaller/commands.c b/usr.sbin/installer/libinstaller/commands.c index 88b6b43b34..b2d6d12706 100644 --- a/usr.sbin/installer/libinstaller/commands.c +++ b/usr.sbin/installer/libinstaller/commands.c @@ -583,11 +583,11 @@ struct command * command_add_ensure_dev(struct i_fn_args *a, struct commands *cmds, const char *dev_name) { +#if 0 struct command *cmd; char *dev_basename; dev_basename = basename(dev_name); - /* * We don't need to do this on systems with a devfs * (which is, at the time of this writing, FreeBSD 5.x and later.) @@ -600,4 +600,6 @@ command_add_ensure_dev(struct i_fn_args *a, struct commands *cmds, dev_basename); return(cmd); +#endif + return (NULL); } diff --git a/usr.sbin/vnconfig/vnconfig.8 b/usr.sbin/vnconfig/vnconfig.8 index 671b248dc2..1a13a36e8e 100644 --- a/usr.sbin/vnconfig/vnconfig.8 +++ b/usr.sbin/vnconfig/vnconfig.8 @@ -118,8 +118,6 @@ Reset which is a comma separated string of options. The list of allowed options and their meanings are: .Bl -tag -width "follow" -.It Ar labels -use disk/slice labels. .It Ar reserve Pre-reserve the blocks underlying the file or swap backing store. Currently only works for swap backing store. This option also disables on-the-fly freeing of @@ -270,7 +268,7 @@ Unmounts (disables) Configures and enables all devices specified in .Pa /etc/vntab . .Pp -.Dl vnconfig -s labels -c vn0 somebackingfile +.Dl vnconfig -c vn0 somebackingfile .Dl disklabel -r -w vn0s0 auto .Dl disklabel -e vn0s0 .Pp @@ -283,7 +281,7 @@ and using the VN configuration already stored in the file rather than relabeling and recreating the filesystem. It is even possible to fsck the VN partitions that previously contained filesystems. .Pp -.Dl vnconfig -e -s labels,reserve -S 400m vn1 +.Dl vnconfig -e -s reserve -S 400m vn1 .Dl disklabel -r -w vn1s0 auto .Dl newfs /dev/vn1s0 .Dl mount /dev/vn1s0 /usr/obj diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c index 7222e0708e..97c0a65308 100644 --- a/usr.sbin/vnconfig/vnconfig.c +++ b/usr.sbin/vnconfig/vnconfig.c @@ -248,7 +248,7 @@ int what_opt(const char *str, u_long *p) { if (!strcmp(str,"reserve")) { *p |= VN_RESERVE; return 0; } - if (!strcmp(str,"labels")) { *p |= VN_LABELS; return 0; } + if (!strcmp(str,"labels")) { return 0; } /* deprecated */ if (!strcmp(str,"follow")) { *p |= VN_FOLLOW; return 0; } if (!strcmp(str,"debug")) { *p |= VN_DEBUG; return 0; } if (!strcmp(str,"io")) { *p |= VN_IO; return 0; } -- 2.41.0