Commit Graph

234 Commits

Author SHA1 Message Date
Warner Losh
eb93b08fe0 Document the rather suprising behavior with ' inside action rules.
To prevent issues with odd shell characters appearing in, a surprising
shell feature is used. Document it and a workaround for it.

Differential Revision: https://reviews.freebsd.org/D26723
2020-10-13 05:19:00 +00:00
Warner Losh
6f6f0f286b Remove gratuitous use of '' around arguments
There's no need to use ' here, so remove it. This use causes no
problems, but is a bad example.
2020-10-09 15:45:34 +00:00
Warner Losh
df9e12ca3d Avoid using single quotes in arguments to logger.
Single quotes interfere with the workaround put in with r335753 and
aren't necessary in this case. I believe that all the underling issues
with r335753 have been corrected, but need to do more extensive
followup before reverting it as a bad idea.

PR: 240411
MFC After: 2 days (to give it time to get into 12.2)
2020-10-09 15:29:05 +00:00
Gordon Bergling
5f35cd7213 devd.conf(5): Bugfix for an issue reported by mandoc
- whitespace at end of input line

MFC after:	1 week
2020-10-03 18:37:59 +00:00
Warner Losh
7daa93c454 Sort IFNET alphabetically 2020-08-31 23:48:27 +00:00
Warner Losh
b87de06445 Add documentation for ETHERNET events. 2020-08-31 23:48:23 +00:00
Warner Losh
f87655ec76 Change the resume notification event from 'kern' to 'kernel'
We have both a system of 'kern' and of 'kernel'. Prefer the latter and
convert this notification to use 'kernel' instead of 'kern'. As a
transition period, continue to also generate the 'kern' notification
until sometime after FreeBSD 13 is branched.

MFC After: 3 days
2020-08-24 19:35:15 +00:00
Warner Losh
350711aa85 Document the VFS FS events
MOUNT notifies when a filesystem is mounted
REMOUNT notifies when a filesystem is mounted again
UNMOUNT notifies when a filesystem is unmounted

These events are asynchronous to the actual state of the event (though the data
is recorded at a time when it is stable). The mount event is reported after the
filesystem is mounted. However, in the interim it may be unmounted by another
agent. Likewise, umount is called just before the mountpoint is finished tearing
down. It may be remounted (or maybe if the process scheduling is wonky and devd
gets to run before the last few steps are complete).

Sponsored by: Netflix
Diffential Revision: https://reviews.freebsd.org/D25969
2020-08-19 17:10:09 +00:00
Warner Losh
346da45741 Three typos:
Amiga is a proper noun
Condition is traditionally spelled starting with 'c'
Some, but not all, of the over/under-voltage instances were hyphenated.
Since they are all adverb phrases, they all need to be hyphenated.

Pointy hat: imp
2020-08-19 02:18:11 +00:00
Warner Losh
d7e357f85c Fix two typos.
Submitted by: rpokala@
MFC After: 3 days
2020-08-18 21:42:02 +00:00
Warner Losh
97f744901f Document the ZFS events as best I can. These are not well documented.
MFC After: 3 days
2020-08-18 21:26:58 +00:00
Warner Losh
77f4a8090c Document the AEON subsystem for the Amiga's power button.
MFC After: 3 days
2020-08-18 21:26:54 +00:00
Warner Losh
428668cca4 Document the PMU system
The pmu(4) and adb(4) drivers on powerpc generate PMU events. Document them.

The allwinner power modules also generate these events. Document those as well.

MFC After: 3 days
2020-08-18 21:26:50 +00:00
Warner Losh
17910c7f6d GEOM::rotation_rate changes are also signaled via devctl.
MFC After: 3 days
2020-08-18 21:26:45 +00:00
Warner Losh
e3c77e3197 Move the possible event types into a column table to make it easier to read.
Sort system type alphabetically.
Remove some commas that aren't in the devd notification messages.

MFC After: 3 days
Reviewed by: 0mp (earlier versions), jhb (useful feedback on earlier versions)
Differential Revision: https://reviews.freebsd.org/D26105
2020-08-18 21:26:39 +00:00
Warner Losh
31178c8a9e Modernize a bit.
Remove PC Card specific information. It's of little value these days and on
the way out after most of its drivers have been removed.
Use iwn instead of wi device.
2020-08-18 06:07:34 +00:00
Mateusz Piotrowski
f2ed697e73 Remove old devd rules for ActiveWire and Entrega Serial DB25
Those rules have been broken at least since 8-STABLE, when the port
providing the ezdownload binary was removed (misc/ezload).

Reviewed by:	kevans, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25686
2020-07-16 14:04:29 +00:00
Alexander Motin
3ab798a100 Add missing "ereport." prefixes of ZFS events.
I was unable to find time when those were working.  I think they have been
broken for at least 5 years or even longer.

Discussed with:	avg@
MFC after:	1 month
2019-12-18 18:43:44 +00:00
Alexander Motin
de57976691 Fix $() handling, broken since the beginning at r108014.
Due to off-by-one error in brackets counting it consumed the rest of the
string, preventing later variables expansions.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2019-12-13 17:52:09 +00:00
Warner Losh
f86e60008b Regularize my copyright notice
o Remove All Rights Reserved from my notices
o imp@FreeBSD.org everywhere
o regularize punctiation, eliminate date ranges
o Make sure that it's clear that I don't claim All Rights reserved by listing
  All Rights Reserved on same line as other copyright holders (but not
  me). Other such holders are also listed last where it's clear.
2019-12-04 16:56:11 +00:00
Baptiste Daroussin
e6f059a96c Stop linking to libl by specifying we do not need yywrap
MFC after: 3 days
2019-09-10 08:19:46 +00:00
Emmanuel Vadot
4c1a82cea5 pkgbase: Create a FreeBSD-utilities package and make it the default one
The default package use to be FreeBSD-runtime but it should only contain
binaries and libs enough to boot to single user and repair the system, it
is also very handy to have a package that can be tranform to a small mfsroot.
So create a new package named FreeBSD-utilities and make it the default one.
Also move a few binaries and lib into this package when it make sense.
Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D21506
2019-09-05 14:15:47 +00:00
Mark Johnston
8e9105dbae acpi_dock(4): Notify devd(8) on dock status change.
PR:		238138
Submitted by:	Muhammad Kaisar Arkhan <hi@yukiisbo.red>
MFC after:	2 weeks
2019-05-31 15:44:33 +00:00
Pawel Jakub Dawidek
e6b0d5eb9f Introduce new event SIZECHANGE within GEOM system to inform about GEOM
providers mediasize changes.

While here, use GEOM nomenclature to describe providers instead of calling
them device nodes.

Obtained from:	Fudo Security
Tested in:	AWS
2019-03-30 07:24:34 +00:00
Andriy Voskoboinyk
bbf61f79ce devd.conf(5): simplify regex
Submitted by:	Helge Oldach <freebsd@oldach.net>
MFC after:	5 days
2019-01-27 15:29:58 +00:00
Andriy Voskoboinyk
51a3cc6ca4 Fix duplicate wpa_supplicant(8) / hostapd(8) startup with devd(8)
Do not invoke 'wlan_up' function from devd(8) on interface
creation event (an example to create such event:
'ifconfig wlan0 create wlandev rtwn0');
they're typically produced during 'service netif (re)start'
and result in duplicate interface initialization.

From the user side if WPA option is used, this result in messages like:
- /etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant
or
- wpa_supplicant already running?  (pid=xxxx).
(for HOSTAP interfaces this race may result in startup failure).

As a side effect, wpa_supplicant(8) / hostapd(8) will not be
invoked when new wlan(4) interface is created manually and
corresponding configuration for it is present in rc.conf(5).

This change does not affect device attach / removal events.

MFC after:	5 days
2019-01-21 04:50:56 +00:00
Andriy Voskoboinyk
271b714d95 devd.conf(5): add otus(4) into wifi-driver-regex
MFC after:	5 days
2019-01-21 03:38:37 +00:00
Warner Losh
1a658069d6 Further research shows usbdump(8) is what we should point people at
rather than tcpdump for usb traffic capture.
2018-11-02 22:18:02 +00:00
Warner Losh
43a9662438 Catch up with the SCSI device removal. We should likely review why we
even have this.
2018-11-02 22:15:47 +00:00
Warner Losh
7e4161c109 Document r226775: tell why we omit usbus[0-9]+
tcpdump can capture packet traces from the usb bus. usbus[0-9] are
registered as ifnet devices so this can work. When these devices come
up, devd was trying to run pccard_ether on those interfaces, which
didn't exist and generated an error.
2018-11-02 22:15:30 +00:00
Warner Losh
6577e8c44b We don't need shell protection for when we're expanding matches.
Don't add it. This should fix when we do regepx matches against
variables we've set and fix wifi bring up.

PR: 231441
Approved by: re@ (kib)
Differential Revision: https://reviews.freebsd.org/D17267
2018-09-22 15:32:53 +00:00
Brad Davis
44e1285c7b Move all devd related configs to sbin/devd/
This helps with pkgbase as it switches these to using CONFS so they are
properly tagged as config files.

Approved by:	will (mentor), imp
Differential Revision:	https://reviews.freebsd.org/D16781
2018-08-21 16:51:45 +00:00
Eitan Adler
27744ca71c Revert "devd: use C++ style casts"
It seems that nullptr is not yet supported by all compilers used by
FreeBSD. :(
2018-07-29 21:00:18 +00:00
Eitan Adler
fc67c746c0 devd: use C++ style casts 2018-07-29 08:43:08 +00:00
Eitan Adler
514e2dbfa6 devd: use static where possible 2018-07-29 08:43:05 +00:00
Edward Tomasz Napierala
39ebf76745 Document kernel/signal/crashdump devd(8) notification.
Discussed with:	kib@
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D16323
2018-07-20 14:32:36 +00:00
Edward Tomasz Napierala
9b63ed8bae Consistently use full stops.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2018-07-18 16:28:57 +00:00
Warner Losh
95cbefb3bf We're not, yet, at C++11 capable on all our plaforms.
Use a possibly slower, but C++98 compatibe way to iterate through the
string.

Noticed by: g++ 4.2.1 and Mark Millard
2018-06-28 01:45:53 +00:00
Warner Losh
54aa407625 Safely quote all variable expansions.
When expanding a variable set by a message from the kernel, safely
quote all arguments expanded when creating a command line for the
shell.

Reviewd by: Shawn Webb, Oliver Pinter, brd@
Sponsored by: Netflix
2018-06-27 23:44:37 +00:00
Matt Macy
3741a56c31 devd: drop WARNS back down to 3 until 6 actually works with GCC 2018-05-24 01:12:06 +00:00
Eitan Adler
f405a1bea1 devd: Move variable declaration to header
Reminder by:	imp
2018-05-23 13:48:16 +00:00
Eitan Adler
695a3b29ff devd: Unbreak build
I'm not quite sure why this wasn't caught before. Most likely due to
some generated file not being properly cleaned.

Fix build by just hiding the warnings that `-i` was supposed to fix.

Tested with clang, gcc9, gcc7
2018-05-23 10:03:09 +00:00
Eitan Adler
e8d9a1edb3 devd: allow build to complete using g++ 2018-05-23 07:44:50 +00:00
Eitan Adler
0bc60783da devd: compile at WARNS=6
Verified with "make universe TARGETS='amd64 arm arm64 i386 sparc64'"
2018-05-23 07:39:05 +00:00
Eitan Adler
958160f3ec devd: correct two warnings
- catching a polymorphic type by value
- "output between 16 and 95 bytes into a destination of size 80"
2018-05-23 07:39:02 +00:00
Brooks Davis
eec02418d8 Remove support for FDDI and token ring media types in userland utilities.
Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15077
2018-04-16 18:07:51 +00:00
Eitan Adler
dacbef689d devd: don't pass &fds in useless parameters to select(2)
select(2) should be declared as restrict. In addition the only fd in
the fdset is open O_RDONLY, and it's not a socket that can provide OOB
notifications,

Reviewed by:	ian, imp, vangyzen
2018-02-15 03:22:53 +00:00
Eitan Adler
7548968ac2 devd: readd virtual
- my C++ knowledge is old and rusty. re-add virtual
2018-01-26 05:03:37 +00:00
Eitan Adler
510a8c88f0 devd: minor nits
- mark usage as noreturn
- config does not need a virtual destructor
2018-01-26 04:40:41 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00