aboutsummaryrefslogtreecommitdiff
path: root/sbin/devd
Commit message (Collapse)AuthorAgeFilesLines
* sound: Notify devd when no devices are connectedChristos Margiolis9 days2-1/+13
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55531
* devd.conf.5: Fix cross-references to devfs(4)Quentin Thébault2026-02-181-4/+4
| | | | | | | | | Fixes: 1687d77197c0 (man filesystems: move driver pages) MFC after: 3 days Reviewed by: ziaee Sponsored by: Defenso Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr> Closes: https://github.com/freebsd/freebsd-src/pull/2015
* src.opts: Introduce MK_SOUNDChristos Margiolis2026-01-121-5/+7
| | | | | | | | PR: 291853 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: zarychtam_plan-b.pwste.edu.pl, markj Differential Revision: https://reviews.freebsd.org/D54456
* devd/snd.conf: Note that any command can be used for the actionChristos Margiolis2025-10-181-1/+4
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D53175
* packages: Add a sound packageLexi Winter2025-10-021-1/+6
| | | | | | | | | | | | | | | Put virtual_oss, /etc/devd/snd.conf and the other audio-related tools into a new "sound" package. Don't create a separate -lib package, since it's unlikely someone will want mixer(3) without mixer(8). Put the sound package in the optional set rather than minimal, since it's not actually required for audio hardware support, and many systems (including nearly all servers) won't want it installed. MFC after: 3 seconds Reviewed by: christos Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52823
* devd: Remove SND packageChristos Margiolis2025-10-011-6/+1
| | | | | | | | | This was done by accident, build snd.conf always. Reported by: ivy Fixes: 2ffaca551eaf ("snd_hda: Implement automatic redirection between associations") Sponsored by: The FreeBSD Foundation MFC after: 1 day
* snd_hda: Implement automatic redirection between associationsChristos Margiolis2025-09-303-0/+44
| | | | | | | | | | | | | | | | | | | | For audio to be redirected to the headphones/headset after plugging the jack, or back to the speaker/internal mic when unplugging it, the speaker and headphone pins need to be part of the same association (i.e., the same PCM device). This patch makes it possible to redirect audio even between different associations, which can reduce the need for manual pin patching. The idea is that we issue a devctl_notify() from within the jack detection callback whenever a jack is (un-)plugged to redirect audio to the appropriate device. Then the snd.conf devd script is responsible for using virtual_oss to change the playback/recording device to whatever snd_hda(4) selected. The reason for requiring virtual_oss is that it has hot-swapping support, which is necessary for jack redirection. Sponsored by: The FreeBSD Foundation MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D50070
* moused(8): Start moused with devdVladimir Kondratyev2025-09-211-0/+9
| | | | | | | | | | | | | | | | | | | | It is appeared that currently starting of moused does not depend on moused_enable variable value in rc.conf. That leads to missing USB mice support in default configuration. Start moused in traditional per device mode with devd to follow POLA. One daemon per system mode still can be enabled with setting of moused_port="auto" moused_nondefault_enable="NO" variables in /etc/rc.conf To revert to sysmouse mode add moused_type="sysmouse" to /etc/rc.conf Reported by: many Requested by: glebius Reviewed by: glebius MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52430
* devd: Remove gross hackWarner Losh2025-09-051-21/+0
| | | | | | | | Remove hack from FreeBSD 14 that mapped kern->kernel for name. Fixes: 8b4e4c273730 MFC: Never Sponsored by: Netflix
* devd/moused.conf: Stop moused quietly on destroy of a ums deviceKonstantin Zhulidov2025-07-251-1/+1
| | | | | | Signed-off-by: Konstantin Zhulidov <kzhulidov@gmail.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1764
* devd: accept new clients before notifying themSludge2025-07-231-8/+8
| | | | | | Signed-off-by: Sludge! <sludge.phd+git@gmail.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1771
* devd.conf(5): call hyperv_vfattach in a Hyper-V guest onlyEugene Grosbein2025-07-221-0/+1
| | | | | | | Limit calls to /usr/libexec/hyperv/hyperv_vfattach to Hyper-V guests. PR: 287873 MFC after: 3 days
* devd(8): correct error loggingEugene Grosbein2025-07-221-2/+1
| | | | | | | | Fix a mistake in a log message that leaked from my preliminary patch. PR: 287873 MFC after: 3 days X-MFC-with: bd4a4e46ceacd8dfc5a5469ec6edd8c92c53605a
* devd: Add vm_guest variableWarner Losh2025-07-221-0/+12
| | | | | | | | Fetch vm_guest on startup in case we're running under a hypervisor. Co-authored-by: eugen@ PR: 287873 Sponsored by: Netflix
* nvmf: Auto-reconnect periodically after a disconnectJohn Baldwin2025-07-093-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a timer in the nvmf(4) driver to periodically trigger a devctl "RECONNECT" notification. A trigger in the /etc/devd/nvmf.conf file invokes "nvmecontrol reconnect nvmeX" upon each notification. This differs from iSCSI which uses a dedicated daemon (iscsid(8)) to wait inside a custom ioctl for an iSCSI initiator event to occur, but I think this design might be simpler. Similar to nvme-cli, the interval between reconnection attempts is specified in seconds by the --reconnect-delay argument to the connect and reconnect commands. Note that nvme-cli uses -c for short letter of this command, but that was already taken so nvmecontrol uses -r. The default is 10 seconds to match Linux. In addition, a second timeout can be used to force a full detach of a disconnected the nvmeX device after the controller loss timeout expires. The timeout for this is specified in seconds by the --ctrl-loss-tmo/-l options (identical to nvme-cli). The default is 600 seconds. Either of these timers can be disabled by setting the timer to 0. In that case, the associated action (devctl notifications or full detach) will not occur after a disconnect. Note that this adds a dedicated taskqueue for nvmf tasks instead of using taskqueue_thread as the controller loss task could deadlock waiting for the completion of other tasks queued to taskqueue_thread. (Specifically, tearing down the CAM SIM can trigger destroy_dev_sched_cb() and waits for the callback to run, but the callback is scheduled to run in a task on taskqueue_thread. Possibly, destroy_dev_sched should be using a dedicated taskqueue.) Reviewed by: imp (earlier version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50222
* devd.conf.5: Use a tag list block for NVMe SMART errorsJohn Baldwin2025-07-081-8/+15
| | | | | | | | groff doesn't seem to handle nested column list blocks correctly for postscript and HTML output causing the subsequent nvme event to be indented incorrectly. Using a tag list block works around this. Sponsored by: Chelsio Communications
* devd.conf.5: Describe $name used with nvme eventsJohn Baldwin2025-07-081-2/+7
| | | | | | While here, fix a couple of nearby nits. Sponsored by: Chelsio Communications
* devd.conf.5: Expand the width of various columnsJohn Baldwin2025-07-081-17/+17
| | | | | | | | | | | | | | | Using upper case for column width templates avoids overfull columns when using groff to generate a postscript version of the manpage but doesn't affect the terminal version. Use a wider default column (8 characters) for the "Type" column and use wider widths for tables with longer event types. In the terminal, man(1) forces a line break after overfull column items, but in the postscript and HTML versions the column just overflows into the adjacent column without any separation. Sponsored by: Chelsio Communications
* devd.conf.5: Consistently use Li to markup literal stringsJohn Baldwin2025-07-081-27/+27
| | | | | | | This doesn't affect terminal output but does affect the fonts used in other formats such as postscript and HTML. Sponsored by: Chelsio Communications
* devd.8: Document monitoring devd.pipe via catJohn Baldwin2025-05-071-1/+7
| | | | | | Reviewed by: ziaee, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50175
* devd.conf.5: memrory -> memoryJohn Baldwin2025-04-291-2/+2
| | | | Sponsored by: Chelsio Communications
* devd: raise the maximum allowed client to 50Baptiste Daroussin2025-03-201-1/+1
| | | | | | | | | | | | | since the creation of libudev-devd, but also with powerd, recent libusb changes etc. 10 client is not enough anymore to cover the desktop needs and end users often ends up with: sonewconn: pcb 0xfffff8004dd43780 (local:/var/run/devd.seqpacket.pipe)... raise the maximum allowed client to 50, which should be enough to cover user requirements. MFC After: 1 week
* mt7601U: Importing if_mtw from OpenBSDJesper Schmitz Mouridsen2025-02-031-1/+1
| | | | | | | | | Added ht20 mode, based on if_run from FreeBSD, and if_mtw.c from OpenBSD. PR: 247545 Approved by: adrian, wireless Differential Revision: https://reviews.freebsd.org/D45179
* devd.conf(5): explain difference between internal and shell variablesJoerg Wunsch2024-12-201-1/+56
| | | | | | | | | | devd.conf by default considers many variables as internal, possibly expanding them to an empty string. Shell variables thus need to be wrapped into braces. Reviewed by: imp, Andre Albsmeier MFC after: 1 week Differential Revision: <https://reviews.freebsd.org/D48154>
* devd tests: Fix client_testMark Johnston2024-11-211-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | The loop doesn't check for overflow of the event buffer, which can easily happen if other tests are running in parallel (the bectl tests in particular trigger devd events). When that overflow occurs, a funny thing can happen: the loop ends up trying to read 0 bytes from the socket, succeeds, and then prints its buffer to stdout. It does this as fast as possible, eventually timing out. Then, because kyua wants to log the test's output, it slurps the output file into memory so that it can insert it into the test db. This output file is quite large, usually around 8GB when I see it happen, and is large enough to trigger an OOM kill in my test suite runner VM. Fix the test: use a larger buffer and fail the test if we fill it before both events are observed. Also don't print the output buffer on every loop iteration, since unlike the seqpacket test that will just print the same output over and over. Reviewed by: imp, asomers MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D47625
* Remove residual blank line at start of MakefileWarner Losh2024-07-152-2/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* man filesystems: fix more xrefs after move to s4Alexander Ziaee2024-06-281-1/+1
| | | | | | Fixes: 1a720cbec513 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1282
* devd: Add directory informationWarner Losh2024-03-071-1/+9
| | | | | | | Devd searches /etc/devd and /usr/local/etc/devd by default (given the default devd.conf file). Document that here. Sponsored by: Netflix
* devd: Document the nvme devd eventsWarner Losh2024-03-071-1/+29
| | | | | | | Nvme informs devd of smart and reset controller events. Document them. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44212
* devd: Don't install autofs.conf with WITHOUT_AUTOFSTijl Coosemans2023-12-221-0/+2
|
* sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* devd: autofs: Move autofs related events to a separate fileEmmanuel Vadot2023-11-243-7/+14
| | | | | | | | | | If a user don't have FreeBSD-autofs installed there is no need to try calling automount on every GEOM event. It's also easier to add/delete autofs related event in a separate file. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D42495 Reviewed by: imp
* devd: Improve devmatch supportWarner Losh2023-10-271-4/+22
| | | | | | | | | | | | | | | | | | | | | | | We know that calling devmatch will be futile if there's no plug and play information for it to match on. Avoid this generically when we see "? at +on" which happens only when the location and pnpinfo aren't provided. Don't call "service devmatch quietstart" here. We also ignore ACPI devices with a _HID of none. These also will never load a new driver, so avoid calling "service devmatch quietstart" here too. Use the more compatct "$*" instead of "'?'$_" when calling "service devmatch quietstart" since it will evaluate to the same thing. On my laptop, this eliminates 45% of the calls to devmatch. While it would be even better to integrate devmatch into devd (so we only parse linker.hints once), that will have to wait for another day as it's a bit more complex to arrange that avoiding easy to avoid calls. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D42326
* devd: Remove obsolete / wrong nomatch examplesWarner Losh2023-10-271-23/+0
| | | | | | | | These examples are wrong, and with devmatch, nobody would ever see them (since it's a higher priority). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42325
* devd: Restore WARNS=6Warner Losh2023-10-261-1/+1
| | | | | | | | We compile correctly on all platforms with clang and WARNS=6. We build on amd64 with gcc12 and WARNS.6. Restore WARNS=6. This reverts 3741a56c310d, since that's no longer relevant. Sponsored by: Netflix
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1612-12/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-162-4/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-164-8/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-125-5/+5
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* ath10k: ath11k: ammend devd.conf regexBjoern A. Zeeb2023-04-231-1/+1
| | | | | | | In order to match these drivers, and in expectiation of ath12k happening add ath[0-9]+k to the regex pattern for wlan devices. MFC after: 2 months
* mt76: devd: add support for mt79* wireless drivers to devd.confBjoern A. Zeeb2023-04-231-2/+2
| | | | | | | Add the "mt79" to the regex for wireless drivers in devd.conf so that they get handled as expected. MFC after: 2 months
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-2/+1
|
* devd.conf.5: Fix a typo in the manual pageGordon Bergling2023-03-261-1/+1
| | | | | | - s/deteted/detected/ MFC after: 5 days
* pkgbase: Create a FreeBSD-console-tools packageEmmanuel Vadot2023-02-084-46/+49
| | | | | | | | | | | | | | | And put in it: - kbdcontrol - vidcontrol - moused - kbdmap Those aren't useful in a jail or for a modern desktop. While here, split the devd.conf part into some new files. Reviewed by: bapt Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38321
* devd: Move power_profile part in devd/power_profile.confEmmanuel Vadot2023-02-083-7/+11
| | | | | | | | | And make it part of the FreeBSD-acpi package. This avoid calling service power_profile on an installation without it installed. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38324
* devd: Move bluetooth part in devd/bluetooth.confEmmanuel Vadot2023-02-083-10/+16
| | | | | | | | | And make it part of the FreeBSD-bluetooth package. This avoid calling service bluetooth on an installation without it installed. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38323
* devd: Move dhclient part in devd/dhclient.confEmmanuel Vadot2023-02-083-19/+24
| | | | | | | | | And make it part of the FreeBSD-dhclient package. This avoid calling dhclient on an installation without dhclient installed. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38322
* devd: Warn for deprecated 'kern' system typeWarner Losh2022-12-021-0/+34
| | | | | | | | | | | | | One year ago, I deprecated 'kern' in favor of 'kernel' for the system name for some power events. I'm about to remove it from the kernel, but realized there's been no warning generated for users. Preserve POLA by converting on the fly here and issuing a warning for 14.x, and an fatal error after we branch 15. Make compiling it an error on 16 to remove the gross hack after we branch. Sponsored by: Netflix Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D37584
* newbus: Remove deprecated "kern" system name for resume events.Warner Losh2022-12-021-9/+1
| | | | | | | | | | The new "kernel" system name is the one that's documented and has been generated for a year now. Remove the old one now that 14.0 is getting close. Sponsored by: Netflix Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D37582