aboutsummaryrefslogtreecommitdiff
path: root/sbin/devd
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/devd')
-rw-r--r--sbin/devd/Makefile36
-rw-r--r--sbin/devd/Makefile.depend4
-rw-r--r--sbin/devd/apple.conf1
-rw-r--r--sbin/devd/asus.conf1
-rw-r--r--sbin/devd/autofs.conf9
-rw-r--r--sbin/devd/bluetooth.conf9
-rw-r--r--sbin/devd/devd.82
-rw-r--r--sbin/devd/devd.cc39
-rw-r--r--sbin/devd/devd.conf117
-rw-r--r--sbin/devd/devd.conf.552
-rw-r--r--sbin/devd/devd.h4
-rw-r--r--sbin/devd/devd.hh4
-rw-r--r--sbin/devd/devmatch.conf27
-rw-r--r--sbin/devd/dhclient.conf19
-rw-r--r--sbin/devd/hyperv.conf1
-rw-r--r--sbin/devd/moused.conf35
-rw-r--r--sbin/devd/parse.y4
-rw-r--r--sbin/devd/power_profile.conf6
-rw-r--r--sbin/devd/syscons.conf9
-rw-r--r--sbin/devd/tests/Makefile1
-rw-r--r--sbin/devd/tests/Makefile.depend1
-rw-r--r--sbin/devd/tests/client_test.c2
-rw-r--r--sbin/devd/token.l4
-rw-r--r--sbin/devd/uath.conf1
-rw-r--r--sbin/devd/ulpt.conf1
-rw-r--r--sbin/devd/zfs.conf1
26 files changed, 220 insertions, 170 deletions
diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile
index 0bda9e1ecf95..09a8ed5898e1 100644
--- a/sbin/devd/Makefile
+++ b/sbin/devd/Makefile
@@ -1,9 +1,8 @@
-# $FreeBSD$
.include <src.opts.mk>
-WARNS?= 3
-PACKAGE=runtime
+WARNS?= 6
+PACKAGE=devd
CONFGROUPS= CONFS DEVD
CONFS= devd.conf
DEVD= devmatch.conf
@@ -12,6 +11,35 @@ DEVDDIR= /etc/devd
DEVD+= asus.conf
.endif
+.if ${MK_AUTOFS} != "no"
+CONFGROUPS+= AUTOFS
+AUTOFSDIR= ${DEVDDIR}
+AUTOFS+= autofs.conf
+AUTOFSPACKAGE= autofs
+.endif
+
+CONFGROUPS+= DHCLIENT
+DHCLIENTDIR= ${DEVDDIR}
+DHCLIENT+= dhclient.conf
+DHCLIENTPACKAGE= dhclient
+
+CONFGROUPS+= POWERPROFILE
+POWERPROFILEDIR= ${DEVDDIR}
+POWERPROFILE+= power_profile.conf
+POWERPROFILEPACKAGE= acpi
+
+CONFGROUPS+= CONSOLE
+CONSOLEDIR= ${DEVDDIR}
+CONSOLE+= moused.conf syscons.conf
+CONSOLEPACKAGE= console-tools
+
+.if ${MK_BLUETOOTH} != "no"
+CONFGROUPS+= BLUETOOTH
+BLUETOOTHDIR= ${DEVDDIR}
+BLUETOOTH+= bluetooth.conf
+BLUETOOTHPACKAGE= bluetooth
+.endif
+
.if ${MK_HYPERV} != "no"
CONFGROUPS+= HYPERV
HYPERVDIR=${DEVDDIR}
@@ -35,8 +63,6 @@ PROG_CXX=devd
SRCS= devd.cc token.l parse.y y.tab.h
MAN= devd.8 devd.conf.5
-NO_SHARED?=YES
-
LIBADD= util
YFLAGS+=-v
diff --git a/sbin/devd/Makefile.depend b/sbin/devd/Makefile.depend
index 8c3f699ac991..a5009d89b087 100644
--- a/sbin/devd/Makefile.depend
+++ b/sbin/devd/Makefile.depend
@@ -1,17 +1,15 @@
-# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libc++ \
lib/libcompiler_rt \
+ lib/libcxxrt \
lib/libutil \
lib/msun \
- usr.bin/lex/lib \
usr.bin/yacc.host \
diff --git a/sbin/devd/apple.conf b/sbin/devd/apple.conf
index 0a9143f7b5a5..7a164c0ebfc7 100644
--- a/sbin/devd/apple.conf
+++ b/sbin/devd/apple.conf
@@ -1,4 +1,3 @@
-# $FreeBSD$
#
# PowerPC Apple specific devd events
diff --git a/sbin/devd/asus.conf b/sbin/devd/asus.conf
index 0074e7a7c55f..0962af7df2e0 100644
--- a/sbin/devd/asus.conf
+++ b/sbin/devd/asus.conf
@@ -1,4 +1,3 @@
-# $FreeBSD$
#
# ASUS specific devd events
diff --git a/sbin/devd/autofs.conf b/sbin/devd/autofs.conf
new file mode 100644
index 000000000000..a06ca7295d38
--- /dev/null
+++ b/sbin/devd/autofs.conf
@@ -0,0 +1,9 @@
+#
+# autofs(5) specific devd events
+
+# Discard autofs caches, useful for the -media special map.
+notify 100 {
+ match "system" "GEOM";
+ match "subsystem" "DEV";
+ action "/usr/sbin/automount -c";
+};
diff --git a/sbin/devd/bluetooth.conf b/sbin/devd/bluetooth.conf
new file mode 100644
index 000000000000..29bd51e36fca
--- /dev/null
+++ b/sbin/devd/bluetooth.conf
@@ -0,0 +1,9 @@
+# When a USB Bluetooth dongle appears, activate it
+attach 100 {
+ device-name "ubt[0-9]+";
+ action "service bluetooth quietstart $device-name";
+};
+detach 100 {
+ device-name "ubt[0-9]+";
+ action "service bluetooth quietstop $device-name";
+};
diff --git a/sbin/devd/devd.8 b/sbin/devd/devd.8
index 77c8e4aac2fb..f7e19df438ed 100644
--- a/sbin/devd/devd.8
+++ b/sbin/devd/devd.8
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd October 19, 2021
.Dt DEVD 8
.Os
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc
index a1b6ee479921..8d621e42a232 100644
--- a/sbin/devd/devd.cc
+++ b/sbin/devd/devd.cc
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause
*
* Copyright (c) 2002-2010 M. Warner Losh <imp@FreeBSD.org>
*
@@ -63,9 +63,6 @@
// - devd needs to document the unix domain socket
// - devd.conf needs more details on the supported statements.
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -173,6 +170,8 @@ delete_and_clear(vector<T *> &v)
static config cfg;
+static const char *curr_cf = NULL;
+
event_proc::event_proc() : _prio(-1)
{
_epsvec.reserve(4);
@@ -452,17 +451,28 @@ config::reset(void)
delete_and_clear(_notify_list);
}
+/*
+ * Called recursively as new files are included, so current stack of old names
+ * saved in each instance of 'old' on the call stack. Called single threaded
+ * so global varaibles curr_cf and lineno (and all of yacc's parser state)
+ * are safe to access w/o a lock.
+ */
void
config::parse_one_file(const char *fn)
{
+ const char *old;
+
devdlog(LOG_DEBUG, "Parsing %s\n", fn);
yyin = fopen(fn, "r");
+ old = curr_cf;
+ curr_cf = fn;
if (yyin == NULL)
err(1, "Cannot open config file %s", fn);
lineno = 1;
if (yyparse() != 0)
errx(1, "Cannot parse %s at line %d", fn, lineno);
fclose(yyin);
+ curr_cf = old;
}
void
@@ -1194,6 +1204,27 @@ new_action(const char *cmd)
eps *
new_match(const char *var, const char *re)
{
+ /*
+ * In FreeBSD 14, we changed the system=kern to system=kernel for the
+ * resume message to match all the other 'kernel' messages. Generate a
+ * warning for the life of 14.x that we've 'fixed' the file on the fly,
+ * but make it a fatal error in 15.x and newer.
+ */
+ if (strcmp(var, "kern") == 0) {
+#if __FreeBSD_version < 1500000
+ devdlog(LOG_WARNING,
+ "Changing deprecated system='kern' to new name 'kernel' in %s line %d.",
+ curr_cf, lineno);
+ free(const_cast<char *>(var));
+ var = strdup("kernel");
+#elif __FreeBSD_version < 1600000
+ errx(1, "Encountered deprecated system=\"kern\" rule in %s line %d",
+ curr_cf, lineno);
+#else
+#error "Remove this gross hack"
+#endif
+ }
+
eps *e = new match(cfg, var, re);
free(const_cast<char *>(var));
free(const_cast<char *>(re));
diff --git a/sbin/devd/devd.conf b/sbin/devd/devd.conf
index 15b37ee8fd90..08cbeb840b2f 100644
--- a/sbin/devd/devd.conf
+++ b/sbin/devd/devd.conf
@@ -1,4 +1,3 @@
-# $FreeBSD$
#
# Refer to devd.conf(5) and devd(8) man pages for the details on how to
# run and configure devd.
@@ -19,8 +18,8 @@ options {
# Setup some shorthand for regex that we use later in the file.
#XXX Yes, this is gross -- imp
set wifi-driver-regex
- "(ath|bwi|bwn|ipw|iwlwifi|iwi|iwm|iwn|malo|mwl|otus|ral|rsu|rtw|rtwn|rum|\
- run|uath|upgt|ural|urtw|wpi|wtap|zyd)[0-9]+";
+ "(ath|ath[0-9]+k|bwi|bwn|ipw|iwlwifi|iwi|iwm|iwn|malo|mwl|mt79|otus|\
+ ral|rsu|rtw|rtwn|rum|run|uath|upgt|ural|urtw|wpi|wtap|zyd)[0-9]+";
};
# Note that the attach/detach with the highest value wins, so that one can
@@ -45,19 +44,6 @@ notify 0 {
};
#
-# Try to start dhclient on Ethernet-like interfaces when the link comes
-# up. Only devices that are configured to support DHCP will actually
-# run it. No link down rule exists because dhclient automatically exits
-# when the link goes down.
-#
-notify 0 {
- match "system" "IFNET";
- match "type" "LINK_UP";
- media-type "ethernet";
- action "service dhclient quietstart $subsystem";
-};
-
-#
# Like Ethernet devices, but separate because 802.11 require spawning
# wlan(4) interface.
#
@@ -69,12 +55,6 @@ detach 0 {
device-name "$wifi-driver-regex";
action "/etc/pccard_ether $device-name stopchildren";
};
-notify 0 {
- match "system" "IFNET";
- match "type" "LINK_UP";
- media-type "802.11";
- action "service dhclient quietstart $subsystem";
-};
# An entry like this might be in a different file, but is included here
# as an example of how to override things. Normally 'ed50' would match
@@ -88,16 +68,6 @@ detach 100 {
device-name "ed50";
};
-# When a USB Bluetooth dongle appears, activate it
-attach 100 {
- device-name "ubt[0-9]+";
- action "service bluetooth quietstart $device-name";
-};
-detach 100 {
- device-name "ubt[0-9]+";
- action "service bluetooth quietstop $device-name";
-};
-
# Firmware downloader for Atheros AR3011 based USB Bluetooth devices
#attach 100 {
# match "vendor" "0x0cf3";
@@ -105,82 +75,6 @@ detach 100 {
# action "sleep 2 && /usr/sbin/ath3kfw -d $device-name -f /usr/local/etc/ath3k-1.fw";
#};
-# When a USB keyboard arrives, attach it as the console keyboard.
-attach 100 {
- device-name "ukbd0";
- action "service syscons setkeyboard /dev/ukbd0";
-};
-detach 100 {
- device-name "ukbd0";
- action "service syscons setkeyboard /dev/kbd0";
-};
-
-notify 100 {
- match "system" "DEVFS";
- match "subsystem" "CDEV";
- match "type" "CREATE";
- match "cdev" "atp[0-9]+";
-
- action "service moused quietstart $cdev";
-};
-
-notify 100 {
- match "system" "DEVFS";
- match "subsystem" "CDEV";
- match "type" "CREATE";
- match "cdev" "ums[0-9]+";
-
- action "service moused quietstart $cdev";
-};
-
-notify 100 {
- match "system" "DEVFS";
- match "subsystem" "CDEV";
- match "type" "CREATE";
- match "cdev" "wsp[0-9]+";
-
- action "service moused quietstart $cdev";
-};
-
-notify 100 {
- match "system" "DEVFS";
- match "subsystem" "CDEV";
- match "type" "DESTROY";
- match "cdev" "ums[0-9]+";
-
- action "service moused stop $cdev";
-};
-
-# Don't even try to second guess what to do about drivers that don't
-# match here. Instead, pass it off to syslog. Commented out for the
-# moment, as the pnpinfo variable isn't set in devd yet. Individual
-# variables within the bus supplied pnpinfo are set.
-nomatch 0 {
-# action "logger Unknown device: $pnpinfo $location $bus";
-};
-
-# Various logging of unknown devices.
-nomatch 10 {
- match "bus" "uhub[0-9]+";
- action "logger Unknown USB device: vendor $vendor product $product \
- bus $bus";
-};
-
-# Some Cardbus cards don't offer numerical manufacturer/product IDs, just
-# show the CIS info there.
-nomatch 10 {
- match "bus" "cardbus[0-9]+";
- action "logger Unknown Cardbus device: device $device class $class \
- vendor $vendor bus $bus";
-};
-
-# Switch power profiles when the AC line state changes.
-notify 10 {
- match "system" "ACPI";
- match "subsystem" "ACAD";
- action "service power_profile $notify";
-};
-
# Notify all users before beginning emergency shutdown when we get
# a _CRT or _HOT thermal event and we're going to power down the system
# very soon.
@@ -242,13 +136,6 @@ notify 0 {
action "service postgresql restart";
};
-# Discard autofs caches, useful for the -media special map.
-notify 100 {
- match "system" "GEOM";
- match "subsystem" "DEV";
- action "/usr/sbin/automount -c";
-};
-
# Handle userland coredumps.
# This commented out handler makes it possible to run an
# automated debugging session after the core dump is generated.
diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5
index dd9faa05c869..ceff27e8be60 100644
--- a/sbin/devd/devd.conf.5
+++ b/sbin/devd/devd.conf.5
@@ -21,8 +21,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.\" The section on comments was taken from named.conf.5, which has the
.\" following copyright:
.\" Copyright (c) 1999-2000 by Internet Software Consortium
@@ -40,12 +38,12 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.Dd November 3, 2021
+.Dd March 6, 2024
.Dt DEVD.CONF 5
.Os
.Sh NAME
.Nm devd.conf
-.Nd configuration file for
+.Nd configuration file format for
.Xr devd 8
.Sh DESCRIPTION
.Ss General Syntax
@@ -177,8 +175,6 @@ For network devices,
will match devices that have the given media type.
Valid media types are:
.Dq Li Ethernet ,
-.Dq Li Tokenring ,
-.Dq Li FDDI ,
.Dq Li 802.11 ,
and
.Dq Li ATM .
@@ -477,18 +473,38 @@ The network interface address removed.
.Pp
.Bl -column "System" "Subsystem" "1234567" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
-.It Li kern Ta Li power Ta Li resume Ta
+.It Li kernel Ta Li signal Ta Li coredump Ta
+Notification that a process has crashed and dumped core.
+.It Li kernel Ta Li power Ta Li resume Ta
Notification that the system has woken from the suspended state.
-Note: this notification is deprecated and will be removed in
-.Fx 14.0 .
.El
.Pp
.Bl -column "System" "Subsystem" "1234567" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
-.It Li kernel Ta Li signal Ta Li coredump Ta
-Notification that a process has crashed and dumped core.
-.It Li kernel Ta Li power Ta Li resume Ta
-Notification that the system has woken from the suspended state.
+.It Li nvme Ta Li controller Ta Li SMART_ERROR Ta
+A SMART Critical Warning State change has happened.
+$state has a hex bitmask of the bits that changed, as defined
+in the NVMe Standard for Critical Warning field of log page 2
+.Dq SMART / Health Information Log :
+.Bl -column "Bit Value" "Meaning" -compact
+.Sy "Bit Value" Ta Sy "Meaning"
+.It 0x1 Ta Spare capacity below threshold
+.It 0x2 Ta Temperature outside acceptable range
+.It 0x4 Ta Reliability of media degraded
+.It 0x8 Ta Media placed into read-only mode
+.It 0x10 Ta Volatime memory backup failure
+.It 0x20 Ta Persistent memrory read-only or degraded
+.El
+.It Li nvme Ta Li controller Ta Li RESET Ta
+A controller reset event has happened.
+$event is one of
+.Dq start ,
+.Dq success ,
+and
+.Dq timed_out
+representing the start of a controller reset, the successful completion of a
+controller reset, and a timeout while waiting for the controller to reset
+respectively.
.El
.Pp
.Bl -column "System" "Subsystem" "1234567" -compact
@@ -553,7 +569,7 @@ device has detected the lid openinging.
.It Li PMU Ta Li POWER Ta ACLINE Ta
The
.Xr pmc 4
-device has deteted an AC line state ($notify=0x00 is offline, 0x01 is online).
+device has detected an AC line state ($notify=0x00 is offline, 0x01 is online).
.It Li PMU Ta Li USB Ta overvoltage Ta
An over-voltage condition on the power lines for the USB power pins.
.It Li PMU Ta Li USB Ta plugged Ta
@@ -736,6 +752,14 @@ regardless of the value of the variable.
The
.Xr devd 8
configuration file.
+.It Pa /etc/devd
+A directory that
+.Nm devd
+searches for additional configuration files.
+.It Pa /usr/local/etc/devd
+A directory that
+.Nm devd
+searches for additional configuration files.
.El
.Sh EXAMPLES
.Bd -literal
diff --git a/sbin/devd/devd.h b/sbin/devd/devd.h
index a291e8141298..6d6495c915de 100644
--- a/sbin/devd/devd.h
+++ b/sbin/devd/devd.h
@@ -1,7 +1,7 @@
/*-
* DEVD (Device action daemon)
*
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 M. Warner Losh <imp@FreeBSD.org>
*
@@ -25,8 +25,6 @@
* 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$
*/
#ifndef DEVD_H
diff --git a/sbin/devd/devd.hh b/sbin/devd/devd.hh
index 62511d8ec3a5..5ab7a190c0e5 100644
--- a/sbin/devd/devd.hh
+++ b/sbin/devd/devd.hh
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002-2003 M. Warner Losh <imp@FreeBSD.org>
*
@@ -23,8 +23,6 @@
* 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$
*/
#ifndef DEVD_HH
diff --git a/sbin/devd/devmatch.conf b/sbin/devd/devmatch.conf
index 902c96f33664..a7c27857c0bd 100644
--- a/sbin/devd/devmatch.conf
+++ b/sbin/devd/devmatch.conf
@@ -1,15 +1,32 @@
+# Implement the run-time component of devmatch by reacting to nomatch events.
+
#
-# $FreeBSD$
+# Ignore those devices that can't possibly match. When there's neither a
+# location, nor a pnpinfo string, we know that there's nothing devmatch can
+# match on. When it's only a location, it'd debateable, but for nomatch
+# events, we can't disambiguate between the two reliably.
#
+nomatch 101 {
+ match "_" " +at +on .*";
+};
#
-# Example devd configuration file for automatically
-# loading what modules we can based on nomatch
-# events.
+# Ignore ACPI devices whose _HID is none. These cannot tell us what to load,
+# since 'none' is not a valid id. There's no need to call devvmatch for these either.
+#
+nomatch 101 {
+ match "_HID" "none";
+ match "bus" "acpi[0-9]+";
+};
+
#
# Generic NOMATCH event
+#
+# Note: It would be better to have some internal-to-devd action that will do
+# what devmatch does without re-parsing loader.hints for each invocation
+#
nomatch 100 {
- action "service devmatch quietstart '?'$_";
+ action "service devmatch quietstart $*";
};
# Add the following to devd.conf to prevent this from running:
diff --git a/sbin/devd/dhclient.conf b/sbin/devd/dhclient.conf
new file mode 100644
index 000000000000..e90558295e1a
--- /dev/null
+++ b/sbin/devd/dhclient.conf
@@ -0,0 +1,19 @@
+#
+# Try to start dhclient on Ethernet-like interfaces when the link comes
+# up. Only devices that are configured to support DHCP will actually
+# run it. No link down rule exists because dhclient automatically exits
+# when the link goes down.
+#
+notify 0 {
+ match "system" "IFNET";
+ match "type" "LINK_UP";
+ media-type "ethernet";
+ action "service dhclient quietstart $subsystem";
+};
+
+notify 0 {
+ match "system" "IFNET";
+ match "type" "LINK_UP";
+ media-type "802.11";
+ action "service dhclient quietstart $subsystem";
+};
diff --git a/sbin/devd/hyperv.conf b/sbin/devd/hyperv.conf
index 7c3e92ed099f..13695a0c75b6 100644
--- a/sbin/devd/hyperv.conf
+++ b/sbin/devd/hyperv.conf
@@ -1,4 +1,3 @@
-# $FreeBSD$
#
# Hyper-V specific events
diff --git a/sbin/devd/moused.conf b/sbin/devd/moused.conf
new file mode 100644
index 000000000000..002edad9a8a9
--- /dev/null
+++ b/sbin/devd/moused.conf
@@ -0,0 +1,35 @@
+notify 100 {
+ match "system" "DEVFS";
+ match "subsystem" "CDEV";
+ match "type" "CREATE";
+ match "cdev" "atp[0-9]+";
+
+ action "service moused quietstart $cdev";
+};
+
+notify 100 {
+ match "system" "DEVFS";
+ match "subsystem" "CDEV";
+ match "type" "CREATE";
+ match "cdev" "ums[0-9]+";
+
+ action "service moused quietstart $cdev";
+};
+
+notify 100 {
+ match "system" "DEVFS";
+ match "subsystem" "CDEV";
+ match "type" "CREATE";
+ match "cdev" "wsp[0-9]+";
+
+ action "service moused quietstart $cdev";
+};
+
+notify 100 {
+ match "system" "DEVFS";
+ match "subsystem" "CDEV";
+ match "type" "DESTROY";
+ match "cdev" "ums[0-9]+";
+
+ action "service moused stop $cdev";
+};
diff --git a/sbin/devd/parse.y b/sbin/devd/parse.y
index 9b8fd592045a..1aa3c20b6b68 100644
--- a/sbin/devd/parse.y
+++ b/sbin/devd/parse.y
@@ -2,7 +2,7 @@
/*-
* DEVD (Device action daemon)
*
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 M. Warner Losh <imp@FreeBSD.org>
*
@@ -26,8 +26,6 @@
* 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$
*/
#include <sys/cdefs.h>
diff --git a/sbin/devd/power_profile.conf b/sbin/devd/power_profile.conf
new file mode 100644
index 000000000000..294856071f00
--- /dev/null
+++ b/sbin/devd/power_profile.conf
@@ -0,0 +1,6 @@
+# Switch power profiles when the AC line state changes.
+notify 10 {
+ match "system" "ACPI";
+ match "subsystem" "ACAD";
+ action "service power_profile $notify";
+};
diff --git a/sbin/devd/syscons.conf b/sbin/devd/syscons.conf
new file mode 100644
index 000000000000..cd0c744955b9
--- /dev/null
+++ b/sbin/devd/syscons.conf
@@ -0,0 +1,9 @@
+# When a USB keyboard arrives, attach it as the console keyboard.
+attach 100 {
+ device-name "ukbd0";
+ action "service syscons setkeyboard /dev/ukbd0";
+};
+detach 100 {
+ device-name "ukbd0";
+ action "service syscons setkeyboard /dev/kbd0";
+};
diff --git a/sbin/devd/tests/Makefile b/sbin/devd/tests/Makefile
index c0a346f94d33..7a51f488ac68 100644
--- a/sbin/devd/tests/Makefile
+++ b/sbin/devd/tests/Makefile
@@ -1,4 +1,3 @@
-# $FreeBSD$
ATF_TESTS_C= client_test
TEST_METADATA.client_test= required_files="/var/run/devd.pid"
diff --git a/sbin/devd/tests/Makefile.depend b/sbin/devd/tests/Makefile.depend
index c062f6026d94..1af0c88e099c 100644
--- a/sbin/devd/tests/Makefile.depend
+++ b/sbin/devd/tests/Makefile.depend
@@ -1,4 +1,3 @@
-# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/devd/tests/client_test.c b/sbin/devd/tests/client_test.c
index 90081d963f4b..729c7a2f8bad 100644
--- a/sbin/devd/tests/client_test.c
+++ b/sbin/devd/tests/client_test.c
@@ -23,8 +23,6 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <stdbool.h>
#include <stdio.h>
diff --git a/sbin/devd/token.l b/sbin/devd/token.l
index 30e48e815fe3..f60ee40dedb2 100644
--- a/sbin/devd/token.l
+++ b/sbin/devd/token.l
@@ -2,7 +2,7 @@
/*-
* DEVD (Device action daemon)
*
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 M. Warner Losh <imp@FreeBSD.org>
*
@@ -26,8 +26,6 @@
* 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$
*/
#include <ctype.h>
diff --git a/sbin/devd/uath.conf b/sbin/devd/uath.conf
index 9f0cb939050b..13b50d44c739 100644
--- a/sbin/devd/uath.conf
+++ b/sbin/devd/uath.conf
@@ -1,4 +1,3 @@
-# $FreeBSD$
#
# Atheros USB wireless network device specific devd events
diff --git a/sbin/devd/ulpt.conf b/sbin/devd/ulpt.conf
index 2082726cbf47..f38398574a09 100644
--- a/sbin/devd/ulpt.conf
+++ b/sbin/devd/ulpt.conf
@@ -1,5 +1,4 @@
#
-# $FreeBSD$
#
#
diff --git a/sbin/devd/zfs.conf b/sbin/devd/zfs.conf
index ef6a6c12b6a1..56e1e2b21acd 100644
--- a/sbin/devd/zfs.conf
+++ b/sbin/devd/zfs.conf
@@ -1,4 +1,3 @@
-# $FreeBSD$
#
# Sample ZFS problem reports handling.