Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2018 15:55:23 +0000 (UTC)
From:      Brad Davis <brd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338204 - in head: etc etc/defaults sbin/devfs
Message-ID:  <201808221555.w7MFtNCW048868@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brd
Date: Wed Aug 22 15:55:23 2018
New Revision: 338204
URL: https://svnweb.freebsd.org/changeset/base/338204

Log:
  Move all devfs related files to sbin/devfs/
  
  This is related to pkgbase as it uses CONFS to properly tag these as config
  files.
  
  Approved by:	will (mentor)
  Differential Revision:	https://reviews.freebsd.org/D16785

Added:
  head/sbin/devfs/devfs.conf
     - copied unchanged from r338203, head/etc/devfs.conf
  head/sbin/devfs/devfs.rules
     - copied unchanged from r338203, head/etc/defaults/devfs.rules
Deleted:
  head/etc/defaults/
  head/etc/devfs.conf
Modified:
  head/etc/Makefile
  head/sbin/devfs/Makefile

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Wed Aug 22 15:29:54 2018	(r338203)
+++ head/etc/Makefile	Wed Aug 22 15:55:23 2018	(r338204)
@@ -13,7 +13,6 @@ SUBDIR+=sendmail
 .endif
 
 BIN1=	crontab \
-	devfs.conf \
 	dhclient.conf \
 	disktab \
 	fbtab \
@@ -142,7 +141,6 @@ distribution:
 		echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
 	) | ${METALOG.add}
 .endif
-	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
 	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
 	${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
 	${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
@@ -281,15 +279,10 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
 	done
 .endif
 
-etc-examples-install: ${META_DEPS}
+etc-examples: ${META_DEPS}
 	cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
 	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
 	    ${DESTDIR}${SHAREDIR}/examples/etc
-
-etc-examples: etc-examples-install
-	${_+_}cd ${.CURDIR}/defaults; \
-	    ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
-	    DESTDIR=${DESTDIR}${SHAREDIR}/examples
 
 .include <bsd.prog.mk>
 

Modified: head/sbin/devfs/Makefile
==============================================================================
--- head/sbin/devfs/Makefile	Wed Aug 22 15:29:54 2018	(r338203)
+++ head/sbin/devfs/Makefile	Wed Aug 22 15:55:23 2018	(r338204)
@@ -1,5 +1,8 @@
 # $FreeBSD$
 
+CONFS=	devfs.conf devfs.rules
+CONFSDIR_devfs.rules=	/etc/defaults
+CONFSMODE_devfs.rules=	600
 PACKAGE=runtime
 PROG=	devfs
 SRCS=	devfs.c rule.c

Copied: head/sbin/devfs/devfs.conf (from r338203, head/etc/devfs.conf)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sbin/devfs/devfs.conf	Wed Aug 22 15:55:23 2018	(r338204, copy of r338203, head/etc/devfs.conf)
@@ -0,0 +1,43 @@
+#  Copyright (c) 2003 The FreeBSD Project
+#  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.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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$
+
+# These are examples of how to configure devices using /etc/rc.d/devfs.
+# The first parameter is always the action to take, the second is always the
+# existing device created by devfs, and the last is what you want to change.
+# The name of the action is only significant to the first unique character.
+#
+# Examples:
+
+# Commonly used by many ports
+#link	cd0	cdrom
+#link	cd0	dvd
+
+# Allow a user in the wheel group to query the smb0 device
+#perm	smb0	0660
+
+# Allow members of group operator to cat things to the speaker
+#own	speaker	root:operator
+#perm	speaker	0660

Copied: head/sbin/devfs/devfs.rules (from r338203, head/etc/defaults/devfs.rules)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sbin/devfs/devfs.rules	Wed Aug 22 15:55:23 2018	(r338204, copy of r338203, head/etc/defaults/devfs.rules)
@@ -0,0 +1,88 @@
+#
+# The following are some default rules for devfs(5) mounts.
+# The format is very simple. Empty lines and lines beginning
+# with a hash '#' are ignored. If the hash mark occurs anywhere
+# other than the beginning of a line, it and any subsequent
+# characters will be ignored.  A line in between brackets '[]'
+# denotes the beginning of a ruleset. In the brackets should
+# be a name for the rule and its ruleset number. Any other lines
+# will be considered to be the 'action' part of a rule
+# passed to the devfs(8) command. These will be passed
+# "as-is" to the devfs(8) command with the exception that
+# any references to other rulesets will be expanded first. These
+# references must include a dollar sign '$' in front of the
+# name to be expanded properly.
+#
+# $FreeBSD$
+#
+
+# Very basic and secure ruleset: Hide everything.
+# Used as a basis for other rules.
+#
+[devfsrules_hide_all=1]
+add hide
+
+# Basic devices typically necessary.
+# Requires: devfsrules_hide_all
+#
+[devfsrules_unhide_basic=2]
+add path log unhide
+add path null unhide
+add path zero unhide
+add path crypto unhide
+add path random unhide
+add path urandom unhide
+
+# Devices typically needed to support logged-in users.
+# Requires: devfsrules_hide_all
+#
+[devfsrules_unhide_login=3]
+add path 'ptyp*' unhide
+add path 'ptyq*' unhide
+add path 'ptyr*' unhide
+add path 'ptys*' unhide
+add path 'ptyP*' unhide
+add path 'ptyQ*' unhide
+add path 'ptyR*' unhide
+add path 'ptyS*' unhide
+add path 'ptyl*' unhide
+add path 'ptym*' unhide
+add path 'ptyn*' unhide
+add path 'ptyo*' unhide
+add path 'ptyL*' unhide
+add path 'ptyM*' unhide
+add path 'ptyN*' unhide
+add path 'ptyO*' unhide
+add path 'ttyp*' unhide
+add path 'ttyq*' unhide
+add path 'ttyr*' unhide
+add path 'ttys*' unhide
+add path 'ttyP*' unhide
+add path 'ttyQ*' unhide
+add path 'ttyR*' unhide
+add path 'ttyS*' unhide
+add path 'ttyl*' unhide
+add path 'ttym*' unhide
+add path 'ttyn*' unhide
+add path 'ttyo*' unhide
+add path 'ttyL*' unhide
+add path 'ttyM*' unhide
+add path 'ttyN*' unhide
+add path 'ttyO*' unhide
+add path ptmx unhide
+add path pts unhide
+add path 'pts/*' unhide
+add path fd unhide
+add path 'fd/*' unhide
+add path stdin unhide
+add path stdout unhide
+add path stderr unhide
+
+# Devices usually found in a jail.
+#
+[devfsrules_jail=4]
+add include $devfsrules_hide_all
+add include $devfsrules_unhide_basic
+add include $devfsrules_unhide_login
+add path fuse unhide
+add path zfs unhide



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808221555.w7MFtNCW048868>