Commit Graph

21801 Commits

Author SHA1 Message Date
Roman Bogorodskiy 148111d377 bhyvectl: improve options error handling
Currently, it is possible to execute bhyvectl(8) with mutually exclusive
options, such as "--destroy" and "--suspend", and it will print out
obscure errors, e.g.:

 bhyvectl --suspend=/var/run/vms/my_vm --destroy --vm my_vm
 connect() failed: Connection refused

Address that by failing early if mutually exclusive options were
specified.

Additionally, move the BHYVE_SNAPSHOT block before the errors are
printed, so its errors are also displayed.

Approved by:		markj
Sponsored by:		The FreeBSD Foundation
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D54092
2025-12-13 10:27:00 +01:00
Roman Bogorodskiy 611bbb190f bhyve: change suspend exit code
Currently, after suspending, bhyve(8) exits with 0. This code is
also used to indicate that a VM was rebooted. To differentiate
reboot and suspend, use the next available exit code, 5, for suspend.

Approved by:		markj
Sponsored by:		The FreeBSD Foundation
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D54087
2025-12-13 10:12:38 +01:00
Toomas Soome e3fa0a22dd bhyve: pci-uart needs to also set subclass and function
edk2 PciSioSerialDxe driver setup depends on subclass and function
being set, adding them does make it possible to access pci-uart
serial port from UEFI.

Reviewed by:		corvink
Differential Revision:	https://reviews.freebsd.org/D54167
Sponsored by:		Edgecast Cloud LLC
2025-12-11 10:11:50 +02:00
Eugene Grosbein b2f8d46d89 trim.8: fix misprint
Grammar fix after previous commit.

MFC after:	1 week
X-MFC-with:	dbc4a1c691
2025-12-09 21:57:10 +07:00
Eugene Grosbein dbc4a1c691 trim.8: minor update for manual page
Further explain that trim(8) is not for trimming free blocks
in populated file systems/ZFS pools, as people still take it wrong sometimes.

MFc after:	1 week
2025-12-09 21:47:26 +07:00
John Baldwin f63a8c0a09 bsdinstall: Mount /dev and /packages after using the shell to partition disks
Normally after partitions are created by the installer, the 'mount'
script is used to mount the target disk partitions under /mnt.  The
tail end of this script also mounts a couple of additional filesystems
under /mnt so that chrooted programs can work such as devfs and
/packages.

When the "Shell" option is used to permit the user to manually mount
the destination filesystem, the "mount" script is not used as the user
is instructed to mount the target filesystems and construct
/mnt/etc/fstab, etc.  However, this means that the user is responsible
for mounting devfs (which is not included in /etc/fstab) and /packages
as well.  The help message for the "Shell" option doesn't mention
these requirements, so users may not know to do so.  This can lead to
confusing errors as chrooted commands can fail to find needed /dev
entries.  For example, running fwget to fetch wireless firmware fails
because /dev/pci doesn't exist.

To make this less painful for users using this option, split out the
bottom half of the 'mount' script that mounts these non-fstab-related
filesystems into a separate 'mount_aux' script.  Invoke 'mount_aux'
after using "Shell" to create the filesystem to ensure that these
filesystems are always present.

PR:		290901
Reported by:	Peter <freebsd@peterk.org>
Tested by:	Peter <freebsd@peterk.org>
Differential Revision:	https://reviews.freebsd.org/D53770
2025-12-08 16:33:30 -05:00
Mark Johnston 792221630b rtsold: Fix a buffer leak if we fail to read the default router sysctl
MFC after:	1 week
Reported by:	Kevin Day <kevin@your.org>
2025-12-08 14:08:13 +00:00
Christos Margiolis 643a606fa2 sndctl(8): Do not free and re-open device
There was a reason for this, but it does not apply anymore.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54031
2025-12-06 15:28:08 +01:00
Jessica Clarke ced7461021 freebsd-update: Mention upgrading packages, not just ports
These days most end users are likely using pre-built packages, not
locally-built ports. Thus be sure to mention this as an important case,
and put it ahead of ports.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42968
2025-12-06 00:33:20 +00:00
Jose Luis Duran 5c7176bba3 certctl.8: Prefer the new TRUSTDESTDIR variable
With the reimplementation in C of certctl, the environment variable
previously known as CERTDESTDIR was renamed to TRUSTDESTDIR for
consistency.

Although the previous variable is still valid, prefer the new one, as it
is described in the manual page, while the old one is not.

Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54044
2025-12-05 17:36:49 +00:00
Kristof Provost f6aa57c86b snmp_pf: use the libpfctl wrapper to retrieve astats
Extend the test case to verify this works as expected.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-12-05 13:24:52 +01:00
Tom Jones 2343516042 xhci: Correct name of HCCPARAMS Register
On inital import the name of HCCPARAMS1 was misnamed as HCSPARAMS0.
HCCPARAMS1 is defined in section 5.3.6 of xHCI Specification 1.2b (April
2023).

Reviewed by:	adrian
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53895
2025-12-05 10:17:45 +00:00
Pau Amma 9ec8196f68 vidcontrol.1: Video buffer dump is syscons only
Fixes:		1f4442f71f (be explicit that -p and -P are sc(4) only)
MFC after:	3 days
Reviewed by:	ziaee
Differential Revision:	https://reviews.freebsd.org/D53878
2025-12-03 22:31:43 -05:00
Konstantin Belousov 1ecf01065b libuvmem: usermode port of vmem(9)
The quantum cache is disabled, there is no uma.

Intent is to use this for resource allocation in bhyve(8), for start.
Addition of -luvmem to bhyve linking was done to test changes to share/mk.

Reviewed by:	bnovkov, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27220
2025-12-02 05:41:13 +02:00
Vladimir Kondratyev dc6f609685 msconvd(8): Drop mentions of Bus/InPort mouse support in manual page
mse(4) was removed long ago.

MFC after:	1 month
2025-12-02 00:09:00 +03:00
Colin Percival a3b0902d73 pkg: Move FreeBSD-base to pkg.freebsd.org
Rather than fetching packages directly from the CDN which currently
backs pkgbase.freebsd.org, requests will go to pkg.freebsd.org mirrors
and be 302ed to the correct servers.  This adds ~70 seconds to the
process of installing or upgrading a pkgbase system; it also orphans
systems with 15.0-{PRERELEASE,ALPHA*,BETA*} installed since they are
expecting to see pkgbase files signed with the pkg keys, not the new
pkgbase signing keys.

Reviewed by:	dch, philip
MFC after:	immediately (for 15.0-RELEASE)
With hat:	re
Requested by:	clusteradm, core
Differential Revision:	https://reviews.freebsd.org/D53964
2025-11-27 14:13:52 -08:00
Olivier Certner 7521dc5dce exports.5: Typo: "auomatically" => "automatically"
Fixes:          9d975e47d5 ("exports.5: Clarify that exported dirs should be local mount points")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2025-11-27 21:35:31 +01:00
ykla e27d5c190a bsdconfig: RealTek -> Realtek
Realtek changed how it styled its name 25 or so years ago, but the old
style persisted in many places. These products use the new styling in
their datasheets.

Signed-off-by: ykla yklaxds@gmail.com
Sponsored by: Chinese FreeBSD Community
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
2025-11-26 23:19:26 -07:00
Colin Percival d45816f369 bsdinstall: Ignore -p[0-9]+ in determining BRANCH
The patch level is not part of the branch per se and should not be
used in constructing the FreeBSD-base.conf file used by bsdinstall.

MFC after:	1 day
2025-11-26 09:07:24 -08:00
Matt Jacobson 4c8bf76893 fdread: Fix logic bug when reading by sector
When reading by sector (because reading a whole track failed), we can
accidentally fall into the "should not happen" path, which both
(a) emits a spurious error message and (b) fouls up our position
accounting going forward.  Ensure we do not inappropriately fall into
that path.

Avoid obscuring the "short after" message in cases where it happens.

Signed-off-by: Matt Jacobson <mhjacobson@me.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1897
2025-11-25 11:17:26 -07:00
John Baldwin e928afc531 Use ZFSTOP more broadly
Reviewed by:	brooks
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D53791
2025-11-24 10:47:10 -05:00
Mark Johnston b0c7eaf83d bhyve/slirp: Drop privileges before entering capability mode
When in restricted mode, the slirp-helper process enters a capsicum
sandbox, after which we cannot look up the uid for the "nobody" user.
Reverse the order.

Reported by:	kp
Fixes:	0e62ebd201 ("bhyve: Move the slirp backend out into a separate process")
2025-11-24 14:28:42 +00:00
Mark Johnston bac572b2b1 bhyve/slirp: Avoid a nested declaration of environ
Fixes:	0e62ebd201 ("bhyve: Move the slirp backend out into a separate process")
2025-11-24 14:28:42 +00:00
Mark Johnston 0e62ebd201 bhyve: Move the slirp backend out into a separate process
The previous implementation implemented hostfwd rules which would allow
the host to connect to the guest via a NATed TCP connection.  libslirp
also permits NAT in the other direction, but this was prevented by
bhyve's capsicum sandbox.

To make the slirp backend more useful, split the backend out into a
separate process which does not enter capability mode if outbound
connections are permitted (enabled by setting the new "open" keyword).
The process communicates with the bhyve network frontend (typically a
virtio network interface) using a unix SOCK_SEQPACKET socket pair.  If
the bhyve process exits, the helper will automatically exit.

Aside from this restructuring, there is not much actual change.  Many
slirp parameters are still hard-coded for now, though this may change.
The "restricted" feature is toggled by the new "open" keyword; in
particular, the backend is restricted by default for compatibility with
15.0 and 14.3.

Each packet now has to traverse an extra socket, but this overhead
should be acceptable given that the slirp backend cannot be said to
provide high-performance networking.  With iperf3 I can get 4Gbps from
the guest to the host on a Zen 4 system.

MFC after:	1 month
Sponsored by:	CHERI Research Centre (EPSRC grant UKRI3001)
Differential Revision:	https://reviews.freebsd.org/D53454
2025-11-19 16:02:21 +00:00
Gordon Bergling 843a4ad581 ypldap(8): Fix a typo in a debug message
- s/unexpect/unexpected/

MFC after:	5 days
2025-11-19 15:31:13 +01:00
Gordon Bergling 66d4a37bc3 lpr(1): Fix a typo in a debug message
- s/unexpect/unexpected/

MFC after:	5 days
2025-11-19 15:30:02 +01:00
Gordon Bergling 16d8aecdf5 cxgbetool(8): Fix a typo in the stats description
- s/addres/address/

MFC after:	3 days
2025-11-19 15:27:02 +01:00
Gordon Bergling 64bbcff944 moused(8): Fix a couple of typos in the manual pages
- s/compatibiliy/compatibility/
- s/rewriten/rewritten/
- s/derrived/derived/
- s/suppported/supported/
- s/Horisontal/Horizontal/
- s/thesholds/thresholds/

MFC after:	3 days
2025-11-19 15:21:09 +01:00
Jose Luis Duran 0628400590 local-unbound: Read a tab separated resolv.conf
Use [[:space:]] rather than a white space character to delimit the keys
and the values in the resolv.conf file.

PR:		236079
Reviewed by:	des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53811
2025-11-19 01:09:58 +00:00
Mark Johnston 1238610a27 setaudit: Add an update mode
By default, setaudit(8) overwrites the whole audit session state.  For
the purpose of overwriting only a single field, e.g., the audit user,
this is inconvenient.  Add -U to accomodate this case: when specified,
setaudit(8) will first fetch the current session state block and then
will only overwrite those fields specified on the command line.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53672
2025-11-18 16:24:20 +00:00
Mark Johnston 551191e14e setaudit: Fix handling of numeric UIDs
The usage of strtoul() was incorrect.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53671
2025-11-18 16:24:20 +00:00
Mark Johnston a9be8f9968 setaudit: Bump WARNS and fix some style bugs
- Cast sockaddrs through void to silence warnings about expected
  alignment.
- Fix cast style.
- Sort includes.
- Make some global variables local.
- Sort options.

No functional change intended.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53670
2025-11-18 16:24:20 +00:00
Mark Johnston dcb0790bad setaudit: Initial import
Unmodified sources from https://github.com/csjayp/setaudit at commit
aa4dd9dfa40b6437030d718834236f4eaeb18ccb.

Some follow-up changes will fix a few issues and make it easier to use
this utility in the rc framework.

Reviewed by:	csjp
MFC after:	2 weeks
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D53669
2025-11-18 16:24:20 +00:00
Martin Matuska 4303bde429 zfs: fix build after openzfs/zfs@e63d026b9
Fix Makefiles
Update zfs_config.h and zfs_gitrev.h
2025-11-17 17:11:56 +01:00
Ed Maste af4ba95daf freebsd-update: Add some diagnositic information for a failure case
Users report freebsd-update failing with "The update metadata index is
correctly signed, but failed an integrity check."  Add a hint at which
of the cases is failing to help track down the issue.

PR:		264205
Reviewed by:	dch
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52222
2025-11-17 09:42:17 -05:00
Ed Maste 4c736cfc69 Deprecate fdc(4) and floppy utilities
Floppies have been obsolete for over a decade.  Add a deprecation note
now and plan to remove fdc(4) support in 16.

Reviewed by:	ziaee
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41549
2025-11-16 17:46:12 -05:00
Colin Percival a96230e032 bsdinstall: Enable FreeBSD-base repo when pkgbase
When performing a pkgbase install, create a configuration file in
/usr/local/etc/pkg/repos/FreeBSD.conf which enables the FreeBSD-base
repository.  (This repository is defined in /etc/pkg/FreeBSD.conf as
being disabled by default.)

Reported by:	Mark Millard
Reviewed by:	markj
MFC after:	immediately (needed for 15.0-RC1)
Differential Revision:	https://reviews.freebsd.org/D53777
2025-11-15 14:05:50 -08:00
Colin Percival 8e0b1a1c03 pkg: Add FreeBSD-base to /etc/pkg/FreeBSD.conf
On -CURRENT and -STABLE this gets bits from pkg.freebsd.org; but we get
base system bits from pkgbase.freebsd.org for BETA/RC/RELEASE.

Note that this repository is disabled by default, but can still be used
by explicitly specifying it, e.g. "pkg upgrade -r FreeBSD-base".

With hat:	re
MFC after:	8 hours (needed in 15.0-RC1)
2025-11-14 23:58:41 -08:00
Colin Percival bdfc223c7a bsdinstall: Don't install FreeBSD-base.conf
When installing e.g. 15.0-RC1, we want to get files from the 15.0-RC1
pkgbase repository; but running 'pkg upgrade' after installation should
get the latest bits build from releng/15.0.

With hat:	re
MFC after:	8 hours (needed in 15.0-RC1)
2025-11-14 23:58:41 -08:00
Colin Percival 51184e38c9 bsdinstall: Use pkgbase.f.o for BETA/RC/RELEASE
For BETA/RC/RELEASE builds, fetch files from the appropriate repository
on pkgbase.freebsd.org, using the appropriate signing keys.  Note that
there is a separate repository for each BETA and RC; this ensures that
someone installing from e.g. a 15.0-RC1 ISO will get 15.0-RC1 bits and
not whatever happens to be the most recent build from releng/15.0.

With hat:	re
MFC after:	8 hours (needed in 15.0-RC1)
2025-11-14 23:58:41 -08:00
Colin Percival 6b0909f940 bsdinstall: Copy in all keys
The keys used for pkgbase signing are going to be placed in
/usr/share/keys/pkgbase-N where N is the FreeBSD major version
number; as such it's not sufficient to copy /usr/share/keys/pkg
into the install chroot, but instead we need /usr/share/keys/*.

With hat:	re
MFC after:	8 hours (needed in 15.0-RC1)
Differential Revision:	https://reviews.freebsd.org/D53753
2025-11-14 23:58:40 -08:00
Dag-Erling Smørgrav 2f3adab9d5 quot: Improve manual page
* Rewrite the first paragraph to clarify that quot(8) only supports FFS.

* Document which options can or cannot be combined with each other.

MFC after:	1 week
Reviewed by:	ziaee
Differential Revision:	https://reviews.freebsd.org/D53727
2025-11-14 15:29:05 +01:00
Dag-Erling Smørgrav fa272a5276 quot: Rewrite -n mode input parser
The existing parser was needlessly complicated and wildly inconsistent
in how it handled invalid input.  Rewrite using getline() and treat
invalid input consistently: silently ignore lines that don't begin with
a number, and print a warning if the inode number is out of range.

PR:		290992
MFC after:	1 week
Reviewed by:	obrien
Differential Revision:	https://reviews.freebsd.org/D53726
2025-11-14 15:29:05 +01:00
Alexander Ziaee 477799750a jail.8: Add creating a jail from package base
MFC after:		immediately for inclusion in 15.0R
Reported by:		ivy
Differential Revision:	https://reviews.freebsd.org/D53745
2025-11-13 18:58:00 -05:00
John Baldwin daa1f9b415 apm(8): Drop MLINK to apmconf(8)
apmconf(8) was merged into apm(8) back in 2000 and this note and MLINK
were added as a transition aid, but that aid is no longer needed.
2025-11-12 21:38:35 -05:00
Navdeep Parhar 17b4a0acfa cxgbe(4): T7 related updates to shared code
- Avoid some more registers with read side-effects during regdump.
- mps_tcam_size is 3x the size of T6/T5.
- Update rss_rd_row to work with T7.

Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
2025-11-12 16:32:38 -08:00
Muhammad Moinur Rahman 5b9fba1cb0 Retire pccard(4)
pccard has been declared obsolete for a long time and also the
support has been removed but the man page still exists. It mentions
being scheduled to be removed before 13.0 but it still exists in the
tree.

[Extracted from review D53434]

Reviewed by: emaste
Fixes: 31b35400c ("pccard: Remove more of the PC Card infrastructure")
2025-11-12 12:09:09 -05:00
Ed Maste 4109cdf0f8 bsdinstall: Use fat32 EFI system partition for ZFS
This is consistent with other operating systems and with bsdinstall's
UFS config and with bsdinstall's ZFS config prior to commit
0b7472b3d8.

Fixes: 0b7472b3d8 ("Mount the EFI system partition (ESP) on newly-installed systems.")
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53642
2025-11-11 13:17:56 -05:00
Christos Margiolis e5c0d7020f virtual_oss(8): Improve hw.snd.basename_clone handling
If we request a /dev/dsp virtual_oss(8) device, we have to replace the
sound(4) one by first disabling hw.snd.basename_clone. This sysctl tells
sound(4) to not create the /dev/dsp alias for the default device. There
are currently two issues with the way this is handled by virtual_oss(8),
however:

1. It uses system(3) instead of sysctlbyname(3).
2. It does not restore hw.snd.basename_clone to its original value, so
   if prior to virtual_oss(8) running, hw.snd.basename_clone was enabled
   (which is the case by default), and it is closed at some point,
   hw.snd.basename_clone stays disabled, which is annoying, because
   users have to manually restore it, otherwise applications that open
   the default device (i.e., most) will not work.

Fix both issues.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D53621
2025-11-11 13:07:44 +01:00
Christos Margiolis 7bedc4634d virtual_oss(8): Use kldload(2) instead of system(3)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	imp, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D53617
2025-11-11 13:07:40 +01:00