Document that the hints file is created in little-endian byte-order
by default now. The -B option can be used to create a big-endian hints
file. Currently, both formats are accepted by the run-time linker on
all architectures.
MFC after: 3 days
Relnotes: yes
Remove the test for building on a big-endian architecture, which
preserved the previous default of creating the ELF hints file in
native byte-order of the respective architecture.
Support for little-endian hints files has been added to the
run-time linker and the pkg command.
This is a step towards architecture independent little-endian hints
files, but support for big-endian hints files shall only be removed
from the run-time linker (and ldconfig and pkg) when the last release
that defaulted to hints files in host-byte has been declared EOL.
Reviewed by: kib
Tested by: tuexen
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44734
Swap which side of a comparison is byte-swapped by be32toh()
on little-endian architectures.
The be32toh() macro just returns the operand and big-endian
architectures and returns it byte-swapped on little-endian
architectures.
When operating on a constant argument, the compiler can perform
the swap operation at build time instead of swapping the data
read from the hints file at run time.
Reviewed by: kib
Tested by: tuexen
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44734
Move to a one file per line setup, and sort the files alphabetically.
Sponsored by: Netflix
Reviewed by: chuck, jhb
Differential Revision: https://reviews.freebsd.org/D44684
Add the lpo, ot, csi and uuid_index fields to read_logpage. The logpage
command has not been updated to allow these to be specified.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44683
Provide preliminary namespace subcommand documentation, along with some
basic definitions from the NVM standards relating to namespaces.
Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D44682
Also, add printing vnedor_specific field, which doesn't have a valid
bit, so is always valid.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44654
The source is always 128-bits in little endian format. For big endian
hosts, we have to convert, or we print bogus numbers.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44651
armv7, powerpc, powerpcspe and i386 all lack 128-bit integer
types. Adjust the comment and #ifdef. I don't think we support nvme on
any of these other architectures at the moment, but it won't hurt to be
more precise.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44650
As the number of page types proliferates, it becomes untennable to
convert them in read_logpage (especailly since new UUID page types will
need to be supported). Convert the error page printing code to operate
on little endian data.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44680
Using _Generic, create letoh which will generically convert uintXX_t
types from little endian to host, regardless of the size. This name has
been floated as a possible addition to endian.h.
Sponsored by: Netflix
Discussed with: jhb
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44649
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