Commit Graph

283905 Commits

Author SHA1 Message Date
Christos Margiolis
6265da14c9 libdtrace: get rid of illumos ifdefs in dt_module_update(), fix dm_file and dm_modid
Because dt_module_update() is highly OS-specific, the ifdefs make it
hard to read and follow what is going on. Also handle dm_modid, and
remove handling of the ".filename" section, since we can easily fetch
the filename from the module's pathname (k_stat->pathname).

Reviewed by:	markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39177
2023-05-23 15:54:58 +03:00
Mike Karels
1082307434 pwd.1: replace /home with /sys in example
The default location for home directories is moving from /usr/home
to /home, and the /home symlink will no longer exist.  Switch to
another example that is in base, /sys.

Reviewed by:	fernape
Differential Revision:	<https://reviews.freebsd.org/D40204
2023-05-23 07:21:50 -05:00
Mike Karels
9a6a948128 hier.7: update /home
The default for home directories is changing from /usr/home to
/home; update the corresponding entries.  Also move /home into
alphabetical order.

Reviewed by:	mhorne, manpages(bcr)
Differential Revision:	https://reviews.freebsd.org/D40203
2023-05-23 07:21:12 -05:00
Mike Karels
d3c32c80a1 release/tools/vmimage.subr: switch zfs dataset from /usr/home to /home
Change the vmimage script for zfs to create /home as a dataset
rather than /usr/home, ala change to bsdinstall's zfs script.

Reviewed by:	markj
Differential Revision:	<https://reviews.freebsd.org/D40111
2023-05-23 07:18:58 -05:00
Mike Karels
3bb92304b4 bsdinstall on zfs: create dataset for /home rather than /usr/home
Now that pw (hence adduser and the initial install) use /home for
user home directories rather than /usr/home, create a dataset for
/home rather than /usr/home.  Update the man page to match.

Reviewed by:	rgrimes, markj
Differential Revision:	https://reviews.freebsd.org/D40086
2023-05-23 07:18:27 -05:00
Mike Karels
bbb2d2ce42 pw: do not move /home/$user to /usr/home
When adding a user, pw will create the path to the home directory
if needed.  However, if creating a path with just one component,
i.e.  that appears to be in the root directory, pw would create the
directory in /usr, and create a symlink from the root directory.
Most commonly, this meant that the default of /home/$user would turn
into /usr/home/$user.  This was added in a self-described kludge 26
years ago.  It made (some) sense when root was generally a small
partition, with most of the space in /usr.  However, the default is
now one large partition.  /home really doesn't belong under /usr,
and anyone who wants to use /usr/home can specify it explicitly.
Remove the kludge to move /home under /usr and create the symlink,
and just use the specified path.  Note that this operation was
done only on the first invocation for a path, and this happened most
commonly when adding a user during the install.

Modify the test that checked for the creation of the symlink to
verify that the symlink is *not* made, but rather a directory.
Add a test that intermediate directories are still created.

Reviewed by:	rgrimes, bapt
Differential Revision:	https://reviews.freebsd.org/D40085
2023-05-23 07:17:42 -05:00
Martin Matuska
c0a83fe074 zfs: merge openzfs/zfs@ad0a55461
Notable upstream pull request merges:
  #12355 Teach zpool scrub to scrub only blocks in error log
  #14811 Refine special_small_blocks property validation
  #14854 zil: Some micro-optimizations
  #14855 zil: Free lwb_buf after write completion
  #14860 Fixes for issues identified by recent Coverity defect reports
  #14861 Probe vdevs before marking removed
  #14873 Add the ability to uninitialize a zpool
  #14875 Hold db_mtx when updating db_state

Obtained from:	OpenZFS
OpenZFS commit:	ad0a554614
2023-05-23 11:51:52 +02:00
Xin LI
634a770a5e /etc/rc.d/motd: Update to accommodate changes in uname(1) and newvers.sh
The recent changes to the uname(1) command removed trailing spaces for
better POSIX conformance, but it broke the regular expression used by
the motd script which expected it.  This commit addresses this by removing
the requirement, as it is no longer present.

Additionally, a recent change in newvers.sh introduced a new format for
uname -v, which omited the build number and build dates to improve
reproducible build support.  This commit adds support for this new format.

Reported-by:	Jamie Landeg-Jones <jamie@catflap.org>
Reviewed-by:	imp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40225
2023-05-22 22:05:35 -07:00
Rose
5a9c724847 Correct size parameter to strncmp
The wrong value passed to strncmp meant that only enable and disable were being
accepted. This change corrects the logic so enabled and disabled are also
accepted.

Pull Request: https://github.com/freebsd/freebsd-src/pull/739
MFC after: 1 week
Reviewed by: delphij, ngie
2023-05-22 18:16:29 -07:00
Christos Margiolis
cef2565587 dtrace: export dtrace_dis_get_byte()
kinst uses this function as well, but because it is not exported, it
implements its own copy of it. The patch also exposes the function to
userland, so programs that need to use dtrace_disx86() can use this
function instead of rolling their own copies.

Reviewed by:	markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39871
2023-05-22 23:21:25 +03:00
Christos Margiolis
3c6fb586b9 riscv: do not duplicate sd of tp
Reviewed by:	jhb
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39894
2023-05-22 23:03:06 +03:00
Christos Margiolis
136b8bd610 arm64: use PSR_DAIF instead of each individual flag
No functional change intended.

Reviewed by:	mhorne, andrew
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D40165
2023-05-22 22:49:33 +03:00
Christos Margiolis
94fe28babf Add christos as a src committer and markj as mentor
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D40210
2023-05-22 22:49:32 +03:00
Christos Margiolis
0c08479898 git-arc: mention creation of separate reviews in man page
Reviewed by:	imp
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D39963
2023-05-22 22:49:32 +03:00
Christos Margiolis
0688eac1f9 git-arc: fix spelling error in -s option
Reviewed by:	imp
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D39962
2023-05-22 22:49:32 +03:00
Kyle Evans
172af24449 arm64: gicv3: setup PPIs on all APs after they're online
For all PPIs setup earlier than SI_SUB_SMP, PIC_INIT_SECONDARY ends up
cleaning these up for each AP as it comes online.  Once they're online,
we don't currently do anything to make sure they're configured for other
APs.  Fix it by using smp_rendezvous for the meaty bits of configuring a
PPI, which will just do single-thread behavior before APs are online but
do the right thing for other CPUs after.

While we're here, make sure redistributor config is correct for other
APs as they come online in gic_v3_init_secondary.

Reported/Tested by:	Souradeep Chakrabarti (Microsoft/Hyper-V)
Reviewed by:		andrew (before slight refactor)
Differential Revision:	https://reviews.freebsd.org/D40112
2023-05-22 10:23:53 -05:00
Alexander V. Chernikov
26056fa8d3 Revert "ifconfig: switch IPv4/IPv6 address manipulations to Netlink"
Revert the change as 2 non-expected issues have been reported.

This reverts commit 54418f79fd.
2023-05-22 15:17:57 +00:00
Alexander V. Chernikov
454d72ec40 Revert "ifconfig: Fix the build"
This reverts commit 5b8ce85e1a.
2023-05-22 15:17:45 +00:00
Mark Johnston
5b8ce85e1a ifconfig: Fix the build
Fix indentation in warn_nomask() while here.

Fixes:	54418f79fd ("ifconfig: switch IPv4/IPv6 address manipulations to Netlink")
2023-05-22 10:53:38 -04:00
Kristof Provost
af15ae9dd1 prepare-commit-msg: add 'Event'
Add 'Event' to the pre-commit template.

The key word is already documented at
https://docs.freebsd.org/en/articles/committers-guide/#_include_appropriate_metadata_in_a_footer

Suggested by:	imp@
Event:		BSDCan 2023
Differential Revision:	https://reviews.freebsd.org/D40184
2023-05-22 16:01:09 +02:00
Konstantin Belousov
6f49eafb05 libthr rtld locks: do not leak URWLOCK_READ_WAITERS into child
Since there is only the current thread in the child, no pending readers
exist.  Clear the bit, since it confuses future attempts to acquire
write ownership of the rtld locks, due to URWLOCK_PREFER_READERS flag.

To be future-proof, clear all state about pending writers and readers.

PR:	271490
Reported and tested by:	KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40178
2023-05-22 16:46:42 +03:00
Alexander V. Chernikov
54418f79fd ifconfig: switch IPv4/IPv6 address manipulations to Netlink
Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D40182
2023-05-22 13:45:33 +00:00
Alexander V. Chernikov
050815ae7f netlink: call IPv6 hook when adding IPv4 addresses.
This provides compatibility with ifioctl() version of SIOCAIFADDR.
This change is temporary until the IPv4/IPv6 address handling code
 is moved to netinet[6].
2023-05-22 13:42:28 +00:00
Mark Johnston
e3f7081b1c fusefs: Remove an unused pbuf zone
The zone has been dead ever since commit
b9e2019755 ("fusefs: rewrite vop_getpages and vop_putpages")

No functional change intended.

Reviewed by:	asomers
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D40143
2023-05-22 09:33:57 -04:00
Hans Petter Selasky
47c887be4a Revert "mlx4: Move DEFINE_MUTEX() outside function body."
Requested by:	jrtc27@

This reverts commit 805d759338.
2023-05-22 12:53:38 +02:00
Dag-Erling Smørgrav
c8d84fa75e pam_tacplus: Mention nss_tacplus in the manual page.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D40135
2023-05-22 10:14:52 +00:00
Dag-Erling Smørgrav
6c5cdba1ba Add nss_tacplus, a TACACS+ NSS module.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40133
2023-05-22 10:14:52 +00:00
Dag-Erling Smørgrav
951beab15d taclib: 0 (not set) is a valid auth type in authorization requests.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	rew
Differential Revision:	https://reviews.freebsd.org/D40132
2023-05-22 10:01:04 +00:00
Peter Holm
be8d01b515 stress2: Added a faster test of fsck_ffs by omitting mount(8) and umount(8) 2023-05-22 10:07:40 +02:00
Peter Holm
ca0088ae27 stress2: Occasionally modify 8 bits 2023-05-22 10:05:34 +02:00
Bjoern A. Zeeb
046d8d89ed LinuxKPI: fix WRITE_ONCE(), remove ACCESS_ONCE()
Fix a gcc warning: "to be safe all intermediate pointers in cast from
'...' to '...' must be 'const' qualified [-Wcast-qual]".
Doing what is essentially a __DECONST() adding the uintptr_t gets
rid of the massive amount of warnings we get in LinuxKPI and lets
us see the actual problems a lot better.
This is a follow-up to 74e908b3c6 which
fixed READ_ONCE().
ACCESS_ONCE() seems to be an obsolete KPI these days in Linux and
FreeBSD does not use it either directly so we can entirely remove
it now.

Sponsored by:	The FreeBSD Foundation
Suggested by:	jhb
Reviewed by:	hselasky
MFC after:	10 days
Differential Revision: https://reviews.freebsd.org/D40084
2023-05-21 23:14:05 +00:00
Hans Petter Selasky
805d759338 mlx4: Move DEFINE_MUTEX() outside function body.
Move static mutex declaration outside function body, to avoid global
variables being declared on the stack, when using SYSINITs.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-05-21 18:20:16 +02:00
Alexander V. Chernikov
63ad5ce733 ifconfig: simplify ifconfig() by factoring out ifa add/del logic
Reviewed by:	kp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40180
2023-05-21 09:42:11 +00:00
Alexander V. Chernikov
197bff385e ifconfig: split argument parsing
Simplify main() by factoring out argument parsing code.

Reviewed by:	kp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40179
2023-05-21 09:42:11 +00:00
Fedor Uporov
50be18cc77 ext2fs: Add large sectorsize disks support
The ext2fs does not support disks with sectorsize more 512 bytes.
The main issue is in reading/writing superblock, which is not aligned
with 4k value. Reimplement the superblock reading logic to make it
indifferent to disk logical sector size. The logical sector size
more then page size is not supported, like it is doing on Linux side.

PR:             271105
Reported by:    k(at)vodka.home.kg
Reviewed by:    pfg
MFC after:      2 week
Differential Revision:  https://reviews.freebsd.org/D40047
2023-05-21 08:17:47 +03:00
Bjoern A. Zeeb
525dd4acaa LinuxKPI: implement pci_rescan_bus()
Try to implement pci_rescan_bus().  pci_rescan_method() is already
doing most of the job.  We only have to do the count for the return
value again ourselves.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D40122
2023-05-21 00:31:25 +00:00
Enji Cooper
902dc544cc Revert "Require the OpenSSL 1.1 APIs when compiling ldns"
This particular change appears to have broken the build; the change
needs some massaging to work with OpenSSL 1.1.

This reverts commit c6750ddec9.
2023-05-20 12:00:34 -07:00
Enji Cooper
c6750ddec9 Require the OpenSSL 1.1 APIs when compiling ldns
Moving the APIs from OpenSSL 1.1 supporting APIs to 3.x supporting APIs
is a non-trivial effort. Require 1.1 API compatibility to unblock
updating OpenSSL in base to 3.x.

This mirrors what upstream has done in their configure.ac file.

Submitted by:	Pierre Pronchery <pierre@freebsdfoundation.org>
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40082
2023-05-20 11:41:24 -07:00
John Baldwin
c98146ae22 cxgbe: Move ethofld_transmit under #ifdef INET || INET.
This fixes a -Wunused-function warning when building LINT-NOIP.

Reported by:	rpokala
2023-05-20 09:27:40 -07:00
John Baldwin
ac6dd01259 netlink: Move an INET-only variable under #if.
This fixes the LINT-NOIP build.
2023-05-20 09:26:46 -07:00
Mateusz Guzik
e0c86f5c2f td: line up with other clean up in thread_reap_domain
NFC
2023-05-20 12:48:15 +00:00
Mateusz Guzik
bbe62559c7 rlimit: line up with other clean up in thread_reap_domain
NFC
2023-05-20 12:46:46 +00:00
Bjoern A. Zeeb
5138ffa877 fwget: remove logging redirects
After adding addpkg() in 10aa369afd
the redirects are no longer needed.  We can now log directly so
simplify the code.

Reported by:	manu
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D40077
2023-05-20 11:20:41 +00:00
Bjoern A. Zeeb
dd8a74e74d fwget: add support for various WiFi NICs
Add support for Realtek, QCA, and Mediatek WiFi NIC cards.
We group the matching entries by driver in sub-functions in order
to semi-automatically create the lists for now.

Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D40073
2023-05-20 11:18:51 +00:00
Bjoern A. Zeeb
17cec33e75 fwget: improve the pci base script
When matching "class" only match the class byte and not subclass and
programming interface.
Extend the list of supported classes by network, old, and misc (for no
better names on the latter two).
Extend the list of known vendors for various WiFi NICs.
Add a "pci_fixup_class" as some wireless cards have unexpected PCI
classes set.  In case we cannot find a matching file for the original
try to see if a "fixed up" version exists.  This allows us to avoid
duplicate matching files for the same vendor/driver but different
chipsets.

Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D40072
2023-05-20 11:16:42 +00:00
Bjoern A. Zeeb
10aa369afd fwget: simplify adding firmware images to pkg to install
Rather than using echo to return the firmware package name, call a
new function (addpkg) which will also deal with (i) no leading space
and (ii) remove duplicates (as some devices have dual-wifi-cards).
In addition we won't have a line break when having multiple packages.

While here also do not call pkg(8) anymore if there is no package to
install and use the correct variable to install all and not just the
last found package.

Reviewed by:	manu, bapt
Differential Revision: https://reviews.freebsd.org/D40071
2023-05-20 11:13:12 +00:00
Bjoern A. Zeeb
ae1e336e05 LinuxKPI: add put_unaligned_le16() and get_unaligned_be64()
Add the two new functions needed by wireless drivers by the same
implementation pattern we did for different sizes.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D40174
2023-05-20 11:10:31 +00:00
Alexander V. Chernikov
7eee0eaf16 netlink: automatically generate broadcast for IPv4 ifa if not set.
MFC after:	2 weeks
2023-05-20 10:42:08 +00:00
Alexander V. Chernikov
a72b78905a ifconfig: simplify carp vhid setup.
Currently carp implementation peeks into the opaque 'afp->af_addreq'
 buffer, assumes it knows the af-specific layout and assigns vhid
 directly.
Simplify the code and remove abstraction leak by introducing per-afp
 callback for setting vhid.
This change is a pre-requisite to set addresses via Netlink,
 as Netlink implementiation uses different structure layout.

Reviewed by:	kp
Differential Revision: https://reviews.freebsd.org/D40160
MFC after:	2 weeks
2023-05-20 09:49:15 +00:00
Bjoern A. Zeeb
b7afaf8a41 LinuxKPI: add further dummy header files
Wireless drivers try to include these files.  Add them empty for no
better reason yet.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-05-20 00:57:38 +00:00