- The HLPR flags are grouped together at the beginning because they are
the standard flags for programs using FTS. Move the N flag out from
among them to its correct place in the sequence.
- The Pflag variable isn't used outside main(), but moving it out lets
us skip initialization and keeps it with its friends H, L and R.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43063
This test case tests two different things: first, that copying a symlink
results in a file with the same contents as the target of the symlink,
rather than a second symlink, and second, that cp will refuse to copy a
file to itself, or to a link to itself, or a link to its target. Leave
the first part in basic_symlink, move the second part to a new test case
named samefile, and slightly expand both cases.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43062
Unlike bwi(4), bwn(4) does not rely on ic_headroom (despite having it
set) but splits the bwn_txhdr (first) segment into its own transaction.
Remove ic_headroom to avoid net80211 troubles with not enough space in
the mbuf around ieee80211_mbuf_adjust().
PR: 275616
MFC after: 3 days
Rewrite `copy_file()` so the lflag and sflag are handled as early as
possible instead of constantly checking that they're not set and then
handling them at the end. This also opens the door to changing the
failure logic at some future point (for instance, we might decide to
fall back to copying if `errno` indicates that the file system does not
support links).
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, allanjude
Differential Revision: https://reviews.freebsd.org/D43055
Now that kldxref is a generic cross tool and can be built on non-FreeBSD
we can bootstrap it during the build and thus remove the condition for
whether it exists. We also need to make sure to add it to the METALOG
for -DNO_ROOT builds.
Reviewed by: brooks, imp
Differential Revision: https://reviews.freebsd.org/D43051
Currently IMAKE_INSTALL, which includes -M METALOG, is enough for the
sub-makes to work, but using kldxref for -DNO_ROOT builds will require
manually adding linker.hints to the METALOG, and thus both METALOG
itself and DISTBASE need to be exposed directly to the sub-makes, so do
so.
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D43050
This is needed for kldxref, which will shortly become a bootstrap tool.
Linux can use the same one as FreeBSD (provided the cross-building
sys/cdefs.h is augmented appropriately), whilst macOS needs its own
Mach-O-specific implementation.
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D43049
OpenZFS upstream refactored the asm versions of sha2 to be usable on all
32-bit arm flavors, so it is not necessary to limit this to armv6 and
armv7.
Suggested by: jhb
[Why]
The amdgpu DRM driver started to use it in Linux 5.18.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43020
[Why]
The i915 DRM driver in Linux 5.18 relies on this indirect include.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43030
[Why]
This header and str_yes_no() are now used by the i915 DRM driver in
Linux 5.18.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43014
This was already handled in ObsoleteFiles.inc (see the 20230622 entry),
but some people never run "make delete-old", or want to upgrade directly
from a revision that still had libc++ 15 to the most recent revision.
They would then encounter a failure during installworld, similar to:
install: target directory `/usr/include/c++/v1/__tuple/' does not exist
Therefore, clean it up in the distrib-cleanup phase, similar to the
earlier instance of the libc++ __string header file that became a
directory.
PR: 273753
MFC after: 1 month
[Why]
This callback is being used by the amdgpu DRM driver in Linux 5.18.
[How]
The callback is called after `suspend_late()`.
Reviewed by: emaste, manu
Approved by: emaste, manu
Differential Revision: https://reviews.freebsd.org/D43029
[Why]
This header is being used by DRM drivers in Linux 5.18.
Reviewed by: emaste, manu
Approved by: emaste, manu
Differential Revision: https://reviews.freebsd.org/D43028
[Why]
The passed structure may not have a `.store` field. This is the case in
the amdgpu DRM driver starting with Linux 5.18.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43023
[Why]
The amdgpu DRM driver started to use it in Linux 5.18.
[How]
The function is a no-op as I'm not sure how to implement this with
sysctls yet.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43022
[Why]
The amdgpu DRM driver started to use it in Linux 5.18.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43021
[Why]
`linux_compat.c` is already too long. I will need to add `struct kset`
in a follow-up commit, so let's move the existing `struct kobject` code
to its own file.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43019
[Why]
This is consistent with Linux.
[How]
The definition is moved from <linux/shmem_fs.h> to <linux/pagemap.h> and
the latter is included from the former. This is how it is done on Linux.
Prototypes are also expanded with argument names. I got a build failure
in the DRM 5.18 drivers because the compiler considered that the
`pgoff_t` argument was there twice.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D43018
The sha256 and sha512 binaries are used when building release images.
Bootstrapping them used to be gated on MK_BOOT, which wasn't quite right
but in practice worked, at least in our use cases downstream. Add back
bootstrapping sbin/md5 and its aliases for this purpose to fix building
release images on Linux and macOS.
Fixes: f213da893c ("Makefile.inc1: Remove beri straggler")
The `kernel` env var provides the default kernel, usually "kernel". It
may be the case that the user doesn't have a "kernel" kernel, just
"kernel.*" kernels, but have left `kernel` to the default because we
autodetect entries by default anyways.
If we're doing autodetection, take note of whether the default kernel
exists or not and remove it from the list if it doesn't and we had found
any other kernels. We avoid it in the #kernels == 1 case because
something fishy has likely happened and we should just trust the
configuration.
Reviewed by: imp, manu
Differential Revision: https://reviews.freebsd.org/D42967
Some callers are using print_mask_arg() when they should be using
print_mask_arg0(); the latter should be used when all flags are optional
and there's not a flag to be decoded with a 0-mask. This turns:
nmount(0x6991e009000,0x8,0<><invalid>0)
into:
nmount(0x6991e009000,0x8,0)
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D43007
Updated pkg is now in quarterly and there is no need to forcibly
install a specific version.
This reverts commit 1c376684c7.
This reverts commit 3c097b06a7.
Reported by: bapt
Sponsored by: The FreeBSD Foundation
This allows kldxref to operate on kernel objects from any
architecture, not just the native architecture. In particular, this
will permit generating linker.hints files as part of a cross-arch
release build.
- elf.c is a new file that includes various wrappers around libelf
including routines to read ELF data structures such as program and
section headers and ELF relocations into the "generic" forms
described in <gelf.h>. This file also provides routines for
converting a linker set into an array of addresses (GElf_Addr)
as well as reading architecture-specific mod_* structures and
converting them into "generic" Gmod_* forms where pointers are
replaced with addresses.
- The various architecture-specific reloc handlers now use GElf_*
types for most values (including GElf_Rel and GElf_Rela for
relocation structures) and use routines from <sys/endian.h> to read
and write target values. A new linker set matches reloc handlers
to specific ELF (class, encoding, machine) tuples.
- The bits of kldxref.c that write out linker.hints now use the
encoding (ELFDATA2[LM]SB) of the first file encountered in a
directory to set the endianness of the output file. Input files
with a different architecture in the same directory are skipped with
a warning. In addition, the initial version record for the file
must be deferred until the first record is finished since the
architecture of the output file is not known until then.
- Various places that used 'sizeof(void *)' throughout now use
'elf_pointer_size()' to determine the size of a pointer in the
target architecture.
Tested by: amd64 binary on both amd64 and i386 /boot/kernel
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42966
- Add a free_pnp_list to complement parse_pnp_list. Add freeing
of 'new_desc' which was previously leaked.
- Move body of loop that checked a single pnp list element against a
table entry into a parse_pnp_entry function to reduce indentation
and split parse_entry into a smaller function.
- Similarly, split out a record_pnp_info function from parse_entry
which builds the pnp_list and walks a table.
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42965
This was originally used (along with FREEBSD_AOUT) to prefer the use
of ELF in various tools instead of a.out as part of the a.out to ELF
transition in the 3.x days. The last use of it was removed from
<link.h> in commit 66422f5b7a back in
2002, but various files still #define it.
Reviewed by: kevans, imp, emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42964
This uses the statement from other files in kldxref when the tool was
first imported in commit 9c6f92408c.
Reviewed by: kevans
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42963
This patch refactors the existing Intel-specific single-stepping
mechanism in bhyve's GDB stub to work with both AMD and Intel CPUs.
Reviewed by: jhb
Sponsored by: Google, Inc. (GSoC 2022)
Differential Revision: https://reviews.freebsd.org/D42298
It appears that the only user of this macro was removed
with support for building a.out binaries in 2002 by commit
66422f5b7a.
Reviewed by: imp, kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42997
This has not been a univerally available interface since it was removed
from amd64 by commit efbef97de9 in 2004.
I removed the last consumers in 2016 when I replaced pipe(2) with
pipe2(2) in commit b60998c633.
Reviewed by: imp, jhibbits
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42996
- Use the correct base pointer after re-allocation to avoid buffer
overflows.
- Maintain correct snl_writer.size, which avoids redundant memory
allocation, e.g. a need for ~1k bytes may end up with ~32k
linear_buffer actually allocated.
This fixes a pfctl regression at least for armv7 after the addrule logic
migration to netlink:
ffbf25951e ("pf: convert rule addition to netlink")
The add rule command creates a bigger than default size netlink requests
which triggers the re-allocation logic.
Reviewed by: kp
MFC after: 2 weeks
Differnetial Revision: https://reviews.freebsd.org/D43003
Hardware timeout uses a 8-bit timeout value and expects the timeout to
be less than 255 seconds. Added software timer implemetation to timeout
and abort the IOs with timeout more than 255 seconds.
Fix the timeout problem by dividing CAM timeouts by 1000 as hardware
expects timeout value in seconds. Before this change, CAM timeouts in
milliseconds were getting truncated to 8 bits and converted to seconds.
So the actual timeout used when going down to the card would depend on
the bottom 8 bits of the timeout used.
Add the mapping of ocs_fc error status to CAM status.
Reported by: ken
Reviewed by: ken
Tested by: ken, ram
Approved by: ken
MFC after: 1 week
Compiling the BBR or RACK stack into the kernel requires HPTS to be
compiled into the kernel.
Reviewed by: glebius, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D42998
The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.
Reviewed By: imp, emaste
Differential Revision: https://reviews.freebsd.org/D43000
It appears that Clang 16 errors by default for the mismatched function
pointer types that are triggered by the fts callback (since glibc has a
callback type without the second const qualifier).
Fortunately, there is already code to handle glibc inside mandoc, we
just have to edit the checked-in config.h.
Reviewed By: imp, emaste
Differential Revision: https://reviews.freebsd.org/D42999
Use mpr1 instead of ahd1 and ahci1 instead of ahc1. ahc and ahd haven't
been relevant for a while. Also update the transfer size HBAs can do
from from 64k to 1MB.
Sponsored by: Netflix
to avoid panic if the name already exists, which is possible with the
interface renaming.
PR: 266999
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43001
We already implemented execvpe internally with an _ prefix in libc so
go ahead and expose it for compatibility with Linux.
This reverts c605eea952.
Bump __FreeBSD_version for the addition and add definitions to supress
compat shims in libzfs (zfs changes were merged from upstream).
PR: 275370 (request and exp-run (thanks antoine!))
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D42846
Remove an extra 'e' in the example command. It is a prefix, not a typo.
This is from the Advanced UNIX Programming Course (Fall’23) at NTHU.
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/913