Commit Graph

14659 Commits

Author SHA1 Message Date
Stefan Eßer
1f474190fc Replace literal uses of /usr/local in C sources with _PATH_LOCALBASE
Literal references to /usr/local exist in a large number of files in
the FreeBSD base system. Many are in contributed software, in configuration
files, or in the documentation, but 19 uses have been identified in C
source files or headers outside the contrib and sys/contrib directories.

This commit makes it possible to set _PATH_LOCALBASE in paths.h to use
a different prefix for locally installed software.

In order to avoid changes to openssh source files, LOCALBASE is passed to
the build via Makefiles under src/secure. While _PATH_LOCALBASE could have
been used here, there is precedent in the construction of the path used to
a xauth program which depends on the LOCALBASE value passed on the compiler
command line to select a non-default directory.

This could be changed in a later commit to make the openssh build
consistently use _PATH_LOCALBASE. It is considered out-of-scope for this
commit.

Reviewed by:	imp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D26942
2020-10-27 11:29:11 +00:00
Mateusz Piotrowski
790c70c825 Clean up backlight.8
- Sort flags
- Stylize incr|+ and decr|- properly
- Add a missing period at the end of the description
- Use the standard layout for the EXAMPLES section (remove the list macro
  and add indentation to the code block)
2020-10-27 09:41:01 +00:00
Scott Long
2586d44d14 Correct calendar entry for myself 2020-10-26 05:22:52 +00:00
Warner Losh
d20d655018 calendar: remove all datafiles except freebsd one
Move all the data files for the calendar(1) program, except
calendar.freebsd to the calendar-data package. When a file
can't be found, and /usr/local/share/calendar doesn't exist
provide a helpful hint to install this package.

Reviewed by: se@
Differential Revision:  https://reviews.freebsd.org/D26926
2020-10-26 03:26:18 +00:00
Mateusz Piotrowski
50f7cdf21c calendar.1: Fix locale of the month in Dd ;) 2020-10-25 16:01:03 +00:00
Ryan Moeller
ae37905b93 sockstat: Fix error message when jail_attach fails
jail_errmsg is for libjail, jail_attach() is a system call.
2020-10-24 22:36:20 +00:00
Richard Scheffenegger
4dfbcffbb9 Add network QoS support for PCP to iscsi initiator.
Make the Ethernet PCP codepoint configurable
for L2 local traffic, to allow lower latency for
iSCSI block IO. This addresses the initiator
side only.

Reviewed by:	mav, trasz, bcr
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26739
2020-10-24 21:07:13 +00:00
Ryan Moeller
73577bf01d flua: Add a libjail module
libjail is pretty small, so it makes for a good proof of concept demonstrating
how a system library can be wrapped to create a loadable Lua module for flua.

* Introduce 3lua section for man pages
* Add libjail module

Reviewed by:	kevans, manpages
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D26080
2020-10-24 17:08:59 +00:00
Fernando Apesteguía
f7585b288b getent(1): Add EXAMPLES section
Add 3 small examples to the EXAMPLES section.

Approved by:	manpages (gbe@)
Differential Revision:		https://reviews.freebsd.org/D26866
2020-10-24 16:40:34 +00:00
Alan Somers
b3baff23fe nfsstat: delete unused fields
Ever since r192762 nfsstat has included a few fields whose values were
always 0. They were copied from OpenBSD, but have never been used on
FreeBSD. Don't display them.

Reviewed by:	rmacklem
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D26920
2020-10-24 05:52:29 +00:00
Stefan Eßer
c77b04884c Udpate calendar man-page to mention the search path added in r366962.
Calendar files in /usr/lcoal/share/calendar take precedence over files in
the base system. They can be provided by a port or package, but since such
a port has not been committed, yet, no specific port name is suggested.

In fact, multiple ports could exist (e.g. per locale) without conflicting
with each other.
2020-10-23 10:00:56 +00:00
Stefan Eßer
34b38e1245 Add search of LOCALBASE/share/calendar for calendars supplied by a port.
Calendar files in LOCALBASE override similarily named ones in the base
system. This could easily be changed if the base system calendars should
have precedence, but it could lead to a violation of POLA since then the
port's files were ignored unless those in base have been deleted.

There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses
of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease
a consistent modification of this prefix.

Reviewed by:	imp, pfg
Differential Revision:	https://reviews.freebsd.org/D26882
2020-10-23 09:22:23 +00:00
Fernando Apesteguía
8a27a63745 col(1): Add EXAMPLES section
Add a small example.
Cross reference clean up for colcrt, nroff and tbl.

Reviewed by:	gbe@, bcr@
Approved by:	gbe@
Differential Revision:		https://reviews.freebsd.org/D26864
2020-10-21 16:30:34 +00:00
Fernando Apesteguía
ea772485d1 compress(1): Add EXAMPLES section
Add 5 examples showing basic usage.

Approved by:	manpages (gbe@)
Differential Revision:		https://reviews.freebsd.org/D26865
2020-10-20 13:05:25 +00:00
Mark Johnston
4caea9b169 icmp6: Count packets dropped due to an invalid hop limit
Pad the icmp6stat structure so that we can add more counters in the
future without breaking compatibility again, last done in r358620.
Annotate the rarely executed error paths with __predict_false while
here.

Reviewed by:	bz, melifaro
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26578
2020-10-19 17:07:19 +00:00
Warner Losh
618cdd8964 Add more explicit instructions about updating motd
Not that you can regenerate the motd by editing motd.template and
running 'service motd restart' rather than rebooting.

Small wordsmithing by me, and updated the example from FreeBSD 2.1.6.1
release to 12.1 release.

Submitted by: Dan Mack
2020-10-19 01:16:39 +00:00
Alex Richardson
3ac62888fc Significantly speed up mkimg_test
It turns out that the majority of the test time for the mkimg tests isn't
mkimg itself but rather the use of jot and hexdump which can be quite slow
on emulated platforms such as QEMU.

On QEMU-RISC-V this reduces the time for `kyua test mkimg_test` from 655
seconds to 200. And for CheriBSD on QEMU-CHERI this saves 4-5 hours (25%
of the time for the entire testsuite!) since jot ends up triggering slow
functions inside the QEMU emulation a lot.

Reviewed By:	lwhsu
Differential Revision: https://reviews.freebsd.org/D26796
2020-10-18 18:35:23 +00:00
Greg Lehey
bce7d45450 Correct location and date of the Boston Shoemakers' organization,
which significantly predated the USA.

Reference: http://www.famousdaily.com/history/boston-shoemakers-form-first-us-labor-organization.html
2020-10-18 03:01:26 +00:00
Alex Richardson
6e4162c60c install(1): Avoid unncessary fstatfs() calls and use mmap() based on size
According to git blame the trymmap() function was added in 1996 to skip
mmap() calls for NFS file systems. However, nowadays mmap() should be
perfectly safe even on NFS. Importantly, onl ufs and cd9660 file systems
were whitelisted so we don't use mmap() on ZFS. It also prevents the use
of mmap() when bootstrapping from macOS/Linux since on those systems the
trymmap() function was always returning zero due to the missing MFSNAMELEN
define.

This change keeps the trymmap() function but changes it to check whether
using mmap() can reduce the number of system calls that are required.
Using mmap() only reduces the number of system calls if we need multiple read()
syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is more expensive
than read() so this sets the threshold at 4 fewer syscalls. Additionally, for
larger file size mmap() can significantly increase the number of page faults,
so avoid it in that case.

It's unclear whether using mmap() is ever faster than a read with an appropriate
buffer size, but this change at least removes two unnecessary system calls
for every file that is installed.

Reviewed By:	markj
Differential Revision: https://reviews.freebsd.org/D26041
2020-10-14 12:28:41 +00:00
Gordon Bergling
4c3191b2d1 cpuset(1): Fix a typo
- 'at at' -> 'at a'

MFC after:	1 week
2020-10-10 13:01:04 +00:00
Gordon Bergling
3d265fce43 Fix a few mandoc issues
- skipping paragraph macro: Pp after Sh
- sections out of conventional order: Sh EXAMPLES
- whitespace at end of input line
- normalizing date format
2020-10-09 19:12:44 +00:00
Mark Johnston
6b43126f81 col(1): Fix a couple of bugs
- When flushing extra lines after all input has been processed, make
  sure that local state is reinitialized correctly.
- When -f is specified, make sure to end output with a full newline.
- Fix some style issues and update comments.
- Add some regression tests.

PR:		249308
Submitted by:	Yang Zhong <yzhong@freebsdfoundation.org>
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D26536
2020-10-09 15:27:37 +00:00
Richard Scheffenegger
bfabdade5c Add DSCP support for network QoS to iscsi initiator.
Allow the DSCP codepoint also to be configurable
for the traffic in the direction from the initiator
to the target, such that writes and any requests
are also treated in the appropriate QoS class.

Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26714
2020-10-09 14:33:09 +00:00
Gordon Bergling
6d6d6c3603 Fix a few mandoc issues
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order
- normalizing date format
- AUTHORS section without An macro
2020-10-09 14:03:45 +00:00
Andrey V. Elsukov
39aff95fe2 Fix EINVAL message when CPU binding information is requested for IRQ.
`cpuset -g -x N` along with requested information always prints
message `cpuset: getdomain: Invalid argument'. The EINVAL is returned
from kern_cpuset_getdomain(), since it doesn't expect CPU_LEVEL_WHICH
and CPU_WHICH_IRQ parameters.

To fix the error, do not call cpuset_getdomain() when `-x' is specified.

MFC after:	1 week
2020-10-09 11:24:19 +00:00
Richard Scheffenegger
0e5e35e322 Extend netstat to display TCP stack and detailed congestion state
Adding the "-c" option used to show detailed per-connection
congestion control state for TCP sessions.

This is one summary patch, which adds the relevant variables into
xtcpcb. As previous "spare" space is used, these changes are ABI
compatible.

Reviewed by:	tuexen
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26518
2020-10-09 10:07:41 +00:00
Fernando Apesteguía
d643ff21f4 ul(1): Remove references to colcrt(1) and nroff(1)
colcrt(1) and nroff(1) where removed in r319664.
Remove references to these commands in ul(1) man page.

PR:	244127
Reported by:	freebsd@tim.thechases.com
Approved by:	manpages (gbe@)
Differential Revision:	https://reviews.freebsd.org/D2614
2020-10-07 14:43:16 +00:00
Baptiste Daroussin
cf64bfef77 backlight: check the lenght if the input before trimming '%'
Reported by:	hps
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D26693
2020-10-06 08:18:09 +00:00
Baptiste Daroussin
4d1308f49b backlight: accept '%' in the brightness input value
Improve friendlyness of the command line by accepting the percent brightness
in both format: with or without a trailing '%'

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D26692
2020-10-06 08:05:19 +00:00
Ryan Moeller
92e17803cd Enable iterating all sysctls, even ones with CTLFLAG_SKIP
Add an "nextnoskip" sysctl that allows for listing of sysctls intended to be
normally skipped for cost reasons.

This makes it so the names/descriptions of those sysctls can be discovered with
sysctl -aN/sysctl -ad/sysctl -at.

It also makes it so children are visited when a node flagged with CTLFLAG_SKIP
is explicitly requested.

The intended use case is to mark the root "kstat" node with CTLFLAG_SKIP so that
the extensive and expensive stats are skipped by default but may still be easily
obtained without having to know them all (which may not even be possible) and
request each one-by-one.

Reviewed by:	jhb
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D26560
2020-10-05 20:13:22 +00:00
Fernando Apesteguía
fd92b91c71 procstat(1): Add EXAMPLES section
* Add some examples showing binary, arguments and file info from living
  processes.
* Show information from core dumps including an attempt using an old core file.
* While here, fix warning 'no blank before trailing delimiter' reported by igor.

Approved by:	manpages (0mp@)
Differential Revision:	https://reviews.freebsd.org/D25467
2020-10-05 14:07:32 +00:00
Gordon Bergling
095bc8eb65 cpuset(1): Fix some issues reported by mandoc
- whitespace at end of input line
- new sentence, new line

MFC after:	1 week
2020-10-03 19:10:54 +00:00
Alexander V. Chernikov
fedeb08b6a Introduce scalable route multipath.
This change is based on the nexthop objects landed in D24232.

The change introduces the concept of nexthop groups.
Each group contains the collection of nexthops with their
 relative weights and a dataplane-optimized structure to enable
 efficient nexthop selection.

Simular to the nexthops, nexthop groups are immutable. Dataplane part
 gets compiled during group creation and is basically an array of
 nexthop pointers, compiled w.r.t their weights.

With this change, `rt_nhop` field of `struct rtentry` contains either
 nexthop or nexthop group. They are distinguished by the presense of
 NHF_MULTIPATH flag.
All dataplane lookup functions returns pointer to the nexthop object,
leaving nexhop groups details inside routing subsystem.

User-visible changes:

The change is intended to be backward-compatible: all non-mpath operations
 should work as before with ROUTE_MPATH and net.route.multipath=1.

All routes now comes with weight, default weight is 1, maximum is 2^24-1.

Current maximum multipath group width is statically set to 64.
 This will become sysctl-tunable in the followup changes.

Using functionality:
* Recompile kernel with ROUTE_MPATH
* set net.route.multipath to 1

route add -6 2001:db8::/32 2001:db8::2 -weight 10
route add -6 2001:db8::/32 2001:db8::3 -weight 20

netstat -6On

Nexthop groups data

Internet6:
GrpIdx  NhIdx     Weight   Slots                                 Gateway     Netif  Refcnt
1         ------- ------- ------- --------------------------------------- ---------       1
              13      10       1                             2001:db8::2     vlan2
              14      20       2                             2001:db8::3     vlan2

Next steps:
* Land outbound hashing for locally-originated routes ( D26523 ).
* Fix net/bird multipath (net/frr seems to work fine)
* Add ROUTE_MPATH to GENERIC
* Set net.route.multipath=1 by default

Tested by:	olivier
Reviewed by:	glebius
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D26449
2020-10-03 10:47:17 +00:00
Emmanuel Vadot
9ddaa99d9d Add backlight(8)
This tool is used to configure registered backlights.
It can incr/decr (default to 10%) or accept a percentage value directly.

Reviewed by:	manpages (gbe@)
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26251
2020-10-02 18:21:30 +00:00
Eric van Gyzen
63c8336d4d zgrep: fix exit status with multiple files
zgrep should exit with success when given multiple files and the
pattern is found in at least one file.  Prior to this change,
it would exit with success only if the pattern was found in _every_ file.

Reviewed by:	dab ngie
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26616
2020-10-01 21:48:22 +00:00
Baptiste Daroussin
755cc40c21 Update nvi to 2.2.0-05ed8b9
This version incorporates many fixes in particular a fix for vi -w
Another approach was proposed to merge those fixes (see review), I find
it easier to track changes if we keep importing snapshot on regular
basis

PR:		241985
Reported by:	fernape
Differential Revision:	https://reviews.freebsd.org/D26158
2020-10-01 04:46:23 +00:00
Kyle Evans
7cc42f6d25 Do a sweep and remove most WARNS=6 settings
Repeating the default WARNS here makes it slightly more difficult to
experiment with default WARNS changes, e.g. if we did something absolutely
bananas and introduced a WARNS=7 and wanted to try lifting the default to
that.

Drop most of them; there is one in the blake2 kernel module, but I suspect
it should be dropped -- the default WARNS in the rest of the build doesn't
currently apply to kernel modules, and I haven't put too much thought into
whether it makes sense to make it so.
2020-10-01 01:10:51 +00:00
Mateusz Piotrowski
c9370e5cec Bump manual page date after 366243
While here, address mandoc warnings.
2020-09-29 10:07:46 +00:00
Greg Lehey
314c5b3583 Document the fact (bug?) that the -a option will normally process
root's calendar files three times, once each for root, toor and
daemon.

This relates to bug 246943, but does not solve it.  See discussion in
bug report for more details.

PR:		246943
Reported by:	wcarson.bugzilla@disillusion.net
2020-09-29 05:49:45 +00:00
Konstantin Belousov
34d7dd1561 procstat: Fix regression after 365880.
Basically it reverts one chunk that reversed the parsing logic, making
legacy variants of invocation, like `procstat -a -f', non-operational.

Reported and tested by:	Dewayne Geraghty <dewayne@heuristicsystems.com.au>
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2020-09-29 00:20:58 +00:00
Konstantin Belousov
b65eb2f8a8 Consistently use __FBSDID("FreeBSD") for ids in usr.bin/procstat.
Submitted by:	Juraj Lutter <juraj@lutter.sk>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D26568
2020-09-27 23:01:54 +00:00
Fernando Apesteguía
347307b8e4 Fix typo and environment variable macro
Follow up for r366119

Reported by:	xtouqh@mm.st
Differential Revision:	https://reviews.freebsd.org/D26182
2020-09-24 16:42:17 +00:00
Fernando Apesteguía
f0f718ce96 which(1): Add EXAMPLES section to manpage
Add EXAMPLES section showing the use of -a and -s flags and how which(1)
treates duplicates.

Approved by:	manpages (gbe@)
Differential Revision:	https://reviews.freebsd.org/D26182
2020-09-24 16:11:53 +00:00
Greg Lehey
02d18aea06 Remove claim that Allied Forces created "West Germany" in 1953. I can
find no historic substantiation for such a claim.  The Federal
Republic of Germany was created by Germans on 23 May 1949, as also
noted in this file.
2020-09-21 22:55:51 +00:00
Alex Richardson
335770ac08 mkcsmapper: Fix UBSan signed shift error
usr.bin/mkcsmapper/yacc.y:466:18: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
2020-09-21 19:03:17 +00:00
Kyle Evans
dc94083273 xargs: add some long options for GNU compatibility
These are low-effort to add, so let's just do it.

Reported by:	"LukeShu" on Hacker News (-r / --no-run-if-empty)
MFC after:	1 week
2020-09-21 17:06:36 +00:00
Alex Richardson
86ce536521 Fix -Wpointer-sign warnings in usr.bin/grep
Reviewed By:	kevans
Differential Revision: https://reviews.freebsd.org/D26479
2020-09-21 09:03:37 +00:00
Kyle Evans
fe815331bb build: provide a default WARNS for all in-tree builds
The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by:	emaste, brooks, ngie (all earlier version)
Reviewed by:	emaste, arichardson (depend-cleanup.sh change)
Differential Revision:	https://reviews.freebsd.org/D26455
2020-09-18 17:17:46 +00:00
Konstantin Belousov
085e04945c Add pargs, penv, pwdx commands and aliases to procstat(1).
Intent is to mimic Solaris commands with the same names.

Submitted by:	Juraj Lutter <juraj@lutter.sk>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D26310
2020-09-18 12:59:27 +00:00
Mark Johnston
c6dce83da8 Fix some posixshmcontrol nits.
- Exit with an error if no path is specified.
- Man page typo.
- Error message typo.

Reviewed by:	kib
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26376
2020-09-15 13:36:19 +00:00