Commit graph

10617 commits

Author SHA1 Message Date
Brooks Davis 6bb132ba1e Reduce reliance on sys/sysproto.h pollution
Add sys/errno.h, sys/malloc.h, sys/queue.h, and vm/uma.h as needed.

sys/sysproto.h currently includes sys/acl.h which currently includes
sys/param.h, sys/queue.h, and vm/uma.h which in turn bring in
sys/errno.h sys/malloc.h.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44465
2024-04-15 21:35:40 +01:00
Elyes Haouas f7cee4fa57 sbin: Remove repeated words
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/887
2024-04-11 11:53:37 -06:00
Elyes Haouas d600ad8101 ipfw: Remove repeated words
Remove repeated words in error message.

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/887
2024-04-11 11:53:26 -06:00
Graham Perrin 20b5e47c93 bectl(8): authors: Kyle Evans: fine-tune
Discussed with Kyle in Discord.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/857
2024-04-09 22:01:03 -06:00
Graham Perrin 984f503749 bectl(8): authors: be more explicit
Cross-reference (name) the manual page that was written by Bryan
Drewery.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/857
2024-04-09 22:00:59 -06:00
Graham Perrin 6e3e24d145 bectl(8): HISTORY, AUTHORS: further attention
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/857
2024-04-09 22:00:56 -06:00
Graham Perrin a27e19a223 bectl(8): corrections, changes
beadm(1) no longer exists.

Cross-reference beadm(8).

Aim to improve the HISTORY and AUTHORS sections, including consistency
with the manual pages for beadm(8) and libbe(3).

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/857
2024-04-09 22:00:48 -06:00
Warner Losh ea002c1017 devmatch: Convert command line flags to bools
These are bools, and should have been bools from the start. Make them
bools.

Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Warner Losh 03cfd91998 devmatch: Make -a work for all devices
devmatch -a should produce output for all attached devices, but doesn't.

Noticed by:		cperciva
Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Warner Losh fe83abacd4 nvme: Add my copyright to logpage.c
Reflect the command line refactoring I did, and other changes. git blame
says I'm to blame for ~1/4 of this file.

Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Yan-Hao Wang c7bdc25d41
savecore(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41392
2024-04-04 02:28:30 +08:00
Christopher Davidson 2ebc7806a1 mount_mfs.8: remove self-reference
Change .Xr instances to .Nm, which quiets several mandoc warnings.

Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1135
2024-04-03 13:55:55 -03:00
Mark Johnston 87e63f2e7f nextboot: Write nextboot.conf safely
As in the old nextboot.sh script:
- First write everything to a tempfile instead of /boot/nextboot.conf.
- fsync() the tempfile before renaming it to nextboot.conf.

Fixes:	fd6d47375a ("rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh")
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44572
2024-04-03 11:31:43 -04:00
Gleb Smirnoff 1bfe195143 pfilctl: fix 'pfilctl hooks' when nothing is connected
The 'hooks' command actually worked accidentially until now.  It used
PFILIOC_LISTHEADS to determine current number of hooks.  This worked when
at least one head had a hook connected to it.
2024-03-28 14:10:15 -07:00
Ed Maste 7dc5c6c412 bsdlabel: add BUGS section documenting 8 partition limit
PR:		276517
2024-03-25 18:26:29 -04:00
Ed Maste 3661658c76 bsdlabel: emit deprecation notice when run
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Reision: https://reviews.freebsd.org/D43586
2024-03-25 15:59:09 -04:00
Ed Maste b6f3cced15 bsdlabel: add deprecation notice
gpart is the preferred tool for managing partitions of all types,
including BSD disklabels.

Note that this is only about bsdlabel/disklabel, the tool -- there is no
current plan to remove support for MBR or BSD disk labels from the
kernel or from gpart.

Reviewed by:	imp, olce
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43563
2024-03-25 15:43:34 -04:00
John Baldwin acbc176c3d nvmecontrol: Display additional Fabrics-related fields for cdata
Some of these fields are specific to Fabrics controllers (such as the
size of capsules) while other fields are shared with PCI-e
controllers, but are more relevant for Fabrics controllers (such as
KeepAlive timer properties).

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44449
2024-03-22 17:25:07 -07:00
Ed Maste 8669e516f0 ccdconfig: reference gpart rather than fdisk and disklabel
fdisk and disklabel are legacy tools for legacy disk partitioning
schemes.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43564
2024-03-22 14:51:15 -04:00
Kristof Provost 470a2b3346 pf: convert DIOCSETSTATUSIF to netlink
While here also add a basic test case for it.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D44368
2024-03-19 16:30:08 +01:00
Dag-Erling Smørgrav a46217ce7d bectl: Simplify command aliases.
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44406
2024-03-18 14:49:23 +01:00
Dag-Erling Smørgrav e819534f15 bectl: Use geopt() and drop mention of -?.
MFC after:	3 days
PR:		272260
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44405
2024-03-18 14:49:18 +01:00
PauAmma 140119a60d ifconfig.8: add missing "be"
Reviewed by:	allanjude, bjk
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44022
2024-03-15 14:16:53 -07:00
John Baldwin 1b38f851d8 nvmecontrol: Update the test for a valid firmare revision slot
Reported by:	Coverity Scan
CID:		1539214
Fixes:		7485926e09 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings
2024-03-15 08:18:47 -07:00
Dag-Erling Smørgrav b53ae8a833 ping: Fix protocol selection with NOINET6 kernel.
A missing else caused the correct resolver hint (AF_INET) to be
overwritten with AF_UNSPEC when the kernel supports IPv4 but not
IPv6.

MFC after:	3 days
PR:		277592
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44304
2024-03-12 20:40:36 +01:00
Gordon Bergling f3343fe4a6 md5.1: Fix the GNU mode example when using a digest file
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead.

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR:	276560
Reviewed by:	mhorne, des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44098
2024-03-12 15:44:48 +01:00
Konstantin Belousov bdf1587a49 mount_nullfs(8): fix typo
Reported by:	mckusick
2024-03-09 23:18:39 +02:00
Konstantin Belousov 4a2a69c447 mount_nullfs(8): document -o cache and vfs.nullfs.cache_vnodes
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-08 20:44:21 +02:00
Warner Losh 7c6af20969 devd: Add directory information
Devd searches /etc/devd and /usr/local/etc/devd by default (given the
default devd.conf file). Document that here.

Sponsored by:		Netflix
2024-03-06 18:38:59 -07:00
Warner Losh 6a3877a0e2 devd: Document the nvme devd events
Nvme informs devd of smart and reset controller events. Document them.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D44212
2024-03-06 18:38:59 -07:00
Gordon Bergling a44658281a Revert "md5.1: Fix an example"
This reverts commit 865baeaf1a.
2024-03-06 09:34:30 +01:00
John Baldwin 7485926e09 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings
In particular, don't try to byteswap the values as 64-bit integers and
always print a non-empty version as a string.

Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44121
2024-03-01 14:18:43 -08:00
Stefan Eßer 484de86fbe ldconfig: remove ignored -v (verbose) option
The -v option used to print useful information when operating on a.out
format libraries. After the removal of a.out support, it was accepted
but did not have any effect.

Remove the option and update the man-page.

While here mention the set of historic options that are accepted but
ignored: "-elf", "-s", and "-v".

The FILES section contained outdated information and did not mention
the way library directories of optional ports and packages are
included in the library search path recorded in the hints file.

The description of the "-B" option was incorrect (described a planned
change) for big-endian platforms (powerpc64). These do still default
to big-endian hints files, since the current version of the "pkg"
program expects the hints file to be in native byte-order.

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D44139
2024-03-01 16:40:55 +01:00
Kristof Provost 706d465dae pf: convert kill/clear state to use netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D44090
2024-02-28 23:26:18 +01:00
Stefan Eßer e0dfecadf5 ldconfig: support hints files of either byte-order
Make the ldconfig program accept hints files in little-endian and
big-endian format on all architectures.

The default format is the native byte-order of the respective host.
This is expected to change when a version of the pkg command is
available that implements support for either byte-order in its
internal ldconfig function. (Already committed in the development
tree of the pkg utility, a release is expected at the end of Q1/2024).

This update adds the -B option to the ldconfig program. It enforces
the creation of a big-endian hints file on a little-endian host.
The main purpose to is support of tests with non-native byte-order
files on little-endian hosts. It will be removed when all supported
FreeBSD releases use little-endian hints files by default.

When little-endian hints files are generally used, support of
either byte-order in libexec/rtld can also be removed.

When support for big-endian hints files is no longer required,
the COND_SWAP macro in ldconfig and rtld shall be replaced by
le32toh(), which just return their argument on little-endian
architectures.

Approved by:	kib
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D44093
2024-02-28 18:49:29 +01:00
Stefan Schlosser 865baeaf1a md5.1: Fix an example
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead:

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a  digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR:	276560
Reviewed by:	mhorne
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44098
2024-02-28 09:31:28 +01:00
Stefan Schlosser 77f6c0ce92 nvmecontrol.8: Fix the SYNOPSIS section
The manpage of nvmecontrol(8) has the following SYNOPSIS:

nvmecontrol format [-f fmt] [-m mset] [-o pi] [-l pil] [-E]
[-C] <device-id | namespace-id>

The correct switch for the pi option is -p according
to sbin/nvmecontrol/format.c:

OPT("pi", 'p', arg_uint32, opt, pi, "Protective information")

So correct the SYNOPSIS section accordingly.

PR:	276554
Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44099
2024-02-28 09:26:20 +01:00
Warner Losh bad90cb4f6 nextboot: check unlink, but only warn on !ENOENT
Emulate rm -f from the nextboot.sh script: Report all errors, except
ENOENT. This problems show through, except the expected one when
nextboot.conf isn't there.

Sponsored by:		Netflix
Reviewed by:		rew
Differential Revision:	https://reviews.freebsd.org/D44013
2024-02-21 20:10:45 -07:00
Warner Losh 07cba2ddcb reboot: Emulate nextboot -D better
It used to produce no output when the file couldn't be removed. Emulate
that better by unlinking and ignoring errors. It's used at the end of
reboot always, even when the file isn't going to be there.

Sponsored by: Netflix
Fixes: 2c47954811
2024-02-20 23:04:56 -07:00
Dag-Erling Smørgrav 702f133fa1 md5: Untabify declarations.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43991
2024-02-20 23:04:45 +01:00
Dag-Erling Smørgrav c05533d97a md5: Fix GNU check mode.
Fixes:		9b20849bc5
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43990
2024-02-20 23:04:40 +01:00
Dag-Erling Smørgrav 4db7ca2447 md5: Fix Perl mode long options.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43989
2024-02-20 23:04:36 +01:00
Dag-Erling Smørgrav e7308a60a5 md5: Add test case for GNU input modes.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43988
2024-02-20 23:04:32 +01:00
Gleb Smirnoff 0c3ade2cf1 nextboot: fix nextboot -k on ZFS
zfsbootcfg(1) expects pool name to operate on, not currently mounted
filesystem name.

Fixes:	fd6d47375a
2024-02-19 19:51:22 -08:00
Gleb Smirnoff 3aefe67596 nextboot: fix typo that merged two args into one
Fixes:	fd6d47375a
2024-02-19 19:51:22 -08:00
Kirk McKusick b241767f8e Eliminate unnecessary UFS1 integrity checks.
The UFS1 integrity checks added in FreeBSD 14 were too aggressive
for UFS1 filesystems created in FreeBSD 4 and 9 systems. This patch
removes those tests which can be done safely since they are not
relevant to the current implementation of UFS1.

This is a follow-on report to bug report 264450 (comments 21-28).

Reported by: slb@sonnet.com
Tested by:   slb@sonnet.com
PR:          264450
MFC after:   1 week
2024-02-19 16:17:05 -08:00
Warner Losh 2546c543fd reboot: Move extern for environ
envorin isn't defined in any header, and gcc is cranky with this inside
a function, so move it to global scope. Both clang and gcc are now happy
with this.

Sponsored by:		Netflix
2024-02-17 21:39:42 -07:00
Warner Losh 4d0be3986c reboot: Remove sys/types.h: it's not needed here... 2024-02-17 21:39:41 -07:00
Dag-Erling Smørgrav 17d5b027c1 md5: Clean up input stream rights.
Keep it simple, caph_limit_stdio() and fileargs_fopen() already take
care of everything for us.

MFC after:	1 week
Reviewed by:	markj, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D43897
2024-02-16 13:37:41 +01:00
Dag-Erling Smørgrav 5b44edb405 md5: Ignore files in string and passthrough mode.
MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43871
2024-02-16 13:37:36 +01:00
Dag-Erling Smørgrav 72ee91fed4 md5: Accept "-" as alias for stdin.
(based on a patch by jhb)

MFC after:	1 week
PR:		276915
Reported by:	Hannes Hauswedell <h2+fbsdports@fsfe.org>
Reviewed by:	allanjude, markj, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D43870
2024-02-16 13:37:29 +01:00
Warner Losh 33a2406eed reboot: Use posix_spawn instead of system
Use posix_spawn to avoid having to allocate memory needed for the system
command line.

Sponsored by:		Netflix
Reviewed by:		jrtc27
Differential Revision:	https://reviews.freebsd.org/D43860
2024-02-15 20:59:22 -07:00
Warner Losh e32de9626f reboot: initialize howto
Make static analyzers happy by initialzing howto to 0. Coverity is
cranky that it could be used unused. But it's analysis is incomplete
because the args to getopt when it wasn't initialized preclude it from
being used.
2024-02-15 14:32:04 -07:00
HUANG,YU-JIA b00271ceea
growfs(8): Grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1056
2024-02-13 17:05:18 +08:00
HUANG,YU-JIA 26c3d72eca
growfs(8): Fix spelling
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1055
2024-02-13 17:03:40 +08:00
Yi-Chen Li d3905a3b07
dmesg(8): Fix typo timetamps -> timestamps
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1036
2024-02-13 16:42:49 +08:00
Yi-Chen Li 7a71b35023
devmatch(8): Grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1034
2024-02-13 16:41:32 +08:00
Yi-Chen Li e8289f82c0
comcontrol(8): Grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1032
2024-02-13 16:40:09 +08:00
Yi-Chen Li c407d351df
ccdconfig(8): Minor grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1031
2024-02-13 16:38:57 +08:00
Yi-Chen Li 9977fb8042
camcontrol(8): Fix grammar: a ATA -> an ATA
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1030
2024-02-13 16:37:21 +08:00
Yi-Chen Li 31f6889564
rcorder(8): Fix grammar
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1029
2024-02-13 16:36:05 +08:00
Yi-Chen Li b287f26c3f
setkey(8): Grammar fix: a FQDN -> an FQDN
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1024
2024-02-13 16:12:39 +08:00
Jui-Hsuan Chang c8e7649b99
veriexec(8): Fix typo
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1018
2024-02-13 16:11:30 +08:00
Chih-Chun Wu 0a68b0066f
fdisk(8): Fix typo forth -> fourth
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1010
2024-02-13 15:17:48 +08:00
Shin-Yi Zheng 94d9c5f3be
ipf(8): Fix typo
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1002
2024-02-13 15:14:27 +08:00
Yu-Sheng Ma c9213e4bb9
restore(8): Fix typo in restore.h
`operation` was spelled wrongly on line 60.
`dumped` was spelled wrongly on line 74.

Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/998
2024-02-13 15:07:35 +08:00
Yu-Sheng Ma 69f9c5a513
nvmecontrol(8): Fix typo in ns.c
`Insufficient` was spelled wrongly on line 537.

Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/997
2024-02-13 15:06:22 +08:00
yue0211 26e69f9f98
dump(8): Fix typo in comment
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/968
2024-02-13 12:30:30 +08:00
Hao-Yu Hou e9866ce84f
ping(8): Fix typo in ping6.c
Line 703 & 863: kerel -> kernel
Line 2110: resposne -> response

Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/967
2024-02-13 12:29:07 +08:00
Hao-Yu Hou 2e8ad2b698
sysctl(8): Fix typo in comment
Line214: combind -> combine

Reviewed by:	zlai
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU
Request:	https://github.com/freebsd/freebsd-src/pull/966
2024-02-13 12:28:55 +08:00
Warner Losh fd6d47375a rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh
Reboot now emulates the nextboot shell script completely. Retire the
nextboot.sh script and install the link. Retain the same manual page,
since there's enough differences between nextboot and reboot that
talking about nextboot would likely be confusing in nextboot.8

The nextboot.sh script no longer exists, so doesn't need to be fixed up
to create rescue. However, now we need a link from nextboot to reboot.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D43831
Differential Revision:	https://reviews.freebsd.org/D43843
2024-02-12 11:46:20 -07:00
Warner Losh 994cc83921 reboot: Allow this to be installed as nextboot
Allow nextboot to be a symlink link to reboot. It does everything reboot
does, except doesn't actually setup the sytem to reboot and reboot. Also,
don't accept the reboot args related to rebooting when in nextboot mode.

Sponsored by:		Netflix
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D43830
2024-02-12 11:46:11 -07:00
Warner Losh 91d2407702 reboot: Implement -o to set kernel options for next boot
Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D43829
2024-02-12 11:46:03 -07:00
Warner Losh 9dcf6cbd83 reboot: Implement -k in terms of env
kernel isn't special, beyond the sanity checks we do. Add it to the env
rather than pass it into write_nextboot().

Sponsored by:		Netflix
Reviewed by:		kevans, kib
Differential Revision:	https://reviews.freebsd.org/D43828
2024-02-12 11:45:54 -07:00
Warner Losh ecc834241f reboot: Implement -e from nextboot
Implement -e foo=bar to add loader environment variables to
nextboot.conf. bar is enclosed in quotes if it isn't already.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D43827
2024-02-12 11:45:48 -07:00
Warner Losh 0df5f65908 reboot: Implement zfs support
Implement full support for ZFS -k support. For ZFS, we have to set a
property that gets cleared by the boot loaeder for whether or not to
process nextboot.conf. Do this using system("zfsbootcfg..." rather than
coding the small subset of that program inline to avoid CDDL
contamination of reboot and the complications of disabling CDDL and/or
ZFS. The few bytes needed to implement reboot for systems with zfs is
not worth saving for systems w/o ZFS.

Only set nextboot_enable=YES for UFS filesystems. They are the only one
that need that as the first line. Its presence on ZFS can cause the
kernel to not be oneshot.

Sponsored by:		Netflix
Reviewed by:		kevans, kib
Differential Revision:	https://reviews.freebsd.org/D43824
2024-02-12 11:45:37 -07:00
Warner Losh 2c47954811 reboot: Implement -D from nextboot
Implement -D from nextboot.sh which deletes the nextboot.conf file and
exists.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D43822
2024-02-12 11:45:29 -07:00
Warner Losh cfeedadfbd reboot: Add sanity checking of write to nextboot.conf
Add sanity checking to the write to nextboot. Move to separate function
and allow force to override all errors. If we can't write nextboot.conf,
don't silently fail anymore.

Sponsored by:		Netflix
Reviewed by:		kevans, kib, markj, jhb
Differential Revision:	https://reviews.freebsd.org/D43803
2024-02-12 11:45:20 -07:00
Warner Losh 7cb1a0e6e0 reboot: Don't reboot if the next kernel isn't there
reboot -k garbage won't boot garbage unless /boot/garbage/kernel is
there. Refuse to reboot if it is missing, though allow -f to force
it for special-use cases. This is in keeping with nextboot.sh.

Sponsored by:		Netflix
Reviewed by:		kevans, kib, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D43802
2024-02-12 11:45:01 -07:00
Warner Losh 7a3210f2ac reboot: convert flags to bools
Convert all the command line flags to bools, since that's how we use
them. Sort the includes while adding stdbool.h.

Sponsored by:		Netflix
Reviewed by:		kevans, kib, emaste
Differential Revision:	https://reviews.freebsd.org/D43801
2024-02-12 11:44:52 -07:00
Warner Losh a78bc42bcc reboot: Disallow -k and -r, it doesn't make sense.
When we're re-rooting to a new /, there is no next kernel. Error out
rather than leaving a timebomb in /boot/nextboot.conf.

Sponsored by:		Netflix
Reviewed by:		kevans, kib, emaste
Differential Revision:	https://reviews.freebsd.org/D43800
2024-02-12 11:44:43 -07:00
Warner Losh 9622dc05ae zfsbootcfg: Remove bogus CFLAGS
When using the zfsbootcfg library, we're talking only to it, not to the
rest of ZFS, nor are we using anything that needs access to the ZFS
compilation environment. Remove all the compiling OpenZFS itself flags.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D43823
2024-02-12 11:44:22 -07:00
Maxim Konovalov 15cb9c0d9f ifconfig: a typo fixed in the man page
PR:	276878
2024-02-09 01:40:00 +00:00
Elyes Haouas c1f6704bf8 ipf: Fix some typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-02-02 21:36:27 -07:00
Ricardo Branco 840a802750 umount: Add -d option to detach md devices
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/972
2024-02-02 18:35:00 -07:00
Kristof Provost 777a4702c5 pf: implement addrule via netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-02-02 17:55:16 +01:00
Ed Maste 5f047ae0c7 pflowctl: add missing break to case 's'
CID:		1534009
Reported by:	Coverity Scan
Reviewed by:	kp
Differential Revision: https://reviews.freebsd.org/D43704
2024-02-01 17:03:12 -05:00
John Baldwin c68ec278de nvmecontrol: Use NVMEF macro to construct fields
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43606
2024-01-29 11:01:46 -08:00
John Baldwin fba73a4083 nvmecontrol: Use the NVMEV macro instead of expanded versions
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43597
2024-01-29 10:34:02 -08:00
R. Christian McDonald 5086b6ec32
libbe: handle destroying/renaming temporary/bootonce boot environments
When a temporary/bootonce boot environment is renamed, we need to also
update the bootenv nvlist on-disk to reflect the new name. Additionally,
when a temporary/bootonce boot environment is destroyed, we also need to
clear out the on-disk state.

Reviewed by:	kevans
Approved by:	kp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43591
2024-01-29 10:07:49 -05:00
Mark Johnston 2e55256de3 route tests: Serialize
These tests reuse jail names and so cannot run in parallel.

MFC after:	1 week
2024-01-27 13:51:14 -05:00
Kristof Provost e95025ed93 pflow: show socket status in verbose mode
Introduce a verbose output mode to pflowctl, and expose the status of
the socket to userspace. This can be helpful in debugging configuration
errors.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-25 17:37:51 +01:00
Ed Maste 54d31cfb27 mount: document atime option
atime is enabled by default, but may be specified explicitly so that any
future change in the default would not have an effect on a given mount.

Reviewed by:	olce, rgrimes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43580
2024-01-24 14:55:54 -05:00
Kristof Provost 8b82f36f89 pflowctl: fix usage message
Reported by:	Jim Pingle <jimp@netgate.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-24 20:36:32 +01:00
Ed Maste a3ed434a69 ccdconfig: remove obsolete references to BSD disklabels
ccd(4) previoulsy had knowledge of BSD disklabels, and relied on their
use on the underlying disks, but this hasn't been the case since 2003
(commit 0f76d6d822).

Remove disklabel references from the man page.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43574
2024-01-24 12:51:45 -05:00
Igor Ostapenko 380b7eb309 sysctl.8: fix format typo
Signed-off-by: Igor Ostapenko <pm@igoro.pro>
2024-01-23 16:40:14 +01:00
Ed Maste 3f4f82c0d7 bsdlabel: limit to 8 partitions
bsdlabel is intended to support up to 20 partitions, but the disklabel
struct has a d_partitions array with only BSD_NPARTS_MIN (8) entries.
Previously, an attempt to operate on a bsdlabel with more than eight
partitions resulted in a buffer overflow.

As a stopgap limit bsdlabel to 8 partitions until this is fixed
properly.

PR:		276517
2024-01-22 21:17:23 -05:00
Kristof Provost 484e977f24 pflow: observation domain is an unsigned integer
Ensure we print it as such, rather than as a signed integer, as that
would lead to confusion.

Reported by:	Jim Pingle <jimp@netgate.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-22 18:02:10 +01:00
Alexander Ziaee c8bf9f09ee newfs_msdos.8: example for specific cluster size
The usual use case in 2024 for newfs_msdosfs is creating filesystems on SD cards
for older hardware. In most tutorials, they call the cluster size "allocation
size". Therefore, add a small note next to cluster size that it is also called
allocation size, and add an example for how to do this.

Reviewed by:	jhb
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1045
2024-01-21 21:39:16 -08:00
John F. Carr deeb1d3402 fsck_msdosfs: do not call checksize() if the cluster is bad
PR:	276464
MFC after:	1 week
2024-01-21 01:20:24 +02:00