Commit Graph

17526 Commits

Author SHA1 Message Date
Vladimir Kondratyev
44af5666d9 bthidd(8): Add evdev protocol support for bluetooth keyboards and mouses
User-visible changes:

"-u" is added to to list of command line options supported by bthidd.
Use it to enable evdev support. uinput and evdev modules should be
kld-loaded or compiled into the kernel in that case.

bthidd_evdev_support rc.conf variable is added to control enabling of
evdev support in bthidd startup script. Possible values are: "YES", "NO",
"AUTO"(default). Setting bthidd_evdev_support to "AUTO" inserts "-u" option
if kernel is compiled with EVDEV_SUPPORT option enabled.

Support for consumer HID usage page keyboard events is implemented. Most of
them are available only through evdev protocol.

kern.evdev.rcpt_mask sysctl is checked, so "sysctl kern.evdev.rcpt_mask=12"
should be executed if EVDEV_SUPPORT is compiled into kernel.

It is recommended to regenerate bthidd.conf entries with bthidcontrol(8)
"Query" command to set user-friendly names of bluetooth devices.

Reviewed by:	emax, gonzo, wblock (docs), bcr (docs, early version)
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 12:16:54 +00:00
Vladimir Kondratyev
e650806966 bthidd(8): Add internal support for user-friendly name of remote devices.
Extend bthidd.conf format to store name of remote Bluetooth HID devices and
implement querying of this information with bthidcontrol(8) "Query" command.

Reviewed by:		emax
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 10:49:29 +00:00
Edward Tomasz Napierala
41adbaa596 Clean up the EXAMPLES section of usbconfig(8). This removes parts that
become redundant after documenting all the subcommands, and switches
to the new syntax, without the '-d'.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-04-29 10:45:09 +00:00
Pedro F. Giffuni
e2ec2f75f2 makefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR.
This is consistent with what some linux filesystems do and has been
adopted in our linuxulator.

MFC after:	3 days
2018-04-25 02:43:53 +00:00
Xin LI
703a6a3b14 Use calloc() instead of malloc+bzero.
Reviewed by:	ken, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D15166
2018-04-24 04:07:51 +00:00
Ed Maste
e936bb9f69 pwd_mkdb: default to network (big) endian hash order
For cross-architecture reproducibility.  The db(3) functions work with
hashes of either endianness, and the current (v4) version password db
entries already store integers in network order.  Do so with the hash as
well so that identical password databases can be created on big- and
little-endian hosts.

The -B and -L flags exist to set the endianness for legacy (v3) entries
when the -l flag is used, and they will still control hash endianness
(at least until the backwards compatibility infrastructure is removed).

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-04-24 01:22:57 +00:00
Xin LI
5992da2c7b Correct size for allocation and bzero of fdsr.
MFC after:	2 weeks
2018-04-23 07:15:49 +00:00
Ed Maste
60dd682329 pwd_mkdb: add deprecation notice in manpage too
Followon to r332789; as reported on the -current and -stable lists and
in review D15144 the -l option will be removed before FreeBSD 12.0.
2018-04-22 23:10:37 +00:00
Ed Maste
daddfa7cc7 makefs: tidy up reach-over source
- cd9660 relies on an #include "iso.h" but does not build any .c files
  out of source, so remove reach-over .PATH
- ffs does not rely on any sys/ headers, so remove -I from CFLAGS.
- ffs_tables from sys/ is used by ffs; move the SRCS entry from the top-
  level Makefile to ffs' Makefile.inc.

Sponsored by:	The FreeBSD Foundation
2018-04-20 22:23:38 +00:00
Ed Maste
97303f37f8 pwd_mkdb: warn that legacy support is deprecated (if specified)
r283981 switched pwd_mkdb to emit only v4 database entries by default,
and introduced a -l (legacy) option emit v3 entries in addition.  The
commit message claims that legacy support will be removed in 12.0, so
emit a warning now if it is used.
2018-04-19 20:25:19 +00:00
Allan Jude
0484aa6d85 Make iostat -xC print CPU information on its own line
Requested by:	mahrens
Reviewed by:	kenm (maintainer), mahrens
MFC after:	1 week
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D15076
2018-04-18 02:25:03 +00:00
Edward Tomasz Napierala
912280b4b4 Make it possible to pass the ugenX.Y to usbconfig(8) without using "-d",
eg "usbconfig ugen1.2 dump_all_desc".

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-04-17 19:39:47 +00:00
Andriy Gapon
020d6f96e3 mountd: fix a crash when getgrouplist reports too many groups
Previously the code only warned about the condition and then happily
proceeded to use the too large value resulting in the array
out-of-bounds access.

Obtained from:	Panzura (Chuanbo Zheng)
MFC after:	10 days
Sponsored by:	Panzura
2018-04-16 09:17:36 +00:00
Ian Lepore
c1ee3587a1 Fix cut-and-pasted line to have the right option letter.
Reported by:	0mp@
Pointy hat:	ian@
2018-04-16 03:35:43 +00:00
Ian Lepore
37820b8746 Add an option to daemon(8) to specify a delay between restarts of a
supervised program.  The existing -r option has a hard-coded delay of one
second.  This change adds a -R option which takes a delay in seconds.  This
can be used to prevent log spam and rapid restarts, similar to init(8)'s
behavior of adding a delay between rapid restarts when it's supervising a
program.
2018-04-15 21:46:08 +00:00
Navdeep Parhar
0d7404ba76 Fix typo in cxgbetool.8. 2018-04-15 19:23:37 +00:00
Ed Schouten
5caf54c7a4 Use proper alphabetic sorting of options. 2018-04-15 08:44:26 +00:00
Ed Schouten
1a874a126a Add RFC 5424 syslog message output to syslogd.
- Move all of the code responsible for transmitting log messages into a
  separate function, fprintlog_write().
- Instead of manually modifying a list of iovecs, add a structure
  iovlist with some helper functions.
- Alter the F_FORW (UDP message forwarding) case to also use iovecs like
  the other cases. Use sendmsg() instead of sendto().
- In the case of F_FORW, truncate the message to a size dependent on the
  address family (AF_INET, AF_INET6), as proposed by RFC 5426.
- Move all traditional message formatting into fprintlog_bsd(). Get rid
  of some of the string copying and snprintf()'ing. Simply emit more
  iovecs to get the job done.
- Increase ttymsg()'s limit of 7 iovecs to 32. Add a definition for this
  limit, so it can be reused by iovlist.
- Add fprintlog_rfc5424() to emit RFC 5424 formatted log entries.
- Add a "-O" command line option to enable RFC 5424 formatting. It would
  have been nicer if we supported "-o rfc5424", just like on NetBSD.
  Unfortunately, the "-o" flag is already used for a different purpose
  on FreeBSD.
- Don't truncate hostnames in the RFC 5424 case, as suggested by that
  specific RFC.

For people interested in using this, this feature can be enabled by
adding the following line to /etc/rc.conf:

  syslogd_flags="-s -O rfc5424"

Differential Revision:	https://reviews.freebsd.org/D15011
2018-04-15 08:34:16 +00:00
Navdeep Parhar
1131c927c4 cxgbe(4): Add support for Connection Offload Policy (aka COP).
COP allows fine-grained control on whether to offload a TCP connection
using t4_tom, and what settings to apply to a connection selected for
offload.  t4_tom must still be loaded and IFCAP_TOE must still be
enabled for full TCP offload to take place on an interface.  The
difference is that IFCAP_TOE used to be the only knob and would enable
TOE for all new connections on the inteface, but now the driver will
also consult the COP, if any, before offloading to the hardware TOE.

A policy is a plain text file with any number of rules, one per line.
Each rule has a "match" part consisting of a socket-type (L = listen,
A = active open, P = passive open, D = don't care) and a pcap-filter(7)
expression, and a "settings" part that specifies whether to offload the
connection or not and the parameters to use if so.  The general format
of a rule is: [socket-type] expr => settings

Example.  See cxgbetool(8) for more information.
[L] ip && port http => offload
[L] port 443 => !offload
[L] port ssh => offload
[P] src net 192.168/16 && dst port ssh => offload !nagle !timestamp cong newreno
[P] dst port ssh => offload !nagle ecn cong tahoe
[P] dst port http => offload
[A] dst port 443 => offload tls
[A] dst net 192.168/16 => offload !timestamp cong highspeed

The driver processes the rules for each new listen, active open, or
passive open and stops at the first match.  There is an implicit rule at
the end of every policy that prohibits offload when no rule in the
policy matches:
[D] all => !offload

This is a reworked and expanded version of a patch submitted by
Krishnamraju Eraparaju @ Chelsio.

Sponsored by:	Chelsio Communications
2018-04-14 19:07:56 +00:00
Baptiste Daroussin
8e877d85dc pkg: accept -y and --yes from arguments
By popular demand, pkg now walks thought the arguments passed and
if it finds -y or --yes it does accept those as equivalent of
ASSUME_ALWAYS_YES env var.

Requested by:	many
MFC after:	1 week
2018-04-13 18:25:00 +00:00
Kyle Evans
a97c64453d cron(8): Correct test sense
We're about to use the result of fstat(2) either way, so don't do that if it
fails...

X-MFC-With: r332429
2018-04-12 14:32:26 +00:00
Kyle Evans
1cb7491a3f cron(8): Reload database if an existing job in cron.d changed as well
Directory mtime will only change if a file is added or removed, not
modified. For /var/cron/tabs, this is fine because of how crontab(1) manages
it using temp files so all crontab(1) changes will trigger a reload of the
database.

For /etc/cron.d and /usr/local/etc/cron.d, this is not necessarily the case.
Instead of checking their mtime, we should descend into them and check mtime
on all jobs also.

Reported by:	des
Reviewed by:	bapt
MFC after:	1 week
2018-04-12 13:52:55 +00:00
Edward Tomasz Napierala
53ed4b300e Strip trailing whitespace.
MFC after:	2 weeks
2018-04-10 08:14:31 +00:00
Rodney W. Grimes
01d822d33b Add the ability to control the CPU topology of created VMs
from userland without the need to use sysctls, it allows the old
sysctls to continue to function, but deprecates them at
FreeBSD_version 1200060 (Relnotes for deprecate).

The command line of bhyve is maintained in a backwards compatible way.
The API of libvmmapi is maintained in a backwards compatible way.
The sysctl's are maintained in a backwards compatible way.

Added command option looks like:
bhyve -c [[cpus=]n][,sockets=n][,cores=n][,threads=n][,maxcpus=n]
The optional parts can be specified in any order, but only a single
integer invokes the backwards compatible parse.  [,maxcpus=n] is
hidden by #ifdef until kernel support is added, though the api
is put in place.

bhyvectl --get-cpu-topology option added.

Reviewed by:	grehan (maintainer, earlier version),
Reviewed by:	bcr (manpages)
Approved by:	bde (mentor), phk (mentor)
Tested by:	Oleg Ginzburg <olevole@olevole.ru> (cbsd)
MFC after:	1 week
Relnotes:	Y
Differential Revision:	https://reviews.freebsd.org/D9930
2018-04-08 19:24:49 +00:00
Ed Schouten
671d700167 Fix enough warnings that we can build syslogd on all targets at WARNS=6.
This also fixes the build on MIPS.

Reported by:	cy (MIPS build failure)
2018-04-07 09:03:51 +00:00
Ed Schouten
b484e3fee4 Push RFC 5424 message format from logmsg() into fprintlog().
Now that all of parsemsg() parses both RFC 3164 and 5424 messages and
hands them to logmsg(), alter the latter to properly forward all RFC
5424 message attributes to fprintlog(). While there, make some minor
cleanups to this code:

- Instead of extending the existing code that compares hostnames and
  message bodies for deduplication, print all of the relevant message
  fields into a single string that we can compare ('saved').

- No longer let the behaviour of fprintflog() depend on whether
  'msg == NULL' to print repetition messages, Simply decompose this
  function into fprintlog_first() and fprintlog_successive(). This
  makes the interpretation of function arguments less magical and also
  allows us to get consistent behaviour across RFC 3164 and 5424 when
  adding support for the RFC 5424 output format.

- As RFC 5424 syslog messages have a dedicated application name field,
  alter the repetition messages to be printed on behalf of syslogd on
  the current system. Change these messages to use the local hostname,
  so that it's obvious which syslogd instance detected the repetition.
  Remove f_prevhost, as it has now become unnecessary.

- Remove a useless strdup(). Deconsting the message string is safe in
  this specific case.
2018-04-06 17:16:50 +00:00
Ed Schouten
228e9d5bd8 Remove some places where error messages are prefixed with "syslogd".
Due to using RFC 5424, the application name is stored in a dedicated
field. It can simply be passed as an argument to logmsg() now.
2018-04-06 16:26:46 +00:00
Ed Schouten
10b154332d Properly respect the passed in hostname for RFC 5424 messages.
Only override the hostname in case none is provided or when remote
hostnames should be ignored.
2018-04-06 16:24:03 +00:00
Ed Schouten
77f0ef9a96 Add RFC 5424 syslog message parsing to syslogd.
Syslogd currently uses the RFC 3164 format for its log messages.One
limitation of RFC 3164 is that it cannot be used to log entries with
sub-second precision timestamps. One of our users has expressed a desire
for doing this for doing some basic performance measurements.

This change attempts to make a first cut at switching to RFC 5424 based
logging. The first step is to alter syslogd's input path to properly
parse such messages. It alters the logmsg() prototype to match the
fields of RFC 5424. The parsemsg() function is extended to parse both
RFC 3164 and 5424 messages and call into logmsg() accordingly.

Additional changes include:

- Introducing proper parsing of timestamps, so that they can be printed
  in any desired output format. This means we need to infer the year and
  timezone for RFC 3164 timestamps.
- Removing ISKERNEL. This can now be realised by simply providing an
  APP-NAME (== "kernel").
- Extending RFC 3164 parsing to trim off the TAG prefix and using that
  to derive APP-NAME and PROCID.
- Increase MAXLINE. RFC 5424 mentions we should support 2k messages.

Differential Revision:	https://reviews.freebsd.org/D14926
2018-04-06 12:57:01 +00:00
Benno Rice
756e49c303 Synchronise with NetBSD's version of EFI handling for El Torito images.
When I implemented my EFI support I failed to check if the upstream version
of makefs in NetBSD had done the same. Override my version with theirs to
make it easier to stay in sync with them in the future.

Reviewed by:	imp, mav
Obtained from:	NetBSD
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14913
2018-03-31 15:04:41 +00:00
Ed Maste
c93ff841aa makefs: sync fragment and block size with newfs
r222319 in newfs raised the default blocksize for UFS/FFS filesystems
from 16K to 32K and the default fragment size from 2K to 4K, with a
rationale that most disks were now running with 4K sectors.

MFC after:	2 weeks
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-03-30 03:38:08 +00:00
Brooks Davis
69f0fecbd6 Remove infrastructure for token-ring networks.
Reviewed by:	cem, imp, jhb, jmallett
Relnotes:	yes
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14875
2018-03-28 23:33:26 +00:00
Conrad Meyer
811d25e014 wpa_supplicant.conf.5: Document minimal eduroam configuration
PR:		226939
Submitted by:	Mateusz Piotrowski (0mp@)
Sponsored by:	Dell EMC Isilon
2018-03-26 22:10:20 +00:00
John-Mark Gurney
3762b440dc minor work smithing... 2018-03-24 04:21:22 +00:00
Benno Rice
633cb765d8 Don't try to modify El Torito section headers if there aren't any.
MFC after:	1 week
2018-03-23 22:59:45 +00:00
Benno Rice
ebf1c08960 Correctly mark the last El Torito section header.
Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	emaste, imp
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14812
2018-03-23 22:52:26 +00:00
Benno Rice
8dbc390581 Allow makefs to properly tag UEFI El Torito boot images. Use them in amd64 ISOs.
UEFI booting requires an EFI System Partition (ESP). On most storage devices
this will be in a specific partition type. To allow booting from CD/ISO
filesystems, UEFI will look for an ESP in the form of a FAT filesystem image
embedded in the image. Historically FreeBSD has added one of these to its
amd64 ISO images but marked it as simply another i386 boot image. Luckily for
us most UEFI implementations are rather forgiving and work this out for us.

This change adds the ability to mark a boot image as being a UEFI image. It
also modifies our ISO generation to use this marking for the UEFI image we
embed.

Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	emaste, imp
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14809
2018-03-23 20:56:18 +00:00
Gleb Smirnoff
c176562d38 Fix whitespace issues in r330034. No functional changes. 2018-03-20 22:00:58 +00:00
Xin LI
3e09403f77 Plug a possible memory leak.
MFC after:	2 weeks
2018-03-19 05:49:26 +00:00
Ed Maste
d8ba45e213 Revert r313780 (UFS_ prefix) 2018-03-17 12:59:55 +00:00
Ed Maste
1e2b9afca9 Prefix UFS symbols with UFS_ to reduce namespace pollution
Followup to r313780.  Also prefix ext2's and nandfs's versions with
EXT2_ and NANDFS_.

Reported by:	kib
Reviewed by:	kib, mckusick
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9623
2018-03-17 01:48:27 +00:00
Warner Losh
3fcd5d6e92 Make not getting BootOrder a warning, not a fatal error when printing.
Sponsored by: Netflix
2018-03-16 18:16:31 +00:00
Devin Teske
5d8a56406b Use full month in dpv(3), figpar(3), and bsdconfig(8) manuals
Reported by:	maxim
2018-03-14 19:09:06 +00:00
Navdeep Parhar
ae9b401786 cxgbetool(8): Add the ability to decode hardware TCBs.
Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
2018-03-14 00:04:58 +00:00
Edward Tomasz Napierala
cd1fd29c26 Add "usbconfig dump_all_desc", a subcommand to dump all device and config
descriptors.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-03-13 19:49:06 +00:00
Scott Long
b3995bb872 Add a new 'debug' command tree and 'dump_reqs' command to grab and parse
command and chain frames of in-flight I/O from the driver.

Sponsored by:	Netflix
2018-03-12 05:03:32 +00:00
Garance A Drosehn
02e8b7b2e7 Fix the resource leak of a 'FILE *' which could happen in routine
ctl_readcf() if a call to malloc failed.

PR:		204955
Reported by:	David Binderman
2018-03-12 01:41:16 +00:00
Peter Grehan
a2d14dcac5 Add CR2 get/set support.
Reported/Tested by:  Fabian Freyer
Reviewed by:	araujo
Differential Revision:	https://reviews.freebsd.org/D14648
MFC after:	3 weeks
2018-03-11 08:27:11 +00:00
Hans Petter Selasky
f3365f07a3 Check that the address is specified in mlx5tool(8).
Submitted by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-08 15:28:13 +00:00
Hans Petter Selasky
e808190a59 Add kernel and userspace code to dump the firmware state of supported
ConnectX-4/5 devices in mlx5core.

The dump is obtained by reading a predefined register map from the
non-destructive crspace, accessible by the vendor-specific PCIe
capability (VSC). The dump is stored in preallocated kernel memory and
managed by the mlx5tool(8), which communicates with the driver using a
character device node.

The utility allows to store the dump in format
    <address> <value>
into a file, to reset the dump content, and to manually initiate the
dump.

A call to mlx5_fwdump() should be added at the places where a dump
must be fetched automatically. The most likely place is right before a
firmware reset request.

Submitted by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-08 15:21:56 +00:00