Commit Graph

254403 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
7abf30d339 Make linux_errtbl[] static.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27004
2020-11-03 19:12:33 +00:00
Mateusz Piotrowski
664eefe222 build.7: Mention etcupdate(8) alongside mergemaster(8)
MFC after:	3 days
2020-11-03 18:13:42 +00:00
Mateusz Piotrowski
23788e6c4a Fix a typo in the description of WITH_DEBUG_PORTS
For each origin listed in WITH_DEBUG_PORTS, the ports framework sets
WITH_DEBUG instead of WITH_DEBUG_PORTS.

MFC after:	3 days
2020-11-03 18:02:02 +00:00
Edward Tomasz Napierala
939e5de8d4 Fix rookie mistake - it's nitems(), not sizeof().
Reported by:	xtouqh_icloud.com
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-11-03 14:44:33 +00:00
Konstantin Belousov
80ba361b2f if_media.c SIOCGMEDIAX handler: improve loop
Stop advancing counter past the current iteration number at the start
of iteration.  This removes the need of subtracting one when
calculating index for copyout, and arguably fixes off-by-one reporting
of copied out elements when copyout failed.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies / NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27073
2020-11-03 14:33:04 +00:00
Mateusz Piotrowski
fcdfe01616 Document how to set ports options via make.conf(5)
This patch is based on:
- https://lists.freebsd.org/pipermail/freebsd-ports-announce/2013-June/000062.html
- current content of /usr/ports/Mk/bsd.options.mk

PR:		194306
Reported by:	Daan K. <daanknip__hotmail_com>
MFC after:	2 weeks
2020-11-03 13:26:00 +00:00
Stefan Eßer
08867050c9 Replace literal uses of /usr/local with a variable
The variable defaults to "/usr/local", unless sysctl returns some other
value for "user.localbase".

The value of user.localbase defaults to _PATH_LOCALBASE as defined in
paths.h and thus this commit has no immediate effect.

The purpose of this change is to make /etc/defaults/rc.conf automatically
use the value of _PATH_LOCALBASE when not set to the default value.

Reviewed by:	imp, scottl
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D27014
2020-11-03 12:29:10 +00:00
Stefan Eßer
f1560bd080 Consistently print calendar dates in the locale of the user
Calendar files that specify LANG=... to specify their character encoding did
also set the date format defined for that locale, resulting in output like:

Nov  4 	Gabriel Faure dies from pneumonia in Paris, France, 1924
 4 nov. 	N'oubliez pas les Charles !

After this commit the output is always printed in a consistent format
according to the user's current locale, e.g.:

Nov  4 	Gabriel Faure dies from pneumonia in Paris, France, 1924
Nov  4 	N'oubliez pas les Charles !

I'll open a review asking for opinions whether this format change should
be merged to -STABLE.

Relnotes:	yes
2020-11-03 12:15:08 +00:00
Stefan Eßer
cc9fbfafbe Check that #ifdef, #ifndef, and #undef are used with a single name
This restores the parameter validation that has been peformed by cpp
for defining and testing of names used in conditions.

MFC after:	3 days
2020-11-03 11:37:19 +00:00
Mateusz Piotrowski
0cadbd6cd2 rc.d/zfs: Add shutdown to KEYWORDS
The problem is that Without walling /etc/rc.d/zfs on shutdown, resources
associated with ZFS mounts are not freed and the jails will remain in dying
state. In addition, the dataset is now in a dangling state, as the jail it
is attached to is dying.

A known workaround for jails was to add the following lines
to /etc/jail.conf, to make sure that "service zfs stop" is run
when the jail is stopped:

    exec.stop = "/bin/sh /etc/rc.shutdown";
    exec.stop += "/usr/sbin/service zfs stop || /usr/bin/true";

While the workaround seems to be okay-ish for the jail situation, it is
still unclean. However, for physical hosts this may wreak havoc with the
pool if shared spares are used, as "zfs unshare" is never invoked on
shutdown.

PR:		147444
Submitted by:	Markus Stoff <markus__stoffdv_at>
Reported by:	Mykah <mburkhardt__exavault_com>
Reviewed by:	cy
Approved by:	cy (src)
MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D27039
2020-11-03 10:02:52 +00:00
Conrad Meyer
eaa5afcefa linux(4) prctl(2): Implement PR_[GS]ET_DUMPABLE
Proxy the flag to the roughly analogous FreeBSD procctl 'TRACE'.

TRACE-disabled processes are not coredumped, and Linux !DUMPABLE processes
can not be ptraced.  There are some additional semantics around ownership of
files in the /proc/[pid] pseudo-filesystem, which we do not attempt to
emulate correctly at this time.

Reviewed by:	markj (earlier version)
Differential Revision:	https://reviews.freebsd.org/D27015
2020-11-03 02:10:54 +00:00
Conrad Meyer
443d8a07df linux(4): Emulate Linux SOL_SOCKET:SO_PASSCRED
This is required by some major linux applications, such as Chrome and
Firefox.  (As well as Electron-using applications, which are essentially
a bundled version of Chrome.)

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D27012
2020-11-03 01:19:13 +00:00
Conrad Meyer
2de07e4096 unix(4): Add SOL_LOCAL:LOCAL_CREDS_PERSISTENT
This option is intended to be semantically identical to Linux's
SOL_SOCKET:SO_PASSCRED.  For now, it is mutually exclusive with the
pre-existing sockopt SOL_LOCAL:LOCAL_CREDS.

Reviewed by:	markj (penultimate version)
Differential Revision:	https://reviews.freebsd.org/D27011
2020-11-03 01:17:45 +00:00
Conrad Meyer
a98f03786e linux(4): style: Eliminate dead 'break' after 'return'
No functional change.
2020-11-03 01:10:27 +00:00
Konstantin Belousov
3f113d5606 ifconfig: properly detect invalid mediaopt keywords.
When invalid keyword is specified, ifconfig(8) is silent about it,
instead random request is sent to the driver.

Before the patch:
root@r-freeb43:~ # ifconfig mce0 mediaopt -txpause,-rxpause
ifconfig: SIOCSIFMEDIA (media): Device not configured

After:
root@r-freeb43:~ # ifconfig mce0 mediaopt -txpause,-rxpause
ifconfig: unknown option: -txpause

Reviewed by:	hselasky, kp
Sponsored by:	Mellanox Technologies / NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27060
2020-11-02 21:47:34 +00:00
Emmanuel Vadot
ea07005137 release: Add an image for CI
A lot of projects CI can't do FreeBSD tests currently.
The main reason is that the project CI infrastructure is runned on Linux
and that our images aren't modifiable from a Linux hosts.
Add a basic image specific for this case (called BASIC-CI for a lack of a
better name).
The image have no package pre-installed.
It only have a few modification to have dhcp client runned on the default
interface and sshd started with option to be able to log on without a password
as root.

Sponsored by: The FreeBSD Foundation

Reviewed by:	re (gjb@)
Differential Revision:	https://reviews.freebsd.org/D25598
2020-11-02 21:10:49 +00:00
Ruslan Bukin
268f7e2539 Add routines for ARM System MMU (SMMU) pmap management.
Reviewed by:	markj
Discussed with:	kib
Sponsored by:	DARPA, Innovate UK
Differential Revision:	https://reviews.freebsd.org/D26877
2020-11-02 19:56:15 +00:00
Alan Cox
9b4e77cb97 Tidy up the #includes. Recent changes, such as the introduction of
VM_ALLOC_WAITOK and vm_page_unwire_noq(), have eliminated the need for
many of the #includes.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D27052
2020-11-02 19:20:06 +00:00
Stefan Eßer
23b4092837 Re-arrange some of the code to separate writable user tree variables from
R/O variables.

While here fix some nearby style. No functional change intended.

MFC after:	1 month
2020-11-02 18:48:06 +00:00
Conrad Meyer
7731194090 linux(4): Quiesce unrecognized ioctl warning for F2FS query
On Linux, sqlite probes for underlying F2FS filesystems that support
certain kinds of atomic update with this ioctl.  The expected result on
non-F2FS filesystem (i.e., all FreeBSD filesystems) is any error value.

Minimally implement the ioctl and avoid the warning message.

(This shows up in Linux Chrome, which embeds sqlite.)

Reviewed by:	emaste, trasz
Differential Revision:	https://reviews.freebsd.org/D27050
2020-11-02 18:45:43 +00:00
Conrad Meyer
53efdb55a8 linux(4): Deduplicate ioctl range construction with a helper macro
No functional change.

Reviewed by:	emaste, trasz
Differential Revision:	https://reviews.freebsd.org/D27049
2020-11-02 18:45:15 +00:00
Emmanuel Vadot
0ac8aa55da pkgbase: Add incremental packages
This adds a new target update-packages which will create the new packages
compared to the last run.

This is how to use it:
At this point we cut a release
$ make buildworld ...
$ make buildkernel
$ make packages

    There is now a PKG_VERSION directory with latest link pointing to it
    Distribute the packages to server

$ something something that update the source tree
$ make buildworld ...
$ make buildkernel
$ make update-packages
You know have a PKG_VERSION directory in the REPODIR and latest link pointing to it.
In PKG_VERSION dir only the packages which differs from the latest run are
named PKG_VERSION, otherwise the old packages are there.

The process is :
Build the new packages in the PKG_VERSION directory
Compare the internal data with the PKG_VERSION_FROM version. The comparison is done
by checking the internal hash of the packages.
By default PKG_VERSION_FROM is set to what the latest link points to.
If the old and new version matches, we rm the new package and cp the old one.

Differential Revision:	https://reviews.freebsd.org/D25984
2020-11-02 18:23:50 +00:00
Mateusz Guzik
36639c3942 zfs: zstd: short-circuit cleaning buffers if none exist
This avoids a barrage of locking every minute.
2020-11-02 17:39:59 +00:00
Mateusz Guzik
e1b6a7f83f malloc: prefix zones with malloc-
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D27038
2020-11-02 17:39:15 +00:00
Mateusz Guzik
828afdda17 malloc: export kernel zones instead of relying on them being power-of-2
Reviewed by:	markj (previous version)
Differential Revision:	https://reviews.freebsd.org/D27026
2020-11-02 17:38:08 +00:00
Adrian Chadd
26c29e743b [libnetmap] Fix 32 bit compilation under gcc-6.4
Use uintptr_t to cast a uint64_t to a pointer type.
Yeah, it isn't technically correct for platforms with pointers
> 64 bits, but it's fine here.

This fixes 32 bit compat library builds on amd64 and also
mips32 builds.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D26790
2020-11-02 15:01:37 +00:00
Hans Petter Selasky
44a1b2f07b Fix for referencing file via its vnode in ibore.
Use the native vnode lookup functions, instead of going via the LinuxKPI,
because the file referenced is typically created outside the LinuxKPI, and
the LinuxKPI's fdget() can only resolve file descriptor numbers which
were created by itself.

The vnode pointer is used as an identifier to identify XRCD handles which
are sharing resources.

This patch fixes the so-called XRCD support in ibcore for FreeBSD.
Refer to ibv_open_xrcd(3) for more information how the file descriptor
argument is used.

Reviewed by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-02 10:44:29 +00:00
Michal Meloun
099b595154 Improve loading of multipage aligned buffers.
The multipage alignment requirements is incompatible with many aspects
of actual busdma code. Multi-page alignment requests are incompatible
with many aspects of current busdma code. Mainly with partially bounced
buffer segments and per-page loop in bus_dmamap_load_buffer(). Because
proper implementation would be a major restructuring of the code, add
the fix only for already known uses and do KASSERT for all other cases.

For this reason, bus_dmamap_load_buffer () should take the memory allocated
by bus_dmam_alloc () as one segment bypassing per page segmentation. We can
do this because it is guaranteed that the memory is physically continuous.

Reviewed by:	bz
Tested by: 	imp, mv, daniel.engberg.lists_pyret.net, kjopek_gmail.com
Differential Revision: https://reviews.freebsd.org/D26735
2020-11-02 08:26:19 +00:00
Conrad Meyer
63ed2e3642 linux(4): Disambiguate identical ioctl errors in distinct paths
And stop truncating the full ioctl number in the error message.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D27048
2020-11-02 06:16:11 +00:00
Alexander Motin
06c888ecb9 Add icc (Isochronous Command Completion) ccb_ataio field.
MFC after:	1 week
2020-11-02 01:01:41 +00:00
Mateusz Piotrowski
a257740767 ifconfig.8: Improve formatting of -f in synopsis
MFC after:	3 days
2020-11-01 22:50:21 +00:00
Mateusz Piotrowski
44c4affa00 Remove Tn macros from ifconfig.8
MFC after:	3 days
2020-11-01 22:46:43 +00:00
Adrian Chadd
e72a100b79 [ctld] Fix compilation under gcc-6.4
* remove dup yylex symbol; already defined in a header file
* uint64_t is always >= 0

Reviewed by:	cem, imp
Differential Revision:	https://reviews.freebsd.org/D27046
2020-11-01 21:18:21 +00:00
Mateusz Piotrowski
758dde0614 Do not document default locations of the OpenBSD and NetBSD ports trees
Our own Ports Collection is not targeting those systems at the moment,
so let's stop documenting bits specific to OpenBSD and NetBSD in the ports
documentation. Especially, that it might bit rot one day.

MFC after:	1 week
2020-11-01 20:54:02 +00:00
Stefan Eßer
ab34af0746 Fix psoition reporting for calendar data file in system directory
MFC after:	3 days
2020-11-01 20:38:35 +00:00
Stefan Eßer
a97cfe08a7 Fix year in 2 most recent entries (2010 -> 2020)
Reported by:	mack@macktronics.com (Dan Mack)
2020-11-01 19:13:55 +00:00
Mateusz Piotrowski
76d2af50b5 Document how to use sudo for SU_CMD
It is rather common for the ports users to replace su(1) with sudo(8)
within the SU_CMD variable. Let's document it in the manual page (so far
it's been hidden in a comment within bsd.commands.mk).

MFC after:	2 weeks
2020-11-01 17:27:48 +00:00
Konstantin Belousov
1fbbe9dbf5 net/if_media.c: improve IFMEDIA_DEBUG output.
Use consistent output format for hex.
Print both media and mask where relevant.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:38:30 +00:00
Konstantin Belousov
e399f19dba Cleanup of net/if_media.c: simplify cleanup loop in ifmedia_removeall().
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:36:21 +00:00
Konstantin Belousov
899322fdfa Cleanup of net/if_media.c: some style.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:30:17 +00:00
Konstantin Belousov
2193fb16b5 Cleanup of net/if_media.c: switch to ANSI C function definitions.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:25:35 +00:00
Adrian Chadd
c2a5b2abc7 [iscsictl] Fix compile issues that creep up with gcc-6.4
This fixes two warnings:

* double-definition of a symbol in a yacc header
* Comparison of an unsigned int being >= 0; that's always
  going to be true.

Reviewed by:	imp, rscheff
Differential Revision:	https://reviews.freebsd.org/D27036
2020-11-01 15:57:14 +00:00
Stefan Eßer
1ebef47735 Make sysctl user.local a tunable that can be written at run-time
This sysctl value had been provided as a read-only variable that is
compiled into the C library based on the value of _PATH_LOCALBASE in
paths.h.

After this change, the value is compiled into the kernel as an empty
string, which is translated to _PATH_LOCALBASE by the C library.

This empty string can be overridden at boot time or by a privileged
user at run time and will then be returned by sysctl.

When set to an empty string, the value returned by sysctl reverts to
_PATH_LOCALBASE.

This update does not change the behavior on any system that does
not modify the default value of user.localbase.

I consider this change as experimental and would prefer if the run-time
write permission was reconsidered and the sysctl variable defined with
CLFLAG_RDTUN instead to restrict it to be set at boot time.

MFC after:	1 month
2020-10-31 23:48:41 +00:00
Vladimir Kondratyev
113ec54c58 acpi_dock(4): Add ACPI_PNP_INFO
MFC after:	2 weeks
2020-10-31 22:20:42 +00:00
Vladimir Kondratyev
58ea3386f3 acpi_wmi(4): Add ACPI_PNP_INFO
MFC after:	2 weeks
2020-10-31 22:19:39 +00:00
Vladimir Kondratyev
9c6e377448 Add plug and play information macroses for ACPI and I2C buses.
Matching table format is compatible with ACPI_ID_PROBE bus method.

Note that while ACPI_ID_PROBE matches against _HID and all _CIDs, current
acpi_pnpinfo_str() exports only _HID and first _CID.  That means second
and further _CIDs should be added to both acpi_pnpinfo_str() and
ACPICOMPAT_PNP_INFO if device matching against them is required.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26824
2020-10-31 22:15:59 +00:00
Brandon Bergren
d4fba56212 Fix 32-bit build after r367209
Fix build on systems with a 32-bit size_t.

Since it's being passed as a pointer, a 64-bit write to it will overflow.

MFC with:	r367209
2020-10-31 22:14:37 +00:00
Vladimir Kondratyev
3bdb684633 devmatch(8): Respect mask field when matching strings of Z type.
While here, add debug output for this action.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26823
2020-10-31 22:04:13 +00:00
Hans Petter Selasky
c77bfaa750 Implement the USB_GET_DEVICEINFO ioctl(2) for uhid(4).
Submitted by:		pedro martelletto <pedro@ambientworks.net>
MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-31 21:53:23 +00:00
Brandon Bergren
bd5e074531 Fix 32-bit build after r367229.
The use of atomic_sub_64() in zfs_zstd.c was breaking the 32-bit build on
platforms without native 64-bit atomics due to atomic_sub_64() not being
available, and no fallback being provided in _STANDALONE.

Provide a standalone stub to match atomic_add_64() using simple math.

While this is not actually atomic, it does not matter in libsa context,
since it always runs single-threaded and does not run under a scheduler.

Reviewed by: mjg (in email)
2020-10-31 21:11:34 +00:00