Commit Graph

19697 Commits

Author SHA1 Message Date
Gordon Bergling
10924c4fc3 ac(8): Fix a typo in a source code comment
- s/chosing/choosing/

MFC after:	3 days
2022-06-04 12:41:20 +02:00
Gordon Bergling
df4da2d6b7 fstype(8): Fix two typos in source code comments
- s/auxillary/auxiliary/

MFC after:	3 days
2022-06-04 10:38:48 +02:00
Doug Rabson
5e9c888a7a pkgbase: Move pw to the runtime package
This allows building a container image with enough functionality for
downloading and installing packages without having to include the
utilities package.

Reviewed by: manu
MFC after:   2 weeks
2022-05-30 15:23:00 +01:00
Corvin Köhne
8284799a23 bhyve: use bhyve_config for SMBIOS strings
Some software uses SMBIOS entries to identify the system on which it's
running. In order to make it possible to use such software inside a VM,
SMBIOS entries should be configurable. Therefore, bhyve_config can be
used. While only a few SMBIOS entries might be of interest, it makes
sense that all SMBIOS entries are configurable. This way all SMBIOS
tables are build the same way and there's no special handling for some
tables.

Reviewed by:	jhb
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34465
2022-05-30 10:03:43 +02:00
Alan Somers
77d678b7a4 Fix a memory leak from caf73e5857
Don't shadow an already-local variable with another local declaration.

Reported by:	dteske
MFC after:	13 days
MFC with:	caf73e5857
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D35331
2022-05-28 13:17:37 -06:00
Alan Somers
caf73e5857 bsdinstall: fix prepopulating the ZFS disk menu with ZFSBOOT_DISKS
If the ZFSBOOT_DISKS variable is set to one or more disk names, then
those disks should be preselected in the disk menu.  However, the code
wasn't correctly setting the variable, leaving all disks unselected.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	dteske
Differential Revision: https://reviews.freebsd.org/D35331
2022-05-27 09:09:33 -06:00
John Baldwin
f8287caae4 etcupdate: Preserve permissions when installing a resolved file.
Similar to the change in 1a04446f08, use
cat to overwrite the contents of the existing file rather than cp so
that metadata of the existing file such as permissions and ownership
is preserved.

PR:		255514
Reported by:	uqs
MFC after:	1 week
2022-05-25 14:20:40 -07:00
John Baldwin
431944fb5f etcupdate: Don't rotate trees for a dry run.
When performing a dry run, remove the temporary tree created rather
than rotating the trees.  Rotating the trees meant that etcupdate
thought the latest changes were already merged and would not merge
them on the next real run.

PR:		260281
Reported by:	Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
Fixes:		0611aec3cf etcupdate: Always extract to a temporary tree.
MFC after:	1 week
2022-05-25 14:02:51 -07:00
Alan Somers
7919c76dbd bsdinstall: use gpt/efiboot0 label in /etc/fstab
Otherwise, boot will hang if the numbering of disks has changed since
initial install.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	brd
Differential Revision: https://reviews.freebsd.org/D35309
2022-05-24 13:17:10 -06:00
Brad Davis
cc42ef5328 bsdinstall: allow whitelabeling the scripts
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35197
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:49:06 -06:00
Brad Davis
33005c89c6 bsdinstall: break list of scripts out to one per line to make adding/removing entries easier
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35249
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:30:31 -06:00
Alfonso S. Siciliano
6368dcb292
bsdinstall hostname: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.
Add --hline info because bsddialog requires TAB to switch the focus on
buttons for an inputbox, dialog differs.
Delete f_dialog_inputbox_size() using libbsddialog autosizing.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35285
2022-05-24 14:20:22 +02:00
Rick Macklem
b387a075d9 rpc.tlsclntd: Add the -2 option to the usage line
Commit 72bf76d6b8 added the -2 option to use
TLS 1.2 NFS-over-TLS mounts.  It did not add -2
to the usage message.

This patch adds -2 to the usage message.

MFC after:	2 weeks
2022-05-22 14:41:20 -07:00
Rick Macklem
b4fa7fde15 rpc.tlsservd: Add the -2 option to the usage line
Commit 0637b12b13 added the -2 option to allow
TLS 1.2 NFS-over-TLS mounts.  It did not add -2
to the usage message.

This patch adds -2 to the usage message.

MFC after:	2 weeks
2022-05-22 14:36:20 -07:00
Rick Macklem
915fc1afe5 rpc.tlsclntd: Add the -2 option to the man page
Since the KTLS now supports TLS1.3, the daemons default
to version 1.3, since the draft (to be an RFC someday)
requires TLS1.3.

However, since FreeBSD 13,0, 13,1 uses TLS1.2 for
NFS-over-TLS, the "-2" option is added to both daemons
for compatibility with FreeBSD 13.0, 13.1.

This patch updates the man pages for this.

This is a content change.

Reviewed by:	pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35290
2022-05-22 14:20:14 -07:00
Rick Macklem
e2c72fecfc rpc.tlsservd: Add the -2 option to the man page
Since the KTLS now supports TLS1.3, the daemons default
to version 1.3, since the draft (to be an RFC someday)
requires TLS1.3.

However, since FreeBSD 13,0, 13,1 uses TLS1.2 for
NFS-over-TLS, the "-2" option is added to both daemons
for compatibility with FreeBSD 13.0, 13.1.

This patch updates the man pages for this.

This is a content change.

Reviewed by:	pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35290
2022-05-22 14:17:06 -07:00
Rick Macklem
0bf3f379e1 rpc.tlsclntd: Update the man page for the -C option
Commit f5b40aa0de modifies the -C command line option
for rpc.tlsclntd to use the TLS 1.3 SSL_CTX_set_ciphersuites().

This patch updates the man page for this modified command
line option.

This is a content change.

Reviewed by:	jhb, pauamma_gundo.com (same change for rpc.tlsservd.8)
MFC after:	2 weeks
2022-05-22 13:58:59 -07:00
Rick Macklem
f5b40aa0de rpc.tlsclntd: Modify the -C option to use SSL_CTX_set_ciphersuites
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
This patch replaces SSL_CTX_set_cipher_list() with
SSL_CTX_set_ciphersuites(), since that is the function
that is used for TLS1.3.

The man page will be updated in a separate commit.

MFC after: 	2 weeks
2022-05-22 13:49:08 -07:00
Rick Macklem
8d098deda3 rpc.tlsservd: Modify the -C option to use SSL_CTX_set_ciphersuites
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
This patch replaces SSL_CTX_set_cipher_list() with
SSL_CTX_set_ciphersuites(), since that is the function
that is used for TLS1.3.

The man page has already been updated.

MFC after: 	2 weeks
2022-05-22 13:44:31 -07:00
Rick Macklem
d94358e29d rpc.tlsservd: Update the man page for the -C option
Commit 712aac1389 adds a new -C command line option
to rpc.tlsservd.

This patch updates the man page for this new command
line option.

This is a content change.

Reviewed by:	jhb, pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35136
2022-05-21 15:44:29 -07:00
Alfonso S. Siciliano
58c63d5e37
bsdinstall netconfig_ipv6: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35270
2022-05-21 18:04:28 +02:00
Alfonso S. Siciliano
90943fbfeb
bsdinstall netconfig_ipv4: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35267
2022-05-21 17:40:34 +02:00
Alfonso S. Siciliano
4effc38819
bsdinstall jail: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35274
2022-05-21 17:14:03 +02:00
Alfonso S. Siciliano
8cfbeb56aa
bsdinstall services: Improve mouse configuration
bsdinstall(8) has an option to enable moused support.
However, if it is not selected, moused is still started
through the configuration of nondefault devices.
So, automatically add the moused_nondefault_enable="NO"
setting to rc.conf unless moused support is selected.

PR:			227999
Reported by:		bcran
Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35193
2022-05-21 16:42:23 +02:00
Rick Macklem
72bf76d6b8 rpc.tlsclntd: Add an option to force use of TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that NFS-over-TLS mounts to 13.0, 13.1
servers will still work.

Without the command line option, NFS-over-TLS mounts
will use TLS version 1.3.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:57:42 -07:00
Rick Macklem
0637b12b13 rpc.tlsservd: Add an option to allow TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that mounts from 13.0, 13.1 will still work.

Without the command line option, only TLS version 1.3
mounts are permitted.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:47:36 -07:00
Mark Johnston
21add93b58 makefs: Remove execute permission from in-tree test scripts
Let the build system set it as needed.  No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-05-19 11:46:02 -04:00
Gleb Popov
7eb6a92e3f jexec man: Explain how PATH is adjusted.
Add a sentence that explains that PATH is set to `/bin:/usr/bin`.
I had to dive into `jexec.c` to find this out.

Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D35251
2022-05-19 16:58:32 +03:00
Andrew Turner
190abf86bb Fix the name of Makefile.aarch64
Makefile.arm64 relies on being included via Makefile.${MACHINE}. This
only works when arm64 is the only aarch64 architecture. Switch to
Makefile.aarch64 so downstream CheriBSD can use the file when building
for Morello which uses a differen ${MACHINE} value.

Sponsored by:	Innovate UK
2022-05-19 11:30:21 +01:00
Ed Maste
ec3c01ae72 makefs: sort cd9660 sysid entries in man page
"efi" was added at the end of the sysid list rather than in alpha
order.  Move it as a diff reduction against NetBSD.
2022-05-18 15:42:12 -04:00
Alan Somers
ecdc04d006 makefs: fix calculation of file sizes
When a new FS image is created we need to calculate how much space each
file is going to consume.
Fix two bugs in that logic:

1) Count the space needed for indirect blocks for large files.
1) Normally the trailing data of a file is written to a block of frag
   size, 4 kB by default.

However for files that use indirect blocks a full block is allocated,
32kB by default.  Take that into account.

Adjust size calculations to match what is done in ffs_mkfs routine:

* Depending on the UFS version the superblock is stored at a different
  offset. Take that into account.
* Add the cylinder group block size.
* All of the above has to be aligned to the block size.

Finally, Remove "ncg" variable. It's always 1 and it was used to
multiply stuff.

PR:		229929
Reviewed by:	mckusick
MFC after:	2 weeks
Sponsored by:	Semihalf
Submitted by:	Kornel Dulęba <mindal@semihalf.com>
Differential Revision:	https://reviews.freebsd.org/D35131
Differential Revision:	https://reviews.freebsd.org/D35132
2022-05-16 16:32:10 -06:00
Brad Davis
147585b489 bsdinstall: allow whitelabeling the installer
Override OSNAME to change the name of the OS in the installer.

This is a first step, the shell changes will be separate.

Reviewed by:		allanjude
Approved by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D34878
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-13 10:35:43 -06:00
Brad Davis
2c4499dcd7 bsdinstall: add missing init of fd variable
Missed breaking this commit into smaller pieces

Approved by:		kp
2022-05-13 09:06:02 -06:00
Brad Davis
964ad27f1e bsdinstall: Filter out devices that cannot be opened
Devices that cannot be opened are most likely the install media and
should not be listed as destinations.

Reviewed by:		allanjude
Approved by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D34879
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-13 08:33:21 -06:00
Mark Johnston
cc1a53bc1a makefs: Fix warnings and reset WARNS to the default
Leave -Wcast-align disabled, at least for now, since there are numerous
instances of that warning in places where buffer pointers are cast to
pointers to various filesystem structures.  Fixing this properly would
be too much work for too little gain.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-05-10 17:38:23 -04:00
Alexander Motin
bce02a0ea4 mpsutil: Fix device speed reporting.
Report controller SAS phy speed only for directly attached devices.
For others try to read and report parent expander phy speed.

MFC after:	1 week
2022-05-09 18:03:24 -04:00
Alexander Motin
53c184cf06 mpsutil: fix set but not used warning
MFC after:	1 week
2022-05-09 18:03:24 -04:00
Rick Macklem
d71c9f1468 rpc.tlsservd: Add logging of TLS version and cipher used
This patch adds logging of the version of TLS and cipher
negotiated successfully by the TLS handshake for each client,
if the "-v" command line option has been specified.

This information may be useful for monitoring and debugging
NFS-over-TLS mounts.

MFC after:	2 weeks
2022-05-06 14:03:43 -07:00
Yan Ka Chiu
3cdfaefa4b bhyve: Fix virtio-console legacy configuration parsing
virtio-console is currently missing .pe_legacy_config, which prevents any
portN configuration from being parsed, and therefore no sockets will be
created.

Reviewed by:	khng
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35142
2022-05-06 15:34:17 -04:00
Rick Macklem
15881823b9 rpc.tlsclntd, rpc.tlsservd: Fix getopt_long argument
The "C" option in the argument to getopt_long() was
missing a ":" for both rpc.tlsclntd.c and rpc.tlsservd.c.
This patch fixes this.

MFC after:	2 weeks
2022-05-05 16:22:12 -07:00
Rick Macklem
712aac1389 rpc.tlsservd: Add a -C command line option for preferred_ciphers
rpc.tlsclntd has a -C command line option for setting
preferred_ciphers.  Testing at a recent IETF NFSv4 testing
event showed that setting preferred_ciphers is not normally
needed for the rpc.tlsservd.

This patch modifies rpc.tlsservd to not specify preferred_ciphers
by default, but provides the same -C option as rpc.tlsclntd to
set preferred_ciphers, in case it is needed.

The man page update will be done as a separate commit.

MFC after:	2 weeks
2022-05-05 15:54:14 -07:00
Corvin Köhne
450b4ac23c bsdinstall/script: umount before zpool export
When running zpool export first, boot/efi and dev is still mounted so
zpool export fails. By running bsdinstall umount first the pool can be
cleanly exported.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D35114
Sponsored by:		Beckhoff Automation GmbH & Co. KG
MFC After:		3 days
2022-05-03 16:02:39 +02:00
Corvin Köhne
1f7746d81f bsdinstall: stop messing with file descriptors
Throughout the bsdinstall script fd 3 is used by f_dprintf (set through
$TERMINAL_STDOUT_PASSTHRU). By closing file descriptor 3 here, the
final f_dprintf "Installation Completed ... does not work anymore.

By putting the code into a subshell, file descriptors can be edited
without interference with the calling script.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D35113
Sponsored by:		Beckhoff Automation GmbH & Co. KG
MFC after:		3 days
2022-05-03 16:02:27 +02:00
Ed Maste
6cd1bc5316 freebsd-update: restart sshd after upgrade
Sometimes the parent-child sshd protocol changes during an upgrade, and
when this happens sshd will not accept new connections until it is
restarted.

PR:		263489
Reviewed by:	kevans, gjb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35109
2022-05-02 14:38:19 -04:00
Alfonso S. Siciliano
1ad9134e11
bsdinstall netconfig_ipv4: Fix resolv.conf rebuild
After an installation restart (for error or choice) dhclient does not
rebuild resolv.conf so `dialog --mixedform' of "Resolver Configuration"
in bsdinstall/scripts/netconfig draws empty forms. It causes a bad UX,
to see PR262262. Fixed resetting the interface before to run dhclient.

PR:			262262
Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35094
2022-04-30 17:34:53 +02:00
Alfonso S. Siciliano
9b4c606b96
bsdinstall/partedit: Fix UFS auto partitioning
Fix bsdinstall "Auto (UFS) Guided Disk Setup" and sade(8) "Auto".
The problem is a string comparison failure, it arose during the
dialog(3)/bsddialog(3) form conversion:

 * dialog uses only form.text while bsdialog differentiates between
   form.init and form.value.
 * dialog always allocates memory for form values while bsddialog only
   when a button is pressed.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35033
2022-04-30 01:24:23 +02:00
Robert Wing
690b7ea081 bhyve/snapshot: ..back to SOCK_STREAM
Now that nvlist_send()/nvlist_recv() are being used, ditch the datagram
socket.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D34863
2022-04-28 07:43:01 -08:00
Rick Macklem
350668eb09 rpc.tlsservd: Delete set but unused variable 2022-04-26 19:29:01 -07:00
Mateusz Piotrowski
460ad988a9 freebsd-update.8: Note availability of updates for ALPHA, BETA, and RC
While here, restructure the section about the binary updates
availability.

MFC after:	1 week
2022-04-22 14:37:14 +02:00
Mateusz Piotrowski
f69f064483 freebsd-update.8: Add --currently-running to synopsis
While here, sort flags in synopsis.

MFC after:	3 days
2022-04-22 13:57:11 +02:00
Alan Somers
1a7f22d9c2 ctlstat: add prometheus output
When invoked by inetd, ctlstat -P will now produce output suitable for
ingestion into Prometheus.

It's a drop-in replacement for https://github.com/Gandi/ctld_exporter,
except that it doesn't report the number of initiators per target, and
it does report time and dma_time.

MFC after:	2 weeks
Sponsored by:	Axcient
Relnotes:	yes
Reviewed by: 	bapt, bcr
Differential Revision: https://reviews.freebsd.org/D29901
2022-04-20 15:18:41 -06:00
Stefan Eßer
7a60e798fb rrenumd: remove a set-but-not-used variable 2022-04-20 17:02:24 +02:00
Gordon Bergling
b92667b302 inetd(8): Fix a typo in the manual page
- s/similarily/similarly/

MFC after:	3 days
2022-04-19 16:49:07 +02:00
Alan Somers
8c47d8f538 prometheus_sysctl_exporter: fix metric aliasing
When exporting sysctls to Prometheus, the exporter replaces "." with
"_".  This caused several metrics to alias, confusing the Prometheus
server.  Fix it by:

* Renaming the "tcp_log_bucket" UMA zone to "tcp_log_id_bucket".  Also,
  rename "tcp_log_node" to "tcp_log_id_node" for consistency.

* Not exporting sysctls with "(LEGACY)" in the description.  That is
  used by ZFS sysctls that have been replaced by others, many of which
  alias to the same Prometheus metric name (like "vfs.zfs.arc_max" and
  "vfs.zfs.arc.max").

PR:		259607
Reported by:	delphij
MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	delphij,rew,thj
Differential Revision: https://reviews.freebsd.org/D34952
2022-04-19 06:56:39 -06:00
John Baldwin
7b02c1e8c6 iscsi: Fetch limits based on a socket rather than assuming global limits.
cxgbei needs the ability to return different limits based on the
connection (e.g. if the connection is over a T5 adapter or a T6
adapter as well as factoring in the MTU).

This change plumbs through the changes in the ioctls without changing
any of the backends.  The limits callback passed to icl_register now
accepts a second socket argument which holds the integer file
descriptor.  To support ABI compatiblity for old binaries, the
callback should return "global" values if the socket fd is zero.

The CTL_ISCSI_LIMITS argument used with CTL_ISCSI by ctld(8) now
accepts the socket fd in a field that was previously part of a
reserved spare field.  Old binaries zero this request which results in
passing a socket fd of 0 to the limits callback.

The ISCSIDREQUEST ioctl no longer returns limits.  Instead, iscsid(8)
invokes a new ISCSIDLIMITS ioctl after establishing the connection via
connect(2).  For ABI compat, if the old ISCSIDREQUEST is invoked, the
global limits are still fetched (with a socket fd of 0) and returned.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34928
2022-04-18 12:53:28 -07:00
John Baldwin
f0df722733 iscsid: Push #ifdef ICL_KERNEL_PROXY into cap_ioctl_limits list.
This reduces duplication in the two lists and makes it clearer which
ioctls are needed in the ICL_KERNEL_PROXY case.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34927
2022-04-18 12:53:15 -07:00
Brooks Davis
a812a5cacb lpr: remove a.out binary detection
Since the first unattributed commit in 1981, lpr has attempted to
prevent users from printing executables (and in earlier versions
archives). Archive detection was lost in 1992 when lpr gained a
dependency on a.out.h. No corresponding support was added for ELF files
with the full transiation to ELF in 1998, but a.out support has been
dragged forward to and contaminated platforms that never supported
a.out.

While this feature isn't unuseful, preventing the printing of
a single file format we stopped producing ~20 years ago isn't worth
the costs (however minimal).

Reviewed by:	gad, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D34901
2022-04-15 20:04:41 +01:00
Navdeep Parhar
811a82d53a cxgbetool(8): User interface to round-robin queue selection via COP.
Queue "roundrobin" in a COP rule means the driver should select queues
for new tids in a round-robin manner.

Reviewed by:	jhb@
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34922
2022-04-14 15:54:13 -07:00
Cy Schubert
145330347f wpa: Remove extraneous slash (/)
Remove the trailing slash (/), indiciating continuation, from the last
line of SRCS. The next line is blank; this is a NOP.

MFC after:	3 days
2022-04-13 15:27:30 -07:00
Tom Jones
016bfb0a97 etcupdate: remove redundant diff3 flag
-A and -m select different output modes output modes for diff3. When
both flags are present gnu diff3 prefers -m, drop the extra -A flag in
etcupdate.

Reviewed by:	pstef, 0mp
MFC after:	3 days
Sponsored by:	Klara Inc
Differential Revision:	<https://reviews.freebsd.org/D###>
2022-04-13 16:05:32 +01:00
Alfonso S. Siciliano
94cb21cda6
tzsetup(8): Refactoring to delete dialog(3) code
Little refactoring to complete the conversion to bsddialog(3),
not functional changes:

 * Delete: remaining code for autosizing using BSDDIALOG_AUTOSIZE.
 * Add: constants to delete magical numbers and to avoid unclear
   returned values.
 * Delete: redundant 'conf.button.default_cancel=false', performed by
   bsddialog_initconf().
 * Add: a new function message_zoneinfo_file() to merge features.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34862
2022-04-12 00:38:40 +02:00
Brad Davis
be0d16b0b0 bsdinstall: filter out disks that are unavailable from the list of options in ZFS
Reviewed by:	allanjude, rew
Differential Revision:	https://reviews.freebsd.org/D34167
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-10 15:09:14 -06:00
Robert Wing
c79331a42c bhyve: use linker set for ipc commands
Reviewed by:	markj, jhb
Differential Revision:	https://reviews.freebsd.org/D34760
2022-04-09 18:46:00 -08:00
Gordon Bergling
c254580cc2 fstyp(8): Fix a typo in a source code comment
- s/Miscellanious/Miscellaneous/

MFC after:	3 days
2022-04-09 09:27:23 +02:00
Christian Weisgerber
81d1214e8a man pages: Fix typo
s/the the/the/

Approved by:	ygy (doc)
2022-04-07 14:58:13 +02:00
Ed Maste
c71ae91f19 vidcontrol: disable p, P, and H when vt(4) is in use
These options use the CONS_SCRSHOT ioctl to capture the contents of the
current console, which is not yet supported by vt(4).  Disable the
options when vt(4) is in use rather than emitting a possibly confusing
error message.

This change should be reverted if CONS_SCRSHOT is implemented for vt(4).

PR:		263099
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-04-06 20:26:43 -04:00
Ed Maste
1f4442f71f vidcontrol: be explicit that -p and -P are sc(4) only
PR:		263099
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-04-06 19:39:19 -04:00
Mark Johnston
b0aa20bec5 bhyve: validate e82545 checksum offset field
Reported by:	Mehdi Talbi, Synacktiv
2022-04-05 22:58:28 +00:00
Alfonso S. Siciliano
50e244964e
bsdinstall/partedit: Replace libdialog with libbsddialog
bsdinstall/partedit: Replace (LGPL) libdialog with (BSD-2-Clause)
libbsddialog. Rewrite diskeditor.c and rename diskmenu.c because
it uses an API for menu totally incompatible with libbsddialog.
This is a User Interface change everything else is unchanged.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34639
2022-04-04 02:05:00 +02:00
Mateusz Piotrowski
84733f2e96 pw.8: Do not specify full path to shell in examples
Providing a full path to a shell is discouraged in the description of
the -s flag. Let's follow the best practices in the examples.

MFC after:	1 week
2022-04-03 14:52:08 +02:00
Mateusz Piotrowski
5fce57dd12 efibootmgr: Use the hier(7) ESP mount point in examples
MFC after:	1 week
2022-04-03 14:52:07 +02:00
Jose Luis Duran
1a0bd2665a sysrc.8: Mention it requires chroot(8)
Option -R uses chroot(8). Mention it in the corresponding section.

MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D34630
2022-04-03 13:54:11 +02:00
Mateusz Piotrowski
5243e560f6 pw.8: Fix synopsis of NIS flags
MFC after:	1 week
2022-04-03 13:54:10 +02:00
Mateusz Piotrowski
a0177bd56a pw.8: Sorty synopsis flag
MFC after:	1 week
2022-04-03 13:54:10 +02:00
Mateusz Piotrowski
feb04c7b7c pw.8: Improve argument names
Arguments passed to flags like -d and -k had ambiguous names like "dir".
Change that to more descriptive names like "homedir".

Also, clarify that -u min,max is for UIDs and -i min,max for GIDs.

MFC after:	1 week
2022-04-03 13:54:09 +02:00
Alfonso S. Siciliano
6833ac673d
bsdinstall netconfig: Replace dialog(1) with bsddialog(1)
Replace (LGPL) dialog(1) with (BSD-2-Clause) bsddialog(1).

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34682
2022-04-02 21:33:40 +02:00
Gordon Bergling
3b31bf26b4 cron(8): Fix a typo in the documentation
- s/commmand/command/

MFC after:	3 days
2022-04-02 15:16:33 +02:00
Gordon Bergling
a16977209b pnfsserver(4): Fix a typo in the manual page
- s/commmand/command/

MFC after:	3 days
2022-04-02 15:12:51 +02:00
Gordon Bergling
cf226430bb efivar(8): Fix a typo in a source code comment
- s/differnt/different/

MFC after:	3 days
2022-04-02 13:34:46 +02:00
Mateusz Piotrowski
39245a7d45 pw.8: Sort flags in synopsis
MFC after:	1 week
2022-04-02 00:49:53 +02:00
Mateusz Piotrowski
77fd0356ef pw.8: Use more appropriate mdoc macros
MFC after:	1 week
2022-04-02 00:49:53 +02:00
Mateusz Piotrowski
61e11ed9bd pw.8: Improve use of mdoc macros in description section
MFC after:	1 week
2022-04-02 00:49:52 +02:00
Mateusz Piotrowski
5392b4fbb7 pw.8: Use Cm and Ar correctly in synopsis
MFC after:	1 week
2022-04-02 00:49:52 +02:00
Corvin Köhne
3256b7ca36 bhyve: avoid an empty passthru config value
pci_parse_legacy_config splits the options string by comma characters.
strchr returns a pointer to the first occurence of a character. In that
case, it's a comma. So, pci_parse_legacy_config will stop at the first
character and creates a new config node with a name of NULL.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D34600
2022-04-01 11:13:16 +02:00
Corvin Köhne
8ac8adda8d bhyve: avoid uninitialized variable
Reviewed by:	markj
Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reported-by: Andy Fiddaman <andy@omniosce.org>
Differential Revision:	https://reviews.freebsd.org/D34688
2022-04-01 11:13:16 +02:00
Corvin Köhne
45ddbf2112 bhyve: avoid overflow of BAR index
At the moment, writes to BAR registers that aren't 4 byte aligned are
ignored. So, there's no overflow yet. Nevertheless, if this behaviour
changes in the future, it could unintentionally, introduce a buffer
overflow. Additionally, some compiler or tools will detect this
potential overflow and complain about it.

Reviewed by:	markj
Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reported-by: Andy Fiddaman <andy@omniosce.org>
Differential Revision:	https://reviews.freebsd.org/D34689
2022-04-01 11:13:16 +02:00
Ed Maste
27c2f016b8 fstyp: Correct comment: Raspberry Pi Pico, not Nano
Fixes:		868c1b8431 ("fstyp: detect Raspberry Pi Pico boot...")
2022-03-30 13:04:11 -04:00
Ed Maste
868c1b8431 fstyp: detect Raspberry Pi Pico boot filesystem as FAT
fstyp looks for a 0x55 0xAA signature at offset 510, but this is not
required by specifications and is not proivded by the Raspberry Pi Nano
bootloader.

We should really remove the signature check and implement a more
comprehensive BPB validation instead, but it will require more
investigation and testing.  For now just add a special case for the
Raspberry Pi Nano bootloader, to avoid introducing regressions or new
false positives.

PR:		262896
Reviewed by:	delphij
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34699
2022-03-29 17:33:15 -04:00
Jens Schweikhardt
e50daba0e4 Remove extraneous semicolons trailing break and continue statements. 2022-03-29 19:48:11 +02:00
Alfonso S. Siciliano
2617d4df52
bsdinstall mount: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34651
2022-03-29 16:54:51 +02:00
Alfonso S. Siciliano
48af6ad902
bsdinstall fetchmissingdists: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34654
2022-03-29 16:43:01 +02:00
Alfonso S. Siciliano
230811a883
bsdinstall/distfetch: Remove duplicate header
Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34685
2022-03-29 16:19:57 +02:00
Mateusz Piotrowski
075999d3f1 Cross-reference nextboot(8) and freebsd-update(8)
MFC after:	1 week
2022-03-29 15:15:35 +02:00
Mateusz Piotrowski
15647a7106 freebsd-update.8: Fix use of mdoc(8) macros
- Use Ar for arguments.
- Use Cm for freebsd-update commands like "upgrade".
- Reference other manuals with Xr when possible.

MFC after:	1 week
2022-03-29 14:39:15 +02:00
Gordon Bergling
4e12c7c510 fstyp(8): Fix a few typos in source code comments
- s/mmaping/mapping/
- s/filesytem/filesystem/

MFC after:	3 days
2022-03-28 19:35:18 +02:00
Gordon Bergling
28a6b24729 cxgbetool(8): Fix a typo in the man page
- s/begining/beginning/

MFC after:	3 days
2022-03-28 19:33:44 +02:00
Gordon Bergling
8bcffb86c7 ypbind(8): Fix a typo in the man page
- s/ot/or/

MFC after:	3 days
2022-03-27 20:42:24 +02:00
Jamie Gritton
8f1543785f jail: handle jailsys parameters in modification permission test
Avoid a null dereference when a value-less jailsys parameter is passed
to "jail -m".  There was already code to handle boolean parameters,
but in reality any parameter could be passed without a value.
2022-03-25 19:16:51 -07:00
Alfonso S. Siciliano
0868f62176
bsdinstall checksum: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34660
2022-03-26 01:37:59 +01:00
Alfonso S. Siciliano
bbddd8888a
bsdinstall mirrorselect: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34582
2022-03-26 01:16:03 +01:00
Alfonso S. Siciliano
268c47b9ac
bsdinstall time: Revert dialog title
Revert dialog title like before dialog(1) replacement
0e5c72c3cc.

Reported by:		jrtc27
Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34647
2022-03-26 00:52:21 +01:00
Alfonso S. Siciliano
852d975ccf
bsdinstall services: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34640
2022-03-26 00:22:10 +01:00
Farhan Khan
4b1e2c2f77 bsdinstall(8): Usage example of tar doesn't work
The order of arguments in the example does not work, because tar thinks
the directory is named -C, which does not exist and reports:
tar: Error opening archive: Failed to open '-C'

Approved by:	rpokala@ (src) on IRC
Differential Revision:	https://reviews.freebsd.org/D34649
2022-03-23 21:59:53 +01:00
Alfonso S. Siciliano
0e5c72c3cc
bsdinstall time: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility,
'dialog --calendar' is replaced by 'bsddialog --datebox' with same
features but different User Interface.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34583
2022-03-23 16:56:37 +01:00
Alfonso S. Siciliano
4d1ba6febf
bsdinstall hardening: Replace dialog with bsddialog
bsdinstall/scripts/hardening: Replace (LGPL) dialog utility with
(BSD-2-CLAUSE) dialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34102
2022-03-23 00:58:48 +01:00
Jens Schweikhardt
8422d54f40 Correct a handful of typos and grammos. 2022-03-22 21:12:42 +01:00
Hans Petter Selasky
95e96c00fd mixer.8: Document shorthand syntax for volume setting.
Submitted by:		christos@
Differential Revision:	https://reviews.freebsd.org/D34614
Sponsored by:		NVIDIA Networking
2022-03-20 20:21:07 +01:00
Hans Petter Selasky
bde8460272 mixer.4 and mixer.8: Fix mandoc -Tlint errors.
Submitted by:		christos@
Differential Revision:	https://reviews.freebsd.org/D34603
Sponsored by:		NVIDIA Networking
2022-03-20 20:21:03 +01:00
Hans Petter Selasky
f250ff5ff3 mixer(8): Improve shorthand volume parsing.
The initial patch had a bug where the full volume syntax, floating point values,
:, + and -, wasn't accepted.

While at it move some defines to enum's.

Fixes:			da3d4469ef
Submitted by:		christos@
Differential Revision:	https://reviews.freebsd.org/D34617
Sponsored by:		NVIDIA Networking
2022-03-20 20:19:16 +01:00
Hans Petter Selasky
da3d4469ef mixer(8): Add shorthand syntax for setting the volume.
dev.volume=X[.X] can now also be written as dev=X[.X] .

Requested by:		hselasky@ and bsduck (FreeBSD forums)
Submitted by:		christos@
Differential Revision:	https://reviews.freebsd.org/D34612
Sponsored by:		NVIDIA Networking
2022-03-20 17:32:46 +01:00
Hans Petter Selasky
60bdfe9869 mixer(8): Remove [.volume] string from default printout.
Submitted by:		christos@
Differential Revision:	https://reviews.freebsd.org/D34591
Sponsored by:		NVIDIA Networking
2022-03-20 17:32:43 +01:00
Robert Wing
3ebe110934 bhyve: sweep MAX_VMNAME
MAX_VMNAME is no longer used.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D34292
2022-03-17 21:55:52 -08:00
Robert Wing
961e6a12ef bhyve/snapshot: limit snapshot filename to NAME_MAX
NAME_MAX is a better fit since strcat_extension() constructs the
filename of the snapshot file.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D34291
2022-03-17 21:51:31 -08:00
Robert Wing
3efc45f34e libvmm: constify vm_get_name()
Allows callers of vm_get_name() to retrieve the vm name without having
to allocate a buffer.

While in the vicinity, do minor cleanup in vm_snapshot_basic_metadata().

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D34290
2022-03-17 21:38:21 -08:00
Robert Wing
ee0ebaa420 bhyvectl: drop vm_get_name()
Grab the vm name from bhyvectl's --vm flag instead.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D34399
2022-03-17 21:22:43 -08:00
Ed Maste
4f75af31a8 wpa_supplicant.conf.5: add note about scan_ssid=1 eavesdropping
When scan_ssid=1 the list of configured SSIDs is available to
eavesdroppers.  Note this in the man page.

PR:		194122
Reviewed by:	debdrup, Pau Amma
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34576
2022-03-16 19:33:16 -04:00
Andy Fiddaman
f6f357efb1 bhyve: missing mutex initializations
Explicitly initialize the mutex that a PCI virtio module passes back to
virtio.

It so happens that these mutexes were being initialized regardless, no
functional change intended.

Reviewed by:    chuck, jhb
Differential Revision:  https://reviews.freebsd.org/D34372
2022-03-15 19:54:16 -08:00
Alfonso S. Siciliano
8cdecdecb4
spkrtest(8): Replace dialog with bsddialog
Replace (LGPL) dialog with (BSD-2-Clause) bsddialog and update manual.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34459
2022-03-16 01:48:53 +01:00
Alfonso S. Siciliano
f27c6a3e87
bsdinstall/distfetch: Replace libdialog with libbsddialog
Replace (LGPL) libdialog with (BSD-2-Clause) libbsddialog,
while here diversify error messages to find quickly the exact point
of failure.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34464
2022-03-16 00:27:36 +01:00
Xin LI
1d33307434 Update leap-seconds to leap-seconds.3676924800
Obtained from:	ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:	3 days
2022-03-13 23:37:56 -07:00
Mateusz Piotrowski
c36d04222d mixer .8: Clean up the manual page
- Use correct macros (e.g., Pa for paths, Ar for arguments, Cm for
  command modifiers).
- Pet igor and mandoc -Tlint (e.g., start sentences after a newline).
- Use Ta instead of a tab character in tables.
- Stylize all table headers with Sy consistency.
- Add a missing "vol" variant to the synopsis of "dev.volume".
- Sort dev.recsrc command modifiers consistency.
- Use "Bd -literal" for code blocks in the examples. "Bl -tag" is not
  the right macro for that.

Fixes:	903873ce15 Implement and use new mixer(3) library for FreeBSD.
2022-03-13 13:40:51 +01:00
Matteo Riondato
a33ead9c9c pfdenied: match actual variable name to the documented one
PR:		262446
Reviewed by:	kp
2022-03-12 23:59:25 +01:00
Jens Schweikhardt
54b75edd9e Correct minor typos/grammos and break long lines to fit in 80 chars. 2022-03-12 10:43:39 +01:00
Ed Maste
2d015cffc7 fwcontrol: eliminate set but not used warning
The variable was used in an #if 0 block; just move the variable
definition and setting into the same block since Firewire is mainly of
historical interest and is unlikely to see ongoing development in
FreeBSD.

Sponsored by:	The FreeBSD Foundation
2022-03-10 15:51:27 -05:00
Mateusz Piotrowski
5e19a51853 bhyve.8: Fix a typo
The Li macro is deprecated. Also, the Cm macro should be used here
instead for consistency with the rest of the manual and style.mdoc(5).

Fixes:		e47fe3183e bhyve: add ROM emulation
MFC after:	1 month
2022-03-10 17:46:43 +01:00
Matteo Riondato
0784121c96 pfdenied: support reporting on additional anchors
The security/520-pfdenied script only reports blocked packets from the
main ruleset or any blocklistd(8) anchor.

Add an option to periodic.conf(5) to make it possible to specify
additional anchors to report.

PR:		262446
Reviewed by:	kp
2022-03-10 12:08:59 +01:00
Corvin Köhne
afd4f7fa25 bhyve/usage: memory size is not in MB
For backward compatibility, the memory size will be interpreted in MB if
it's smaller than1 MB and has no suffix. Nowadays, the -m switch accepts
more than just MB. Respect it in the usage message.

Differential Revision:	https://reviews.freebsd.org/D34506
Reviewed by:	grehan
Sponsored by:   Beckhoff Automation GmbH & Co. KG
MFC after:      1 month
2022-03-10 12:31:00 +01:00
Corvin Köhne
e47fe3183e bhyve: add ROM emulation
Some PCI devices especially GPUs require a ROM to work properly.
The ROM is executed by boot firmware to initialize the device.
To add a ROM to a device use the new ROM option for passthru device
(e.g. -s passthru,0/2/0,rom=<path>/<to>/<rom>).

It's necessary that the ROM is executed by the boot firmware.
It won't be executed by any OS.
Additionally, the boot firmware should be configured to execute the
ROM file.
For that reason, it's only possible to use a ROM when using
OVMF with enabled bus enumeration.

Differential Revision:	https://reviews.freebsd.org/D33129
Sponsored by:   Beckhoff Automation GmbH & Co. KG
MFC after:      1 month
2022-03-10 12:30:37 +01:00
Corvin Köhne
563fd2240e bhyve: export funcs for read/write pci config
Export functions for reading and writing the pci config space from passthru
device to be used by other devices.
This is required for lpc devices to set their vendor/device ids to their
physical values.
Otherwise, GPU passthrough for integrated Intel GPUs won't work properly.

Differential Revision:	https://reviews.freebsd.org/D33769
Reviewed by:	markj
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	1 month
2022-03-10 12:30:02 +01:00
John Baldwin
c76e4b89d9 bhyve: Use vm_get_topology to query kernel's maximum vCPU count.
Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34493
2022-03-09 15:39:23 -08:00
John Baldwin
fd6f92946f bhyve: Don't force an upper bound on vCPUs when parsing pinning.
Even today it is possible to specify pinning for a vCPU higher than
the configured number of CPUs but lower than VM_MAXCPU without raising
an error.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34492
2022-03-09 15:39:16 -08:00
John Baldwin
7261f82156 bhyve: Allocate dynamic arrays to hold per-VCPU state.
This avoids hardcoding VM_MAXCPU in userspace.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34491
2022-03-09 15:39:08 -08:00
John Baldwin
340a293f91 bhyve: Make the MADT dynamically sized.
Use basl_ncpu instead of VM_MAXCPU in MADT_SIZE.  Since several of the
offsets are no longer compile time constants, unroll the loop
generating ACPI tables.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34490
2022-03-09 15:38:58 -08:00
John Baldwin
730510dc1a bhyve: Allocate mmio_hint array based on number of guest CPUs.
This avoids an instance of hardcoding VM_MAXCPU in userspace.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34489
2022-03-09 15:38:49 -08:00
Nils Johannsen
901c52f13c periodic: remove obsolete news.expire
With the initial import of 386BSD 0.1 in 1993, the daily execution of
/etc/news.expire was introduced (see commit 1bf9d5d951).

In 1997, this was brought into periodic resulting in daily/330.news
(see commit 28dce04d19). But as far as I see, /etc/news.expire has
never existed.

PR:         256238
MFC after:  1 week
Differential Revision:	https://reviews.freebsd.org/D30631
2022-03-07 19:37:42 -09:00
Alexander Motin
2117cdd4b4 GEOM: Introduce gctl_add_param() API.
Make gctl_add_param() API public, allowing more precise control over
parameter flags.  Previously it was impossible to properly declare
write-only ASCII parameters, used for result reporting, they were
declared as read-write binary instead, that was not nice.

MFC after:	1 month
2022-03-07 11:12:25 -05:00
Corvin Köhne
87f6367f10 bhyve: add varfile option to nvlist of lpc device
Use seperate nvlist entries for the romfile and the varfile.

While here, don't leak varfd in bootrom_loadrom().

Reviewed by:    jhb, markj
Differential Revision:  https://reviews.freebsd.org/D33433
2022-03-02 22:50:24 -09:00
Alfonso S. Siciliano
912df915c2
wlanconfig: allow to enter WiFi details if no networks found
Improve the installer: wlanconfig allows user to enter WiFi details
if no networks found, useful to connect to a hidden SSID.

PR:			246192
Reported by:		emaste
Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34149
2022-03-02 00:04:57 +01:00
Warner Losh
f5366026ad devctl: add getpath command
Retrieves that path for a device. Different methods to enumerat the path
are supported, called locators.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32747
2022-03-01 08:06:41 -07:00
Jessica Clarke
b58ea3e1f7 Fix hand-rolled METALOG entries for installconfig during distributeworld
During distributeworld we call distribute on subdirectories, which in
turn calls installconfig. However, this recursive installconfig call
appends the distribution name (in these cases, "base") to DESTDIR. For
install(1) this works fine as its -D argument comes from the top-level
Makefile.inc1, which passes the original DESTDIR, thereby resulting in
the METALOG entry having the distribution name as a prefix representing
its true installed path relative to the root, but for the hand-rolled
entries they do not use install(1) and thus do not have access to what
the original DESTDIR was, resulting in the METALOG missing this prefix.

Thus, pass down the name of the distribution via a new variable DISTBASE
(chosen as Makefile.inc1 already uses that to convey this exact same
information to etc's distrib-dirs during distributeworld) and prepend
this to the handful of manually-generated METALOG entries. For the
installworld case this variable will be empty and so this behaves as
before.

Note that we need to be careful to avoid double slashes in the METALOG;
distributeworld uses find | awk to split the single METALOG up into
multiple dist.meta files, and this relies on the paths in the METALOG
having the exact prefix ./dist (or ./dist/usr/lib/debug).

Reviewed by:	brooks, emaste
Differential Revision:	https://reviews.freebsd.org/D33997
2022-02-28 22:36:39 +00:00
Ed Maste
1ffe6d7909 ntp: disable format string warnings in libopts
libopts uses generated format string tables that contain embedded NULs.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34386
2022-02-27 16:31:01 -05:00
Jose Luis Duran
cd46006588 ofwdump.8: Remove references to eeprom(8)
Somehow missed in bc4fc770af

Pull Request: https://github.com/freebsd/freebsd-src/pull/582
2022-02-27 09:03:42 -07:00
Richard Scheffenegger
407c34e735 iscsi: retrieve global login timeout from sysctlbyname() as integer
The OID "kern.iscsi.login_timeout" references an integer and
not a string.

Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34380
2022-02-25 20:57:05 +01:00
Eric van Gyzen
d0f4e583bf efivar: handle error when reading --fromfile
The result of read() was stored in an unsigned variable, so the
test for a negative value would never work.

While I'm here, print a better error message for an empty file,
omitting the misleading errno message.

Reported by:	Coverity
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2022-02-25 09:30:29 -06:00
Eric van Gyzen
331b84b5db rtsold: fix memory leak in script execution
Since commit 04e9edb544, rtsold has leaked the memory for the
argument vector of every script it runs.

Reported by:	Coverity
Reviewed by:	markj
Fixes:		04e9edb544
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34355
2022-02-25 09:30:29 -06:00
Eric van Gyzen
a2a8efb4f6 rtsold: Use correct error in llflags_get()
Set errno to EINVAL if the name overflows the buffer, as was done
before commit ecce515d54.

Reviewed by:	dab, markj
Fixes:		ecce515d54
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34354
2022-02-25 09:30:29 -06:00
Richard Scheffenegger
bd6bb49397 iscsi: per-session timeouts and rapid teardown of session on reconnect
Add per-Session configurable ping (SCSI NOP) and login timeouts.

Remove the torn down, old iSCSI session quickly, when performing a reconnect.

Reviewed By: trasz
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34198
2022-02-25 10:35:47 +01:00
Andy Fiddaman
ad3da82996 bhyve: plug memory leak in topology_parse()
Reviewed by:    jhb, rew
Differential Revision:  https://reviews.freebsd.org/D34301
2022-02-24 08:38:53 -09:00
Chuck Tuffli
e0ac9dc2b0 bhyve nvme: Advertise Namespace changed AEN
Advertise Namespace Attribute Notices events in the Optional
Asynchronous Events Supported (OAES) field of the Identify Controller
data structure. Additionally, rename the enums and macros to clarify
these are AEN's related to Notices and not generic information.

Reported by: andy@omniosce.org

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34331
2022-02-23 09:15:45 -08:00
Alfonso S. Siciliano
55af0f96d0
bsdinstall/distfetch: fix main bar percentage with errors
UI fix not related to the real fetching process, use 'nfiles'
(instead of 'total files size') to compute main bar percentage
if an error occurs:

 - fix: main bar greater than 100%, if an error occurs before fetching
 - fix: main bar less than 100%, if an error occurs during fetching
 - add: last mixedgauge, at least one dialog if a total failure occurs

PR:		164094, 169748
Approved by:	bapt (mentor)
Review:		https://reviews.freebsd.org/D33978
2022-02-23 01:54:51 +01:00
Mitchell Horne
13ec1e3155 boottrace(8): small wrapper utility
This is a small program that when invoked will create start and stop
boottrace entries via sysctl, and execute the desired command. Having
this as an executable -- as opposed to some shell script invoking
sysctl(8) -- allows the total resource usage recorded by the trace
entries to include the child process.

Reviewed by:	0mp, trasz (older version)
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D31929
2022-02-21 20:16:12 -04:00
Chuck Tuffli
c2318cf80a nvme: fix spelling of Namespace
Fix spelling of a macro definition.

Reviewed by:	mav, imp
Differential Revision:	https://reviews.freebsd.org/D34330
2022-02-21 10:34:46 -08:00
Robert Wing
4379c1da56 bhyve/snapshot: use a string for cmd element in the nvlist
The nvlist for a checkpoint request will now look like:

    { cmd="checkpoint", suspend="true/false", filename="afilename" }

Reviewed by:	jhb
Suggested by:   jhb
Differential Revision:	https://reviews.freebsd.org/D34237
2022-02-15 08:12:15 -09:00
Kyle Evans
e01e8f911b freebsd-update: improve BE creation feature
This addresses one nit and one bug in the BE creation feature of
freebsd-update:

The nit addressed is that it currently only names the BEs after the
userland version, but the kernel version may be higher.  After this
change, we request both and pass them through sort(1) to choose the
highest.  This is especially helpful if a freebsd-update patch touched
one but not the other.

The bug fixed is that roots updated that are not located at '/', e.g.,
by using -b or -j, will no longer create boot environments
automatically.  There's a very low chance these will actually change the
BE in any meaningful way, anyways.  It could make sense in the future
to allow an argument-override to create the BE anyways if someone comes
up with a non-standard setup, e.g., where a jail is an important part of
their boot environment on an appliance or some such setup.

Half of this patch is submitted by delphij@, the other half kevans@.

PR:		261446
MFC after:	3 days
Reviewed by:	delphij, emaste, Dave Fullard <dave_fullard.ca>
Differential Revision:	https://reviews.freebsd.org/D34257
2022-02-12 15:36:24 -06:00
Alfredo Dal'Ava Junior
79f5d19890 kldxref: add R_PPC_ADDR32 handler
Implements R_PPC_ADDR32 handler for kldxref, addressing
"kldxref: unhandled relocation type 1" when running
"kldxref /boot/kernel" on powerpc 32 bits.

Reviewed by:	luporl
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D33745
2022-02-10 12:15:47 -03:00
Gordon Bergling
80212a36a3 tcpsso.8: Add a history section to the manpage
Mention that the tcpsso command first appeard in FreeBSD 14.
2022-02-10 09:27:42 +01:00
Alexander Motin
c04506fd4c pciconf: Fix PCIS_CRYPTO_ENTERTAIN copy/paste.
Submitted by:   Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2022-02-09 15:56:30 -05:00
Michael Tuexen
d24e064aaf tcpsso: fix typo in man page
Reported by:	maxim
Sponsored by:	Netflix, Inc.
2022-02-09 21:16:42 +01:00
Fangrui Song
ec81497cc7 crunchgen: remove -dc from linker invocation
In GNU ld and ld.lld, -dc is used with -r to allocate space to COMMON
symbols.  It is presumably to work around legacy code which cannot
handle COMMON symbols in relocatable output.  ld.lld may remove -dc or
make it a no-op for the 15.0.0 release.

As of 7420b323a0 crunch/crunchide does not require -dc, as the symbol
hiding technique no longer relied on making symbols local.

In addition -fno-common is now the default in Clang and GCC, so -dc
serves no purpose as the compiler does not generate COMMON symbols
anyway.

See https://maskray.me/blog/2022-02-06-all-about-common-symbols for more
detail on common symbols.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34215
2022-02-09 13:54:35 -05:00
Michael Tuexen
d73d40c17f usr.sbin: add tcpsso to Makefile 2022-02-09 19:22:18 +01:00
Michael Tuexen
881631a2a3 usr.sbin: add tcpsso
tcpsso is a command line tool to apply a socket option to an
existing TCP endpoint, which is identified by the inp_gencnt.
tcpsso can be used, for example, to switch the congestion control
module or the TCP stack.

Reviewed by:		rrs, rscheff, debdrup, pau amma
Relnotes:		yes
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34139
2022-02-09 19:14:25 +01:00
Robert Wing
edfb339d38 bhyve/snapshot: switch to nvlist for snapshot requests
Switch to using an nvlist with nvlist_send()/nvlist_recv() to
communicate from bhyvectl(8) to bhyve(8).

The idea is that a bhyve process receives a command with with a set of
arguments. The nvlist here is structured to reflect that premise.

For example, to snapshot the vm, the expected nvlist looks like:

    { cmd=START_CHECKPOINT, filename="filename" }

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D33977
2022-02-09 08:11:57 -09:00
Mateusz Piotrowski
ca77b6ff31 cron.8: Add periodic(8) to See Also 2022-02-09 11:50:01 +01:00
Mark Johnston
927aa5fefd bhyve: Fix getaddrinfo() error handling
- Use errx() since errno will not be set.
- Print the message returned by gai_strerror().

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-08 12:40:41 -05:00
Dimitry Andric
e17fede8ff Fix too small sscanf output buffers in kbdmap
This fixes the following warnings from clang 14:

usr.sbin/kbdmap/kbdmap.c:241:16: error: 'sscanf' may overflow; destination buffer in argument 5 has size 20, but the corresponding specifier may require size 21 [-Werror,-Wfortify-source]
                            &a, &b, buf);
                                    ^
usr.sbin/kbdmap/kbdmap.c:615:8: error: 'sscanf' may overflow; destination buffer in argument 3 has size 64, but the corresponding specifier may require size 65 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                            ^
usr.sbin/kbdmap/kbdmap.c:615:14: error: 'sscanf' may overflow; destination buffer in argument 4 has size 64, but the corresponding specifier may require size 65 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                                  ^
usr.sbin/kbdmap/kbdmap.c:615:19: error: 'sscanf' may overflow; destination buffer in argument 5 has size 256, but the corresponding specifier may require size 257 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                                       ^

In each case, the buffer being sscanf'd into is one byte too small.

MFC after:	 3 days
2022-02-06 16:25:25 +01:00
Dimitry Andric
d310bf3867 Fix too small hostname buffer in bootparamd
This fixes the following warning from clang 14:

usr.sbin/bootparamd/bootparamd/bootparamd.c:204:32: error: 'fscanf' may
overflow; destination buffer in argument 3 has size 255, but the
corresponding specifier may require size 256 [-Werror,-Wfortify-source]

The MAX_MACHINE_NAME macro indicates the maximum number of bytes in a
machine name, but it does not include the NUL terminator required for
scanf.

MFC after:	 3 days
2022-02-06 15:25:49 +01:00
Gordon Bergling
64b3bcc6bd moused(8): Fix a common typo in source code comments
- s/comatible/compatible/

Obtained from:	NetBSD
MFC after:	3 days
2022-02-06 13:47:25 +01:00
Gordon Bergling
164fa411b9 makefs(8): Fix a few typos in source code comments
- s/concearned/concerned/
- s/quadradically/quadratically/

Obtained from:	NetBSD
MFC after:	3 days
2022-02-06 13:46:38 +01:00
Wolfram Schneider
a0e33bbdc5 update URL 2022-02-05 17:35:24 +00:00
Andrew Turner
c363da4ae8 Add the Arm SPE interrupt to acpidump
To support the Arm Statistical Profiling Extension (SPE) ACPI 6.3 added
a place to hold the SPE interrupt. Add to acpidump to show when printing
the Arm Generic Interrupt data.

Sponsored by:	The FreeBSD Foundation
2022-02-01 11:43:13 +00:00
John Baldwin
58862c0bea fstyp: Remove __packed from struct exfat_de_label.
This fixes a -Waddress-of-packed-member warning about a possibly
unaligned pointer from GCC 9 when calling convert_label().

__packed has to be removed from struct exfat_dirent as well to fix an
alignment warning when casting from a struct exfat_dirent pointer to a
struct exfat_de_label pointer.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D32144
2022-01-31 17:33:31 -08:00
Robert Wing
b4cc5d63b6 bhyve/virtio: use correct device id for virtio-scsi
Section 4.1.2.1 of the virtio spec states that the transitional PCI
device id for a scsi device is 0x1004.

Fix suggested by reporter.

PR:             259961
Reported by:    me@nanaya.pro
Reviewed by:	imp, jhb
Fixes:  f9c005a17f ("Add bhyve virtio-scsi storage backend support.")
Differential Revision:	https://reviews.freebsd.org/D34103
2022-01-31 09:44:47 -09:00
Chuck Tuffli
ac678b4aaf bhyve nvme: Fix Identify Namespace, NSID=ffffffff
If the NVMe Controller doesn't support Namespace Management, it should
return "Invalid Namespace or Format" when the Host request Identify
Namespace with the global NSID value.

Fixes UNH IOL 16.0 Test 9.1, Case 6

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33578
2022-01-29 23:11:14 -08:00
Chuck Tuffli
fa263c532b bhyve nvme: Fix Set Features, AEN
NVMe Controllers which do not support Endurance Groups must return an
error when the Endurance Group Event Aggregate Log Change Notices bit is
set in Set Features, Asynchronous Event Configuration.

Fixes UNH IOL Test 3.12, Case 8

Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33577
2022-01-29 23:10:59 -08:00
Chuck Tuffli
ff5ed0fac4 bhyve nvme: Fix reported VWC value
v1.4 and later NVMe Controllers report "Flush all Namespaces" support
differently.

Fixes UNH IOL 16.0 Test 2.6, Case 3

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33576
2022-01-29 23:10:42 -08:00
Chuck Tuffli
9d8cd04694 bhyve nvme: Fix LBA out-of-range calculation
The function which checks for a valid LBA range mistakenly named an
input value as NLB ("Number of Logical Blocks") instead of "number of
blocks". The NVMe specification defines NLB as a zero-based value (i.e.
NLB=0x0 represents 1 block, 0x1 is 2 blocks, etc.), but the passed
parameter is a 1's-based value.

Fix is to rename the variable to avoid future confusion.

While in the neighborhood, also check that the starting LBA is less than
the size of the backing storage to avoid an integer overflow.

Reviewed by:	imp, allanjude, jhb
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33575
2022-01-29 23:09:57 -08:00
Chuck Tuffli
073f2076fe bhyve nvme: Add Select support to Get Features
Implement basic support for the SEL field of Get Features. This returns
information about Namespace Specific features.

Fixes UNH ILO 16.0 Test 1.2, Case 13

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33574
2022-01-29 23:09:35 -08:00
Chuck Tuffli
29241c96f7 bhyve nvme: Update v1.4 Identify Controller data
Compliant v1.4 Controllers must report a Controller Type (CNTRLTYPE).
Also, do not advertise secure erase functionality in the Format NVM
Attributes field of the Identify Controller data structure as the
Controller does not implement secure erase.

Fixes UNH ILO Test 1.1, Case 2

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33573
2022-01-29 23:09:10 -08:00
Chuck Tuffli
ea9ee35583 bhyve nvme: Add Temperature Threshold support
This adds the ability for a guest OS to send Set / Get Feature,
Temperature Threshold commands. The implementation assumes a constant
temperature and will generate an Asynchronous Event Notification if the
specified threshold is above/below this value. Although the
specification allows 9 temperature values, this implementation only
implements the Composite Temperature.

While in the neighborhood, move the clear of the CSTS register in the
reset function after all other cleanup. This avoids a race with the
guest thinking the reset is complete (i.e. CSTS.RDY = 0) before the NVMe
emulation is actually complete with the reset.

Fixes UNH IOL 16.0 Test 1.7, cases 1, 2, and 4.

Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33572
2022-01-29 23:08:47 -08:00
Chuck Tuffli
1381a11829 bhyve nvme: Fix Set Features
Be more conservative and only support the Features mandatory for an I/O
Controller.

Avoids a "hang" in UNH test 1.2.10 associated with Predictable Latency
Mode Configuration and Host Behavior Support features.

Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33571
2022-01-29 23:07:44 -08:00
Chuck Tuffli
45ab4076f3 bhyve nvme: Remove redundant AER Limit checks
The NVMe emulation checked if the Asynchronous Event Request Limit
(a.k.a AERL) would be exceeded in pci_nvme_aer_add(), but this function
is only called from nvme_opc_async_event_req() which also checks for
exceeding the AERL.

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33570
2022-01-29 23:07:29 -08:00
Chuck Tuffli
785b5da318 bhyve nvme: Add missing Admin opcodes
Don't treat unsupported Admin commands as Invalid Opcode. Instead return
the proper Invalid Field in Command.

Fixes UNH IOL test 1.17.2

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33569
2022-01-29 23:07:04 -08:00
Chuck Tuffli
b1b2a4d9e8 bhyve nvme: Implement Log Page Offset
Modify the Get Log Page command to parse the Log Page Offset fields to
support more recent versions of the NVMe specification.

Fixes various tests for UNH Test 1.3.*

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33568
2022-01-29 23:06:46 -08:00
Chuck Tuffli
62d47feceb bhyve nvme: Fix Namespace Specific Set Features
Return an error if the feature specified in Set Features is Namespace
specific but the Namespace ID uses the Global Namespace tag.

Fixes UNH Test 1.2.7

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33566
2022-01-29 23:06:23 -08:00
Chuck Tuffli
cf76cdd4bf bhyve nvme: Fix NVM Format completion status
The NVM Format command is unique among the Admin commands in that it
needs to finish asynchronously. For this reason, the emulation code
invented a synthetic completion status (NVME_NO_STATUS) to indicate that
the command was still in progress and the command processing loop should
not generate a completion message. The implementation used the value
0xffff for the synthetic value as this set both the Status Code and
Status Code Type fields to reserved values.

Format initialized the completion status to this value and expected
error cases to override it with a status code/type appropriate to the
situation. The macros used to set the NVMe status are careful not to
modify bit 0 (i.e. the phase bit), which with the synthetic completion
status, causes the phase bit to get out of sync. When running tests in a
guest with illegal NVM Format commands, Admin commands would eventually
hang because it appeared there were no completions due to the incorrect
phase bit value.

Fix is to only set NVME_NO_STATUS if the blockif delete command
succeeds. While in the neighborhood, add a missing break statement when
NVM Format is not supported.

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33565
2022-01-29 23:05:58 -08:00
Chuck Tuffli
595a12f18b bhyve nvme: Advertise v1.4 support
Bump advertised NVMe support from v1.3 to v1.4

Reviewed by:	allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33564
2022-01-29 23:04:25 -08:00
Mateusz Piotrowski
75a86e93e6 usbconfig.8: Sort flags according to style(9)
MFC after:	2 weeks
2022-01-29 22:10:21 +01:00
Mateusz Piotrowski
5eafaf9e68 usbconfig.8: Improve style and fix examples
- Use Ar macros for arguments
- Stylize the argument synopsis to the -d flag
- Change the width of the list to one of the actual tags in the list
- Stylize "ugen" and "/dev/ugen" with Cm as those are constant strings,
  which are usually treated as command modifiers.
- Break long lines to reduce the number of warnings from linters
- Fix examples; the -d flag is now required when specifying the unit and
  the address with the "dot notation".

MFC after:	2 weeks
2022-01-29 22:05:22 +01:00
Baptiste Daroussin
f954986015 disextract: eliminate last use of __DECONST 2022-01-28 10:09:08 +01:00
Baptiste Daroussin
dd8ca6b27f distextract: simply code by using strsep(3) 2022-01-28 10:06:55 +01:00
Alfonso Siciliano
263660c061 bsddialog: import version 0.1
Import bsddialog 0.1 Utility and Library, fully refatorized, API stable,
manuals completed, easier to maintain and improve.

Update deps for new API:
add mixedgauge consts, delete __DECONST and add bsddialog_geterror()
info to avoid silent errors

* tzsetup
* kbdmap
* distextract

Differential Revision:	https://reviews.freebsd.org/D34066
2022-01-28 09:56:21 +01:00
Trond Endrestol
140db0be99 efitable(8): Add missing -u in the manpage
PR:	261524
MFC after:	3 days
2022-01-28 03:04:38 +02:00
Tom Jones
f0ec0fda01 bsdinstall: Add quotes around error message argument
When error is called with a message with spaces (and probably multiple
lines) these are passed into dialog unquoted and an error message was
presented, wrap with quotes.

Reviewed by:	bapt, allanjude
Sponsored by:   Ampere Computing LLC
Sponsored by:   Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33918
2022-01-27 17:14:30 +00:00
Emmanuel Vadot
9acd521dbd pkgbase: bhyve: Tag the kbdlayout file to be in the bhyve package 2022-01-26 19:32:19 +01:00
Gordon Bergling
575c1773bf mergemaster(8): Fix a typo in an error message
- s/differnt/different/

MFC after:	3 days
2022-01-26 17:59:49 +01:00
Gordon Bergling
ee6d379be7 cpucontrol(8): Fix a typo in an error message
- s/incorret/incorrect/

MFC after:	1 week
2022-01-26 10:36:42 +01:00
Robert Wing
08cb63a12f bhyve/block_if: allow DIOCGMEDIASIZE ioctl
This is needed to get mediasize of the device after a resize event.

I missed this earlier as I was building WITH_BHYVE_SNAPSHOT, which
disables capsicum.

Reviewed by:	khng, markj
Fixes: ae9ea22e14 ("bhyve: get mediasize for character devices when ...")
Differential Revision:	https://reviews.freebsd.org/D34013
2022-01-25 07:44:13 -09:00
Gordon Bergling
340e08beee pmcstudy: Fix a typo in a usage message
-s /measurments/measurements/

MFC after:	3 days
2022-01-24 19:41:39 +01:00
Martin Matuska
e92ffd9b62 zfs: merge openzfs/zfs@17b2ae0b2 (master) into main
Notable upstream pull request merges:
  #12766 Fix error propagation from lzc_send_redacted
  #12805 Updated the lz4 decompressor
  #12851 FreeBSD: Provide correct file generation number
  #12857 Verify dRAID empty sectors
  #12874 FreeBSD: Update argument types for VOP_READDIR
  #12896 Reduce number of arc_prune threads
  #12934 FreeBSD: Fix zvol_*_open() locking
  #12947 lz4: Cherrypick fix for CVE-2021-3520
  #12961 FreeBSD: Fix leaked strings in libspl mnttab
  #12964 Fix handling of errors from dmu_write_uio_dbuf() on FreeBSD
  #12981 Introduce a flag to skip comparing the local mac when raw sending
  #12985 Avoid memory allocations in the ARC eviction thread

Obtained from:	OpenZFS
OpenZFS commit:	17b2ae0b24
2022-01-22 23:05:15 +01:00
Ryan Moeller
b252fb2430 bhyve: ahci: Fix regression with no ports
An AHCI controller may be specified with no connected ports.  Avoid
dumping core in this case for compatibility with existing VM configs.

Reviewed by:	khng, jhb
Fixes:		621b509048 Refactor configuration management in bhyve.
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D33969
2022-01-21 12:59:25 +00:00
Michael Reifenberger
19eaa01bea Append Keyboard Layout specified option for using VNC.
Part two: Append bhyve -K option for specified keyboard layout
with layout setting files every languages.
Since the cmd option '-k' was used in the meantime
it was changed to '-K'

PR:		246121
Submitted by:	koinec@yahoo.co.jp
Reviewed by:	grehan@
Differential Revision:	https://reviews.freebsd.org/D29473

MFC after:	4 weeks
2022-01-20 23:49:27 +01:00
Alan Somers
eea7c61590 Add tests for ses(4)
The tests require SES hardware.  Without it, the test cases will be
skipped.

Reviewed by:	ken
Differential Revision: https://reviews.freebsd.org/D31809
Sponsored by:	Axcient
MFC after:	2 weeks
2022-01-19 12:43:51 -07:00
Alan Somers
18acbeb392 sesutil: fix a comment
MFC after:	2 weeks
Sponsored by:	Axcient
2022-01-19 12:43:51 -07:00
Robert Wing
51fbd894dd bhyve/snapshot: fix pthread_create() error check
pthread_create() returns 0 on success or an error number on failure.

Reviewed by:	khng, markj
Differential Revision:	https://reviews.freebsd.org/D33930
2022-01-19 08:40:06 -09:00
Robert Wing
ae9ea22e14 bhyve: get mediasize for character devices when resizing virtio-blk
Reviewed by:	imp, allanjude, jhb
Differential Revision:	https://reviews.freebsd.org/D33403
2022-01-18 11:26:49 -09:00
Corvin Köhne
fe453891d7 bhyve: add nvlist functions for setting unset nodes
If an emulation uses those functions instead of set_config_value_node
or set_config_value, it allows the config values to get
overwritten. Introducing new functions is much more readable than
if else statements in the emulation code.

Reviewed by:	khng
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33770
2022-01-14 12:41:44 +01:00
Alexander Motin
2e19fae49f sesutil: Avoid setting reserved bits.
Weird side of SES specification is that some bits have different
meaning or semantics in status and control pages.  This patch fixes
non-zero writes into reserved fields, that caused errors on some
enclosures when trying to control locate/fault LEDs, keeping other
bits unchanged.

MFC after:	2 weeks
Sposonred by:	iXsystems, Inc.
2022-01-13 13:57:35 -05:00
Konstantin Belousov
65990b68a2 msdosfs: clusterfree() is used only in error handling cases
Change its return type to void, because its result is ignored in both
call sites.  Remove oldcnp argument as well, it is NULL always.

Suggested and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Matt Audesse
9d47858138 Fix "Mesurement" typo in usr.sbin/acpi/acpiconf/acpiconf.c
Pull Request: https://github.com/freebsd/freebsd-src/pull/572
2022-01-07 07:59:11 -07:00
Scott Long
638e2a132e Fix formatting of the usage() output 2022-01-06 22:59:18 -07:00
Mark Johnston
4558c11f1b bhyve: Correct unmapping of the MSI-X table BAR
The starting address passed to mprotect was wrong, so in the case where
the last page containing the table is not the last page of the BAR, the
wrong region would be unmapped.

Reported by:	Andy Fiddaman <andy@omniosce.org>
Reviewed by:	jhb
Fixes:		7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33739
2022-01-05 10:12:09 -05:00
Mark Johnston
76b45e688a bhyve: Map the right BAR in init_msix_table()
The PBA and MSI-X table can reside in different BARs.

Reported by:	Andy Fiddaman <andy@omniosce.org>
Reviewed by:	jhb
Fixes:		7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33739
2022-01-05 10:12:09 -05:00
Corvin Köhne
9fe79f2f2b bhyve: dynamically register FwCtl ports
Qemu's FwCfg uses the same ports as Bhyve's FwCtl. Static allocated
ports wouldn't allow to switch between Qemu's FwCfg and Bhyve's
FwCtl.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D33496
2022-01-03 16:32:55 +01:00
Corvin Köhne
7d55d29508 bhyve: add more slop to 64 bit BARs
Bhyve allocates small 64 bit BARs below 4 GB and generates ACPI tables
based on this allocation. If the guest decides to relocate those BARs
above 4 GB, it could lead to mismatching ACPI tables. Especially
when using OVMF with enabled bus enumeration it could cause
issues. OVMF relocates all 64 bit BARs above 4 GB. The guest OS
may be unable to recover from this situation and disables some PCI
devices because their BARs are located outside of the MMIO space
reported by ACPI. Avoid this situation by giving the guest more
space for relocating BARs.

Let's be paranoid. The available space for BARs below 4 GB is 512 MB
large. Use a slop of 512 MB. It'll allow the guest to relocate all
BARs below 4 GB to an address above 4 GB. We could run into issues
when we exceeding the memlimit above 4 GB. However, this space has
a size of 32 GB. Even when using many PCI device with large BARs
like framebuffer or when using multiple PCI busses, it's very
unlikely that we run out of space due to the large slop.
Additionally, this situation will occur on startup and not at runtime
which is much better.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D33118
2022-01-03 16:32:55 +01:00
Corvin Köhne
8ec366ec6c bhyve: allow reading of fwctl signature multiple times
At the moment, you only have one single chance to read the fwctl
signature. At boot bhyve is in the state IDENT_WAIT. It's then
possible to switch to IDENT_SEND. After bhyve sends the signature,
it switches to REQ. From now on it's impossible to switch back to
IDENT_SEND to read the signature. For that reason, only a single
driver can read the signature. A guest can't use two drivers to
identify that fwctl is present. It gets even worse when using
OVMF. OVMF uses a library to access fwctl. Therefore, every single
OVMF driver would try to read the signature. Currently, only a
single OVMF driver accesses the fwctl. So, there's no issue with
it yet. However, no OS driver would have a chance to detect fwctl when
using OVMF because it's signature was already consumed by OVMF.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D31981
2022-01-03 16:32:55 +01:00
Corvin Köhne
01f9362ef4 bhyve: enumerate BARs by size
E.g. Framebuffers can require large space and BARs need to be aligned
by their size. If BARs aren't allocated by size, it'll cause much
fragmentation of the MMIO space. Reduce fragmentation by ordering
the BAR allocation on their size to reduce the risk of
OUT_OF_MMIO_SPACE issues.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D28278
2022-01-03 16:32:55 +01:00
Corvin Köhne
338a1be836 bhyve: only init MSI-X table if passthru device supports it
Some passthru devices only support MSI instead of MSI-X. For those
devices the initialization of MSI-X table will fail. Re-add the
check erroneously removed in f1442847c9.

MFC after:	3 days
X-MFC with:	f1442847c9
PR:		260148
Reviewed by:	manu, bz
Differential Revision:	https://reviews.freebsd.org/D33728
2022-01-03 14:55:10 +00:00
Jessica Clarke
5b13fa7987 ufs: Rework shortlink handling to avoid subobject overflows
Shortlinks occupy the space of both di_db and di_ib when used. However,
everywhere that wants to read or write a shortlink takes a pointer do
di_db and promptly runs off the end of it into di_ib. This is fine on
most architectures, if a little dodgy. However, on CHERI, the compiler
can optionally restrict the bounds on pointers to subobjects to just
that subobject, in order to mitigate intra-object buffer overflows, and
this is enabled in CheriBSD's pure-capability kernels.

Instead, clean this up by inserting a union such that a new di_shortlink
can be added with the right size and element type, avoiding the need to
cast and allowing the use of the DIP macro to access the field. This
also mirrors how the ext2fs code implements extents support, with the
exact same structure other than having a uint32_t i_data[] instead of a
char di_shortlink[].

Reviewed by:	mckusick, jhb
Differential Revision:	https://reviews.freebsd.org/D33650
2022-01-02 20:55:36 +00:00
Poul-Henning Kamp
79f38143bd sesutil: Widen "Desc" field to fit "Drive Slot 23" 2022-01-02 11:44:02 +00:00
sebastien.bini
bffefaf3e1 pmcstudy: fix error handling
Close file descriptor in the correct way if no counters
are built into the application.

Obtained from:		Stormshield
2022-01-02 10:51:07 +01:00
Nathan Whitehorn
dfa5a74357 Fix grammatical issues. 2022-01-01 19:34:48 -05:00
Alfonso Siciliano
18f20d5d96 bsddialog: convert bsdinstall/distextract
Differential Revision:	https://reviews.freebsd.org/D33581
2022-01-01 21:51:23 +01:00
Garance A Drosehn
b7b447fd4c When parsing a rule to rotate log files on a specific week day,
parseDWM() can advance the time to the next week. If the next week is
in the next month, then tm_mon is incremented. However, the increment
was failing to handle the wraparound from December to January, so when
parsing a rule during the last week of the December, the month would
advance to month 12. This triggered an out-of-bounds read of the
mtab[] array in days_pmonth() after parseDWM() returned.  To fix,
this change resets the month to January and increment the year when
the month increment wraps.

The default rule for /var/log/weekly.log triggers this during the
last week of December each year.
Reported by:	CHERI
Obtained from:	CheriBSD
Reviewed by:	jhb
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	<https://reviews.freebsd.org/D33687>
2021-12-30 20:45:13 +00:00
John Baldwin
b406897911 iscsi: Handle large Text responses.
Text requests and responses can span multiple PDUs.  In that case, the
sender sets the Continue bit in non-final PDUs and the Final bit in
the last PDU.  The receiver responds to non-final PDUs with an empty
text PDU.

To support this, add a more abstract API in libiscsi which accepts and
receives key sets rather than PDUs.  These routines internally send or
receive one or more PDUs.  Use these new functions to replace the
handling of TextRequest and TextResponse PDUs in discovery sessions in
both ctld and iscsid.

Note that there is not currently a use case for large Text requests
and those are still always sent as a single PDU.  However, discovery
sessions can return a text response listing targets that spans
multiple PDUs, so the new API supports sending and receiving multi-PDU
responses.

Reported by:	Jithesh Arakkan @ Chelsio
Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33548
2021-12-29 14:36:04 -08:00
Toomas Soome
04f55b5b0e bhyve smbios type 3 structure is incorrect
If you look at the SMBIOS specification, we'll find something is
missing. In particular at offset 0Dh is supposed to be the OEM-defined
field. This should go between security and height. It is not legal to
actually skip this and will lead to other folks not properly
interpreting later parts of the table.

https://www.illumos.org/issues/14312

Reviewed by:	jhb
Submitted by:	Robert Mustacchi <rm@fingolfin.org>
Obtained from:	ilumos
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D33682
2021-12-27 20:06:33 +02:00
Toomas Soome
c2fa905cf6 bhyve: clean up trailing whitespaces
Clean up trailing whitespaces. No functional changes.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D33681
2021-12-27 19:58:10 +02:00
Bjoern A. Zeeb
f1442847c9 bhyve: passthru: enable BARs before possibly mmap(2)ing them
The first time we start bhyve with a passthru device everything is fine
as on boot we do enable BARs.  If a driver (unload) inside bhyve disables
the BAR(s) as some Linux drivers do, we need to make sure we re-enable
them on next bhyve start.

If we are trying to mmap a disabled BAR for MSI-X (PCIOCBARMMAP)
the kernel will give us an EBUSY.
While we were re-enabling the BAR(s) in the current code loop
cfginit() was writing the changes out too late to the real hardware.

Move the call to init_msix_table() after the register on the real
hardware was updated.  That way the kernel will be happy and the
mmap will succeed and bhyve will start.
Also simplify the code given the last argument to init_msix_table()
is unused we do not need to do checks for each bar. [1]

MFC after:	3 days
PR:		260148
Pointed out by:	markj [1]
Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D33628
2021-12-29 17:01:05 +00:00
John Baldwin
c74ab5ce6f iscsid: Always free the duplicated address in resolve_addr().
If a "raw" IPv6 address (denoted by a leading '[') is used as a target
address, then 'arg' is incremented by one to skip over the '['.
However, this meant that at the end of the function the wrong address
was passed to free().  With malloc junking enabled and given suitably
small strings, malloc() would happily overwrite the correct number of
bytes with junk, but off by one byte overwriting the byte after the
allocation.

This manifested as the first byte of the 'HeaderDigest' key being
overwritten causing the key name on the wire to be sent as
'\x5eaderDigest' which the target rejected.

Reported by:	Jithesh Arakkan @ Chelsio
Found with:	ASAN (via WITH_ASAN=yes)
Sponsored by:	Chelsio Communications
2021-12-28 16:49:46 -08:00
Alfredo Dal'Ava Junior
c3d9c63329 kldxref: add R_PPC64_ADDR64 handler
Implements R_PPC64_ADDR64 handler for kldxref, addressing
"kldxref: unhandled relocation type 38" when running
"kldxref /boot/kernel"

Reviewed by:	jhibbits
MFC after:	1 week
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D33615
2021-12-27 15:29:50 -03:00
John Baldwin
fa255ab1b8 ctld: Disable -Wcast-align warnings.
clang complains about the downcasts from struct connection to struct
ctld_connection as the alignment of struct ctld_connection is higher
on 32-bit platforms.  However, the warning is in this case harmless as
the downcasts are on objects originally allocated as instances of
struct ctld_connection with suitable alignment.

Reported by:	npn, gjb
Fixes:		6378393308 Add an internal libiscsiutil library.
Sponsored by:	Chelsio Communications
2021-12-22 15:23:45 -08:00
John Baldwin
25700db366 libiscsiutil: Change keys_load/save to operate on data buffers.
This will be used in future changes to support large text requests
spanning multiple PDUs.

Provide wrapper functions keys_load/save_pdu that operate use a PDU's
data buffer.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33547
2021-12-22 10:43:24 -08:00
John Baldwin
6378393308 Add an internal libiscsiutil library.
Move some of the code duplicated between ctld(8) and iscsid(8) into a
libiscsiutil library.

Sharing the low-level PDU code did require having a
'struct connection' base class with a method table to permit separate
initiator vs target behavior (e.g. in handling proxy PDUs).

Reviewed by:	mav, emaste
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33544
2021-12-22 10:43:11 -08:00
Emmanuel Vadot
ec0ea6efa1 pkgbase: Add a FreeBSD-pkg-bootstrap package
And put pkg and its keys in it.
It's easier for small image to depend on this package rather than the
larger utilities one.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33458
2021-12-21 10:17:48 +01:00
Emmanuel Vadot
380073af3a pkgbase: Put certctl in the FreeBSD-caroot package
There is no reason that this shouldn't be there.
Change the dependency of caroot from utilities to openssl as it's
the only command that it uses not in runtime.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33458
2021-12-21 10:17:44 +01:00
Emmanuel Vadot
26ea904caa pkgbase: Create a FreeBSD-newsyslog package
This allow one to install it without having to install FreeBSD-utilities.
While here put some newsyslog.d file in their own package.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33456
2021-12-21 10:17:42 +01:00
Emmanuel Vadot
25367c806b pkgbase: Create a FreeBSD-syslogd package
This allow one to not install syslogd and use syslog-ng or any other
syslog daemon.
While here put some syslog.d file in their own package.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33455
2021-12-21 10:17:40 +01:00
Emmanuel Vadot
b3d14eaccc pkgbase: Create a FreeBSD-periodic package
While here put the periodic files for some utilities in their own
packages.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33454
2021-12-21 10:17:38 +01:00
Emmanuel Vadot
dcf9d46a3f pkgbase: Create a FreeBSD-mtree package
And put the mtree binary and files in it.
Useful to create small mfsroot using /etc/rc.d/var without
having to install FreeBSD-utilities.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33442
2021-12-21 10:17:33 +01:00
Emmanuel Vadot
078b764da3 pkgbase: Create a FreeBSD-tcpd package
And put the tcp-wrapper utilities in it.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33439
2021-12-21 10:17:31 +01:00
Emmanuel Vadot
93c4369096 pkgbase: Put more binaries/lib in runtime
Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33435
2021-12-21 10:17:27 +01:00
Emmanuel Vadot
eb14f050a3 pkgbase: Put autofs config files in the FreeBSD-autofs package
Reviewed by:	emaste
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33434
2021-12-21 10:17:25 +01:00
Emmanuel Vadot
5abb10faa1 pkgbase: Put yellow pages programs to its own package
YP is less and less used, split them to users have the choice to not
install them.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33441
2021-12-21 10:17:22 +01:00
Peter Wemm
81a48881c6
periodic: Use a deterministic $PATH for periodic.
Various tools can have alternate versions elsewhere, eg: the GNU
mailutils port (a dependency of emacs*) brings /usr/local/bin/mail.
Match the preset PATH in /etc/crontab for deterministic path searches
even when run manually with a different environment.

PR:		259265
Reported by:	iandstanley@gmail.com
2021-12-20 18:54:56 -08:00
Joerg Wunsch
1654b51455
usbconfig: actually set the exit code in usage()
Oversight in previous commit: usage() had been turned to accept
an "exitcode" parameter, but it hasn't been used.

MFC after:	2 weeks
2021-12-20 22:25:19 +01:00
Joerg Wunsch
d69b9cc26d
usbconfig: implement a -v option
Implement a -v option to usbconfig(8), as a shortcut for the most
frequently needed commands dump_device_desc, dump_curr_config_desc,
and show_ifdrv.

While here, implement a real -h option that has been promised by the
man page.

Use <sysexits.h> to declare the utility return codes.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D33586
MFC after:	2 weeks
2021-12-20 22:08:57 +01:00
Joerg Wunsch
cae1884d47
usbconfig: documentation fixes, mainly for -i option
* in usage(), clearly mark -i interface as optional
* both, -u busnum and -a devaddr are optional as well
* various minor man page fixes
* clearly mark those two commands that actually use -i ifaceidx
* remove unused bitfield tag got_iface
* fix indentation level according to review comment

Differential Revision:	https://reviews.freebsd.org/D33579/
Reviewed by:	hselasky
MFC after:	2 weeks
2021-12-20 12:49:31 +01:00
Joerg Wunsch
ae450e6de9
usbconfig: use getopt(3) for option handling
This makes option handling consistent with other utilities as well as
Posix rules. By that, it's no longer important whether option name and
its argument are separated by a space or not, so -d5.3 works the same
as -d 5.3.

Also, recognize either /dev/ugen or ugen as prefix to the -d argument.

Note that this removes the undocumented feature that allowed to
specify multiple -d n.m options interleaved with commands referring to
that particular device in a single run.
2021-12-20 12:49:30 +01:00
Vitaliy Gusev
d079fc197a bhyve: Only snapshot initialized VirtIO queues
If the virtio device is not fully initialized, then suspend fails with:

  vi_pci_snapshot_queues: invalid address: vq->vq_desc
  Failed to snapshot virtio-rnd; ret=14

MFC after:	1 week
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D26268
2021-12-17 13:06:53 -05:00
Alfonso Siciliano
be0236ebd8 tzsetup: Fix unicode support
Differential revision:	https://reviews.freebsd.org/D33532
2021-12-17 09:25:07 +01:00
Emmanuel Vadot
9935b0e8ea bsdinstall: zfsboot: Prompt user for zpool name if the pool already exists
If one install FreeBSD on multiple disks (say 13 and CURRENT) the first created
pool will always be used.
Prompt the user for a new pool name if we detect that the default or supplied one
already exists.

Reviewed by:	imp
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33331
2021-12-15 15:24:07 +01:00