]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 weeks agobhnd(4): Remove a double word in a source code comment
Gordon Bergling [Sat, 20 Apr 2024 12:09:18 +0000 (14:09 +0200)]
bhnd(4): Remove a double word in a source code comment

- s/of of/of/

MFC after: 3 days

7 weeks agoNOTES: Remove a double word in comment
Gordon Bergling [Sat, 20 Apr 2024 12:08:04 +0000 (14:08 +0200)]
NOTES: Remove a double word in comment

- s/of of/of/

MFC after: 3 days

7 weeks agoarm64: Remove a double word in a source code comment
Gordon Bergling [Sat, 20 Apr 2024 12:06:53 +0000 (14:06 +0200)]
arm64: Remove a double word in a source code comment

- s/of of/of/

MFC after: 3 days

7 weeks agosys: Remove two double words in source code comments
Gordon Bergling [Sat, 20 Apr 2024 12:04:31 +0000 (14:04 +0200)]
sys: Remove two double words in source code comments

- s/of of/of/

MFC after: 5 days

7 weeks agomwlstats: Fix a typo in an error message
Gordon Bergling [Sat, 20 Apr 2024 12:02:54 +0000 (14:02 +0200)]
mwlstats: Fix a typo in an error message

- s/the the/the/

MFC after: 5 days

7 weeks agoifconfig(8): Fix two typos in source code comments
Gordon Bergling [Sat, 20 Apr 2024 12:01:23 +0000 (14:01 +0200)]
ifconfig(8): Fix two typos in source code comments

- s/the the/the/

MFC after: 3 days

7 weeks agotimerfd.2: Remove a double word
Gordon Bergling [Sat, 20 Apr 2024 09:31:25 +0000 (11:31 +0200)]
timerfd.2: Remove a double word

- s/is is/is/

MFC after: 3 days

7 weeks agotarfs(5): Grammar fix for a source code comment
Gordon Bergling [Sat, 20 Apr 2024 09:21:54 +0000 (11:21 +0200)]
tarfs(5): Grammar fix for a source code comment

- s/the the/of the/

MFC after:i 3 days

7 weeks agonvmecontrol(8): Remove a double word in a source code comment
Gordon Bergling [Sat, 20 Apr 2024 09:18:59 +0000 (11:18 +0200)]
nvmecontrol(8): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

7 weeks agobinmiscctl.8: Remove a double word
Gordon Bergling [Sat, 20 Apr 2024 09:15:20 +0000 (11:15 +0200)]
binmiscctl.8: Remove a double word

- s/the the/the/

MFC after: 3 days

7 weeks agoman: do not ignore the exit status of roff tools
Wolfram Schneider [Sat, 20 Apr 2024 08:24:58 +0000 (08:24 +0000)]
man: do not ignore the exit status of roff tools

PR: 223516
Approved by: emaste, bapt
Differential Revision: https://reviews.freebsd.org/D44798

7 weeks agoldconfig: document changed default byte-order
Stefan Eßer [Sat, 20 Apr 2024 06:30:35 +0000 (08:30 +0200)]
ldconfig: document changed default byte-order

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

7 weeks agoabd_iter_page: rework to handle multipage scatterlists
Rob N [Fri, 19 Apr 2024 23:41:31 +0000 (09:41 +1000)]
abd_iter_page: rework to handle multipage scatterlists

Previously, abd_iter_page() would assume that every scatterlist would
contain a single page (compound or no), because that's all we ever
create in abd_alloc_chunks(). However, scatterlists can contain multiple
pages of arbitrary provenance, and if we get one of those, we'd get all
the math wrong.

This reworks things to handle multiple pages in a scatterlist, by
properly finding the right page within it for the given offset, and
understanding better where the end of the page is and not crossing it.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reported-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16108

7 weeks agoHandle FLUSH errors as "expected"
Alexander Motin [Fri, 19 Apr 2024 23:18:54 +0000 (19:18 -0400)]
Handle FLUSH errors as "expected"

Before #16061 zio_vdev_io_done() was not used for FLUSH requests.
Addition of it triggers reprobe each TXG for vdevs not supporting
them.  Since those errors are often expected, they are normally
handled by individual vdev drivers and should be ignored here.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16110

7 weeks agotests/quota: consistently clear quota property between tests
Rob Norris [Tue, 16 Apr 2024 04:56:35 +0000 (14:56 +1000)]
tests/quota: consistently clear quota property between tests

When run in isolation, quota_005_pos would fail in cleanup because it
would attempt restore the previous quota, which was 0, and so get an
error (because you can't set quota to '0', you have to use 'none').

It worked as part of the quota tag set because the previous tests did
not clean up their quota, so there was always a non-zero quota to return
to.

This adds a simple quota reset function, and has all quota tests run it
at cleanup. For the ones that weren't cleaning up, they now do, and for
quota_005_pos, which was trying to do the right thing, it now just
resets it.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16097

7 weeks agotests/quota_005_pos: use a long int for doubling the quota size
Rob Norris [Tue, 16 Apr 2024 05:03:33 +0000 (15:03 +1000)]
tests/quota_005_pos: use a long int for doubling the quota size

When run in isolation, quota_005_pos would see an empty ~300G dataset.
Doubling it's space overflows a int32, which meant it was trying to then
set the quota to a negative value, and would fail.

When run as part of the quota tests, the filesystem appears to have
stuff in it, and so a lower available space, which doesn't overflow, and
so succeeds.

The bare minimum fix seems to be to use a int64 for the available space,
so it can be comfortably doubled. Here it is.

(Also a typo fix and a tiny bit of cleanup).

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16097

7 weeks agoadd dtb support for RPI CM4, CM4s, CM4_ioBoard
Klaus Küchemann [Fri, 19 Apr 2024 22:53:46 +0000 (16:53 -0600)]
add dtb support for RPI CM4, CM4s, CM4_ioBoard

Signed-off-by: Klaus Küchemann <maciphone2@googlemail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1182

7 weeks agopackage: move lpr into its own package
Lexi Winter [Fri, 19 Apr 2024 22:53:30 +0000 (16:53 -0600)]
package: move lpr into its own package

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1171

7 weeks agorescue: add ipfw, pfctl
Lexi Winter [Fri, 19 Apr 2024 22:53:23 +0000 (16:53 -0600)]
rescue: add ipfw, pfctl

Rationale for this change:

- ipf is already there

- if the kernel is configured with a packet filter which drops packets
  by default, pfctl or ipfw will be required in the rescue environment
  to make the network functional.

- rescue's stated purpose is to be useful for small/embedded systems
  (and is also quite useful for small jails); a rescue-based router
  would want these binaries.

On amd64, this increases the size of rescue from 17346200 to 17907248,
or 561048 bytes (3.2%).

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1169

7 weeks agousr.bin/units: use else..if to avoid calling the next branch
rilysh [Fri, 19 Apr 2024 22:53:05 +0000 (16:53 -0600)]
usr.bin/units: use else..if to avoid calling the next branch

Even if the first branch succeeds, next time it will still check for
the second branch (which will be false) as the first one was true.
Add an else..if statement to address this.

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1165

7 weeks agoAdd support for Intel Atom S1200 UART
Henrich Hartzer [Fri, 19 Apr 2024 22:52:49 +0000 (16:52 -0600)]
Add support for Intel Atom S1200 UART

PR: 278316

Signed-off-by: Henrich Hartzer <henrichhartzer@tuta.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1164

7 weeks agoglabel: Remove support for old reiserfs
Ricardo Branco [Fri, 19 Apr 2024 22:47:55 +0000 (16:47 -0600)]
glabel: Remove support for old reiserfs

Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1101

7 weeks agoacpi_iicbus: Shift slave address
Ahmad Khalifa [Fri, 19 Apr 2024 22:43:19 +0000 (16:43 -0600)]
acpi_iicbus: Shift slave address

The address is expected to need shifting.
see https://uefi.org/specs/ACPI/6.5/13_System_Mgmt_Bus_Interface_Specification.html#smbus-slave-addresses

Reviewed by: imp, markj, Elliott Mitchell
Pull Request: https://github.com/freebsd/freebsd-src/pull/1125

7 weeks agoig4_iic: Warn on NACK
Ahmad Khalifa [Fri, 19 Apr 2024 22:43:19 +0000 (16:43 -0600)]
ig4_iic: Warn on NACK

Some DSDTs define non-existent devices, warn the user when an access is attempted on one of these devices.

Reviewed by: imp, markj, Elliott Mitchell
Pull Request: https://github.com/freebsd/freebsd-src/pull/1125

7 weeks agoacpi_cmbat: Use nitems instead of sizeof
Ahmad Khalifa [Fri, 19 Apr 2024 22:43:19 +0000 (16:43 -0600)]
acpi_cmbat: Use nitems instead of sizeof

Reviewed by: imp, markj, Elliott Mitchell
Pull Request: https://github.com/freebsd/freebsd-src/pull/1125

7 weeks agoig4_reg: Update datasheet link
Ahmad Khalifa [Fri, 19 Apr 2024 22:43:19 +0000 (16:43 -0600)]
ig4_reg: Update datasheet link

Reviewed by: imp, markj, Elliott Mitchell
Pull Request: https://github.com/freebsd/freebsd-src/pull/1125

7 weeks agoAdd support for i2c-tiny-usb: usb to iic bridge
Denis Bodor [Fri, 19 Apr 2024 22:38:37 +0000 (16:38 -0600)]
Add support for i2c-tiny-usb: usb to iic bridge

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1123

7 weeks agobsdiff: Use mmap instead of malloc
Ricardo Branco [Fri, 19 Apr 2024 22:32:43 +0000 (16:32 -0600)]
bsdiff: Use mmap instead of malloc

Note: This follows the current style of the bsdiff.c and bspatch.c
files, which is rather far from style(9).

Reviewed by: imp, cpervica
Pull Request: https://github.com/freebsd/freebsd-src/pull/1076

7 weeks agointro.2: Integrate introduction with state of page
Alexander Ziaee [Fri, 19 Apr 2024 22:22:39 +0000 (16:22 -0600)]
intro.2: Integrate introduction with state of page

Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065

7 weeks agointro.2: Section RETURN VALUES is actually ERRORS
Alexander Ziaee [Fri, 19 Apr 2024 22:22:39 +0000 (16:22 -0600)]
intro.2: Section RETURN VALUES is actually ERRORS

Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065

7 weeks agointro.2: Add FILES mentioning table of syscalls
Alexander Ziaee [Fri, 19 Apr 2024 22:22:39 +0000 (16:22 -0600)]
intro.2: Add FILES mentioning table of syscalls

Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065

7 weeks agointro.2: Tweak grammar and syntax for consistency
Alexander Ziaee [Fri, 19 Apr 2024 22:22:39 +0000 (16:22 -0600)]
intro.2: Tweak grammar and syntax for consistency

Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065

7 weeks agointro.2: Import HISTORY from OpenBSD but our style
Alexander Ziaee [Fri, 19 Apr 2024 22:22:39 +0000 (16:22 -0600)]
intro.2: Import HISTORY from OpenBSD but our style

Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065

7 weeks agomailwrapper(8): change behaviour if mailer.conf cannot be opened
Lexi Winter [Sat, 30 Dec 2023 15:09:15 +0000 (15:09 +0000)]
mailwrapper(8): change behaviour if mailer.conf cannot be opened

Previously, mailwrapper(8) would default to invoking _PATH_DEFAULTMTA
(i.e., dma) if mailer.conf couldn't be opened for any reason, including
transient errors like ENFILE.  This behaviour is undesirable, because if
the administrator has configured a different MTA in mailer.conf, they
almost certainly don't want mailwrapper to unpredictably fall back to
the compiled-in default; and in any case, the default MTA is probably
not running, meaning the mail may be queued and then never delivered,
which is worse than not accepting it to begin with.

Change this behaviour depending on why mailer.conf can't be opened:

- If it doesn't exist, keep the existing behaviour of falling back to
  the default MTA, on the assumption that this is a reasonable default
  if mailer.conf hasn't been configured at all.

- If it cannot be opened for any other reason, do not invoke an MTA and
  instead return an error to the caller.

PR: 25218
Reviewed by: imp, emaste, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/969

7 weeks agolibc/quad: further narrow list of i386 symbols
Brooks Davis [Fri, 19 Apr 2024 21:54:39 +0000 (22:54 +0100)]
libc/quad: further narrow list of i386 symbols

It's unclear to me why lld didn't complain about these are they aren't
present and haven't been.  Instead ld.bfd complained.

Reviewed by: dim
Fixes: 6e6cd03c911c libc/quad: narrow list of symbols exposed on i386
Differential Revision: https://reviews.freebsd.org/D44879

7 weeks agolibgcc_s: expose __divmoddi4 on i386
Brooks Davis [Fri, 19 Apr 2024 21:52:42 +0000 (22:52 +0100)]
libgcc_s: expose __divmoddi4 on i386

GCC has used this for some time (since 7.0) and apparently we were
getting away with using the hidden symbol, but when linking with
--no-undefined-version we get an error unless it's properly exported.
(For anyone who wonders at the assymetry, __udivmoddi4 is indeed much
older and was introduced with GCC 3.0.)

MFC after: 3 days
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D44878

7 weeks agolibgcc_{eh,s}: restore __*_frame_info symbols post llvm18
Brooks Davis [Fri, 19 Apr 2024 21:45:05 +0000 (22:45 +0100)]
libgcc_{eh,s}: restore __*_frame_info symbols post llvm18

The upstream llvm commit 5eb44df1b64d made the addition of these GCC
compatability symbols dependent on build configuration rather than
hardcoded for amd64, i386, and powerpc.  Reenable them.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D44877

7 weeks agoxargs: use getline() instead of fgetln()
Martin Tournoij [Fri, 19 Apr 2024 21:11:31 +0000 (15:11 -0600)]
xargs: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
               https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893

7 weeks agopatch: use getline() instead of fgetln()
Martin Tournoij [Fri, 19 Apr 2024 21:11:30 +0000 (15:11 -0600)]
patch: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
               https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893

7 weeks agojoin: use getline() instead of fgetln()
Martin Tournoij [Fri, 19 Apr 2024 21:11:30 +0000 (15:11 -0600)]
join: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
               https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893

7 weeks agohead: use getline() instead of fgetln()
Martin Tournoij [Fri, 19 Apr 2024 21:11:30 +0000 (15:11 -0600)]
head: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
               https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893

7 weeks agodiff: use getline() instead of fgetln()
Martin Tournoij [Fri, 19 Apr 2024 21:11:30 +0000 (15:11 -0600)]
diff: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
               https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893

7 weeks agocut: use getline() instead of fgetln()
Martin Tournoij [Fri, 19 Apr 2024 21:11:30 +0000 (15:11 -0600)]
cut: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
               https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893

7 weeks agoztest: use ASSERT3P to compare pointers
Brooks Davis [Fri, 19 Apr 2024 21:31:53 +0000 (22:31 +0100)]
ztest: use ASSERT3P to compare pointers

Fixes i386-gcc13 build.  Direct commit while waiting for upstream.

Pull Request: https://github.com/openzfs/zfs/pull/16115

7 weeks agoRevert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext"
Brooks Davis [Fri, 19 Apr 2024 21:21:46 +0000 (22:21 +0100)]
Revert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext"

I put the symbols in the wrong file (should have been
lib/libc/sys/Symbol.map), added a duplicate pdfork entry due to a botch
rebase, and there seems to be a issue with gcc13/binutils not exposing
the symbols so revert the whole thing while I debug.

This reverts commit ee632fb9eb4a060a4087a7f5425bfe36e65cda61.

7 weeks agokasan: fix false-positive kasan_report upon thread reuse
Ka Ho Ng [Fri, 19 Apr 2024 19:18:27 +0000 (15:18 -0400)]
kasan: fix false-positive kasan_report upon thread reuse

In fork1(), if a thread is reused and thread_alloc_stack() is not
called, mark the reused thread's kstack pages clean in the KASAN shadow
buffer.

Sponsored by: Juniper Networks, Inc.
MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44875

7 weeks agoctags: Use C99 bool instead of defining our own
Collin Funk [Wed, 7 Feb 2024 00:34:50 +0000 (16:34 -0800)]
ctags: Use C99 bool instead of defining our own

Use stdbool.h definitions instead of defining non-standard ones.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1107

7 weeks agotests: move atf_python/sys/ into the tests package
Lexi Winter [Tue, 16 Apr 2024 11:18:23 +0000 (12:18 +0100)]
tests: move atf_python/sys/ into the tests package

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1174

7 weeks agobpf: Make BPF interop consistent with if_loop
Seth Hoffert [Sun, 22 Oct 2023 14:12:45 +0000 (09:12 -0500)]
bpf: Make BPF interop consistent with if_loop

The pseudo_AF_HDRCMPLT check is already being done in if_loop and
just needed to be ported over to if_ic, if_wg, if_disc, if_gif,
if_gre, if_me, if_tuntap and ng_iface.  This is needed in order to
allow these interfaces to work properly with e.g., tcpreplay.

PR: 256587
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/876

7 weeks agoinstall: Fix a compiler warning when bootstrapping
Mark Johnston [Fri, 19 Apr 2024 18:22:00 +0000 (14:22 -0400)]
install: Fix a compiler warning when bootstrapping

Fixes: 4336161cc9c6 ("install: Don't skip syncing in the common case.")
Reviewed by: imp, des
Differential Revision: https://reviews.freebsd.org/D44866

7 weeks agoLinuxKPI: utsname.h add missing SPDX-License-Identifier
Bjoern A. Zeeb [Fri, 19 Apr 2024 18:23:12 +0000 (18:23 +0000)]
LinuxKPI: utsname.h add missing SPDX-License-Identifier

Reported by: markj (2023-05-24; sorry took me a while)
MFC after: 3 days

7 weeks agoAdd zfetch stats in arcstats
Ameer Hamza [Fri, 19 Apr 2024 17:19:12 +0000 (22:19 +0500)]
Add zfetch stats in arcstats

arc_summary also reports zfetch stats but it's inconvenient to monitor
contiguously incrementing numbers. Adding them in arcstats allows us to
observe streams more conveniently.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #16094

7 weeks agoFix: FreeBSD Arm64 does not build currently
Tino Reichardt [Fri, 19 Apr 2024 17:15:38 +0000 (19:15 +0200)]
Fix: FreeBSD Arm64 does not build currently

The define LD_VERSION isn't defined on FreeBSD Arm64 when OpenZFS is
build with the default compiler: clang.
I used only gcc for testing - my fault.

Fast fix as suggested by @mmatuska

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Martin Matuska <mm@FreeBSD.org>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #16103

7 weeks agofreebsd-update(8): Use kern.module_path
Fernando Apesteguía [Mon, 15 Apr 2024 12:18:06 +0000 (14:18 +0200)]
freebsd-update(8): Use kern.module_path

Instead of tailored configuration files to look for module_path entries.

Reported by: kevans@
Reviewed by: kevans, imp, zlei
Approved by: kevans,zlei
Differential Revision: https://reviews.freebsd.org/D44797

7 weeks agoexpand.1: Fix markup for the '-t' option
Gordon Bergling [Fri, 19 Apr 2024 15:39:37 +0000 (17:39 +0200)]
expand.1: Fix markup for the '-t' option

When viewing the manpage the '-t' option is shown as follows

    -t -Sm tab1, tab2, ..., tabn Sm

with the markup '\&Sm' included within '.It Fl t', which doesn't
makes any sense.

So just remove it.

PR: 274897
MFC after: 3 days

7 weeks agoadduser: Overhaul.
Dag-Erling Smørgrav [Fri, 19 Apr 2024 15:11:16 +0000 (17:11 +0200)]
adduser: Overhaul.

Most importantly:

* Make local variables local.
* Use `$()` instead of backticks.
* Avoid unsafe use of `-a` and `-o` operators in `test` expressions.
* Remove a hack intended to ease the transition from Perl 22 years ago.

MFC after: 1 week
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44863

7 weeks agoldconfig: use little-endian hints file on all architectures
Stefan Eßer [Fri, 19 Apr 2024 14:49:57 +0000 (16:49 +0200)]
ldconfig: use little-endian hints file on all architectures

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

7 weeks agoldconfig: small optimization
Stefan Eßer [Fri, 19 Apr 2024 14:29:12 +0000 (16:29 +0200)]
ldconfig: small optimization

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

7 weeks agoarm: Fix a typo in a KASSERT message
Gordon Bergling [Fri, 19 Apr 2024 06:54:39 +0000 (08:54 +0200)]
arm: Fix a typo in a KASSERT message

- s/resoure/resource/

MFC after: 5 days

7 weeks agouipc_shm: Fix a free() of an uninitialized variable
Mark Johnston [Fri, 19 Apr 2024 00:15:51 +0000 (20:15 -0400)]
uipc_shm: Fix a free() of an uninitialized variable

Reported by: Coverity
CID: 1544043
Fixes: b112232e4fb9 ("uipc_shm: Copyin userpath for ktrace(2)")

7 weeks agoice(4): Update to 1.39.13-k
Eric Joyner [Tue, 13 Feb 2024 06:26:26 +0000 (22:26 -0800)]
ice(4): Update to 1.39.13-k

- Adds mirror interface functionality
- Remove unused virtchnl headers

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC-with: 768329961dc0c041f7647f1c4549944a2ca168aa
MFC after: 3 days
Sponsored by: Intel Corporation
Tested by: jeffrey.e.pieper@intel.com
Differential Revision: https://reviews.freebsd.org/D44004

7 weeks agoice(4): Update copyright year to 2024
Eric Joyner [Tue, 13 Feb 2024 06:25:47 +0000 (22:25 -0800)]
ice(4): Update copyright year to 2024

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D44003

7 weeks agoiflib: Add subinterface interrupt allocation function
Eric Joyner [Wed, 18 Jan 2023 00:46:39 +0000 (16:46 -0800)]
iflib: Add subinterface interrupt allocation function

The ice(4) driver will add the ability to create extra interfaces
that hang off of the base interface; to do that the driver requires
a method for the subinterface to request hardware interrupt resources
from the base interface.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39930

7 weeks agoiflib: Add sysctl to request extra MSIX vectors on driver load
Eric Joyner [Wed, 22 Mar 2023 19:18:44 +0000 (12:18 -0700)]
iflib: Add sysctl to request extra MSIX vectors on driver load

Intended to be used with upcoming feature to add sub-interfaces, since
those new interfaces will be dynamically created and will need to have
spare MSI-X interrupts already allocated for them on driver load.

This sysctl is marked as a tunable since it will need to be set before
the driver is loaded since MSI-X interrupt allocation and setup is
done during the attach process.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41326

7 weeks agoUpdate sys.dirdeps.mk set default DEP_*
Simon J. Gerraty [Thu, 18 Apr 2024 21:07:24 +0000 (14:07 -0700)]
Update sys.dirdeps.mk set default DEP_*

Even at level 0 it is handy to default DEP_*
used by Makefile.depend* to aid the first include if
in a leaf dir.

Reviewed by: stevek

7 weeks agosound: Remove obsolete DV_F_* flags
Christos Margiolis [Thu, 18 Apr 2024 20:35:26 +0000 (22:35 +0200)]
sound: Remove obsolete DV_F_* flags

The ISA sound drivers that used them are retired.

Last reference of DV_F_DRQ_MASK and DV_F_DUAL_DMA:
716924cb4832ea0a440daf09913a06f3166f243e ("Retire snd_sbc ISA sound card
driver")

Last reference of DV_F_DEV_MASK and DV_F_DEV_SHIFT:
5126e5eeeb5e07ceef3c809452a8c9f508b2d4d1 ("Retire snd_mss ISA sound card
driver")

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D44858

7 weeks agosound: Simplify unit fetching in dsp_oss_audioinfo()
Christos Margiolis [Thu, 18 Apr 2024 20:35:20 +0000 (22:35 +0200)]
sound: Simplify unit fetching in dsp_oss_audioinfo()

"i" keeps the value of the current unit, so we do not have to call
PCMUNIT() and device_get_unit() to fetch it.

In the mixer case, I think it is more correct to do it like this, since
mixer and DSP device units have a 1-1 relationship (i.e the mixer unit
is always the same as the corresponding DSP device one) and that way we
can make it more clear.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44855

7 weeks agosound: Remove PCMMINOR()
Christos Margiolis [Thu, 18 Apr 2024 20:35:15 +0000 (22:35 +0200)]
sound: Remove PCMMINOR()

It's a NO-OP.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D44854

7 weeks agosound: Remove obsolete chn_setvolume()
Christos Margiolis [Thu, 18 Apr 2024 20:35:11 +0000 (22:35 +0200)]
sound: Remove obsolete chn_setvolume()

It is marked as obsolete and there are no consumers of it anymore.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D44853

7 weeks agosound: Get rid of snddev_info->devcount
Christos Margiolis [Thu, 18 Apr 2024 20:35:06 +0000 (22:35 +0200)]
sound: Get rid of snddev_info->devcount

snddev_info->devcount keeps track of the total number of channels for a
given device. However, it is redundant to have it, since it is only used
in sound_oss_sysinfo() to populate the "numaudios" field, and we also
keep track of the channel counts in the playcount, pvchancount, reccount
and rvchancount fields anyway. We can simply sum those fields together
instead of updating a separate variable upon every channel
addition/deletion.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44852

7 weeks agosound: Call device_get_name() and device_get_unit() only once in mixer_init()
Christos Margiolis [Thu, 18 Apr 2024 20:35:01 +0000 (22:35 +0200)]
sound: Call device_get_name() and device_get_unit() only once in mixer_init()

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D44840

7 weeks agosound: Be more verbose with virtual channel descriptions
Christos Margiolis [Thu, 18 Apr 2024 20:34:45 +0000 (22:34 +0200)]
sound: Be more verbose with virtual channel descriptions

Non-virtual channel description denote "play" or "record", so do the
same for virtual ones as well.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D44839

7 weeks agotcp rack: improve BBR_LOG_CWND event
Michael Tuexen [Thu, 18 Apr 2024 19:57:44 +0000 (21:57 +0200)]
tcp rack: improve BBR_LOG_CWND event

Fix a typo, which resulted in missing r_ctl.gate_to_fs in the BBLog
event.

Reported by: Coverity Scan
CID: 1540024
Reviewed by: rrs, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44648

7 weeks agotcp: drop data received after a FIN has been processed
Michael Tuexen [Thu, 18 Apr 2024 19:50:31 +0000 (21:50 +0200)]
tcp: drop data received after a FIN has been processed

RFC 9293 describes the handling of data in the CLOSE-WAIT, CLOSING,
LAST-ACK, and TIME-WAIT states:
This should not occur since a FIN has been received from the remote
side. Ignore the segment text.
Therefore, implement this handling.

Reviewed by: rrs, rscheff
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44746

7 weeks agoorganization.dot: Fix typos
Mateusz Piotrowski [Thu, 18 Apr 2024 19:59:49 +0000 (21:59 +0200)]
organization.dot: Fix typos

MFC after: 3 days

7 weeks agoCONTRIBUTING: request only one submission type per change
Ed Maste [Thu, 18 Apr 2024 18:38:54 +0000 (14:38 -0400)]
CONTRIBUTING: request only one submission type per change

We have some instances of contributors opening a GitHub pull request and
a Phabricator review for the same change, which divides or duplicates
review effort.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44856

7 weeks agoCONTRIBUTING: mention sys/crypto as another "contrib" directory
Ed Maste [Thu, 18 Apr 2024 18:44:30 +0000 (14:44 -0400)]
CONTRIBUTING: mention sys/crypto as another "contrib" directory

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44857

7 weeks agoshare/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures
Dimitry Andric [Thu, 18 Apr 2024 17:46:57 +0000 (19:46 +0200)]
share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures

As discussed in bug 278417, some ports require the F16C instruction set
to compile, but there is no way yet to detect whether the currently
chosen CPUTYPE supports this feature.

Add the feature to the MACHINE_CPU variable, for each processor that
supports it. The list of processors was extracted from clang 18's -dM
output, filtered on the __F16C__ define.

PR: 278417
Reviewed by: brooks, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44848

7 weeks agoAdd preliminary in-tree CI infrastructure for developers
Muhammad Moinur Rahman [Thu, 18 Apr 2024 17:57:38 +0000 (19:57 +0200)]
Add preliminary in-tree CI infrastructure for developers

The goal of this project is to integrate the relevant scripts from the
FreeBSD-CI project (https://github.com/freebsd/freebsd-ci) into the src
repository. This allows developers to run the test suite similar to how
it is executed on ci.freebsd.org, and eventually, have it directly used
by our CI system. This effort is also part of the workflow improvement
project, aiming to incorporate pre-merge testing.

Current Features:
* Does smoke tests using either bhyve(amd64 only) or qemu(Non x86_64 or
  when defined USE_QEMU=1). Currently defined CITYPE=smoke. Once we have
  added full tests we can also utilize something like CITYPE=full
* Most of the resources are dynamically allocated based on available
  resources in the host
* If CPU supports POPCNT or vmm can be loaded then bhyve is used for
  amd64 otherwise automatically installs and uses qemu@nox11
* When required third party applications or packages for booting non-x86
  images are automatically installed

Current Limitation:
* Does not support full tests like the one in our Jenkins
* At this moment this is also not suitable to be used in our Jenkins
  platform as the jobs are divided in multiple smaller tasks and
  artifacts are moved here and there which are not exactly the scenario
  for individual developers.

Future Works:
* Add full tests like the one in ci.freebsd.org
* Add different tests or options to disable some tests
* Add test profiles full
* Possibly add test through Cloud Providers like AWS/GCP/Azure or Cirrus
  or Github Actions
* Update documentation

Test Plan:
cd /usr/src/tests/ci
make ci
make TARGET=amd64 TARGET_ARCH=amd64 ci
make TARGET=amd64 TARGET_ARCH=amd64 USE_QEMU=1 ci
make TARGET=arm64 TARGET_ARCH=aarch64 ci
make TARGET=powerpc TARGET_ARCH=powerpc64 ci
make TARGET=powerpc TARGET_ARCH=powerpc64le ci
make TARGET=riscv TARGET_ARCH=riscv64 ci

Reviewed by:           lwhsu
Sponsored by:          The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43786

7 weeks agointro(7): add link to new networking(7)
Mitchell Horne [Thu, 18 Apr 2024 17:58:33 +0000 (14:58 -0300)]
intro(7): add link to new networking(7)

It improves the discoverability of the page.

Sponsored by: The FreeBSD Foundation

7 weeks agohier.7: polish entry to system manual
Alexander Ziaee [Wed, 20 Mar 2024 17:40:57 +0000 (13:40 -0400)]
hier.7: polish entry to system manual

Entries reworded to improve grammar or add keywords:
- document description: substitute layout for index for first-glance
- /etc/freebsd/update.conf
- /usr/share/vi/

Entries that have been wordshuffled for brevity or consistency:
- /{bin,libexec,nonexistent,sbin,tmp}/
- /boot/dtb/overlays/
- /boot/{defaults,efi,kernel,lua}/
- /usr/libexec/
- /var/{db,games,lib,log/{bsdisks.log,spool/,tmp/}}
- /usr/share/sysroot/VERSION/MACHINE.MACHINE_ARCH/ (unfold a little)
- /usr/local/share/doc/freebsd/ (unfold a little)

Entries that have macro or linking adjustments:
- /{boot,boot/efi,dev,etc,home,sbin,usr/bin}/ (overview or intro pages)
- /media/ (bsdisks is from ports, but afaik pulled by every desktop)
- /usr/share/{lib/,lib/dtrace/,libdata/games/,man/}/ (intro pages)
- /var/log/messages (syslog(3) -> syslogd(8))

Entries that have been added:
- /dev/{cuaU0,vmm,zvol}/
- /usr/share/{atf,bhyve}/
- /usr/share/libexec/hyperv/ (thanks @rtprio)
- /local/<subdirectories>/
- /var/log/debug.log (thanks @pauamma)
- /var/spool/{lock,lpd}

Please forgive my earlier mistakes fixed in this commit:
- /{dev,/usr/share/{calendar,misc}} : accidentally reverted description
- /etc/local-unbound.conf/ (wrong link)
- /usr/{freebsd-dist,lib32,libdata},/var/log/{dmesg.today,lpd-errs} (typos)
- /{usr/libdata/gcc/,var/log/bsdisks.log} (removed, unnecessary)

PR: 261349
Reviewed by: mhorne
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1131

7 weeks agodumpon: fix set but not used variable
inkeliz [Wed, 17 Apr 2024 21:22:44 +0000 (21:22 +0000)]
dumpon: fix set but not used variable

Signed-off-by: inkeliz <inkeliz@inkeliz.com>
Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1178

7 weeks agotools: Remove stray "then"
Cy Schubert [Thu, 18 Apr 2024 14:31:13 +0000 (07:31 -0700)]
tools: Remove stray "then"

Fixes: 26a09db3add3

7 weeks agovtnet: use CURVNET_SET() instead of CURVNET_SET_QUIET()
Gleb Smirnoff [Thu, 18 Apr 2024 14:58:00 +0000 (07:58 -0700)]
vtnet: use CURVNET_SET() instead of CURVNET_SET_QUIET()

We don't expect the VNET context to be set for virtqueue neither
for taskqueue handlers.

Suggested by: zec
Fixes: 3f2b9607756d0f92ca29c844db0718b313a06634

7 weeks agooce(4): Fix a typo in a source code comment
Gordon Bergling [Thu, 18 Apr 2024 14:19:18 +0000 (16:19 +0200)]
oce(4): Fix a typo in a source code comment

- s/addres/address/

MFC after: 3 days

7 weeks agomuge(4): Fix a typo in a source code comment
Gordon Bergling [Thu, 18 Apr 2024 14:18:26 +0000 (16:18 +0200)]
muge(4): Fix a typo in a source code comment

- s/addres/address/

MFC after: 3 days

7 weeks agonetpfil: Fix typos in source code comments
Gordon Bergling [Thu, 18 Apr 2024 14:17:10 +0000 (16:17 +0200)]
netpfil: Fix typos in source code comments

- s/addres/address/

MFC after: 3 days

7 weeks agoFix incremental build with WITH_NVME newly enabled
Brooks Davis [Thu, 18 Apr 2024 13:57:38 +0000 (14:57 +0100)]
Fix incremental build with WITH_NVME newly enabled

rescue.mk doesn't get updated when options change so nvme_util.o is now
missing on architectures were NVME was previously marked BROKEN.

Reviewed by: imp
Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken.
Differential Revision: https://reviews.freebsd.org/D44826

7 weeks agolib{c,sys}: normalize export of openat, setcontext, and swapcontext
Brooks Davis [Tue, 16 Apr 2024 22:26:29 +0000 (23:26 +0100)]
lib{c,sys}: normalize export of openat, setcontext, and swapcontext

List them in the symbol map rather than using the __sym_default to
expose them.  This will allow later improvements in the stub
implementations in libc.so.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44113

7 weeks agolibsys: expose a few more symbols for libc's use
Brooks Davis [Tue, 16 Apr 2024 21:50:52 +0000 (22:50 +0100)]
libsys: expose a few more symbols for libc's use

These private symbols are used by libc so expose as we do with
auxargs bits rather then relying on duplicate implementations in libc.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44114

7 weeks agolibcompiler_rt Makefile.inc: update _Float16/__bf16 checks
Dimitry Andric [Wed, 17 Apr 2024 20:20:47 +0000 (22:20 +0200)]
libcompiler_rt Makefile.inc: update _Float16/__bf16 checks

Clang supports __bf16 for riscv from version 18.0 onwards, so update the
checks for it. While here, rewrite the checks so they are hopefully more
readable, and also handle gcc a little better.

In addition, define COMPILER_RT_HAS_FLOAT16 and COMPILER_RT_HAS_BFLOAT16
when these features should be available, since there are some parts in
compiler-rt that check for these defines.

PR: 276104
MFC after: 1 month

7 weeks agocrunchgen: add --list option
Martin Tournoij [Wed, 17 Apr 2024 16:04:27 +0000 (10:04 -0600)]
crunchgen: add --list option

"bsdbox --list" will print all tools in the binary, one per line. The
main use case for this is to make it easier to create links:

for t in $(bsdbox --list); do
ln -s bsdbox $t
done

The name --list was taken from busybox.

This just adds a new "program" with the name "--list". I don't think we
need to do real argument parsing here, and this is also how busybox does
it.

An additional minor change is that just "bsdbox" will no longer print
the binary name itself ("bsdbox" in this case). Before it would do:

% bsdbox
usage: boxlike <prog> <args> ..., where <prog> is one of:
 cp ls mv bsdbox

And now just:

% bsdbox
usage: boxlike <prog> <args> ..., where <prog> is one of:
 cp ls mv

And just "bsdbox" will also exit with code 0 (and print to stdout)
rather than exit with 0 and print to stderr

Example output:

% ./bsdbox
usage: bsdbox program [args ...]
       bsdbox --list
       program [args ...]

bsdbox combines several programs in one executable. Create a link to this
executable with the program name to run that program, or give the program
name as the first argument.

Currently defined programs:
 true false tail head uname

% ./bsdbox --list
true
false
tail
head
uname

% ./bsdbox uname -a
FreeBSD freebsd 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64

% ln -s bsdbox uname
% ./uname -a
FreeBSD freebsd 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64

Pull Request: https://github.com/freebsd/freebsd-src/pull/894
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/894

7 weeks agoheimdal: asn1: Use unsigned bitfields for named bitsets
Dimitry Andric [Wed, 17 Apr 2024 17:49:30 +0000 (19:49 +0200)]
heimdal: asn1: Use unsigned bitfields for named bitsets

Import upstream 6747e1628:

  asn1: Use unsigned bitfields for named bitsets

  Signed 1-bit bitfields are undefined in C.

This should fix the following warnings, which for unknown reasons are
errors in CI:

  /usr/src/crypto/heimdal/lib/hx509/ca.c:1020:22: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1020 |         ku.digitalSignature = 1;
        |                             ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1021:21: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1021 |         ku.keyEncipherment = 1;
        |                            ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1028:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1028 |         ku.keyCertSign = 1;
        |                        ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1029:13: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1029 |         ku.cRLSign = 1;
        |                    ^ ~

PR: 276960
Fixes: 1b7487592987
MFC after: 1 week

7 weeks agoLinux 6.8 compat: META (#16099)
Tony Hutter [Wed, 17 Apr 2024 16:29:21 +0000 (09:29 -0700)]
Linux 6.8 compat: META (#16099)

Update the META file to reflect compatibility with the 6.8 kernel.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
7 weeks agoheimdal: Add 64-bit integer support to ASN.1 compiler
Dimitry Andric [Tue, 16 Apr 2024 18:56:37 +0000 (20:56 +0200)]
heimdal: Add 64-bit integer support to ASN.1 compiler

Import upstream 19d378f44:

  ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending
  on whether the constraint ranges include numbers that cannot be
  represented in 32-bit ints and whether they include negative
  numbers.

  Template backend support included.  check-template is now built with
  --template, so we know we're testing it.

  Tests included.

Also adjusts the generated files:
* asn1parse.c, asn1parse.h (not strictly necessary, but nice to have)
* der-protos.h, which needs a bunch of new prototypes. I copied these
  from a der-protos.h generated by the upstream build system, which
  uses a perl script for this.
* adjust printf format strings for int64_t. Upstream uses %lld for this,
  but that is not portable, and leads to lots of -Werror warnings.

This should fix target-dependent differences between headers generated
by asn1_compile. For example, when cross compiling world from amd64 to
i386, the generated cms_asn1.h header has:

  CMSRC2CBCParameter ::= SEQUENCE {
    rc2ParameterVersion   INTEGER (0..-1),
    iv                    OCTET STRING,
  }

while a native build on i386 has:

  CMSRC2CBCParameter ::= SEQUENCE {
    rc2ParameterVersion   INTEGER (0..2147483647),
    iv                    OCTET STRING,
  }

These are _both_ wrong, since the source file, cms.asn1, has:

  CMSRC2CBCParameter ::= SEQUENCE {
          rc2ParameterVersion   INTEGER (0..4294967295),
          iv                    OCTET STRING -- exactly 8 octets
  }

PR: 276960
Reviewed by: cy, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44814
Differential Revision: https://reviews.freebsd.org/D44815

7 weeks agonetworking.7 : create network quickstart guide
Alexander Ziaee [Wed, 17 Apr 2024 15:51:35 +0000 (09:51 -0600)]
networking.7 : create network quickstart guide

Now that the handbook has been moved to ports, I think it's very nice to
have a network quickstart guide in-band, in base, in the system manual.
If the user uses any of the following terms "man -k
{network,networking,wifi,quickstart}" this page will come up, which is I
think a very common use case for new users.

Currently, this document explains connecting to a basic Ethernet
network, a basic wifi network, scanning for wifi networks, and airplane
mode, as well as linking to other sections, including the handbook

Co-authored-by: Graham Perrin <grahamperrin@gmail.com>
Reviewed by: imp, bcr, freebsd@igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/833

7 weeks agonfsserver: Rate-limit messages about requests from unprivileged ports
Mark Johnston [Wed, 17 Apr 2024 14:36:58 +0000 (10:36 -0400)]
nfsserver: Rate-limit messages about requests from unprivileged ports

If access from unreserved ports is disabled, then a remote host can
cause an NFS server to log a message by sending a packet.  This is
useful for diagnosing problems but bad for resiliency in the case where
the server is being spammed with a large number of rejected requests.

Limit prints to once per second (racily).

Reviewed by: rmacklem, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44819

7 weeks agonuageinit: start the script after zfs
Baptiste Daroussin [Wed, 17 Apr 2024 14:25:02 +0000 (16:25 +0200)]
nuageinit: start the script after zfs

It prevents the home directory for the new users to be hidden
by late mount of the home directory

7 weeks agolibarchive: add two missing package files to libarchive tests
Martin Matuska [Wed, 17 Apr 2024 07:58:32 +0000 (09:58 +0200)]
libarchive: add two missing package files to libarchive tests

MFC after: 1 week

7 weeks agolibarchive: fix null format string error in tests (unbreaks gcc13 build)
Martin Matuska [Wed, 17 Apr 2024 07:33:13 +0000 (09:33 +0200)]
libarchive: fix null format string error in tests (unbreaks gcc13 build)

Obtained from: libarchive (d43c39247)
MFC after: 1 week