Commit Graph

6185 Commits

Author SHA1 Message Date
Jose Luis Duran 4f093770b5 nanobsd: Fix _populate_part()
- Avoid unnecessary subshell execution
- Fix removing the temporary and empty /cfg directory
- Do not remove the generated metalog file for /cfg or /data partitions

Fixes:		61ac7309c3 ("nanobsd: Add a provisional populate_part function")
MFC after:	3 days
2026-01-25 10:59:27 +00:00
Peter Holm c2b513335f stress2: Added two new test scenarios 2026-01-24 13:30:31 +01:00
Peter Holm 833f9294b4 stress2: Added two syzkaller reproducers. Updated the exclude file 2026-01-24 13:28:54 +01:00
Jose Luis Duran cd730bef74 nanobsd: Use mtree -C to produce the metalog
Prefer an mtree -C output, which is guaranteed to be mtree-compatible.
Add "gname", "uname", and "tags" to the default keyword set, while
removing "size" and "time", the latter being set on kernel file entries
and taking precedence over makefs -T (when paired with -F).

As a side effect, this produces a cleaner file with sorted keywords.

Note that passing "-u" to sort in order to pipe to mtree is no longer
necessary, but we'll do it out of habit.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54854
2026-01-24 02:06:57 +00:00
Ed Maste 466bad427d src.conf.5: Add WITHOUT_SOUND description
Fixes: f74f891581 ("src.opts: Introduce MK_SOUND")
Sponsored by:	The FreeBSD Foundation
2026-01-20 13:13:10 -05:00
John Baldwin 8e1c85f032 OptionalObsoleteFiles.inc: Treat compat runtime loaders as libraries
Binaries require the runtime loader to use shared libraries, and
removing the runtime loader in `make delete-old` while leaving the
libraries around makes it impossible to use those shared libraries.
Treat rtld as a de facto dependency of shared libraries to ensure it
is not removed until the corresponding shared libraries are removed.

Differential Revision:	https://reviews.freebsd.org/D52210
2026-01-20 12:07:21 -05:00
Jose Luis Duran eced166af0 nanobsd: Avoid unnecessary subshell execution
Mimic c99bb5747f ("nanobsd: minor formatting cleanup") and cleanup
_create_code_slice(), somehow I missed it when rebasing.

No functional change intended.

Fixes:		ecc039be7f ("nanobsd: Add a NO_ROOT build option")
MFC after:	3 days
2026-01-20 16:51:09 +00:00
Jose Luis Duran aed4089c25 nanobsd: Use NANO_DEF_{UNAME,GNAME}
Prefer to use NANO_DEF_UNAME and NANO_DEF_GNAME instead of a fixed
"root/wheel".

Fixes:		61ac7309c3 ("nanobsd: Add a provisional populate_part function")
MFC after:	3 days
2026-01-20 16:51:06 +00:00
Cy Schubert 1876de606e krb5: Expose missing symbols
Add symbols found in the port but not in base. This requires replacing
a shared libkrb5profile.so with libkrb5profile.a (with -fPIC so it can
be used by shared libraries). We do this by making libkrb5profile
INTERNALLIB.

Base currently has libkrb5profile in a shared library. The patch moves
those functions to the various "consumer" libraries as the port does.

Symbols that should be in the other libraries are in libkrb5profile.so.
This is causing some ports issues.

PR:		291695
Reported by:	michaelo, markj,  Chris Inacio <inacio@andrew.cmu.edu>
Tested by:	michaelo
Fixes:		ae07a5805b
Reviewed by:	michaelo (previous version)
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D54323
2026-01-20 05:41:02 -08:00
Jose Luis Duran 4cd4ccb8e2 nanobsd: Fix typos
MFC after:	1 week
2026-01-17 18:11:19 +00:00
Jose Luis Duran ecc039be7f nanobsd: Add a NO_ROOT build option
Add a -U option to build NanoBSD images without root privileges.  It
relies on makefs/mkimg and metalog (mtree) files, similar to what
release engineering uses to build images.

Keep the current way to build NanoBSD images untouched.  Once this
method gets battle tested, it may be used to build images as root as
well.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48793
2026-01-17 18:10:48 +00:00
Jose Luis Duran 8832f767d6 nanobsd: Add a provisional populate /data function
Add a provisional _populate_data_part function.  It populates the
optional /data partition, but using makefs(8), which is more in-line
with what release engineering uses to create images.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48792
2026-01-17 18:10:22 +00:00
Jose Luis Duran 800d390fe7 nanobsd: Add a provisional populate /cfg function
Add a provisional _populate_cfg_part function.  It populates the /cfg
partition, but using makefs(8), which is more in-line with what release
engineering uses to create images.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48791
2026-01-17 18:09:59 +00:00
Jose Luis Duran 61ac7309c3 nanobsd: Add a provisional populate_part function
Add a _populate_part(ition) function that mimics the current
populate_slice.  Note however, that this function is not
backward-compatible with populate_slice, hence the different name.  A
"_" is prepended to signal that it still experimental.

It can be used to populate the /cfg and /data partition using makefs(8).

Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48790
2026-01-17 18:09:14 +00:00
Jose Luis Duran 5ba2a74e3a nanobsd: Add a nano_makefs function
Add a NANO_MAKEFS global variable with options equivalent to NANO_NEWFS
to be used with a nano_makefs function for creating images.

Also add a function that adjusts the code size calculation, so makefs -s
won't error about the minimum rounded size.  Ideally this shim should be
removed, therefore the suspicious _xxx prefix.

Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48789
2026-01-17 18:08:52 +00:00
Jose Luis Duran 4f141f5ef4 nanobsd: Switch the / partition in fstab
Introduce a function tgt_switch_root_fstab() that switches the root
partition in the target file system tab file.  Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48788
2026-01-17 18:08:03 +00:00
Jose Luis Duran 605fb076eb nanobsd: Add a NANO_TIMESTAMP variable
Initially not wired, this variable will hold the time stamp for all the
files of the final image.
By default uses the last commit time stamp, if empty, it will use the
start time of the NanoBSD build.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48787
2026-01-17 18:07:31 +00:00
Jose Luis Duran 7c4d6fbd1b nanobsd: Add a function to create directories
Add tgt_dir(), that creates and adds directory entries to the metalog
specification file.  Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48786
2026-01-17 18:06:58 +00:00
Jose Luis Duran 64e16fa5c7 nanobsd: Prefer tgt_touch() instead of touch
Prefer tgt_touch() as it adds an entry to the metalog file.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48785
2026-01-17 18:06:19 +00:00
Jose Luis Duran b8b046a259 nanobsd: Set the proper mode for /tmp
The correct mode for /tmp is 1777, keep the same mode when symlinking it
to /var/tmp.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48784
2026-01-17 18:06:01 +00:00
Jose Luis Duran 5345567935 nanobsd: Prefer tgt_dir2symlink() to create symlinks
Prefer tgt_dir2symlink() to create symlinks, as it has the benefit of
appending the entry to the metalog file.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48783
2026-01-17 18:04:09 +00:00
Jose Luis Duran 6eccd84bee nanobsd: Make tgt_dir2symlink() take a mode
Make tgt_dir2symlink() take an optional third argument that sets the
mode.  By default, assume an absolute mode of 0777, to maintain
backward compatibility.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48782
2026-01-17 18:03:50 +00:00
Jose Luis Duran eb544c63fc nanobsd: Add uname/gname to the spec
Also include the default NanoBSD uname/gname in the specification file.

By default, NANO_DEF_UNAME and NANO_DEF_GNAME map to root and wheel
respectively.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48781
2026-01-17 18:03:26 +00:00
Jose Luis Duran 7106db625e nanobsd: Prefer nano_umount to umount
nano_umount[^1] is a convenience routine used to override issues with
umount(8) without changing the nanobsd.sh source code.  There were a few
places where it was not being used.

[^1]: Introduced in 6d12b61a88 ("Add a routine for easy workaround any
umount issues w/o hacking nanobsd.sh.")

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48780
2026-01-17 18:03:00 +00:00
Xin LI 8e6843db9b libc: drop NO_FP_LIBC support
NO_FP_LIBC was added in 2004 to save space by disabling FP support in
*printf()/*scanf(). The size benefit is negligible on modern systems
and conflicts with assumptions made by current base utilities.

Remove the option and always build libc with floating-point support.

Reported by:	Oskar Holmlund <eovholmlund at gmail com>
MFC after:	2 weeks
2026-01-16 22:43:40 -08:00
Mark Johnston bda6ed2ee4 exterr: Sort output from make_libc_exterr_cat_filenames.sh
Otherwise the script may permute the order of entries in the file since
find(1) output is not stable.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54669
2026-01-16 15:56:33 +00:00
Andrew Turner fb96702a03 depend-cleanup.sh: Clean up the old arm64 memset.S
This has moved from a generated file in objdir to the source tree.
Remove the old file and any .depend files that reference it.

Reviewed by:	bapt (via IRC)
Fixes:	41ccf82b29 ("libc/aarch64: Use MOPS implementations of memcpy/memmove/memset where availble")
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54729
2026-01-15 15:05:28 +00:00
Baptiste Daroussin 68ad2b0d7a ncurses: merge update to ncurses 6.6
6.6 is ABI compatible with 6.5 (tested with abidiff)
Remove html documentation to ease updates

MFC After:	1 month
2026-01-14 14:48:32 +01:00
Christos Margiolis f74f891581 src.opts: Introduce MK_SOUND
PR:		291853
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	zarychtam_plan-b.pwste.edu.pl, markj
Differential Revision:	https://reviews.freebsd.org/D54456
2026-01-12 16:16:35 +02:00
Minsoo Choo 0f937f171a tools: remove powerpcspe
As reported on the freebsd-announce mailing list[1] FreeBSD is
continuing to retire 32-bit support.  Remove powerpcspe from boot test
tools.

[1] https://lists.freebsd.org/archives/freebsd-announce/2024-February/000117.html

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:	jhibbits, emaste
Pull request:	698d3c98d8f5814f705908d5bc6d930e3d4c4eda
2026-01-09 11:28:33 -05:00
Warner Losh 92f251f36b cam: Dtrace scripts to help diagnose weird things
These are sample dtrace scripts that likely need to be modified for
whatever problem you are chasing. Unfortuneately, you have to read the
driver extensively to understand them or how to use them. But studying
the completion routine of mpr/mps will help understand many of the error
and recovery paths.

Sponsored by:		Netflix
2026-01-08 23:11:10 -07:00
Warner Losh cd1aa5f991 tools/cam: Start to add the testing tools for CAM
Create a directory for testing tools arond CAM. These are snippets of
what will eventually be camio. At the moment, it was written using fbt
traces. This is OK, but fragile, so they need to be re-written with the
cam provider. cam_all_but_scsi.d is the first step. It shows how to do
this with the new cam dtrace provider.

Sponsored by:		Netflix
Reviewed by:		adrian
Differential Revision:	https://reviews.freebsd.org/D54472
2026-01-07 23:20:34 -07:00
George V. Neville-Neil e2bedc7d69 Extend the script to collect gprof data
While we're at it, switch to simple waiting from communicate() calls.
2026-01-08 04:14:52 +00:00
George V. Neville-Neil 77153a491e Split counting from sampling. 2026-01-06 08:55:42 +00:00
George V. Neville-Neil e018fedef0 Correct the data collection arguments. Add proper tempdirs. 2026-01-06 08:18:22 +00:00
Mark Johnston 1c8dafe618 git-arc: Try to improve documentation
When I originally wrote git-arc, the usage string was the documentation.
Later, a man page was added, largely copied from the usage string.  Over
time they have diverged slightly.

It is silly to have two copies of the same information, so let's make
the man page the source of truth.

While here, document some options for git-arc-patch and rewrite a few
sentences here and there in a way that I hope is clearer.

Reviewed by:	ziaee, ngie, adrian
Differential Revision:	https://reviews.freebsd.org/D54405
2026-01-05 14:17:21 +00:00
Mark Johnston 684c762485 git-arc: Try to make patching more useful
Add a raw mode, which fetches the patch file and applies it manually
rather than using arc patch.  This is handy because arc patch will
always try to fetch your remotes if it can't find the base commit in
your repo (even if you ask it not to make a commit).  This is basically
unusable in some of my workspaces where I have 20+ remotes configured,
some of which may be unreachable.

Add a stack mode, which causes git-arc to recursively apply parent
revisions, going up the patch stack.  Thus, to apply a full patch stack,
just apply the final patch with -s.

Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D54403
2026-01-05 14:17:11 +00:00
George V. Neville-Neil 4a1b69ade6 Start adding an exercise mode for programs under test.
In exercise mode we collect data for every available counter on a
program and keep all of that in a directory in /tmp.
2026-01-05 12:30:22 +00:00
George V. Neville-Neil eb1c0d74cb Convert fully to Python 3. Remove licence text, only keep
SPDX.

Update to use argparse rather than OptionParser (now deprecated).
2026-01-05 11:40:12 +00:00
Dag-Erling Smørgrav aa611fa7e8 depend-cleanup.sh: Reduce repetition
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D54329
2025-12-31 19:51:14 +01:00
Dag-Erling Smørgrav 1d52d5c537 depend-cleanup: Force a clean build when options change
Similar to the build epoch check, cache a list of source options in the
object tree, and force a clean build if the cached list does not match
the current list, after filtering out options which are known not to
affect the build (e.g. CLEAN, TESTS, WARNS).

This also adds a DEPEND_CLEANUP option (which defaults to yes unless
the CLEAN option is set) which can be used to skip depend-cleanup for
faster incremental builds.

MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D52011
2025-12-31 19:51:13 +01:00
Dimitry Andric 8e95158393 Fix typo in tools/build/options/WITH_REPRODUCIBLE_PATHS
Fixes:		faeaa25f56
2025-12-29 22:34:22 +01:00
Ayrton Munoz b6672803a1 cross-build: Avoid adding <sys/cdefs.h> to SYSINCS
Summary:
The sys/cdefs.h in src is incompatible with glibc's sys/cdefs.h so
cross-building broke when the former was added to SYSINCS in 1c9ff80f06. This
commit adds a guard around that to only do that when building on FreeBSD. This
should fix github CI.

Test Plan:
Ran buildkernel using tools/build/make.py on linux in github CI and
locally on FreeBSD to double check nothing broke.

Reviewed by:    dim
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D54385
2025-12-29 03:04:45 +01:00
Konstantin Belousov 3ef25acf36 Add a script to auto-generate mapping from exterr category to source file
Reviewed by:	emaste, mkusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Warner Losh faeaa25f56 kernel: MK_REPRODUCIBLE_PATHS for full paths vs /usr/src
There are many environments that you do not want the paths to be
canonicalized. For example, if I always build a product from a specific
path in a jail that's dependent on the product version, I don't want
that to be sanitized to /usr/src because when I have profiling tools run
against multiple kernels, I can't do A/B testing and results processing
if everything points to /usr/src (sadly, the profiling tools cannot
remap back to the original like gdb can). Since we need both active at
the same time, symbloic link fallbacks don't work.

We do want the rest of the build to be reproducible, however. We'll get
the same binaries if we rebuild later since we always rebuild with the
same path.

Turn them both on for maximum reproduction for environments where that
cannot be guaranteed.

Sponsored by:		Netflix
Input from:		emaste, ivy
Differential Revision:	https://reviews.freebsd.org/D52959
2025-12-28 01:16:39 -07:00
Dimitry Andric 086bedb11a tools.build: also add sys/_visible.h to SYSINCS
This is needed since sys/cdefs.h includes sys/_visible.h.

Reported by:	kib
Fixes:		1c9ff80f06
MFC after:	3 days
2025-12-27 00:11:17 +01:00
Dimitry Andric 1c9ff80f06 tools.build: add sys/cdefs.h to SYSINCS, since lots of other headers use it
This is needed to let the legacy stage compile against newer versions of
sys/font.h, which transitively includes sys/cdefs.h, and requires the
new __nonstring macro from it.

Fixes:		e2c93ed09f
MFC after:	3 days
2025-12-26 16:26:13 +01:00
Dimitry Andric 160077a4d7 OptionalObsoleteFiles.inc: fix up WITH_LLVM_LINK_STATIC_LIBRARIES cases
In commit cf1eaaf41c I added the WITH_LLVM_LINK_STATIC_LIBRARIES
src.conf(5) build knob, which also affects OptionalObsoleteFiles.inc.

However, the checks were incorrect: when WITH_LLVM_LINK_STATIC_LIBRARIES
is active, the OLD_LIBS libprivatellvm.so.19, libprivateclang.so.19 and
libprivatelldb.so.19 should always be cleaned up.

Fixes:		cf1eaaf41c
MFC after:	1 week
2025-12-24 16:52:48 +01:00
Dimitry Andric 8d5a11cd01 src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knob
In commit 2e47f35be5 libllvm, libclang and liblldb were converted into
private shared libraries. This allowed clang, lld, lldb, and other llvm
tools to be linked against these shared libraries, which makes them
smaller and avoids duplication.

However, this also comes at the cost of some performance, since the
dynamic libraries are quite large, and contain lots of long symbols
(mangled C++ identifiers).

Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go
back to the previous behavior: libllvm, libclang and liblldb are built
as internal static libraries, i.e. only available during buildworld, and
fully linked into the various executables such as clang, lld, etc.

PR:		287447
Reviewed by:	emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D50956
2025-12-23 22:01:40 +01:00
Alex Richardson 802c6d5d61 cdefs.h: Introduce __nonstring attribute
This attribute can be used to annotate char arrays that are not supposed to
be terminated with a NUL char and is needed to silence clang's new
-Wunterminated-string-initialization warning. The name matches linuxkpi.

Reviewed by:	emaste, jhb
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52565
2025-12-16 12:21:45 -08:00