Commit Graph

36 Commits

Author SHA1 Message Date
imp
8843b48176 Parse the ! lines that will soon be coming from the kernel. These are
a generalized notification mechanism for subsystems wishing to report
events.

Revieded by: njl

# The kernel side seems like it might be causing panics for me, but should
# be forthcoming shortly.
2003-10-24 22:02:29 +00:00
rse
fe875f1ee1 fix typo: s/Instaed/Instead/ 2003-09-26 12:24:16 +00:00
gordon
2d695adb5d At imp's request, force devd to be statically compiled. This avoids the
need for libstdc++ in /lib, and the generated binary is actually smaller
statically linked than dynamically + sizeof(libstdc++). Additionally,
devd doesn't use get*by*() which is one of the main motivations for
dynamically linking your root partition anyway.
2003-08-17 08:40:49 +00:00
imp
2a341818c0 Simplistic C comment re is wrong, use more correct one 2003-07-23 23:50:25 +00:00
imp
be3888273b Remove old workaround 2003-07-23 23:50:00 +00:00
imp
738a947fd0 Drop the pid file after we call the final daemon call. w/o -n would
give the wrong pid.

Submitted by: ru and Lukas Ertl
PR: 54113
2003-07-05 00:43:50 +00:00
ru
d135695ab6 mdoc(7) fixes: Expand contraction. 2003-05-17 22:21:27 +00:00
imp
c85a17e45d Allow zero or more actions in an action list, rather than requiring
one or more actions in the list.  This makes constructs like:

attach 10 {
//	echo "Driver $device_name attached"
};

to be accepted by the parser.  It will be treated as if the user had
entered:

// attach 10 {
//	echo "Driver $device_name attached"
// };

(eg totally ignored).

Approved by: re@ (rwatson)
2003-05-15 02:23:32 +00:00
imp
80dc620e7d sysctlbyname takes a size_t as its 5th argument, not a pointer.
However, since NULL was used, and this is C++, this error went
undetected until g++ 3.3 somehow managed to whine about it.

Reported by: obrien
2003-05-02 17:38:08 +00:00
imp
912138f780 Create a new C++ header file called devd.hh which has all the class
definitions in it.  Begin to document the classes that we use, and how
they interrelate (using comments that I can use with doxygen to
automatically generate docs with).
2003-04-26 20:59:04 +00:00
imp
562f7a033d Update to use is_id_char() in the last patch. I should have done this
before the last commit.
2003-04-26 20:25:40 +00:00
imp
12d3a8ac15 Make better use of the string type when parsing things. This switches
expand one from using a fixed buffer to using a string which
dynamically allocates these things.

Submitted by: green@ (against an earlier version of devd)
Ignored for too long by: imp
2003-04-26 19:44:45 +00:00
imp
3cc75f1128 Change default to be 'process all events before calling daemon.'
Also, put a small work around into devd to prevent a hang on boot this
would cause because select used to return 2 rather than 0 for no
evetnts due to a bug I fixed a few days ago in subr_bus.c.  I'll
remove this workaround May 7th.  You have until then to upgrade your
kernel if you want to run a new devd with an older kernel.
2003-04-25 02:13:42 +00:00
imp
8c0fbffe62 Kill debug printf that crept in my last commit 2003-04-21 17:25:39 +00:00
imp
f438262cfc Implement a two new flags, and change the meaning of another one.
'd': now means don't do daemon().
'D': Debug
'n': Don't wait to process all pending events before calling daemon.

In the past, devd would call daemon immediately.  However, this causes
a race.  If anything in the boot process depends on configuring the
devices configured by devd, maybe they would be configured in time,
maybe not.  Now we don't call daemon until all pending events are
processed, unless -n is specified.

# -n is actually the default for a while due to the select(2) bug in devctl
# that I just fixed to give people a chance to upgrade.
2003-04-21 06:26:08 +00:00
imp
3c266c65a3 Put an anti-foot-shooting measure in place. Set hw.bus.devctl_disable
to 0 when we startup.  Print a warning in this case.  This allows
people that are playing with devd by hand to have something happen.
Otherwise, it appears that devd isn't working because /dev/devctl is
disabled and producing no events.

Suggested by: peter on irc a long time ago.
2003-04-21 04:30:12 +00:00
imp
dc7e0f76ad o Skip white space between variables better. This makes
'a="b" c="d" at loc=1 on busN' properly set 'c' and process the rest of
  the stirng.  Before it would ignore everything after variable 'a'.
o Parse nomatch and other events differently.  They are more different
  than the code allowed for, so we weren't properly parsing nomatch
  events.  It appears this fixes some of the demand loading issues that
  I was having with devd.

Noticed by: Gary Palmer
2003-04-21 04:00:01 +00:00
imp
2f3e8c4760 devd.conf already has the examples in the todo list 2003-04-21 03:29:53 +00:00
ru
cc3973ee4d This can't obviously be cleaner than system headers. 2003-04-01 11:11:38 +00:00
ru
30f26bbb54 mdoc(7) police: Revision. 2003-03-03 11:51:30 +00:00
imp
8036b006ab The bugs section hasn't been true since before 5.0-R 2003-02-14 19:49:19 +00:00
imp
14a9905fad devd bugs section is now OBE 2003-02-14 16:21:50 +00:00
imp
5f18ebdc65 These are OBE. devd.conf now lives in /etc. 2003-01-09 04:11:19 +00:00
imp
dc065040a3 Terminate the usage message with \n.
Submitted by: joe
2003-01-06 16:46:25 +00:00
imp
7fb0d0bc17 MFp4: make it work
o Expand variables correctly.
o Set variables for each event.
o rewrite event loop to execute the commands in the config file, rather
  than the hard wired generic command
o better(?) debug when running -d
o sort vectors of actions so that we just have to search for the first
  one to match rather than the best one that matches.
o better attempts to clear all resources used on 'restart'
o Remove now bogus comments

MFC After: 1 centiyear
2003-01-06 08:09:41 +00:00
imp
5b992405ea devd not devdd
submitted by: joe
2003-01-06 08:03:00 +00:00
schweikh
2505bee728 english(4) police. 2002-12-27 12:15:40 +00:00
imp
bdb42b11d0 Latest snapshot of devd. This one adds re-matching and string
expansion.
2002-12-18 07:08:01 +00:00
imp
1ae1ad9cf7 MFp4 (imp_freebsd branch): snapshot of devd work:
o improve parsing and lexing
o create data structures based on the parsed file now.
o Still need to rewrite main loop and add regex (still uses hard coded
  devd-generic)
o minor man page updates.

# There should be one more commit before rc2

Approved by: re (blanket)
2002-12-07 08:04:36 +00:00
jhb
d5b4eeceb3 Fixup FILES section to use proper width and to use a cross-reference to
devd(8).
2002-11-18 21:07:48 +00:00
jhb
75b260abd4 Remove leading ^ from example of match line in vendor-supplied rules since
the ^ is implicit at the beginning of the expressions.
2002-11-18 21:02:29 +00:00
imp
512efc01fa Add BUGS section and note departure of actual implementation from what
is documented so the pioneers will know why it works the way it does.
2002-11-18 07:16:47 +00:00
tjr
a30d806640 Install devd.conf(5). 2002-11-14 10:00:01 +00:00
jhb
2e4d03bd1d Try to reword things a bit more to make it clearer.
Reviewed by:	imp
2002-11-13 20:27:46 +00:00
jhb
080cee122b - Fix some minor grammar and spelling nits.
- Massage the wording in a few places.
- Put .Nm on lines by itself so it renders correctly.

Reviewed by:	imp
2002-11-13 19:31:04 +00:00
imp
012767f50d devd. A daemon that hooks into the kernel's /dev/devctl to produce
arbitrary commands when devices come and go in the device tree (which is
different than the /dev directory).

This is an initial version.  Much of the planned power isn't here.
Instead of doing the full matching, we always run /etc/devd-generic.
/etc/devd.generic will go away at some point, I think.

I'm committing it in this early state so I can start getting feedback
from early adapters.

Approved by: re
2002-10-20 22:15:17 +00:00