FreeBSD/src d9a65c5contrib/bmake job.c bsd.after-import.mk, contrib/bmake/mk meta.stage.mk meta.autodep.mk

Merge bmake-20250308
DeltaFile
+86-165contrib/bmake/job.c
+52-52usr.bin/bmake/Makefile
+28-11contrib/bmake/bsd.after-import.mk
+23-6contrib/bmake/mk/meta.stage.mk
+3-19contrib/bmake/main.c
+16-4contrib/bmake/mk/meta.autodep.mk
+208-25712 files not shown
+265-28018 files

FreeBSD/src 397f576. job.c bsd.after-import.mk, mk meta.stage.mk meta.autodep.mk

Import bmake-20250308

Intersting/relevant changes since bmake-20250125

ChangeLog since bmake-20250125

2025-03-08  Simon J Gerraty  <sjg at beast.crufty.net>

        * bsd.after-import.mk: by default generate makefiles
        closer to BSD style.

        * VERSION (_MAKE_VERSION): 20250308
        Merge with NetBSD make, pick up
        o clean up comments and code for parallel mode
        o job.c: avoid SIGPIPE for children, call Job_Wait befor abort.

2025-02-27  Simon J Gerraty  <sjg at beast.crufty.net>

        * VERSION (_MAKE_VERSION): 20250225

    [18 lines not shown]
DeltaFile
+86-165job.c
+28-11bsd.after-import.mk
+23-6mk/meta.stage.mk
+3-19main.c
+16-4mk/meta.autodep.mk
+17-0ChangeLog
+173-2059 files not shown
+210-22515 files

FreeBSD/src e9c2838share/mk Makefile local.sys.env.mk

Add newlog.sh and setops.sh to share/mk

jobs.mk makes use of newlog.sh if found.

Set NEWLOG_SH in local.sys.env.mk to save jobs.mk searching for it.

PR:     284390
Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D48737
DeltaFile
+7-0share/mk/Makefile
+6-0share/mk/local.sys.env.mk
+13-02 files

FreeBSD/src f8f5b65libexec/rc rc.subr

rc.subr:rc_trace take advantage of sdot

Since we now have sdot, use it to get RC_LEVEL from rc.conf.d/rc_trace
also avoid logging execution of ':' when RC_LEVEL > 0

Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D48856
DeltaFile
+5-10libexec/rc/rc.subr
+5-101 files

FreeBSD/src c8245ceshare/mk meta2deps.py auto.obj.mk

Update dirdeps.mk et al

Update dirdeps.mk and friends to match latest contrib/bmake/mk

Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D48855
DeltaFile
+12-4share/mk/meta2deps.py
+8-6share/mk/auto.obj.mk
+12-1share/mk/meta.sys.mk
+7-6share/mk/dirdeps.mk
+4-1share/mk/dirdeps-targets.mk
+2-2share/mk/gendirdeps.mk
+45-201 files not shown
+48-217 files

FreeBSD/src a69ac6eusr.bin/bmake Makefile

Fix mangled bmake makefile
DeltaFile
+19-19usr.bin/bmake/Makefile
+19-191 files

FreeBSD/src 6a7405fcontrib/bmake var.c, contrib/bmake/mk rust.mk setopts.sh

Merge bmake-20250125

Merge commit '5ad769f660f3d00853bc739f82d9bc62f6a682cb'
DeltaFile
+129-104contrib/bmake/unit-tests/moderrs.exp
+203-0contrib/bmake/mk/rust.mk
+101-74contrib/bmake/unit-tests/moderrs.mk
+175-0contrib/bmake/mk/setopts.sh
+61-88contrib/bmake/var.c
+146-0contrib/bmake/unit-tests/suff.exp
+815-266198 files not shown
+3,249-1,811204 files

FreeBSD/src 5ad769f. var.c, mk rust.mk setopts.sh

Import bmake-20250125

Intersting/relevant changes since bmake-20240711

ChangeLog since bmake-20240711

2025-01-25  Simon J Gerraty  <sjg at beast.crufty.net>

        * VERSION (_MAKE_VERSION): 20250125
        Merge with NetBSD make, sync up below change.

        * unit-tests/Makefile: remove $TMPDIR via .END
        to avoid failure in test on NFS - since the temp file for the
        target script is open and thus gets renamed by the server rather
        than removed.

2025-01-20  Simon J Gerraty  <sjg at beast.crufty.net>

        * VERSION (_MAKE_VERSION): 20250120

    [244 lines not shown]
DeltaFile
+129-104unit-tests/moderrs.exp
+203-0mk/rust.mk
+101-74unit-tests/moderrs.mk
+175-0mk/setopts.sh
+61-88var.c
+146-0unit-tests/suff.exp
+815-266195 files not shown
+3,148-1,740201 files

FreeBSD/src f486ebblib/libsecureboot README.rst

libsecureboot/README.rst clarify use of gpg

Clarify some language and provide an example of gpg use to generate
a detached signature.
DeltaFile
+13-4lib/libsecureboot/README.rst
+13-41 files

FreeBSD/src dae4eb6lib/libsecureboot vets.c Makefile.inc, lib/libsecureboot/openpgp opgp_sig.c

libsecureboot add sha384 and sha512 for OpenPGP

gpg supports SHA384, SHA512 as well as SHA256 so allow for them.

Tweak Makefile.inc so we can build libsecureboot with only OpenPGP
trust anchors.

Reviewed by: imp
Differential Revision:  https://reviews.freebsd.org/D48546
DeltaFile
+18-12lib/libsecureboot/vets.c
+10-0lib/libsecureboot/openpgp/opgp_sig.c
+5-1lib/libsecureboot/Makefile.inc
+33-133 files

FreeBSD/src 203027blibexec/rc debug.sh hooks.sh

Update libexec/rc/debug.sh and hooks.sh

Use local_works() to test if 'local' actually works for
current shell.
DeltaFile
+32-14libexec/rc/debug.sh
+19-18libexec/rc/hooks.sh
+51-322 files

FreeBSD/src f239981sys/fs/procfs procfs_mem.c, sys/kern sys_process.c

proc_rwmem check PRIV_PROC_MEM_WRITE when writing

This will fail when mac_veriexec is enforced.

Move the check from procfs_doprocmem to proc_rwmem to ensure all
cases are covered.

Reviewed by:    olce, markj
Sponsored by:   Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D47484
DeltaFile
+6-0sys/kern/sys_process.c
+0-2sys/fs/procfs/procfs_mem.c
+1-1sys/sys/priv.h
+7-33 files

FreeBSD/src a4e7810libexec/rc debug.sh

debug.sh check for :debug_add:

When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.

This allows for more focused debugging during boot.

Reviewed by:    stevek
DeltaFile
+77-15libexec/rc/debug.sh
+77-151 files

FreeBSD/src 0265383libexec/rc debug.sh, share/man/man8 debug.sh.8

debug.sh add DebugAdd

Sometimes it is desirable while debugging one script for it to enable
debugging of a child.
We can do that with

$DEBUG_DO DebugAdd tag

to add tag to DEBUG_SH but only when we are already debugging.
DeltaFile
+20-1libexec/rc/debug.sh
+10-1share/man/man8/debug.sh.8
+30-22 files

FreeBSD/src 0aa4a9ftargets/pseudo/bootstrap-packages bootstrap-packages.sh

bootstrap-packages.sh escape ++

We need to escape + when egreping parent makefile too.

Reviewed by:    stevek
DeltaFile
+10-5targets/pseudo/bootstrap-packages/bootstrap-packages.sh
+10-51 files

FreeBSD/src 45fe558lib/liblutok Makefile.depend, usr.bin/clang/lldb-server Makefile.depend

Updated and new Makefile.depend files

Reviewd by:     stevek
DeltaFile
+14-0lib/liblutok/Makefile.depend
+3-3usr.bin/clang/lldb-server/Makefile.depend
+1-1usr.bin/kyua/Makefile.depend
+18-43 files

FreeBSD/src c5c0e79share/mk local.meta.stage.mk

Add local.meta.stage.mk

We need to undo NO_OBJ if we are staging
as it causes us to drop the stage* target cookies in src tree
which is bad, and may break doing the same targets for multiple
architectures.

Reviewed by:    stevek
DeltaFile
+6-0share/mk/local.meta.stage.mk
+6-01 files

FreeBSD/src 2bdd404targets/pseudo/bootstrap-packages bootstrap-packages.sh Makefile

bootstrap-packages handle optional DIRDEPS

Add logic to bootstrap-packages.sh to handle constructs like:

SUBDIR.${MK_OPT}+= sub

and:

.if ${MK_OPT} == "yes"
SUBDIR+= sub
.endif

there are other methods used in various makefiles
so this will be better than nothing, but not complete coverage.

In either case a reldir will be added to
targets/packages/$package/Makefile.depend.options
rather than
targets/packages/$package/Makefile.depend

    [11 lines not shown]
DeltaFile
+123-11targets/pseudo/bootstrap-packages/bootstrap-packages.sh
+2-1targets/pseudo/bootstrap-packages/Makefile
+125-122 files

FreeBSD/src ec7e7eeshare/mk local.dirdeps-targets.mk

local.dirdeps-targets.mk include src.opts.mk

Include src.opts.mk to ensure we have options defined for when
assessing dirdeps-options.

Reviewed by:    stevek
DeltaFile
+4-0share/mk/local.dirdeps-targets.mk
+4-01 files

FreeBSD/src ad34c4dtargets Makefile.inc

targets/Makefile.inc skip updates

When PKG_METHOD is "no" or "none" we should *not*
attempt to update Makefile.depend.

Reviewed by:    stevek
DeltaFile
+1-1targets/Makefile.inc
+1-11 files

FreeBSD/src 6b135ddshare/mk local.gendirdeps.mk

local.gendirdeps.mk skip awk and xinstall for host

Do not record DIRDEPS for awk.host or xinstall.host
if we ever need them they can be dealt with specially.

Reviewed by: stevek
DeltaFile
+2-0share/mk/local.gendirdeps.mk
+2-01 files

FreeBSD/src 498dac0share/mk dirdeps.mk

Update dirdeps.mk for better debug output

Latest dirdeps.mk provides better clue as to which makefile
is being read for a given DIRDEP.

Reviewed by: stevek
DeltaFile
+3-6share/mk/dirdeps.mk
+3-61 files

FreeBSD/src a64729fusr.bin/clang/lldb-server Makefile.depend, usr.bin/kyua Makefile.depend

Update Makefile.depend files

After building packages we have a number of new
and updated Makefile.depend files

Reviewed by:    stevek
DeltaFile
+32-0usr.bin/clang/lldb-server/Makefile.depend
+24-0usr.bin/ofed/librdmacm/mckey/Makefile.depend
+23-0usr.bin/ofed/librdmacm/ucmatose/Makefile.depend
+23-0usr.bin/ofed/librdmacm/udaddy/Makefile.depend
+23-0usr.bin/ofed/librdmacm/rping/Makefile.depend
+23-0usr.bin/kyua/Makefile.depend
+148-0123 files not shown
+909-98129 files

FreeBSD/src 87b759ftargets/pseudo/bootstrap-packages bootstrap-packages.sh Makefile

Add targets/pseudo/bootstrap-packages

Try to compensate for the lack any origin for a DIRDEPS build.

bootstrap-packages will extract the PACKAGE lines from
the tree's Makefiles and use them to populate
targets/packages/Makefile.depend and targets/packages/*/Makefile.depend
so we can at least try to keep the Makefile.depend files throughout
the tree up to date.

This is far from ideal, as we cannot (easily) take into account
options that affect the contents of various packages.

Reviewed by:    stevek
Sponsored by:   Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D47065
DeltaFile
+96-0targets/pseudo/bootstrap-packages/bootstrap-packages.sh
+23-0targets/pseudo/bootstrap-packages/Makefile
+119-02 files

FreeBSD/src 4a5fa10sys/fs/procfs procfs_mem.c, sys/kern kern_priv.c

procfs require PRIV_PROC_MEM_WRITE to write mem

Add a priv_check for PRIV_PROC_MEM_WRITE which will be blocked
by mac_veriexec if being enforced, unless the process has a maclabel
to grant priv.

Reviewed by:    stevek
Sponsored by:   Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D46692
DeltaFile
+3-1sys/kern/kern_priv.c
+3-0sys/fs/procfs/procfs_mem.c
+2-0sys/security/mac_grantbylabel/mac_grantbylabel.c
+1-0sys/security/mac_veriexec/mac_veriexec.c
+1-0sys/sys/priv.h
+10-15 files

FreeBSD/src 7e1c014libexec/rc hooks.sh debug.sh

debug.sh take advantage of hooks.sh

Allow Debug{On,Off} to run associated hooks.
This makes it feasible to collect extra debug info at runtime
without needing to modify any potentially verified and hence immutable
scripts.

Like debug.sh, hooks.sh is extremely handy and used extensively
in many parts of Junos and its build environment.
It is provided here in the hope that others may benefit.

We do not dot hooks.sh by default to reduce overhead, but it can
but done from rc.conf et al using

$_HOOKS_SH . /libexec/hooks.sh

to avoid including more than once.

Reviewed by:    stevek

    [2 lines not shown]
DeltaFile
+276-0libexec/rc/hooks.sh
+89-8libexec/rc/debug.sh
+1-1libexec/rc/Makefile
+366-93 files

FreeBSD/src 2d203f5usr.bin/bmake/unit-tests Makefile

bmake/unit-tests/Makefile use _shell

Set _shell like later versions of bmake so that .SHELL
does not appear in conditionals.

This avoids errors when an older version of bmake parses this makefile
such as when doing src upgrade from stable/12 or older.

Direct commit to stable/13 since this is the only branch where
this issue arrises.

PR:             281151
DeltaFile
+6-5usr.bin/bmake/unit-tests/Makefile
+6-51 files

FreeBSD/src bd8486bsys/conf kern.pre.mk

kern.pre.mk include local.kern.pre.mk

Allow for local customization.

Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D46423
DeltaFile
+1-0sys/conf/kern.pre.mk
+1-01 files

FreeBSD/src 35399f6libexec/rc safe_eval.sh

safe_dot check file is a file

Since we are being paranoid, check that each arg to safe_dot is
actually a file as well as non-empty.

Check for white-space in filenames - these require special handling.
DeltaFile
+14-4libexec/rc/safe_eval.sh
+14-41 files

FreeBSD/src 82cb2a4libexec/rc safe_eval.sh

Update safe_eval.sh to support --export

This update allows

safe_dot --export file ...

to export any variables that get set.

Reviewed by: obrien
DeltaFile
+24-5libexec/rc/safe_eval.sh
+24-51 files