Commit Graph

19149 Commits

Author SHA1 Message Date
John Baldwin
0611aec3cf etcupdate: Always extract to a temporary tree.
etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against.  This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by:	dim, np (and many others)
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29843
2021-04-20 13:21:42 -07:00
Alfredo Dal'Ava Junior
fc9780fd41 mprutil: add big endian support
This fix mprutil on big endian platforms, as follow up of D25785.

Flash operations are still not working, such as MPI2_FUNCTION_FW_UPLOAD
failing due to timeout.

Firmware version used during tests: 16.00.01.00

Submitted by:	Andre Fernando da Silva <andre.silva@eldorado.org.br>
Reviewed by:	luporl, Sreekanth Reddy <sreekanth.reddy@broadcom.com> (by e-mail)
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26040
2021-04-20 19:19:47 -03:00
Warner Losh
2763a0928a config: style for '\0' and NULL
Use NULL for pointers instead of '0' (though hey are the same thing in
these cases). Ditto for using the zero character '\0' instead of a naked
0 (ditto).

Reviewed by:		markj@
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29847
2021-04-19 16:10:12 -06:00
Yuri Pankov
d3f0c032fb bsdinstall: restore time selection screen
Apparently new dialog does not like the height of 2 for the
timebox widget, use 0 (minimum size) instead.

Do the same for calendar widget as it does not change the
appearance and to prevent possible future surprises.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D29720
2021-04-19 21:39:59 +03:00
Mateusz Piotrowski
8d9fefe643 bhyve.8: Fix mandoc -Tlint issues
While here, keep network backends section consistent with other
sections.

MFC after:	2 weeks
2021-04-19 02:16:14 +02:00
Mateusz Piotrowski
061f37d280 bhyve: Document the format for HD audio backends
- This change is done for consistency with other backend definitions.

MFC after:	2 weeks
2021-04-19 02:16:14 +02:00
Mateusz Piotrowski
d5fcc4b606 bhyve.8: Improve AHCI backends documentation
- Document the backend format.

MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
6eff58acc7 bhyve.8: Improve documentation of NVME backend
- Document the configuration format.
- Document two additional configuration options: eui64 and dsm.

MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
8b97e97548 bhyve.8: Improve framebuffer backends description
- Use appropriate mdoc macros
- Document that tcp= is a synonym to rfb= (tcp is used in the examples,
  but never mentioned)
- Clarify the IP address specification

MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
3f4c771f64 bhyve.8: Clean up virtio console device backends description
MFC after:	2 weeks
2021-04-19 02:16:13 +02:00
Mateusz Piotrowski
2fda01a1b7 bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
2d00b57022 bhyve.8: Clean up 9P device backends section
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
7c5829c942 bhyve.8: Clean up SCSI device backends section
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
5232a35f1e bhyve.8: Clean up block storage device backends description
MFC after:	2 weeks
2021-04-19 02:16:12 +02:00
Mateusz Piotrowski
7fb2272981 bhyve.8: Clean up network backends section
- Reformat the format lists, use appropriate mdoc macros for
  readability.
- Add a missing Oxford comma.

MFC after:	2 weeks
2021-04-18 23:33:24 +02:00
Mateusz Piotrowski
7014cb2393 bhyve.8: Improve emulation description of the -s flag
- Set width of the list to the longest key word for readability.
- Separate descriptions of amd_hostbridge and hostbridge emulations.
  Also, wordsmith their descriptions for consistency with other entries.
- Use Cm instead of Li for command modifiers.
- Do not stylize AMD with Li, there's no need to do it.
- Mention COM3 and COM4 in the definition of lpc.
- Fix a typo in the definition of ahci-hd ("hard drive" instead of
  "hard-drive").

MFC after:	2 weeks
2021-04-18 23:33:23 +02:00
Mateusz Piotrowski
234d8c470b bhyve.8: Clean up the slot description of -s
Also, remove the macros of the nested list which contained slot,
emulation and conf. This decreases the indention of the -s description.
It was necessary to clean up the slot description.

MFC after:	2 weeks
2021-04-18 23:33:23 +02:00
Mateusz Piotrowski
449f0e48e9 bhyve.8: Clean-up synopsis of -s
- Document "-s help" separately for readability.
- Use appropriate mdoc macros.

MFC after:	2 weeks
2021-04-18 23:33:23 +02:00
Mateusz Piotrowski
3357e9482f bhyve.8: Fix indention in the signals table
MFC after:	2 weeks
2021-04-18 22:09:39 +02:00
Mateusz Piotrowski
b24eea8c7a bhyve.8: Clean up description of -r
There is no need to wrap those flags in Op macros.

MFC after:	2 weeks
2021-04-18 22:09:37 +02:00
Mateusz Piotrowski
90df54374f bhyve.8: Fix the synopsis of -p
Use appropriate mdoc macros.

MFC after:	2 weeks
2021-04-18 22:09:36 +02:00
Mateusz Piotrowski
7e0cb3df68 bhyve.8: Improve the description of the -m flag
- Stylize the synopsis with proper mdoc macros
- Do some wordsmithing on the description for consistency.

MFC after:	2 weeks
2021-04-18 22:09:34 +02:00
Mateusz Piotrowski
4c08b978b2 bhyve.8: Improve the description and synopsis of -l
- Describe "-l help" separately for readability.
- List all the supported comX devices explicitly
- Use Cm instead of Ar for command modifiers (i.e., literal values a
  user can specify as an argument to the command).
- Explain where to get more information about the possible values of the
  conf argument.

MFC after:	2 weeks
2021-04-18 22:09:33 +02:00
Mateusz Piotrowski
ccb1c87a6a bhyve.8: Sort the options in the OPTIONS section
No content change intended. Just moving the option descriptions around
to follow the order suggested by style(9).

MFC after:	2 weeks
2021-04-18 22:09:24 +02:00
Mateusz Piotrowski
b6a572d03f bhyve: Improve the option description in the usage message
- Sort options as suggested by style(9)
- Capitalize some words like CPU and HLT
- Add a missing description for the -G flag

MFC after:	2 weeks
2021-04-18 20:22:13 +02:00
Mateusz Piotrowski
03c3e5e40d bhyve: Fix synopsis in the usage message
In particular:
- Sort short options to align with style(9)
- Add two missing flags: -G and -r
- Drop unnecessary angle brackets for consistency
- Rename the "vm" argument to vmname for consistency with the manual
  page

MFC after:	2 weeks
2021-04-18 20:22:13 +02:00
Mateusz Piotrowski
bfe40b692d bhyve.8: Make synopsis more readable
There is no need to squeeze all the possible options into one synopsis
entry. Let "-l help" and "-s help" be listed separately.

While here, keep -s and its arguments on the same line.

MFC after:	2 weeks
2021-04-18 20:22:13 +02:00
Fernando Apesteguía
8b1a5062e0 jail.conf(5): emphasize where to find jail parameters
Some people expect jail.conf(5) to have a list of jail parameters.
jail(8) contains a comprehensive list of all parameters to be used during jail
invocation or in jail.conf.

Highlighting where to look for jail parameters seems a reasonable solution.

PR:	244569
Reported by:	joneum@
Approved by: 0mp (manpages, mentor)
Reviewed by: debdrup
Differential Revision: https://reviews.freebsd.org/D28701
2021-04-18 17:58:16 +02:00
Cy Schubert
8c6732ac77 usr.sbin/wpa: complete the revert of wpa import
This completes the revert of b51f459a20.
2021-04-17 10:48:35 -07:00
Cy Schubert
0aad5de37c Revert wpa import.
b51f459a20 resulted in a mismerge
due to having to do a remerge because my tree was over a week out of
date. Changes that were made to fix the build were lost in the remerge
resulting in build errors that were fixed a week ago.
2021-04-17 08:44:52 -07:00
Chris Rees
cebcca89f1 lpd: Update SYNOPSIS with new flag
Reported by:	0mp
2021-04-15 13:27:09 +01:00
Chris Rees
56b0f5f360 lpd.8: Chase Dd-- took old value when merging 2021-04-15 12:40:16 +01:00
Chris Rees
3c63660670 lpd: Add -F flag to prevent daemonizing
This is necessary for use with supervision, e.g. runit.

I chose -F simply because that is what the folks at LPRng use.

Approved by:		pfg, gad, ngie
Differential Revision:	https://reviews.freebsd.org/D29566
2021-04-15 12:34:01 +01:00
Corvin Köhne
17d214c2ca bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL
Without the -w option, Windows guests crash on boot. This is caused by a rdmsr
of MSR_IA32_FEATURE_CONTROL. Windows checks this MSR to determine enabled VMX
features. This MSR isn't emulated in bhyve, so a #GP exception is injected
which causes Windows to crash.

Fix by returning a rdmsr of MSR_IA32_FEATURE_CONTROL with Lock Bit set and
VMX disabled to informWindows that VMX isn't available.

Reviewed by:	jhb, grehan (bhyve)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29665
2021-04-15 13:49:19 +10:00
Gordon Bergling
c8786bba8e Revert "config(8): Correct the mentioned paper in the SEE ALSO section"
config(8) was first imported from 4.4BSD.

Reported by:	rgrimes

This reverts commit e6ab1e365c.
2021-04-14 20:22:48 +02:00
Tai-hwa Liang
a0d6d0d0b9 arp(8): fixing the deletion failure of IEEE1394 associated addresses
Without this, 'arp -d ${IEEE1394_ADDRESS}' gives the following error:

	arp: delete: cannot locate 10.0.0.71

Reviewed by:	glebius
MFC after:	2 weeks
2021-04-13 22:59:58 +00:00
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
D Scott Phillips
f8a6ec2d57 bhyve: support relocating fbuf and passthru data BARs
We want to allow the UEFI firmware to enumerate and assign
addresses to PCI devices so we can boot from NVMe[1]. Address
assignment of PCI BARs is properly handled by the PCI emulation
code in general, but a few specific cases need additional support.
fbuf and passthru map additional objects into the guest physical
address space and so need to handle address updates. Here we add a
callback to emulated PCI devices to inform them of a BAR
configuration change. fbuf and passthru then watch for these BAR
changes and relocate the frame buffer memory segment and passthru
device mmio area respectively.

We also add new VM_MUNMAP_MEMSEG and VM_UNMAP_PPTDEV_MMIO ioctls
to vmm(4) to facilitate the unmapping needed for addres updates.

[1]: https://github.com/freebsd/uefi-edk2/pull/9/

Originally by:	scottph
MFC After:	1 week
Sponsored by:	Intel Corporation
Reviewed by:	grehan
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D24066
2021-03-19 11:04:36 +08:00
John Baldwin
621b509048 Refactor configuration management in bhyve.
Replace the existing ad-hoc configuration via various global variables
with a small database of key-value pairs.  The database supports
heirarchical keys using a MIB-like syntax to name the path to a given
key.  Values are always stored as strings.  The API used to manage
configuation values does include wrappers to handling boolean values.
Other values use non-string types require parsing by consumers.

The configuration values are stored in a tree using nvlists.  Leaf
nodes hold string values.  Configuration values are permitted to
reference other configuration values using '%(name)'.  This permits
constructing template configurations.

All existing command line arguments now set configuration values.  For
devices, the "-s" option parses its option argument to generate a list
of key-value pairs for the given device.

A new '-o' command line option permits setting an individual
configuration variable.  The key name is always given as a full path
of dot-separated components.

A new '-k' command line option parses a simple configuration file.
This configuration file holds a flat list of 'key=value' lines where
the 'key' is the full path of a configuration variable.  Lines
starting with a '#' are comments.

In general, bhyve starts by parsing command line options in sequence
and applying those settings to configuration values.  Once this is
complete, bhyve then begins initializing its state based on the
configuration values.  This means that subsequent configuration
options or files may override or supplement previously given settings.

A special 'config.dump' configuration value can be set to true to help
debug configuration issues.  When this value is set, bhyve will print
out the configuration variables as a flat list of 'key=value' lines.

Most command line argments map to a single configuration variable,
e.g.  '-w' sets the 'x86.strictmsr' value to false.  A few command
line arguments have less obvious effects:

- Multiple '-p' options append their values (as a comma-seperated
  list) to "vcpu.N.cpuset" values (where N is a decimal vcpu number).

- For '-s' options, a pci.<bus>.<slot>.<function> node is created.
  The first argument to '-s' (the device type) is used as the value of
  a "device" variable.  Additional comma-separated arguments are then
  parsed into 'key=value' pairs and used to set additional variables
  under the device node.  A PCI device emulation driver can provide
  its own hook to override the parsing of the additonal '-s' arguments
  after the device type.

  After the configuration phase as completed, the init_pci hook
  then walks the "pci.<bus>.<slot>.<func>" nodes.  It uses the
  "device" value to find the device model to use.  The device
  model's init routine is passed a reference to its nvlist node
  in the configuration tree which it can query for specific
  variables.

  The result is that a lot of the string parsing is removed from
  the device models and centralized.  In addition, adding a new
  variable just requires teaching the model to look for the new
  variable.

- For '-l' options, a similar model is used where the string is
  parsed into values that are later read during initialization.
  One key note here is that the serial ports use the commonly
  used lowercase names from existing documentation and examples
  (e.g. "lpc.com1") instead of the uppercase names previously
  used internally in bhyve.

Reviewed by:	grehan
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D26035
2021-03-18 16:30:26 -07:00
Daniel Ebdrup Jensen
21864048f3 inetd.conf: Wordsmith recommendation
Rather than recommend specific VTIs, it's better to give a general
recommendation for where current and future suitable VTIs can be found.
2021-03-18 15:17:32 +01:00
Baptiste Daroussin
c244b1d8a3 pkg: settle the uniq extension to .pkg instead of .bsd
Requested by:	many
2021-03-16 16:19:52 +01:00
Ka Ho Ng
54ac6f721e bhyve: virtio shares definitions between sys/dev/virtio
Definitions inside usr.sbin/bhyve/virtio.h are thrown away.
Definitions in sys/dev/virtio are used instead.

This reduces code duplication.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	grehan
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D29084
2021-03-16 19:29:39 +08:00
Baptiste Daroussin
a2aac2f5e5 pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txz
The package extension is going to be changed to .bsd to be among other
things resilient to the change of compression format used and reduce
the impact of all third party tool of that change.

Ensure the bootstrap knows about it

Reviewed by:	manu
Differential revision:	https://reviews.freebsd.org/D29232
2021-03-15 17:52:22 +01:00
Fernando Apesteguía
16b2290447 wlandebug.8: remove Xref for missing manpages
Remove references for: athdebug(8), athstats(8) and wlanstats(8)

Those are tools in the tools/ directory that are not built as part of the base
system. According to the toolds/README file:

"...these tools are not meant to be built as part of the standard system..."

Even more, the tools/tools/README is not udpated and wlanstats does not even
built on current:

error: cast from 'struct sockaddr *' to 'const struct sockaddr_dl *' increases
required alignment from 1 to 2 [-Werror,-Wcast-align]

PR:	 227174
Reported by: freebsd.org@alexandrews.me.uk
Reviewed by: gbe@ adrian@
Approved by: gbe@ (mentor) adrian@
Differential Revision: https://reviews.freebsd.org/D29033
2021-03-15 10:04:13 +01:00
Robert Wing
88e531f38c autofs: best effort to maintain mounttab and mountdtab
When an automounted filesystem is successfully unmounted, call
rpc.umntall(8) with the -k flag.

rpc.umntall(8) is used to clean up /var/db/mounttab on the client and
/var/db/mountdtab on the server. This is only useful for NFSv3.

PR:     251906
Reviewed by: trasz
Differential Revision:  https://reviews.freebsd.org/D27801
2021-03-12 06:41:55 -09:00
Oskar Holmund
17b14d8f77 usr.sbin/pwm/pwm add support for flags
The pwm utility cant set the only flag defined (PWM_POLARITY_INVERTED) so this
patch add the option -I (capital letter i) to send it to the drivers.

None of existing PWM driver have implemented support for flags.
But soon:ish I will put up an review of a pwm driver using TI OMAP DMTimer.

Differential Revision: https://reviews.freebsd.org/D29137
MFC after:   2 weeks
2021-03-11 09:57:56 +01:00
Dag-Erling Smørgrav
e5f02c140b Fix local-unbound setup for some IPv6 deployments.
PR:		250984
MFC after:	1 week
2021-03-10 15:53:22 +00:00
Rick Macklem
09673fc0f3 mountd(8): generate a syslog message when the "V4:" line is missing
Daniel reported that NFSv4 mounts were not working despite having
set "nfsv4_server_enable=YES" in /etc/rc.conf.  Mountd was logging a
message that there was no /etc/exports file.
He noted that creating a /etc/exports file with a "V4:" line in it
was needed make NFSv4 mounts work.
At least one "V4:" line in one of the exports(5) file(s) is needed to
make NFSv4 mounts work. This patch fixes mountd.c so that it logs a
message indicting that there is no "V4:" line in any exports(5)
file when NFSv4 mounts are enabled.
To avoid this message being generated erroneously, /etc/rc.d/mountd
is updated to make sure vfs.nfsd.server_max_nfsvers is properly set
before mountd(8) is started.

Reported by:	debdrup
PR:	253901
MFC after:	2 weeks
2021-03-08 16:08:02 -08:00
Hajimu UMEMOTO
006a01374f Simplify using nvlist_append_string_array().
Reported by:	hrs
MFC after:	1 week
2021-03-08 12:03:32 +09:00
Robert Wing
38dfb0626f bhyve/snapshot: use SOCK_DGRAM instead of SOCK_STREAM
The save/restore feature uses a unix domain socket to send messages
from bhyvectl(8) to a bhyve(8) process. A datagram socket will suffice
for this.

An added benefit of using a datagram socket is simplified code. For
bhyve, the listen/accept calls are dropped; and for bhyvectl, the
connect() call is dropped.

EPRINTLN handles raw mode for bhyve(8), use it to print error messages.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D28983
2021-03-07 15:23:29 -09:00
Robert Wing
6bb140e3ca bhyvectl: print a better error message when vm_open() fails
Use errno to print a more descriptive error message when vm_open() fails

libvmm: preserve errno when vm_device_open() fails

vm_destroy() squashes errno by making a dive into sysctlbyname() - we
can safely skip vm_destroy() here since it's not doing any critical
clean up at this point. Replace vm_destroy() with a free() call.

PR:             250671
MFC after:      3 days
Submitted by:   marko@apache.org
Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D29109
2021-03-06 21:19:30 -09:00
Nathan Whitehorn
e77cf2a4ab Restore /boot/efi to mtree.
Instead of whether /boot/efi exists, which it now always does, including
on systems that don't and can't use EFI, use whether /boot/efi is
present in fstab to signal to the installer that it is a valid ESP and
should be configured. This has essentially the same semantics, but allows
/boot/efi to be created unconditionally.

Reviewed by:	bdragon, imp
Tested by:	bdragon (ppc64)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29068
2021-03-05 21:01:11 -05:00
Kyle Evans
466df976ba jail(8): reset to root cpuset before attaching to run commands
Recent changes have made it such that attaching to a jail will augment
the attaching process' cpu mask with the jail's cpuset. While this is
convenient for allowing the administrator to cpuset arbitrary programs
that will attach to a jail, this is decidedly not convenient for
executing long-running daemons during jail creation.

This change inserts a reset of the process cpuset to the root cpuset
between the fork and attach to execute a command. This allows commands
executed to have the widest mask possible, and the administrator can
cpuset(1) it back down inside the jail as needed.

With this applied, one should be able to change a jail's cpuset at
exec.poststart in addition to exec.created.  The former was made
difficult if jail(8) itself was running with a constrained set, as then
some processes may have been spawned inside the jail with a non-root
set.  The latter is the preferred option so that processes starting in
the jail are constrained appropriately up front.

Note that all system commands are still run with the process' initial
cpuset applied.

PR:		253724
MFC after:	3 days
Reviewed by:	jamie
Differential Revision:	https://reviews.freebsd.org/D29008
2021-03-04 13:28:53 -06:00
Oleksandr Tymoshenko
37cd6c20db cron: consume blanks in system crontabs before options
On system crontabs, multiple blanks are not being consumed after reading the
username. This change adds blank consumption before parsing any -[qn] options.
Without this change, an entry like:

  * * * * * username  -n true  # Two spaces between username and option.

will fail, as the shell will try to execute (' -n true'), while an entry like:

  * * * * * username -n true   # One space between username and option.

works as expected (executes 'true').

For user crontabs, this is not an issue as the preceding (day of week
or @shortcut) processing consumes any leading whitespace.

PR:		253699
Submitted by:	Eric A. Borisch <eborisch@gmail.com>
MFC after:	1 week
2021-03-03 23:23:31 -08:00
Andrew Gierth
55deb0a5f0 service(8): use an environment more consistent with init(8)
init(8) sets the "daemon" login class without specifying a pw
entry (so no substitutions are done on the variables). service(8)'s
use of env -L had the effect of specifying root's pw entry, with two
effects: getpwnam and getpwuid are being called, which may not be
entirely safe depending on what nsswitch is up to and what stage of
boot we are at, and substitutions would have been done.

Fix by teaching env(8) to allow -L -/classname to set the class
environment with no pw entry at all specified, and use it in
service(8).

PR:		253959
2021-03-03 12:25:11 -06:00
Chris Rees
2935869428 crontab.5: Correct claims on ranges and names
Ranges use the function get_number, which means that ranges of names
are supported and indeed always have been, righ back to the initial
import.

PR:		docs/253969
Reported by:	Ben Bullock <benkasminbullock@gmail.com>
2021-03-03 16:35:45 +00:00
Robert Wing
ce22a792de autounmountd: set filter-specific flags for the EVFILT_FS filter
Set the filter-specific flags VQ_MOUNT and VQ_UNMOUNT for the
EVFILT_FS filter.

The filter-specific flags for the EVFILT_FS filter are undocumented, but
their usage can be found by looking up vfs_event_signal().

Reviewed by:	trasz
Differential Revision:	https://reviews.freebsd.org/D28975
2021-03-02 14:18:40 -09:00
Kyle Evans
e4d63c5d5f Remove fmtree(8)
fmtree(8) deprecation was announced on February 12, 2021, and no longer
built by default as of that date.  The deprecation notice was merged
back to stable/12 and stable/13 + releng/13.0.

Continue with the plan by finishing the removal.

Relnotes:	yes
2021-03-02 15:22:05 -06:00
Mariusz Zaborski
05b267e232 service: respect nojailvnet keyword
In the 761d2bb5b9 we added nojailvnet
keyword. The nojailvnet keyword is used to skip startup scripts in
jails that are run without VNET.

The service.sh was omitted in this commit. The service.sh
even documents that this is the same code as in rc - so lets reflect
that.

Submitted by:	Adam Wołk <a.wolk@fudosecurity.com>
Sponsored by:	Fudo Security
2021-03-01 23:18:58 +01:00
Juraj Lutter
c7d27b225d newsyslog(8): Implement a new 'E' flag to not rotate empty log files
Based on an idea from dvl's coworker, László DANIELISZ, implement
a new flag, 'E', that prevents newsyslog(8) from rotating the empty
log files. This 'E' flag ist mostly usable in conjunction with 'B'
flag that instructs newsyslog(8) to not insert an informational
message into the log file after rotation, keeping it still empty.

Reviewed by:	markj, ian, manpages (rpokala)
Approved by:	markj, ian, manpages (rpokala)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28940
2021-02-28 23:32:19 +01:00
Robert Wing
d656ce199d bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME
MAX_SNAPSHOT_VMNAME is a macro used to set the size of a character
buffer that stores a filename or the path to a file - this file is used
by the save/restore feature.

Since the file doesn't have anything to do with a vm name, rename
MAX_SNAPSHOT_VMNAME to MAX_SNAPSHOT_FILENAME. Bump the size to PATH_MAX
while here.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D28879
2021-02-27 12:07:35 -09:00
Robert Wing
da9713917e bhyvectl: reduce code duplication
Combine send_start_checkpoint() and send_start_suspend() into a
single function named snapshot_request().

snapshot_request() is equivalent to send_start_checkpoint() and
send_start_suspend() except that it takes an additional argument. The
additional argument, enum ipc_opcode, is used to determine the type of
snapshot request being performed. Also, switch to using strlcpy instead
of strncpy.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D28878
2021-02-27 12:05:52 -09:00
Robert Wing
b7fd9c4e5e bhyve/snapshot: rename checkpoint_opcodes to be more generic
Generalize the naming here since the domain socket that uses these codes
might be used for purposes other than the save/restore feature.

- rename checkpoint_opcodes to ipc_opcode

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D28877
2021-02-27 12:03:03 -09:00
Daniel Ebdrup Jensen
bc3bba70d8 inetd: Add examples from manual page and other sources
The manual page lists a bunch of examples, some of which already exist
in this file. Since it's both easier to remember when all examples are
listed in the same location, move examples so they get installed into
/etc/inetd.conf

This also means users won't have to copy-paste, but can simply
uncomment one or more services to use them.

As such, it also becomes necessary to remove the examples from the
manual page, so instead add a note explaining where the previous
examples as well as others may be found.
Cross-references, including to ports, have also been added where
applicable.

The rsync example has lived in the bug tracker for too long,
considering how useful it can situationally be, for example when
backup jobs on client devices are run through periodic(8) weekly.

The microsoft-ds entry is necessary for Windows 10 compatibility
(this can be confirmed with packet capturing, as it is not readily
documented at time of writing).

While here, remove two examples for which compatible daemons could not
be found in ports.

Submitted by:	David Yeske <dyeske at gmail.com> (in part, prev ver)
PR:		122037
Reviewed by:	kevans, brueffer, lwhsu, yuripv
Differential Revision:	https://reviews.freebsd.org/D28882
2021-02-26 20:07:03 +01:00
Nathan Whitehorn
0b7472b3d8 Mount the EFI system partition (ESP) on newly-installed systems.
Per hier(7), the ESP will be mounted at /boot/efi. On UFS systems,
any existing ESP will be reused and mounted there; otherwise, a new one
will be made. On ZFS systems, space for an ESP is allocated on all disks
in the root pool, but only the partition actually used to boot is set up
and mounted.

This makes future upgrades of the EFI loader easier (upgrade scripts can
just change /boot/efi) and also greatly simplifies the parts of the
installer involved in initialization of the ESP. It also makes the
installer's behavior correspond to the documentation in hier(7).

Reviewed by:		imp, tsoome
MFC after:		1 week
Relnotes:		yes
Differential Revision:	https://reviews.freebsd.org/D28897
2021-02-23 16:24:21 -05:00
Robert Wing
5ce2d4a1c2 bhyve/snapshot: drop mkdir when creating the unix domain socket
Add /var/run/bhyve/ to BSD.var.dist so we don't have to call mkdir when
creating the unix domain socket for a given bhyve vm.

The path to the unix domain socket for a bhyve vm will now be
/var/run/bhyve/vmname instead of /var/run/bhyve/checkpoint/vmname

Move BHYVE_RUN_DIR from snapshot.c to snapshot.h so it can be shared
to bhyvectl(8).

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28783
2021-02-22 11:31:07 -09:00
Alex Richardson
ba2cfa80e1 Fix makefs bootstrap after d485c77f20
The makefs msdosfs code includes fs/msdosfs/denode.h which directly uses
struct buf from <sys/buf.h> rather than the makefs struct m_buf.
To work around this problem provide a local denode.h that includes
ffs/buf.h and defines buf as an alias for m_buf.

Reviewed By:	kib, emaste
Differential Revision: https://reviews.freebsd.org/D28835
2021-02-22 17:55:45 +00:00
Konstantin Belousov
d485c77f20 Remove #define _KERNEL hacks from libprocstat
Make sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable in
userspace, assuming that the consumer has an idea what it is for.
Unhide more material from sys/mount.h and sys/ufs/ufs/inode.h,
sys/ufs/ufs/ufsmount.h for consumption of userspace tools, with the
same caveat.

Remove unacceptable hack from usr.sbin/makefs which relied on sys/buf.h
being unusable in userspace, where it override struct buf with its own
definition.  Instead, provide struct m_buf and struct m_vnode and adapt
code to use local variants.

Reviewed by:	mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D28679
2021-02-21 11:38:21 +02:00
Ed Maste
020f411255 bsdinstall: add knob to set ASLR sysctls
Reviewed by:	mw
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28418
2021-02-20 11:55:00 -05:00
Ed Maste
fbc57e2df9 bsdinstall: replace multiple ifs with case
Reduce copy-paste and use a more typical construct.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28417
2021-02-20 11:54:31 -05:00
Navdeep Parhar
038148c108 cxgbetool(8): Add support for setting the hashfilter mode (filter mask).
Tighten up the validation of filter modes while here.  Unrecognized
keywords will be now be flagged as errors instead of being ignored.
2021-02-19 14:23:58 -08:00
Alexander V. Chernikov
f9e1cd6c99 Fix arp/ndp deletion broken by 2fe5a79425.
Changes in the 2fe5a79425 moved dst sockaddr masking from the
 routing control plane to the rtsock code.

It broke arp/ndp deletion.
It turns out, arp/ndp perform RTM_GET request first to get an
 interface index necessary for the deletion.
Then they simply stamp the reply with RTF_LLDATA and set the
 command to RTM_DELETE.
As a result, kernel receives request with non-empty RTA_NETMASK
 and clears RTA_DST host bits before passing the message to the
 lla code.

De facto, the only needed bits are RTA_DST, RTA_GATEWAY and the
 subset of rtm_flags.

With that in mind, fix the interace by clearing RTA_NETMASK
 for every messages with RTF_LLDATA.

While here, cleanup arp/ndp code a bit.

MFC after:	1 day
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D28804
2021-02-19 21:17:17 +00:00
Rick Macklem
b9cbc85d72 nfs-over-tls: add user space daemons rpc.tlsclntd and rpc.tlsservd
The kernel changes needed for nfs-over-tls have been committed to main.
However, nfs-over-tls requires user space daemons to handle the
TLS handshake and other non-application data TLS records.
There is one daemon (rpc.tlsclntd) for the client side and one daemon
(rpc.tlsservd) for the server side, although they share a fair amount
of code found in rpc.tlscommon.c and rpc.tlscommon.h.
They use a KTLS enabled OpenSSL to perform the actual work and, as such,
are only built when MK_OPENSSL_KTLS is set.
Communication with the kernel is done via upcall RPCs done on AF_LOCAL
sockets and the custom system call rpctls_syscall.

Reviewed by:	gbe (man pages only), jhb (usr.sbin/Makefile only)
Comments by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28430
Relnotes:	yes
2021-02-18 14:15:03 -08:00
Robert Wing
4f4065e0a2 libvmm: clean up vmmapi.h
struct checkpoint_op, enum checkpoint_opcodes, and
MAX_SNAPSHOT_VMNAME are not vmm specific, move them out of the vmmapi
header.

They are used for the save/restore functionality that bhyve(8)
provides and are better suited in usr.sbin/bhyve/snapshot.h

Since bhyvectl(8) requires these, the Makefile for bhyvectl has been
modified to include usr.sbin/bhyve/snapshot.h

Reviewed by:    kevans, grehan
Differential Revision:  https://reviews.freebsd.org/D28410
2021-02-17 17:46:42 -09:00
Robert Wing
63640b2f55 automount(8): fix absolute path when creating a mountpoint
When executing automount(8), it will attempt to create the directory where an
autofs filesystem is to be mounted. Explicity set the root path for this
directory to "/".

This fixes the issue where the directory being created was being treated as a
relative path instead of an absolute path (as expected).

PR:     224601
Reported by:    kusumi.tomohiro@gmail.com
Reviewed by:    trasz
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D27832
2021-02-17 01:02:56 -09:00
Kyle Evans
6fea22cebe fmtree: add a deprecation notice to the manpage
Note that this mtree(8) is actually installed as fmtree(8), while
mtree(8) is located in ^/contrib/mtree -- thus, the reference to
mtree(8) makes a lot more sense in the context in which folks would
actually notice it. Shout-out to Ravi for pointing out that this may
not be an obvious fact.

MFC after:	3 days
Reviewed by:	bdrewery, brooks, cy, emaste
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D28573
2021-02-12 23:15:58 -06:00
Kyle Evans
1253835121 inetd: fix unix sockaddr's length assignment
unsz was always exactly '1' here due to an unfortunate mispositioning
of closing parenthesis. While it's generally irrelevant because bind(2)
is passed the (accurate) sep->se_ctrladdr_size instead, it's not very
helpful for anything locally that wants to use it rather than assuming
that sep->se_ctrladdr_size perfectly fits the end of sun_path.

Just drop unsz entirely and use the result of SUN_LEN() for it.

MFC-after:	3 days
2021-02-12 13:36:38 -06:00
Kyle Evans
b2c4ca8d28 pkg(7): address minor nits (mostly clang-analyze complaints)
- One (1) spurious whitespace.
- One (1) occurrence of "random(3) bad, arc4random(3)" good.
- Three (3) writes that will never be seen.

The latter two points are complaints from clang-analyze. Switching to
arc4random(3) is decidedly a good idea because we weren't doing any kind
of PRNG seeding anyways. The discarded assignments are arguably good
for future-proofing, but it's better to improve the S/N ratio from
clang-analyze.

Reviewed by:	bapt, manu
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28525
2021-02-11 18:58:27 -06:00
Kyle Evans
18418e1936 pkg(7): add an -r reponame option for bootstrap and add
This is limited to bootstrap/add because some real pkg(8) commands
have -r flags with an incompatible meaning/usage, e.g., pkg-audit.
pkg(7) will still commence the search as it has, but it will ignore any
repo objects without the given name so that overrides and whatnot still
work as expected.

The use of it for add is noted in the manpage; notably, that the
signature config for that repository will be used over global config if
it's specified. i.e., pkg(7) should assume that the given pkg did come
from that repository and treat it appropriately.

Reviewed by:	bapt, manu
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28524
2021-02-11 18:58:26 -06:00
Warner Losh
7fe2f504f8 efibootmgr: Check for efi supported after parsing args
Move the check for efi variables being supported to after parsing the args. This
allows '-h' to produce both as a normal user as well as on all systems.
2021-02-11 16:09:51 -07:00
Alex Richardson
12ad8bdb34 usr.sbin/makefs: fix use-after-free in read_mtree_keywords()
The st variable is used as a shortcut for &node->inode->st, but in one
branch just before the exit we update node->inode without changing st.

Reported by:	AddressSanitizer
Reviewed By:	emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D28570
2021-02-10 15:24:25 +00:00
Cy Schubert
f44e67d120 MFV d60fa10fd8:
Update unbound 1.13.0 --> 1.13.1.

Includes numerous bugfixes documented at:
https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1

MFC after:	1 month
2021-02-09 20:27:25 -08:00
Mark Johnston
c7fcb36f56 binmiscctl: Avoid segfault with "binmiscctl add" and no extra params
MFC after:	1 week
2021-02-08 09:20:38 -05:00
Alexander Motin
92d0d6bb14 Print DeviceHandle and PhysicalId in hex.
The first is actually a bitfield.  The second is printed in hex by
dmidecode, so uniformidy should be good.

MFC after:	1 week
2021-02-05 16:15:53 -05:00
Alexander Motin
35e39fd95f Improve ACPI_NFIT_CONTROL_REGION formatting.
MFC after:	1 week
2021-02-05 10:08:34 -05:00
Konstantin Belousov
856789c123 cpucontrol(8): Fix display.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2021-02-05 03:22:26 +02:00
Alex Richardson
72692dfdfe usr.bin/jail: Fix tests when using kyua -v parallelism=N
These tests create jails with the same name, so they cannot be run in
parallel.

Reviewed By:	lwhsu
Differential Revision: https://reviews.freebsd.org/D28482
2021-02-04 17:56:55 +00:00
Alex Richardson
7791ecf04b usr.sbin/praudit: Fix tests after 5619d49e07
Commit 5619d49e07 made the getgrgid() call inside bsm work as
intended so we now print "wheel" instead of a numeric 0 in the rgid field.

Reviewed By:	markj
Differential Revision: https://reviews.freebsd.org/D28462
2021-02-03 16:02:46 +00:00
John Baldwin
bcaa6aa153 config: Fix typo in comment. 2021-02-01 13:13:36 -08:00
Xin LI
07d218f70c Now that the portsnap buildbox is generating the raw bits for INDEX-14,
add it to the set of INDEX files built by portsnap.

Switch to INDEX-14 for main.
2021-01-28 23:26:14 -08:00
Alex Richardson
9a0a48b12d usr.sbin/pkg: Don't re-define roundup2
The file already includes sys/param.h and should use that definition.
I found this while testing D28332.

Reviewed By:	bapt
Differential Revision: https://reviews.freebsd.org/D28331
2021-01-28 17:25:53 +00:00
Mitchell Horne
7b08a307e8 bsdinstall: riscv-specific tweaks
Make the installer more useful, by allowing it to create a bootable
installation. Also, enable the menu option for ZFS-on-root.

Like arm64, RISC-V boots by UEFI only, so arm64's partedit
implementation is renamed and shared among the two platforms.

Reviewed by:	gjb
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D28180
2021-01-27 19:29:42 -04:00
Mitchell Horne
676b7d077c bsdinstall: create /efi/boot directory in ESP
If the installer is creating a new ESP, then this directory will not
exist and the subsequent cp will fail silently. This is usually of no
consequence if /efi/freebsd/loader.efi is set up correctly.

Reviewed by:	imp
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D28176
2021-01-27 19:27:51 -04:00
Brooks Davis
bfc99943b0 ndis(4): remove as previous announced
nids(4) was a clever idea in the early 2000's when the market was
flooded with 10/100 NICs with Windows-only drivers, but that hasn't been
the case for ages and the driver has had no meaningful maintenance in
ages. It only supports Windows-XP era drivers.

Also remove:
 - ndis support from wpa_supplicant
 - ndiscvt(8)

Reviewed By:	emaste, bcr (manpages)
Differential Revision:	https://reviews.freebsd.org/D27609
2021-01-25 21:45:03 +00:00
Alexander Motin
1b109c69ed Decode NFIT Platform Capabilities.
MFC after:	1 week
2021-01-25 16:08:06 -05:00
Ed Maste
25611bc0ab cxgbetool: correct utilties typo 2021-01-24 10:21:53 -05:00
Kyle Evans
123ae3045d build: remove LIBPTHREAD/LIBTHR build options
WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR:		252760
Reviewed by:	brooks, emaste, kib
Differential Revision:	https://reviews.freebsd.org/D28263
2021-01-22 12:33:27 -06:00
Allan Jude
e6d795d154 Fix manpage markup in 2c8bb126de 2021-01-21 20:32:15 +00:00
Allan Jude
2c8bb126de bhyve: Add missing man page section on the nodelete block-device-option
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D28272
2021-01-21 20:30:55 +00:00
Alex Richardson
db4b5a16a3 Minor simplification of MK_PMC case in usr.sbin/Makefile
MK_PMC is already guarded by MK_CXX in src.opts.mk, so we can actually
merge it with the following SUBDIR statement after c1a3d7f206.

Suggested By:	jrtc27
2021-01-20 09:52:58 +00:00
Alex Richardson
c1a3d7f206 Remove remaining uses of ${COMPILER_FEATURES:Mc++11}
All supported compilers have C++11 support so these checks can be replaced
with MK_CXX guards.
See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252759

PR:		252759
Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D28234
2021-01-19 21:37:36 +00:00
Peter Grehan
eed1cc6cdf Support COM3 and COM4 serial ports.
Submitted by: Jan Poctavek <janci@binaryparadise.com>, otis
Reviewed by: grehan (bhyve), imp, 0mp (manpages)
Differential Revision: https://reviews.freebsd.org/D28207
2021-01-20 03:30:22 +10:00
Conrad Meyer
ddf6115613 fstyp(8): fix exfat detection
In the presence of high-level errors (spec violations, bad boot blocks
checksum), report non-detection instead of detection.

PR:	252787 (related, but does not fully address)
2021-01-17 11:55:06 -08:00
Daniel Ebdrup Jensen
bce5d6aa24 service.8: Use entire section of literally displayed text
.Dl indents literal display text for one line, but .Bd can do it for a
whole subsection.

Pointy hat to:	debdrup
Reported by:	0mp
Reviewed by:	0mp
Differential Revision:	https://reviews.freebsd.org/D28198
2021-01-16 23:21:05 +01:00
Daniel Ebdrup Jensen
c6a112cf84 service.8: Provide example for adding completions to (t)csh
service(8) has an example for bash completion, however bash is third
party and in /usr/share/examples/csh/dot.cshrc is a working example for
csh.

Since I use (t)csh, I've tested it, and it works for me.

PR:		179497
Submitted by:	ohauer@

Reviewed by:	kp (tentatively)
Differential Revision:	https://reviews.freebsd.org/D28197
2021-01-16 22:05:29 +01:00
Mateusz Piotrowski
54c743e5b2 Fix a typo
"and" is not a flag.

MFC after:	3 days
2021-01-14 19:12:55 +01:00
Adrian Chadd
7c5a624afa [wpa] Add support for hostapd/wpa_supplicant when WITHOUT_CRYPT=YES
is enabled.

This builds wpa_supplicant / hostpad using internal encryption routines
rather than using libcrypt.

This has been supported in wpa for years now, however since we use
local makefiles for this, we bitrotted dependencies and configuration
options.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D27958
2021-01-12 16:43:19 -08:00
Ed Maste
a5584ace96 bsdconfig: correct utilties typo 2021-01-11 19:57:23 -05:00
Alexander V. Chernikov
0da3f8c98d Bump amount of queued packets in for unresolved ARP/NDP entries to 16.
Currently default behaviour is to keep only 1 packet per unresolved entry.
Ability to queue more than one packet was added 10 years ago, in r215207,
 though the default value was kep intact.

Things have changed since that time. Systems tend to initiate multiple
 connections at once for a variety of reasons.
For example, recent kern/252278 bug report describe happy-eyeball DNS
 behaviour sending multiple requests to the DNS server.

The primary driver for upper value for the queue length determination is
 memory consumption. Remote actors should not be able to easily exhaust
 local memory by sending packets to unresolved arp/ND entries.

For now, bump value to 16 packets, to match Darwin implementation.

The proper approach would be to switch the limit to calculate memory
 consumption instead of packet count and limit based on memory.

We should MFC this with a variation of D22447.

Reviewers: #manpages, #network, bz, emaste

Reviewed By: emaste, gbe(doc), jilles(doc)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D28068
2021-01-11 19:51:11 +00:00
Kyle Evans
8c4094f38c certctl: factor out certname resolution
create_blacklisted() will identify a cert whether it's provided a path to
a cert or the hash.serial format that is shown by `certctl list`.

Factor this logic out into a resolve_certname() so that it may be reused
elsewhere.
2021-01-08 22:36:22 -06:00
Kyle Evans
b799d38a2a certctl: replace hardcoded uses of /usr/local
Use the new user.localbase sysctl here as well, to reduce the number of
hardcoded localbase by one (1).

MFC after:	3 days (note: just use a literal /usr/local default)
2021-01-08 22:06:42 -06:00
Warner Losh
23e124c78b pccard: Remove bt3c(4) driver
pccard is being removed, so remove bt3c driver since it only has PC
Card attachment. Also remove bt3cfw(8) since it's the firmware for this
driver.

Relnotes: Yes
2021-01-07 20:40:41 -07:00
Mateusz Piotrowski
0199cbf641 Fix a typo
MFC after:	3 days
2021-01-07 15:28:29 +01:00
Alex Richardson
7fa2f2a62f Rename NO_WERROR -> MK_WERROR=no
As suggested in D27598. This also supports MK_WERROR.clang=no and
MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D27601
2021-01-07 09:31:03 +00:00
Alex Richardson
fe41c64b57 Fix -Wpointer-sign warnings in makefs and mkimg
Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D27175
2021-01-07 09:26:21 +00:00
Fernando Apesteguía
439862883f gstat(8): Bump .Dd
Forgotten in cfaa2958dc

PR: 251313
Differential Revision: https://reviews.freebsd.org/D27815
2021-01-06 19:04:09 +01:00
Fernando Apesteguía
cfaa2958dc gstat(8): Document interactive keyboard commands
gstat(8) allows for <, >, c, f, F and q while in interactive mode.

PR:	251313
Submitted by:	bojan_petrovic@fastmail.fm
Approved by:	manpages (0mp@)
Differential Revision:	https://reviews.freebsd.org/D27815
2021-01-06 18:55:03 +01:00
Baptiste Daroussin
ae994fdc5b pkg(7): rework the arguments handling
Rework the arguments handling around using getopt_long:
* add long option support
* add -4 and -6 support to enforce ipv4 or ipv6

While here fix a regression which occured between FreeBSD 12.1 and
FreeBSD 12.2 where pkg bootstrap -y stopped working

PR:		252270
MFC after:	2 weeks
Submitted by:	evilham <contact@evilham.com>
Differential Revision:	https://reviews.freebsd.org/D27860
2021-01-06 11:47:34 +01:00
Alexander Motin
4d86ab429e Fix devinfo typo.
Submitted by:	Nick Wolff <darkfiberiru@gmail.com>
MFC after: 	1 week
Differential Revision:	https://reviews.freebsd.org/D27981
2021-01-05 14:56:23 -05:00
Andrew Turner
9fd96b416c Add the missing pmcstat log entries
Sponsored by:	Innovate UK
2021-01-05 10:03:05 +00:00
Emmanuel Vadot
a22cde7c02 pkgbase: Put ppp in it's own package
ppp uses libalias modules which now belong in the natd package.
Avoid bringing a dependancy on natd for the utilities package.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D27711
2021-01-04 16:19:36 +01:00
Mariusz Zaborski
845b273728 bhyve: fix build without casper/capsicum support
Fix typo introduced in 966026246e.

Pointed out by:	jbeich
2021-01-03 18:17:04 +01:00
Mariusz Zaborski
966026246e bhyve: fix build without casper/capsicum support
PR:		252353
2021-01-03 17:21:28 +01:00
Yoshihiro Takahashi
8c45fe5d8e bootparamd: Add missing __unused mark.
e03764d931 did not catch all unused
variables.

Submitted by:		otis
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D27894
2021-01-03 00:40:34 +09:00
Yoshihiro Takahashi
e03764d931 bootparamd: Fix several warnings and increase warn level to 6.
- Increase WARNS to 6.
- Except -Wcast-align and -Wincompatible-pointer-types-discards-qualifiers
  checks.
- Use ANSI C prototype.
- Statically variables and functions.
- Add extern declaration for global variables.
- Rename local variables to resolve shadow warnings.

PR:		71667
MFC after:	2 weeks
2021-01-02 12:36:09 +09:00
Xin LI
bfe90bb336 usr.sbin/rtadvctl: Remove support for FreeBSD 9.x. 2021-01-01 16:06:08 -08:00
Pedro F. Giffuni
978b10d8ef services: reinstate CouchDB and bring amqps
CouchDB was mistakenly removed in r368712
amqps is used by net/rabbitmp

Both are registered in IANA

Reported by:	dch
Differential Revision:	https://reviews.freebsd.org/D27691
2020-12-31 20:49:03 -05:00
Pedro F. Giffuni
302c387cd6 services: fiz bug introduced in r361898
Reported by:	deischen@
2020-12-31 19:38:29 -05:00
Adrian Chadd
697684325d [vale] Fix valectl to compile on a 32-bit platform
This shows up when compiling valectl on a 32 bit platform like i386 and mips32.
gcc-6.4 complains about this (-Wint-to-pointer-cast).

Reviewed by: vmaffione
Differential Revision: https://reviews.freebsd.org/D27814
2020-12-30 10:40:43 -08:00
Alexander Motin
bdbc2a6fc2 Fix typo in an_initator_name.
MFC after:	1 week
2020-12-30 13:05:41 -05:00
Xin LI
2edcc10cb1 Update leap-seconds to leap-seconds.3676924800.
Obtained from:	ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800
MFC after:	3 days
2020-12-29 22:01:46 -08:00
Alexander Motin
a3434cdc6b Fix typo in ap_initator_portal.
MFC after:	1 week
2020-12-29 13:32:05 -05:00
Edward Tomasz Napierala
a7972b4904 iscsid(8): fix memory leak by freeing the 'addr'
Reviewed By:	mav
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27328
2020-12-29 14:53:06 +00:00
Edward Tomasz Napierala
7db3d97e0f iscsid(8): free data allocated by getaddrinfo(3)
Reviewed By:	mav
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27329
2020-12-29 14:52:23 +00:00
Ed Maste
93900fc697 Fix daily_backup_gpart_exclude in periodic daily 221.backup-gpart
Since gpart_devs was not quoted (losing embedded newlines), if
daily_backup_gpart_exclude matched something, gpart_devs was empty.

PR:		251961
Submitted by:	Kan Sasaki
MFC after:	1 week
2020-12-26 19:27:12 -05:00
Xin LI
760dbe84ab Don't set more_data which is never used.
MFC after:	2 weeks
2020-12-24 18:49:12 -08:00
Robert Wing
c4df8cbfde Remove bvmconsole and bvmdebug.
Now that bhyve(8) supports UART, bvmconsole and bvmdebug are no longer needed.

This also removes the '-b' and '-g' flag from bhyve(8). These two flags were
marked deprecated in r368519.

Reviewed by:    grehan, kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D27490
2020-12-23 17:15:23 -09:00
Gordon Bergling
a652079615 trim(8): Fix a few issues reported by mandoc
- new sentence, new line
- unusual Xr order: ioctl(2) after da(4)
- unusual Xr order: sysexits(3) after nda(4)

MFC after:	1 week
2020-12-19 13:56:19 +00:00
Gordon Bergling
8ef235787b zonectl(8): Fix a few issues reported by mandoc
- Add missing quotation mark for a comment above the .Dd
- inserting missing end of block: Sh breaks Bd
- skipping paragraph macro: Pp before Bl
- skipping paragraph macro: Pp before Bd
- empty block: Bd

MFC after:	1 week
2020-12-19 13:51:46 +00:00
Gordon Bergling
749ddf491b nfsv4(4): Fix a few issues reported by mandoc
- new sentence, new line
- function name without markup: rtalloc()
- function name without markup: VOP_RECLAIM()

MFC after:	1 week
2020-12-19 13:45:39 +00:00
Gordon Bergling
60ee05db4b bluetooth: Fix a mandoc related issues
- new sentence, new line
- sections out of conventional order: Sh FILES
- unusual Xr order: bthost(1) after bthidd(8)
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order: Sh EXIT STATUS

MFC after:	1 week
2020-12-19 13:36:59 +00:00
Gordon Bergling
84572415b4 mpsutil(8): Remove trailing whitespace
MFC after:	1 week
2020-12-19 13:23:26 +00:00
Gordon Bergling
1c77a78367 bhyvectl(8): Normalize the man page date
MFC after:	1 week
2020-12-19 13:21:40 +00:00
Gordon Bergling
cc984b0a5a camdd(8): Fix the man page date
The comment before the .Dd macro was missing a quotation mark, so that
the date of the man page was always today.

MFC after:	3 days
2020-12-19 13:17:25 +00:00
Gordon Bergling
aeb0c721f5 config: Fix a few mandoc related errors
- new sentence, new line
- no blank before trailing delimiter

MFC after:	1 week
2020-12-19 13:11:44 +00:00
Gordon Bergling
267d86e15d devctl(8): Correct "sections out of conventional order" error
MFC after:	1 week
2020-12-19 13:05:54 +00:00
Konstantin Belousov
1557543669 Remove redundand redefinion, fixing build.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-12-19 01:46:47 +00:00
Peter Grehan
2bb4be0f86 Fix issues with various VNC clients.
- support VNC version 3.3 (macos "Screen Sharing" builtin client)
- wait until client has requested an update prior to sending framebuffer data
- don't send an update if no framebuffer updates detected
- increase framebuffer poll frequency to 30Hz, and double that when
  kbd/mouse input detected
- zero uninitialized array elements in rfb_send_server_init_msg()
- fix overly large allocation in rfb_init()
- use atomics for flags shared between input and output threads
- use #defines for constants

 This work was contributed by Marko Kiiskila, with reuse of some earlier
work by Henrik Gulbrandsen.

Clients tested :
FreeBSD-current
 - tightvnc
 - tigervnc
 - krdc
 - vinagre

Linux (Ubuntu)
 - krdc
 - vinagre
 - tigervnc
 - xtightvncviewer
 - remmina

MacOS
 - VNC Viewer
 - TigerVNC
 - Screen Sharing (builtin client)

Windows 10
 - Tiger VNC
 - VNC Viewer (cursor lag)
 - UltraVNC (cursor lag)

o/s independent
 - noVNC (browser) using websockify relay

PR: 250795
Submitted by:	Marko Kiiskila <marko@apache.org>
Reviewed by:	jhb (bhyve)
MFC after:	3 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D27605
2020-12-18 00:38:48 +00:00
Cy Schubert
0ebcbcc0ef Update the unbound version number from r368478.
Updating the version number is an extra manual step.

Pointy hat to:	cy
Reported by:	Herbert J. Skuhra <herbert _ gojira.at>
MFC after:	3 days
2020-12-17 19:50:41 +00:00
Aleksandr Fedorov
ea57b2d7a8 [bhyve] virtio-net: Do not allow receiving packets until features have been negotiated.
Enforce the requirement that the RX callback cannot be called after a reset until the features have been negotiated.
This fixes a race condition where the receive callback is called during a device reset.

Reviewed by:	vmaffione, grehan
Approved by:	vmaffione (mentor)
Sponsored by:	vstack.com
Differential Revision:	https://reviews.freebsd.org/D27381
2020-12-17 16:52:40 +00:00
Mitchell Horne
10720ae4db bsdinstall: remove VTOC8 partition scheme option
Now that sparc64 has been removed, there are no kernels built with
support for the VTOC8 partitioning scheme by default. Remove the option
from the installer, as it is unsupported on all installer images
produced by re@.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D27641
2020-12-17 15:00:19 +00:00