rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid.
Store the same UUID, without hyphens, in /etc/machine-id. The hypĥens
are removed with a shell function because hostid_save runs before file
systems are mounted so other tools may not be available yet.
This eliminates some duplication between hostid and machine-id and for
virtual machines machine-id now contains the UUID configured in the
hypervisor like it does on Linux.
Reviewed by: delphij
Discussed with: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38811
This code was used only on MIPS platforms, and has not built in some
time.
Reviewed by: ray
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38986
This reduces some duplication between the existing arm64 + x86 section
and the powerpc64 section. To make the diff simpler, enable mlx4 on
powerpc64 since it compiles.
Reviewed by: pkubaj, imp, emaste
Differential Revision: https://reviews.freebsd.org/D38973
Replace <sys/cdefs.h> with <sys/types.h>. Other includes need types
defined in <sys/types.h> and <sys/types.h> includes <sys/cdefs.h>
already.
While here, move the <machine/*.h> headers below the <sys/*.h>
headers.
Reviewed by: imp, kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38841
It shows progress more clearly, there aren't so many that the output
is excessive, and it's more friendly for things like Cirrus-CI's
logging that print the backspaces as boxes.
Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38990
There's no need to insert this line which won't be expanded in git. Not
generating it won't impact MFCs to 12 since the removal won't be MFCd.
Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38989
When compiling current on arm64, it breaks since LA_UNLOCKED is
undefined. This was in turn caused by the mutex code aliasing
it as MA_NOTOWNED.
Add <sys/lock.h> so the macro is defined.
Building with -DMSDOSFS_DEBUG failed due to a format mismatch and
a variable that has been renamed but not updated in the printf()
parameter list.
MFC after: 1 month
Started seeing the following after updating to VMware ESXi 8.0:
pcib2: <ACPI Host-PCI bridge> on acpi0
pcib2: could not evaluate _ADR - AE_NOT_FOUND
pci2: <ACPI PCI bus> on pcib2
vmx0: <VMware VMXNET3 Ethernet Adapter> ...
The virtual NIC works fine, and the code comment suggests that
missing _ADR is not something fatal, skip printing the message
if status is AE_NOT_FOUND.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/682
If a directory entry has an illegal inode number (less than zero
or greater than the last inode in the filesystem) the entry is removed.
If a directory '.' or '..' entry had an illegal inode number they
were being removed. Since fsck_ffs knows what the correct value is
for these two entries fix them rather deleting them.
Add much more extensive cylinder group checks and use them to be
more careful about rebuilding a cylinder group.
Check for out-of-range block numbers before trying to free them.
When a directory is deleted also remove its cache entry created
in pass1 so that later passes do not try to operate on a deleted
directory.
Check for ctime(3) returning NULL before trying to use its return.
When freeing a directory inode, do not try to interpret it as a
directory.
Reserve space in the inostatlist to have room to allocate a
lost+found directory.
If an invalid block number is found past the end of an inode simply
remove it rather than clearing and removing the inode.
Modernize the inoinfo structure to use queue(3) LIST rather than a
handrolled linked list implementation.
Reported by: Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by: Peter Holm
Reviewed by: Peter Holm
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668
This reverts commit d6327ae8c1.
Before version 2.25, glibc's unistd.h would define the POSIX subset of
getopt.h by defining __need_getopt, including getopt.h (which would
disable the header guard) and then undefining it so later including
getopt.h explicitly would define the extensions. However, we wrap
getopt, and so the wrapper's #pragma once breaks that. Thus getopt.h was
included before the real unistd.h to ensure we get all the extensions.
However, with clang 12 that causes problems where we get a function
mismatch (since getopt can throw exceptions). If we include it after
unistd.h, it will get the full definitions since glibc no longer does
the subsetting thing. This will result in matching definitions and fix
clang 12.
Reviewed by: imp, jrtc27 (OK'd on irc)
Pull Request: https://github.com/freebsd/freebsd-src/pull/668
Have to add a check that the computed cylinder group size does not
exceed the block size of the filesystem.
It is also necessary to validate additional parameters when a
superblock is going to be used in read-only mode if its supplementary
information is going to be read in to ensure that the size and
location of the supplementary information is valid. Also when a
warning is raised let it be accepted, but bound the flagged field
to the value checked by the warning.
No legitimate superblocks should fail as a result of these changes.
Reported by: Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by: Peter Holm
Reviewed by: Peter Holm
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668
NDIS was removed a couple of years ago, but the src.conf knob was left
behind.
Fixes: bfc99943b0 ("ndis(4): remove as previous announced")
Sponsored by: The FreeBSD Foundation
Where options exist in both src.opts.mk and kern.opts.mk they should be
kept in sync.
It may be that the option should be flipped the other way (e.g.,
enabling OFED in the kernel on arm64); if so that will be done as a
subsequent commit after further testing.
PR: 269994
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38952
* Remove unused nlattr_add_nla() - that's a duplicate of nlattr_add_raw().
* Calculate alignment only once in nlmsg_reserve_data_raw()
MFC after: 2 weeks
When updating byacc to 20230201, I enabled the backtracking extension as it seemed useful and harmless. With a little more experience, it appears to have more impact than I initially thought and I'm no longer sure how useful it really is, so turn it back off.
PR: 244149, 269425
Sponsored by: Klara, Inc.
Reviewed by: imp, jkim
Differential Revision: https://reviews.freebsd.org/D38931
libcasper(3) is not used in bhyve. So move dependency to the appropriate
place.
Reviewed by: markj
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D38905
Language servers like clangd generate a .cache directory to store
compilation cache. Tell Git to ignore this directory when staging files.
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38937
Summary:
Avoid referencing the ifnet struct directly, and use the IfAPI accessors
instead.
Reviewed by: gallatin
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38932
Summary:
When iflib was first converted some IfAPI APIs were not yet present, so
were tagged with "XXX" comments. Finish the conversion by using these
new APIs.
Reviewed by: gallatin, erj
Sponsored by: Juniper Networks, Inc
Differential Revision: https://reviews.freebsd.org/D38928