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
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
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
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.
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
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
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
While here also add a basic test case for it.
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44368
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
`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
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
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
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
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
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
Implement -D from nextboot.sh which deletes the nextboot.conf file and
exists.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43822
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
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
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
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
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
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
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")
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
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
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
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")
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