Commit Graph

18963 Commits

Author SHA1 Message Date
Gordon Bergling
e6ab1e365c config(8): Correct the mentioned paper in the SEE ALSO section
FreeBSD's version of the config(8) utility is based on 4.3BSD not
4.4BSD. So correct the mentioned paper in the SEE ALSO section.

Reported by:	imp
Reviewed by:	imp
X-MFC-with:	2b59392cb0
Differential Revision:	https://reviews.freebsd.org/D29701
2021-04-13 06:49:00 +02:00
John Baldwin
eacc27affe bhyve: Move the gdb_active check to gdb_cpu_suspend().
The check needs to be in the public routine (gdb_cpu_suspend()), not
in the internal routine called from various places
(_gdb_cpu_suspend()).  All the other callers of _gdb_cpu_suspend()
already check gdb_active, and this breaks the use of snapshots when
the debug server is not enabled since gdb_cpu_suspend() tries to lock
an uninitialized mutex.

Reported by:	Darius Mihai, Elena Mihailescu
Reviewed by:	elenamihailescu22_gmail.com
Fixes:		621b509048
Differential Revision:	https://reviews.freebsd.org/D29538
2021-04-12 11:43:34 -07:00
Chuck Tuffli
0c6282e842 bhyve: add SMBIOS Baseboard Information
Add the System Management BIOS Baseboard (or Module) Information
a.k.a. Type 2 structure to the SMBIOS emulation.

Reviewed by:	rgrimes, bcran, grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29657
2021-04-12 08:09:52 -07:00
Andrew Turner
5d2d599d3f Create VM_MEMATTR_DEVICE on all architectures
This is intended to be used with memory mapped IO, e.g. from
bus_space_map with no flags, or pmap_mapdev.

Use this new memory type in the map request configured by
resource_init_map_request, and in pciconf.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D29692
2021-04-12 06:15:31 +00:00
Kristof Provost
e9eb09414a libpfctl: Switch to pfctl_rule
Stop using the kernel's struct pf_rule, switch to libpfctl's pfctl_rule.
Now that we use nvlists to communicate with the kernel these structures
can be fully decoupled.

Reviewed by:	glebius
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29644
2021-04-10 11:16:02 +02:00
Kristof Provost
956e7d2325 bsnmp: Use libpfctl
Reviewed by:	glebius
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29642
2021-04-10 11:16:02 +02:00
Kristof Provost
95be9288f0 (t)ftp-proxy: use libpfctl
Reviewed by:	glebius
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29641
2021-04-10 11:16:02 +02:00
Edward Tomasz Napierala
28b475b018 Cross-reference camcontrol(8) and zonectl(8) man pages. 2021-04-10 10:13:29 +01:00
Warner Losh
066b096d13 efivar: use bool for booleans
Rather than int flags we ++, use booleans for all command line args.
No functional change intended.

Reviewed by:		markj@
Sponsored by:		Netflix, Inc
Differential Revision:	https://reviews.freebsd.org/D29621
2021-04-09 16:36:44 -06:00
Warner Losh
0292a5c95f efivar: Attempt to fix setting/printing/deleting EFI vars with '-' in their name
Due to how we're parsing UUIDs, we were disallowing setting, printing or
deleting any UEFI variable with a '-' in it when you attempted to do that
operation with the exact name (wildcard reporting was unaffected). Fix the
parser to loop over all the dashes in the name and only give up when all
possible matches are exhausted.

Reviewed by:		markj@
Sponsored by:		Netflix, Inc
Differential Revision:	https://reviews.freebsd.org/D29620
2021-04-09 16:36:40 -06:00
Warner Losh
3c0dcbfc85 efivar: Add --quiet to not report errors
Add -q/--quiet flag to the command line. With it, errors are not reported at
all. Instead nothing is printed and the exit code is non-zero.

Reviewed by:		markj
Sponsored by:		Netflix, Inc
Differential Revision:	https://reviews.freebsd.org/D29619
2021-04-09 16:36:20 -06:00
Gordon Bergling
c07aa0a587 lpd(8): Mention the author of a paper in the SEE ALSO section
Obtained from:	OpenBSD
MFC after:	1 week
2021-04-09 11:29:18 +02:00
Gordon Bergling
2b59392cb0 config(8): Mention the authors of a paper in the SEE ALSO section
Obtained from:	OpenBSD
MFC after:	1 week
2021-04-09 11:20:49 +02:00
Roman Bogorodskiy
f2ecc0d1b7 bhyve: fix regression in legacy virtio-9p config parsing
Commit 621b509048 introduced a regression
in legacy virtio-9p config parsing by not initializing *sharename to
NULL. As a result, "sharename != NULL" check in the first iteration fails
and bhyve exits with "virtio-9p: more than one share name given".

Fix by adding NULL back.

Approved by:	grehan
2021-04-08 18:44:58 +04:00
Eric van Gyzen
12db51d208 uefisign: handle empty sections
loader.efi has an empty set_Xfic section.  Handle it correctly.

```
Sections:
Idx Name          Size      VMA               LMA               File off  Algn
[...]
3 set_Xcom      00000168  00000000000d4000  00000000000d4000  000d0e00  2**2
	      CONTENTS, ALLOC, LOAD, DATA
4 set_Xfic      00000000  00000000000d4168  00000000000d4168  00000000  2**2
	      ALLOC, LOAD, DATA
5 .sdata        00000448  00000000000d5000  00000000000d5000  000d1000  2**2
	      CONTENTS, ALLOC, LOAD, DATA
[...]
```

Reviewed by:	trasz, dab
Reported by:	andy.y.liu@dell.com
Tested by:	andy.y.liu@dell.com
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D29606
2021-04-07 11:23:11 -05:00
Alexander Motin
ac503c194c Introduce "soft" serseq variant.
With new ZFS prefetcher improvements it is no longer needed to fully
serialize reads to reach decent prediction hit rate.  Softer variant
only creates small time window to reduce races instead of completely
blocking following reads while previous is running.  It much less
hurts the performance in case of prediction miss.

MFC after:	1 month
2021-04-06 17:27:16 -04:00
Nathan Whitehorn
afb6a168f8 Allocate extra inodes in makefs when leaving free space in UFS images.
By default, makefs(8) has very few spare inodes in its output images,
which is fine for static filesystems, but not so great for VM images
where many more files will be added. Make makefs(8) use the same
default settings as newfs(8) when creating images with free space --
there isn't much point to leaving free space on the image if you
can't put files there. If no free space is requested, use current
behavior of a minimal number of available inodes.

Reviewed by:	manu
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D29492
2021-04-06 13:43:29 -04:00
Eric van Gyzen
9e6158d274 uefisign: fix handling of errors from child proc
Close the unused pipe file descriptors so the parent will notice if
the child exits prematurely.  Previously, the parent would block
forever on a read from the pipe.

    $ uefisign -c foo.cert -k foo.key -o loader.efi loader.efi.unsigned
    uefisign: section points inside the headers
    load: 0.06  cmd: uefisign 4502 [piperd] 7.25r 0.00u 0.00s 0% 5968k
    ... _sleep+0x1be pipe_read+0x3d6 kern_readv+0x8c sys_read+0x83 ...

Reviewed by:	trasz
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D29605
2021-04-06 12:13:59 -05:00
Marcin Wojtas
1c1ead9b94 pciconf: Use VM_MEMATTR_DEVICE on supported architectures
Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE
when mapping device registers in kernel. Do the same in pciconf.
On armada8k SoC all reads from BARs mapped with hitherto attribute
(VM_MEMATTR_UNCACHEABLE) return 0xff's.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Marvell
Differential revision: https://reviews.freebsd.org/D29603
2021-04-06 17:00:05 +02:00
Philip Paeps
e5fc416c28 bsdinstall: remove ftp7.ua.freebsd.org mirror
PR:		254779
Reported by:	Dmytro <dima@dima.rv.ua>
2021-04-06 10:32:52 +08:00
Philip Paeps
e270eebc97 bsdconfig: remove ftp7.ua.freebsd.org mirror
PR:		254779
Reported by:	Dmytro <dima@dima.rv.ua>
2021-04-06 10:32:23 +08:00
Ed Maste
741223a65c freebsd-update: improve mandoc db generation
freebsd-update compares the dates on man pages with mandoc.db, and if
any newer pages are found it regenerates mandoc.db.

Previously, if mandoc.db did not already exist the check failed and
freebsd-update then failed to create one.  Now, check that mandoc.db
exists before performing the check for newer pages.

Reported by:	bdrewery (in D10482)
Reviewed by:	gordon
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29575
2021-04-05 13:23:37 -04:00
Nathan Whitehorn
b8639a1098 Tweak language involving ZFS installation; no content changes. 2021-04-05 10:23:41 -04:00
Nathan Whitehorn
3b20b988e0 Add some general notes about scripted installations. 2021-04-05 10:23:41 -04:00
Jamie Gritton
8c1d956ffa jail: fix jail(8) synposis and usage message to match reality.
Reported by:	yuri
PR:		254741
MFC after:	5 days
2021-04-04 10:49:38 -07:00
Konstantin Belousov
2d223ccdae Remove kgmon(8)
Follow-up to the removal of the mcov from kernel.

Noted by:	mckusick
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D29563
2021-04-04 00:50:28 +03:00
Peter Grehan
ab899f8937 Fix typo in xhci nvlist node name, and also increment device counter.
This allows the xhci tablet device to be recognized and a PCI device
instantiated.

Reviewed by:	jhb
Fixes:		621b509048 Refactor configuration management in bhyve.
MFC after:	3 months.
2021-04-03 14:32:54 +10:00
Konstantin Belousov
69efe3695d config(8): remove support for -p
and other equivalent ways to request mcount-based profiling, like
'profile N' in kernel config.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D29529
2021-04-02 15:41:51 +03:00
Vincenzo Maffione
45c67e8f6b netmap: several typo fixes
No functional changes intended.
2021-04-02 07:01:20 +00:00
Rick Macklem
b43fe9eb4b nfsd: silence rpcb_unset noise for NFSv4 only servers
An NFSv4 only configuration does not register with
rpcbind(). Without this patch a failure to rpcb_unset()
is reported when the daemon is terminated for this case.

This is harmless noise, but this patch avoids calling
rpcb_unset() for the NFSv4 only case, avoiding the noise.

When called with "-d", it still does the rpcb_unset(),
assuming that the configuration might have been
changed to NFSv4 only and unregistering with
rpcbind() might still be needed.

Reviewed by:	freqlabs
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29449
2021-04-01 15:09:03 -07:00
Mark Johnston
b8ae450f05 traceroute6: Fix Capsicum rights for rcvsock
- Always use distinct sockets for send and recv
- Limit rights on the recv socket

For ICMP6 we were using the same socket for both send and receive, and
we limited rights on the socket such that it's impossible to receive
anything.

PR:		254623
Diagnosed by:	Zhenlei Huang <zlei.huang@gmail.com>
Reviewed by:	oshogbo
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29523
2021-04-01 10:00:29 -04:00
Xin LI
18f3c5fe92 usr.sbin/services_mkdb: plug memory leak when line was blank.
Reviewed by:	bapt
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29370
2021-03-30 15:21:37 -07:00
Ka Ho Ng
b013912772 bhyve: change vq_getchain to return iovecs in both directions
The old prototype requires callers to inspect flags of each descriptors
to get the starting position of host-writable iovecs.

vq_getchain() is changed to return a virtio request with the number of
host-readable iovecs and host-writable iovecs instead. Callers can avoid
boilerplate code of getting the start offset of host-writable iovecs.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Reviewed by:	afedorov
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D29433
2021-03-30 16:44:07 +08:00
John Baldwin
4d5460a720 bhyve: Enable virtio-scsi legacy config parsing.
The previous commit added the handler to parse the command line
options for virtio-scsi devices but forgot to set the correct function
pointer to point to the handler.

Reported by:	vangyzen
Reviewed by:	vangyzen
Fixes:		621b509048
Differential Revision:	https://reviews.freebsd.org/D29438
2021-03-29 10:25:45 -07:00
Ryan Moeller
b07b7aec65 bsdinstall: Drop vestigial bsdinstall-esps cleanup
This is not needed after 0b7472b3d8.

MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D29325
2021-03-26 14:12:18 -04:00
Caleb St. John
badcfbacf3 rpc.lockd: Unconditionally close fds as daemon
When lockd is configured with a debug level of > 0 and foreground == 0,
the process is daemonized with a truth noclose argument to daemon().
This doesn't seem to be the desired behavior because that prevents
stdout and stderr from being closed, however, stdout and stderr aren't
used anywhere else. Furthermore, the man pages state that with a higher
debug level it will use the syslog facilities to do so.

Submitted by:	Caleb St. John
Discussed with:	rmacklem
MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D29415
2021-03-26 14:05:33 -04:00
Nathan Whitehorn
5140034cc0 Add a new mode to the scripted partition editor for variant disk names.
If the disk parameter "DEFAULT" is set in place of an actual device name,
or no disk is specified for the PARTITIONS parameter, the installer will
follow the logic used in the automatic-partitioning mode, in which it
will either provide a selection dialog for one of several disks if
several are present or automatically select it if there is only one. This
simplifies the creation of fully-automatic installation media for
hardware or VMs with varying disk names.

Suggested by:	Egoitz Aurrekoetxea <egoitz@sarenet.es>
MFC after:	3 weeks
Relnotes:	yes
2021-03-26 11:43:47 -04:00
Alan Somers
f073ab8712 mpsutil.8: fix typos in the man page
MFC after:	2 weeks
Sponsored by:	Axcient
2021-03-25 08:43:40 -06:00
Caleb St. John
efad9c8ba3 align nfsdumpstate column output
There are scenarios where an NFS client will mount an NFSv4 export
without specifying a callback address.

When running nfsdumpstate under this circumstance, the column output is
shifted incorrectly which places the "ClientID" value underneath the
"Clientaddr" column.

This diff is a small cosmetic change that prints a blank in the
"Clientaddr" column and ensures the data for the columns are aligned
appropriately.

Submitted by:	Caleb St. John
Reviewed by:	sef (previous version)
MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D18958
2021-03-24 16:33:41 -04:00
John Baldwin
9f40a3be3d bhyve hostbridge: Rename "device" property to "devid".
"device" is already used as the generic PCI-level name of the device
model to use (e.g. "hostbridge").  The result was that parsing
"hostbridge" as an integer failed and the host bridge used a device ID
of 0.  The EFI ROM asserts that the device ID of the hostbridge is not
0, so booting with the current EFI ROM was failing during the ROM
boot.

Fixes:		621b509048
2021-03-24 09:29:15 -07:00
Mark Johnston
ed42b22abc makefs: Ignore the "tags" keyword in mtree manifests
An install using -DNO_ROOT emits mtree entries containing tags used by
pkgbase.  makefs(8) can safely ignore them, so do that rather than
emitting a warning for each entry.

Reviewed by:	brooks, imp
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29384
2021-03-23 14:38:40 -04:00
Dmitry Wagin
2d82b47a5b syslogd: Increase message size limits
Add a -M option to control the maximum length of forwarded messages.
syslogd(8) used to truncate forwarded messages to 1024 bytes, but after
commit 1a874a126a ("Add RFC 5424 syslog message output to syslogd.")
applies a more conservative limit of 480 bytes for IPv4 per RFC 5426
section 3.2.  Restore the old default behaviour of truncating to 1024
bytes.  RFC 5424 specifies no upper limit on the length of forwarded
messages, while for RFC 3164 the limit is 1024 bytes.

Increase MAXLINE to 8192 bytes to correspond to commit 672ef817a192.

Replaced bootfile[] size for MAXPATHLEN used in getbootfile(3) as a
returned value. Using (MAXLINE+1) as a size for bootfile[] is excessive.

PR:		241937
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D27206
2021-03-23 12:49:58 -04:00
Nathan Whitehorn
c2f16c595e Fix scripted installs on EFI systems after default mounting of the ESP.
Because the ESP mount point (/boot/efi) is in mtree, tar will attempt to
extract a directory at that point post-mount when the system is installed.
Normally, this is fine, since tar can happily set whatever properties it
wants. For FAT32 file systems, however, like the ESP, tar will attempt to
set mtime on the root directory, which FAT does not support, and tar will
interpret this as a fatal error, breaking the install (see
https://github.com/libarchive/libarchive/issues/1516). This issue would
also break scripted installs on bare-metal POWER8, POWER9, and PS3
systems, as well as some ARM systems.

This patch solves the problem in two ways:
- If stdout is a TTY, use the distextract stage instead of tar, as in
  interactive installs. distextract solves this problem internally and
  provides a nicer UI to boot, but requires a TTY.
- If stdout is not a TTY, use tar but, as a stopgap for 13.0, exclude
  boot/efi from tarball extraction and then add it by hand. This is a
  hack, and better solutions (as in the libarchive ticket above) will
  obsolete it, but it solves the most common case, leaving only
  unattended TTY-less installs on a few tier-2 platforms broken.

In addition, fix a bug with fstab generation uncovered once the tar issue
is fixed that umount(8) can depend on the ordering of lines in fstab in a
way that mount(8) does not. The partition editor now writes out fstab in
mount order, making sure umount (run at the end of scripted, but not
interactive, installs) succeeds.

PR:		254395
Reviewed by:	gjb, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29380
2021-03-23 09:29:54 -04:00
Nathan Whitehorn
9f88bee146 Bump documentation date after recent updates to bsdinstall.8. 2021-03-22 19:41:49 -04:00
Nathan Whitehorn
c8923d191d Include examples of how to build script-install media. 2021-03-22 15:58:10 -04:00
Nathan Whitehorn
f91026bf46 Improve example install scripts, making them simpler and more robust.
In particular:
- There is no need to do anything with gpart (the installer does that
  for you).
- There is no need to specify the network interface, since we have
  an option for defaults.
2021-03-22 15:58:10 -04:00
Mark Johnston
1af332a7d8 rtsold: Fix validation of RDNSS options
The header specifies the size of the option in multiples of eight bytes.
The option consists of an eight-byte header followed by one or more IPv6
addresses, so the option is invalid if the size is not equal to 1+2n for
some n>0.  Check this.

The bug can cause random stack data to be formatted as an IPv6 address
and passed to resolvconf(8), but a host able to trigger the bug may also
specify arbitrary addresses this way.

Reported by:	Q C <cq674350529@gmail.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2021-03-21 14:19:42 -04:00
Xin LI
57b9a062d1 usr.sbin/services_mkdb: diff reduction against NetBSD.
MFC after:	1 month
2021-03-21 10:22:50 -07:00
Xin LI
6234a0bfc8 usr.sbin/uefisign: prevent specifying certificate, key or output
multiple times.

MFC after:	1 month
2021-03-21 10:12:34 -07:00
Nathan Whitehorn
e8b4c5a622 Clarify that scripted installations don't require specification of boot
partitions, as there seems to be widespread confusion on this point.

MFC after:	1 day
2021-03-19 09:45:58 -04:00