svn commit: r367999 - head/share/mk

2020-11-24 Thread Simon J. Gerraty
Author: sjg
Date: Tue Nov 24 21:45:38 2020
New Revision: 367999
URL: https://svnweb.freebsd.org/changeset/base/367999

Log:
  Update dirdeps.mk et al to latest
  
  Move some local tweaks to local.*.mk
  
  Reviewed by:  bdrewery
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D27300

Modified:
  head/share/mk/bsd.init.mk
  head/share/mk/dirdeps-options.mk
  head/share/mk/dirdeps-targets.mk
  head/share/mk/dirdeps.mk
  head/share/mk/gendirdeps.mk
  head/share/mk/local.autodep.mk
  head/share/mk/local.dirdeps.mk
  head/share/mk/local.gendirdeps.mk
  head/share/mk/local.meta.sys.mk
  head/share/mk/meta.autodep.mk
  head/share/mk/meta.stage.mk
  head/share/mk/meta.subdir.mk
  head/share/mk/meta.sys.mk
  head/share/mk/meta2deps.py
  head/share/mk/meta2deps.sh

Modified: head/share/mk/bsd.init.mk
==
--- head/share/mk/bsd.init.mk   Tue Nov 24 21:28:44 2020(r367998)
+++ head/share/mk/bsd.init.mk   Tue Nov 24 21:45:38 2020(r367999)
@@ -55,9 +55,13 @@ $xGRP=   ${_gid}
 # - make install is used without other targets.  This is to avoid breaking
 #   things like 'make all install' or 'make foo install'.
 # - non-build targets are called
-.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL:U1} == 0 && \
-${BUILD_AT_LEVEL0:Uyes:tl} == "no" && !make(clean*) && !make(*clean)
+.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL} == 0
+# targets that are ok at level 0
+DIRDEPS_BUILD_LEVEL0_TARGETS += clean* destroy*
+M_ListToSkip?= O:u:S,^,N,:ts:
+.if ${.TARGETS:Uall:${DIRDEPS_BUILD_LEVEL0_TARGETS:${M_ListToSkip}}} != ""
 _SKIP_BUILD=   not building at level 0
+.endif
 .elif !empty(.MAKEFLAGS:M-V${_V_DO_BUILD}) || \
 ${.TARGETS:M*install*} == ${.TARGETS} || \
 ${.TARGETS:Mclean*} == ${.TARGETS} || \

Modified: head/share/mk/dirdeps-options.mk
==
--- head/share/mk/dirdeps-options.mkTue Nov 24 21:28:44 2020
(r367998)
+++ head/share/mk/dirdeps-options.mkTue Nov 24 21:45:38 2020
(r367999)
@@ -1,7 +1,7 @@
 # $FreeBSD$
-# $Id: dirdeps-options.mk,v 1.9 2018/09/20 00:07:19 sjg Exp $
+# $Id: dirdeps-options.mk,v 1.17 2020/08/07 01:57:38 sjg Exp $
 #
-#  @(#) Copyright (c) 2018, Simon J. Gerraty
+#  @(#) Copyright (c) 2018-2020, Simon J. Gerraty
 #
 #  This file is provided in the hope that it will
 #  be of use.  There is absolutely NO WARRANTY.
@@ -38,6 +38,11 @@
 # to whatever applies for that dir, or it can rely on globals
 # set in local.dirdeps-options.mk
 # Either way, we will .undef DIRDEPS.* when done.
+#
+# In some cases the value of MK_FOO might depend on TARGET_SPEC
+# so we qualify MK_FOO with .${TARGET_SPEC} and each component
+# TARGET_SPEC_VAR (in reverse order) before using MK_FOO.
+#
 
 # This should have been set by Makefile.depend.options
 # before including us
@@ -48,21 +53,43 @@ DIRDEPS_OPTIONS ?=
 
 .if ${.MAKE.LEVEL} == 0
 # :U below avoids potential errors when we :=
-.for o in ${DIRDEPS_OPTIONS:tu}
-DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U}
+# some options can depend on TARGET_SPEC!
+DIRDEPS_OPTIONS_QUALIFIER_LIST ?= \
+   ${DEP_TARGET_SPEC:U${TARGET_SPEC}} \
+   ${TARGET_SPEC_VARSr:U${TARGET_SPEC_VARS}:@v@${DEP_$v:U${$v}}@}
+# note that we need to include $o in the variable _o$o
+# to ensure correct evaluation.
+.for o in ${DIRDEPS_OPTIONS}
+.undef _o$o _v$o
+.for x in ${DIRDEPS_OPTIONS_QUALIFIER_LIST}
+.if defined(MK_$o.$x)
+_o$o ?= MK_$o.$x
+_v$o ?= ${MK_$o.$x}
+.endif
 .endfor
+_v$o ?= ${MK_$o}
+.if ${_debug_reldir:U0}
+.info ${DEP_RELDIR:U${RELDIR}}.${DEP_TARGET_SPEC:U${TARGET_SPEC}}: o=$o 
${_o$o:UMK_$o}=${_v$o:U} DIRDEPS += ${DIRDEPS.$o.${_v$o:U}:U}
+.endif
+DIRDEPS += ${DIRDEPS.$o.${_v$o:U}:U}
+.endfor
 DIRDEPS := ${DIRDEPS:O:u}
+.if ${_debug_reldir:U0}
+.info ${DEP_RELDIR:U${RELDIR}}: DIRDEPS=${DIRDEPS}
+.endif
 # avoid cross contamination
-.for o in ${DIRDEPS_OPTIONS:tu}
+.for o in ${DIRDEPS_OPTIONS}
 .undef DIRDEPS.$o.yes
 .undef DIRDEPS.$o.no
+.undef _o$o
+.undef _v$o
 .endfor
 .else
 # whether options are enabled or not,
 # we want to filter out the relevant DIRDEPS.*
 # we should only be included by meta.autodep.mk
 # if dependencies are to be updated
-.for o in ${DIRDEPS_OPTIONS:tu}
+.for o in ${DIRDEPS_OPTIONS}
 .for d in ${DIRDEPS.$o.yes} ${DIRDEPS.$o.no}
 .if exists(${SRCTOP}/$d)
 GENDIRDEPS_FILTER += N$d*

Modified: head/share/mk/dirdeps-targets.mk
==
--- head/share/mk/dirdeps-targets.mkTue Nov 24 21:28:44 2020
(r367998)
+++ head/share/mk/dirdeps-targets.mkTue Nov 24 21:45:38 2020
(r367999)
@@ -1,16 +1,16 @@
 # $FreeBSD$
 # RCSid:
-#   $Id: dirdeps-targets.mk,v 1.9 2019/10/06 20:07:50 sjg Exp $
+#   $Id: dirdeps-targets.mk,v 1.22 2020/08/15 18:00:11 sjg Ex

svn commit: r367863 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/missing contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2020-11-19 Thread Simon J. Gerraty
/contrib/bmake/unit-tests/directive-warning.exp
  head/contrib/bmake/unit-tests/directive-warning.mk
  head/contrib/bmake/unit-tests/directive.exp
  head/contrib/bmake/unit-tests/directive.mk
  head/contrib/bmake/unit-tests/dollar.exp
  head/contrib/bmake/unit-tests/dollar.mk
  head/contrib/bmake/unit-tests/envfirst.mk
  head/contrib/bmake/unit-tests/error.exp
  head/contrib/bmake/unit-tests/error.mk
  head/contrib/bmake/unit-tests/escape.mk
  head/contrib/bmake/unit-tests/forloop.exp
  head/contrib/bmake/unit-tests/forloop.mk
  head/contrib/bmake/unit-tests/forsubst.mk
  head/contrib/bmake/unit-tests/include-sub.mk
  head/contrib/bmake/unit-tests/moderrs.mk
  head/contrib/bmake/unit-tests/modmisc.mk
  head/contrib/bmake/unit-tests/modts.mk
  head/contrib/bmake/unit-tests/modword.mk
  head/contrib/bmake/unit-tests/opt-chdir.exp
  head/contrib/bmake/unit-tests/opt-chdir.mk
  head/contrib/bmake/unit-tests/opt-debug-jobs.exp
  head/contrib/bmake/unit-tests/opt-debug-jobs.mk
  head/contrib/bmake/unit-tests/opt-ignore.mk
  head/contrib/bmake/unit-tests/opt-keep-going.mk
  head/contrib/bmake/unit-tests/opt-no-action.mk
  head/contrib/bmake/unit-tests/opt-query.mk
  head/contrib/bmake/unit-tests/opt-touch.exp
  head/contrib/bmake/unit-tests/opt-touch.mk
  head/contrib/bmake/unit-tests/opt-var-expanded.mk
  head/contrib/bmake/unit-tests/opt-var-literal.mk
  head/contrib/bmake/unit-tests/opt-warnings-as-errors.exp
  head/contrib/bmake/unit-tests/opt-warnings-as-errors.mk
  head/contrib/bmake/unit-tests/opt.exp
  head/contrib/bmake/unit-tests/opt.mk
  head/contrib/bmake/unit-tests/order.mk
  head/contrib/bmake/unit-tests/recursive.exp
  head/contrib/bmake/unit-tests/recursive.mk
  head/contrib/bmake/unit-tests/sh-leading-at.exp
  head/contrib/bmake/unit-tests/sh-leading-at.mk
  head/contrib/bmake/unit-tests/sh-leading-hyphen.mk
  head/contrib/bmake/unit-tests/sh-leading-plus.mk
  head/contrib/bmake/unit-tests/sh-meta-chars.mk
  head/contrib/bmake/unit-tests/use-inference.mk
  head/contrib/bmake/unit-tests/var-class-local.exp
  head/contrib/bmake/unit-tests/var-class-local.mk
  head/contrib/bmake/unit-tests/var-op-assign.exp
  head/contrib/bmake/unit-tests/var-op-assign.mk
  head/contrib/bmake/unit-tests/var-op-expand.exp
  head/contrib/bmake/unit-tests/var-op-expand.mk
  head/contrib/bmake/unit-tests/var-op-shell.exp
  head/contrib/bmake/unit-tests/var-op-shell.mk
  head/contrib/bmake/unit-tests/var-op-sunsh.mk
  head/contrib/bmake/unit-tests/vardebug.exp
  head/contrib/bmake/unit-tests/varmisc.mk
  head/contrib/bmake/unit-tests/varmod-defined.exp
  head/contrib/bmake/unit-tests/varmod-defined.mk
  head/contrib/bmake/unit-tests/varmod-exclam-shell.mk
  head/contrib/bmake/unit-tests/varmod-ifelse.exp
  head/contrib/bmake/unit-tests/varmod-ifelse.mk
  head/contrib/bmake/unit-tests/varmod-loop.exp
  head/contrib/bmake/unit-tests/varmod-loop.mk
  head/contrib/bmake/unit-tests/varmod-match.mk
  head/contrib/bmake/unit-tests/varmod-order-shuffle.mk
  head/contrib/bmake/unit-tests/varmod-shell.exp
  head/contrib/bmake/unit-tests/varmod-shell.mk
  head/contrib/bmake/unit-tests/varmod-subst.exp
  head/contrib/bmake/unit-tests/varmod-subst.mk
  head/contrib/bmake/unit-tests/varmod-to-abs.exp
  head/contrib/bmake/unit-tests/varmod-to-abs.mk
  head/contrib/bmake/unit-tests/varmod-to-lower.mk
  head/contrib/bmake/unit-tests/varmod-to-separator.mk
  head/contrib/bmake/unit-tests/varmod-undefined.mk
  head/contrib/bmake/unit-tests/varmod.exp
  head/contrib/bmake/unit-tests/varmod.mk
  head/contrib/bmake/unit-tests/varname-dot-shell.exp
  head/contrib/bmake/unit-tests/varname-empty.exp
  head/contrib/bmake/unit-tests/varname-makefile.exp
  head/contrib/bmake/unit-tests/varname-makefile.mk
  head/contrib/bmake/unit-tests/varname-vpath.exp
  head/contrib/bmake/unit-tests/varname-vpath.mk
  head/contrib/bmake/unit-tests/varname.exp
  head/contrib/bmake/unit-tests/varname.mk
  head/contrib/bmake/unit-tests/varparse-undef-partial.mk
  head/contrib/bmake/util.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/Makefile.config
  head/usr.bin/bmake/config.h
  head/usr.bin/bmake/unit-tests/Makefile
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogFri Nov 20 05:46:27 2020
(r367862)
+++ head/contrib/bmake/ChangeLogFri Nov 20 06:02:31 2020
(r367863)
@@ -1,3 +1,78 @@
+2020-11-17  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201117
+   Merge with NetBSD make, pick up
+   o fix some unit-tests when dash is .SHELL
+   o rename Targ_NewGN to GNode_New
+   o make some GNode functions const
+   o main.c: call Targ_Init before Var_Init
+   cleanup PrintOnError, getTmpdir and ParseBoolean
+   o var.c: fix error message of failed :!cmd! modifier
+
+2020-11-14  Simon J Gerraty  
+
+   * VERSION

svn commit: r367861 - vendor/NetBSD/bmake/20201117

2020-11-19 Thread Simon J. Gerraty
Author: sjg
Date: Fri Nov 20 03:54:46 2020
New Revision: 367861
URL: https://svnweb.freebsd.org/changeset/base/367861

Log:
  tag bmake-20201117

Added:
  vendor/NetBSD/bmake/20201117/
 - copied from r367860, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367860 - in vendor/NetBSD/bmake/dist: . filemon missing missing/sys mk unit-tests

2020-11-19 Thread Simon J. Gerraty
  vendor/NetBSD/bmake/dist/unit-tests/modword.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-chdir.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-chdir.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-jobs.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-jobs.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-ignore.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-keep-going.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-no-action.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-query.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-touch.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-touch.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-var-expanded.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-var-literal.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt-warnings-as-errors.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-warnings-as-errors.mk
  vendor/NetBSD/bmake/dist/unit-tests/opt.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt.mk
  vendor/NetBSD/bmake/dist/unit-tests/order.mk
  vendor/NetBSD/bmake/dist/unit-tests/recursive.exp
  vendor/NetBSD/bmake/dist/unit-tests/recursive.mk
  vendor/NetBSD/bmake/dist/unit-tests/sh-leading-at.exp
  vendor/NetBSD/bmake/dist/unit-tests/sh-leading-at.mk
  vendor/NetBSD/bmake/dist/unit-tests/sh-leading-hyphen.mk
  vendor/NetBSD/bmake/dist/unit-tests/sh-leading-plus.mk
  vendor/NetBSD/bmake/dist/unit-tests/sh-meta-chars.mk
  vendor/NetBSD/bmake/dist/unit-tests/use-inference.mk
  vendor/NetBSD/bmake/dist/unit-tests/var-class-local.exp
  vendor/NetBSD/bmake/dist/unit-tests/var-class-local.mk
  vendor/NetBSD/bmake/dist/unit-tests/var-op-assign.exp
  vendor/NetBSD/bmake/dist/unit-tests/var-op-assign.mk
  vendor/NetBSD/bmake/dist/unit-tests/var-op-expand.exp
  vendor/NetBSD/bmake/dist/unit-tests/var-op-expand.mk
  vendor/NetBSD/bmake/dist/unit-tests/var-op-shell.exp
  vendor/NetBSD/bmake/dist/unit-tests/var-op-shell.mk
  vendor/NetBSD/bmake/dist/unit-tests/var-op-sunsh.mk
  vendor/NetBSD/bmake/dist/unit-tests/vardebug.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmisc.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-defined.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-defined.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-exclam-shell.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-ifelse.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-ifelse.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-loop.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-loop.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-match.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-order-shuffle.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-shell.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-shell.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-subst.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-subst.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-abs.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-abs.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-lower.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-separator.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-undefined.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-shell.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-empty.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-makefile.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-makefile.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-vpath.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-vpath.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname.mk
  vendor/NetBSD/bmake/dist/unit-tests/varparse-undef-partial.mk
  vendor/NetBSD/bmake/dist/util.c
  vendor/NetBSD/bmake/dist/var.c

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Fri Nov 20 03:33:30 2020
(r367859)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Fri Nov 20 03:54:37 2020
(r367860)
@@ -1,3 +1,78 @@
+2020-11-17  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201117
+   Merge with NetBSD make, pick up
+   o fix some unit-tests when dash is .SHELL
+   o rename Targ_NewGN to GNode_New
+   o make some GNode functions const
+   o main.c: call Targ_Init before Var_Init
+   cleanup PrintOnError, getTmpdir and ParseBoolean
+   o var.c: fix error message of failed :!cmd! modifier
+
+2020-11-14  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201114
+   Merge with NetBSD make, pick up
+   o replace a few HashTable_CreateEntry with HashTable_Set
+   o clean up cached_stats
+   o rename DEFAULT to defaultNode
+   o remove redundant struct make_stat
+   o cond.c: in lint mode, check for ".else "
+   use bitset for IfState
+   replace large switch with if-else in Cond_EvalLine
+   o job.c: clean up JobExec, JobStart, JobDoOutput
+   use stderr for error message about failed touch
+   clean up

svn commit: r367808 - vendor/NetBSD/bmake

2020-11-18 Thread Simon J. Gerraty
Author: sjg
Date: Wed Nov 18 17:50:33 2020
New Revision: 367808
URL: https://svnweb.freebsd.org/changeset/base/367808

Log:
  Retain missing/sys/cdefs.h to support build on non-FreeBSD

Modified:
  vendor/NetBSD/bmake/import.sh

Modified: vendor/NetBSD/bmake/import.sh
==
--- vendor/NetBSD/bmake/import.sh   Wed Nov 18 17:37:01 2020
(r367807)
+++ vendor/NetBSD/bmake/import.sh   Wed Nov 18 17:50:33 2020
(r367808)
@@ -65,7 +65,7 @@ tar zxf $TARBALL
 
 # steps unique to bmake
 VERSION=`grep '^_MAKE_VERSION' bmake/VERSION | sed 's,.*=[[:space:]]*,,'`
-rm -rf bmake/missing
+#rm -rf bmake/missing
 
 # the rest should be common
 ('cd' dist && $SVN list -R) | grep -v '/$' | sort > $TF.old
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367465 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2020-11-07 Thread Simon J. Gerraty
/varparse-dynamic.mk
  head/contrib/bmake/unit-tests/varshell.exp
  head/contrib/bmake/unit-tests/varshell.mk
  head/contrib/bmake/util.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/Makefile.config
  head/usr.bin/bmake/config.h
  head/usr.bin/bmake/unit-tests/Makefile
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogSat Nov  7 21:17:49 2020
(r367464)
+++ head/contrib/bmake/ChangeLogSat Nov  7 21:46:27 2020
(r367465)
@@ -1,3 +1,267 @@
+2020-11-01  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201101
+   Merge with NetBSD make, pick up
+   o negate NoExecute to GNode_ShouldExecute
+   o job.c: rename JobMatchShell to FindShellByName
+   extract EscapeShellDblQuot from JobPrintCommand
+   extract ParseRunOptions from JobPrintCommand
+   o var.c: extract ApplyModifiersIndirect from ApplyModifiers
+   treat malformed :range, :ts and :[...] as errors
+   add tests for the variable modifiers :[words] and :range
+
+2020-10-31  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201031
+   Merge with NetBSD make, pick up
+   o format #include directives consistently
+   o do not look up local variables like .TARGET anywhere else
+   o main.c: Main_SetObjdir is first called for curdir which may be
+   readonly
+   reduce the scope where recursive expressions are detected
+   remove redundant :tl from getBoolean
+   clean up mkTempFile
+   o meta.c: simplify memory allocation in meta_create and meta_oodate
+   o parse.c: extract loadedfile_mmap from loadfile
+   o trace.c: document possible undefined behavior with .CURDIR
+   o var.c: make parsing of the :gmtime and :localtime modifiers stricter
+   rename ismeta to is_shell_metachar
+   remove debug logging for the :Q variable modifier
+   rename VarIsDynamic to VarnameIsDynamic
+   use consistent parameter order in varname parsing functions
+   extract ParseVarnameLong from Var_Parse
+   extract ParseVarnameShort from Var_Parse
+   fix type of ParseModifierPart parameter delim
+   extract IsEscapedModifierPart from ParseModifierPart
+   clean up ModifyWords
+   add test for combining the :@ and :? variable modifiers
+   
+2020-10-30  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201030
+   Merge with NetBSD make, pick up
+   o change char * to void * in Var_Value
+   o make iterating over HashTable simpler
+   o rename VAR_CMD to VAR_CMDLINE
+   o cond.c: clean up is_separator
+   fix parse error in string literal in conditional
+   o main.c: do not use objdir that is not writable
+   in lint mode, exit with error status on errors
+   o  parse.c: clean up StrContainsWord
+   fix out-of-bounds pointer in ParseTrackInput
+   o var.c: rename Str_SYSVMatch and its parameters
+   remove unsatisfiable conditions in Var_Set_with_flags
+   document where the variable name is expanded
+   fix documentation for VARP_SUB_ONE
+   rename VAR_EXPORTED_YES to VAR_EXPORTED_SOME
+   document VAR_READONLY
+   prevent appending to read-only variables
+   extract MayExport from Var_Export1
+   remove redundant evaluations in VarFind
+   replace VarFindFlags with a simple Boolean
+   rename FIND_CMD to FIND_CMDLINE, to match VAR_CMDLINE
+
+2020-10-28  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201028
+   Merge with NetBSD make, pick up
+   o rename defIncPath to defSysIncPath
+   o initialize all CmdOpts fields
+   o lst.c: inline Vector_Get
+   o main.c: refactor main extract
+   InitMaxJobs,InitObjdir,InitVarMake,InitRandom,
+   ReadMakefiles,CleanUp,InitVpath,ReadBuiltinRules,
+   InitDefIncPath,CmdOpts_Init,UnlimitFiles
+   o parse.c: merge curFile into includes
+   rename predecessor to order_pred
+   sort ParseSpecial alphabetically
+   remove unused, undocumented .NOEXPORT
+   rename ParseSpecial enum values consistently
+   rename some fields of struct IFile
+
+2020-10-26  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201026
+   Merge with NetBSD make, pick up
+   o group the command line options and arguments into a struct
+   o rename GNode.cmgn to youngestChild
+   o rename hash functions to identify the type name
+   o negate OP_NOP and rename it to GNode_IsTarget
+   o add GNode_Path to access the path of a GNode
+   o remove macros MIN and MAX
+   o remove unused Lst_Find and Lst_FindFrom
+   o arch.c: and make Arch_FindLib simpler
+   clean up code layout
+   make Arch_ParseArchive simpler
+   o cond.c: inline CondFindStrMatch into FuncMake
+   o dir.c: replace Dir_CopyDir

svn commit: r367461 - vendor/NetBSD/bmake/20201101

2020-11-07 Thread Simon J. Gerraty
Author: sjg
Date: Sat Nov  7 19:42:15 2020
New Revision: 367461
URL: https://svnweb.freebsd.org/changeset/base/367461

Log:
  tag bmake-20201101

Added:
  vendor/NetBSD/bmake/20201101/
 - copied from r367460, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367460 - in vendor/NetBSD/bmake/dist: . filemon mk unit-tests

2020-11-07 Thread Simon J. Gerraty
/dist/unit-tests/varmod-defined.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-exclam-shell.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-gmtime.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-gmtime.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-hash.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-ifelse.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-ifelse.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-l-name-to-value.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-localtime.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-localtime.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-loop.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-loop.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-match-escape.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-match-escape.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-match.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-match.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-order-reverse.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-order-shuffle.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-order.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-quote.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-range.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-range.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-subst-regex.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-subst.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-sysv.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-sysv.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-lower.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-separator.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-separator.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-to-upper.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-undefined.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-curdir.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-includes.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-libs.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-newline.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-parsedir.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-parsedir.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-parsefile.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-parsefile.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-path.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-shell.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-dot-shell.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-empty.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-empty.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname-make_print_var_on_error.exp
  vendor/NetBSD/bmake/dist/unit-tests/varname-make_print_var_on_error.mk
  vendor/NetBSD/bmake/dist/unit-tests/varname.mk
  vendor/NetBSD/bmake/dist/unit-tests/varparse-dynamic.mk
  vendor/NetBSD/bmake/dist/unit-tests/varshell.exp
  vendor/NetBSD/bmake/dist/unit-tests/varshell.mk
  vendor/NetBSD/bmake/dist/util.c
  vendor/NetBSD/bmake/dist/var.c

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Sat Nov  7 19:17:37 2020
(r367459)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Sat Nov  7 19:39:21 2020
(r367460)
@@ -1,3 +1,267 @@
+2020-11-01  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201101
+   Merge with NetBSD make, pick up
+   o negate NoExecute to GNode_ShouldExecute
+   o job.c: rename JobMatchShell to FindShellByName
+   extract EscapeShellDblQuot from JobPrintCommand
+   extract ParseRunOptions from JobPrintCommand
+   o var.c: extract ApplyModifiersIndirect from ApplyModifiers
+   treat malformed :range, :ts and :[...] as errors
+   add tests for the variable modifiers :[words] and :range
+
+2020-10-31  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20201031
+   Merge with NetBSD make, pick up
+   o format #include directives consistently
+   o do not look up local variables like .TARGET anywhere else
+   o main.c: Main_SetObjdir is first called for curdir which may be
+   readonly
+   reduce the scope where recursive expressions are detected
+   remove redundant :tl from getBoolean
+   clean up mkTempFile
+   o meta.c: simplify memory allocation in meta_create and meta_oodate
+   o parse.c: extract loadedfile_mmap from loadfile
+   o trace.c: document possible undefined behavior with .CURDIR
+   o var.c: make parsing of the :gmtime and :localtime modifiers stricter
+   rename ismeta to is_shell_metachar
+   remove debug logging for the :Q variable modifier
+   rename VarIsDynamic to VarnameIsDynamic
+   use consistent parameter order in varname parsing functions
+   extract ParseVarnameLong from Var_Parse
+   extract ParseVarnameShort from Var_Parse

svn commit: r365366 - in head: contrib/bmake contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2020-09-05 Thread Simon J. Gerraty
Author: sjg
Date: Sat Sep  5 19:29:42 2020
New Revision: 365366
URL: https://svnweb.freebsd.org/changeset/base/365366

Log:
  Update to bmake-20200902
  
  Lots of code refactoring, simplification and cleanup.
  Lots of new unit-tests providing much higher code coverage.
  All courtesy of rillig at netbsd.
  
  Other significant changes:
  
  o new read-only variable .SHELL which provides the path of the shell
used to run scripts (as defined by  the .SHELL target).
  
  o variable parsing detects more errors.
  
  o new debug option -dl: LINT mode, does the equivalent of := for all
variable assignments so that file and line number are reported for
variable parse errors.

Added:
  head/contrib/bmake/enum.c
 - copied unchanged from r365363, vendor/NetBSD/bmake/dist/enum.c
  head/contrib/bmake/enum.h
 - copied unchanged from r365363, vendor/NetBSD/bmake/dist/enum.h
  head/contrib/bmake/lst.c
 - copied unchanged from r365363, vendor/NetBSD/bmake/dist/lst.c
  head/contrib/bmake/mk/dirdeps-cache-update.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/mk/dirdeps-cache-update.mk
  head/contrib/bmake/unit-tests/archive-suffix.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/archive-suffix.exp
  head/contrib/bmake/unit-tests/archive-suffix.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/archive-suffix.mk
  head/contrib/bmake/unit-tests/archive.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/archive.exp
  head/contrib/bmake/unit-tests/archive.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/archive.mk
  head/contrib/bmake/unit-tests/cmd-interrupt.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cmd-interrupt.exp
  head/contrib/bmake/unit-tests/cmd-interrupt.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cmd-interrupt.mk
  head/contrib/bmake/unit-tests/cmdline.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cmdline.exp
  head/contrib/bmake/unit-tests/cmdline.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cmdline.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-eq.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-eq.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric-eq.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-eq.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-ge.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-ge.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric-ge.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-ge.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-gt.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-gt.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric-gt.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-gt.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-le.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-le.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric-le.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-le.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-lt.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-lt.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric-lt.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-lt.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-ne.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-ne.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric-ne.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric-ne.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-numeric.mk
  head/contrib/bmake/unit-tests/cond-cmp-string.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-string.exp
  head/contrib/bmake/unit-tests/cond-cmp-string.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-string.mk
  head/contrib/bmake/unit-tests/cond-func-commands.exp
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-func-commands.exp
  head/contrib/bmake/unit-tests/cond-func-commands.mk
 - copied unchanged from r365363, 
vendor/NetBSD/bmake/dist/unit-tests/cond-func-commands.mk
  

svn commit: r365363 - vendor/NetBSD/bmake/20200902

2020-09-05 Thread Simon J. Gerraty
Author: sjg
Date: Sat Sep  5 16:44:37 2020
New Revision: 365363
URL: https://svnweb.freebsd.org/changeset/base/365363

Log:
  tag bmake-20200902

Added:
  vendor/NetBSD/bmake/20200902/
 - copied from r365362, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365361 - in vendor/NetBSD/bmake/dist: . lst.lib mk mk/sys unit-tests

2020-09-05 Thread Simon J. Gerraty
/bmake/dist/mk/manifest.mk
  vendor/NetBSD/bmake/dist/mk/meta.autodep.mk
  vendor/NetBSD/bmake/dist/mk/meta.stage.mk
  vendor/NetBSD/bmake/dist/mk/meta.subdir.mk
  vendor/NetBSD/bmake/dist/mk/meta.sys.mk
  vendor/NetBSD/bmake/dist/mk/meta2deps.py
  vendor/NetBSD/bmake/dist/mk/meta2deps.sh
  vendor/NetBSD/bmake/dist/mk/mk-files.txt
  vendor/NetBSD/bmake/dist/mk/mkopt.sh
  vendor/NetBSD/bmake/dist/mk/obj.mk
  vendor/NetBSD/bmake/dist/mk/options.mk
  vendor/NetBSD/bmake/dist/mk/own.mk
  vendor/NetBSD/bmake/dist/mk/prlist.mk
  vendor/NetBSD/bmake/dist/mk/prog.mk
  vendor/NetBSD/bmake/dist/mk/progs.mk
  vendor/NetBSD/bmake/dist/mk/rst2htm.mk
  vendor/NetBSD/bmake/dist/mk/scripts.mk
  vendor/NetBSD/bmake/dist/mk/srctop.mk
  vendor/NetBSD/bmake/dist/mk/stage-install.sh
  vendor/NetBSD/bmake/dist/mk/sys.clean-env.mk
  vendor/NetBSD/bmake/dist/mk/sys.debug.mk
  vendor/NetBSD/bmake/dist/mk/sys.dependfile.mk
  vendor/NetBSD/bmake/dist/mk/sys.mk
  vendor/NetBSD/bmake/dist/mk/sys.vars.mk
  vendor/NetBSD/bmake/dist/mk/sys/AIX.mk
  vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk
  vendor/NetBSD/bmake/dist/mk/sys/Generic.mk
  vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk
  vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk
  vendor/NetBSD/bmake/dist/mk/sys/Linux.mk
  vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk
  vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk
  vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk
  vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk
  vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk
  vendor/NetBSD/bmake/dist/mk/target-flags.mk
  vendor/NetBSD/bmake/dist/mk/warnings.mk
  vendor/NetBSD/bmake/dist/mk/whats.mk
  vendor/NetBSD/bmake/dist/mk/yacc.mk
  vendor/NetBSD/bmake/dist/nonints.h
  vendor/NetBSD/bmake/dist/os.sh
  vendor/NetBSD/bmake/dist/parse.c
  vendor/NetBSD/bmake/dist/str.c
  vendor/NetBSD/bmake/dist/strlist.c
  vendor/NetBSD/bmake/dist/strlist.h
  vendor/NetBSD/bmake/dist/suff.c
  vendor/NetBSD/bmake/dist/targ.c
  vendor/NetBSD/bmake/dist/trace.c
  vendor/NetBSD/bmake/dist/unit-tests/Makefile
  vendor/NetBSD/bmake/dist/unit-tests/cond-late.exp
  vendor/NetBSD/bmake/dist/unit-tests/cond-late.mk
  vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk
  vendor/NetBSD/bmake/dist/unit-tests/export-all.mk
  vendor/NetBSD/bmake/dist/unit-tests/export.exp
  vendor/NetBSD/bmake/dist/unit-tests/export.mk
  vendor/NetBSD/bmake/dist/unit-tests/forloop.mk
  vendor/NetBSD/bmake/dist/unit-tests/impsrc.exp
  vendor/NetBSD/bmake/dist/unit-tests/impsrc.mk
  vendor/NetBSD/bmake/dist/unit-tests/include-main.mk
  vendor/NetBSD/bmake/dist/unit-tests/moderrs.exp
  vendor/NetBSD/bmake/dist/unit-tests/moderrs.mk
  vendor/NetBSD/bmake/dist/unit-tests/modmatch.exp
  vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk
  vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp
  vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk
  vendor/NetBSD/bmake/dist/unit-tests/modts.exp
  vendor/NetBSD/bmake/dist/unit-tests/modts.mk
  vendor/NetBSD/bmake/dist/unit-tests/phony-end.exp
  vendor/NetBSD/bmake/dist/unit-tests/posix1.mk
  vendor/NetBSD/bmake/dist/unit-tests/sysv.exp
  vendor/NetBSD/bmake/dist/unit-tests/sysv.mk
  vendor/NetBSD/bmake/dist/unit-tests/unexport-env.mk
  vendor/NetBSD/bmake/dist/unit-tests/unexport.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmisc.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmisc.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.mk
  vendor/NetBSD/bmake/dist/util.c
  vendor/NetBSD/bmake/dist/var.c

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Sat Sep  5 10:16:24 2020
(r365360)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Sat Sep  5 16:11:04 2020
(r365361)
@@ -1,3 +1,243 @@
+2020-09-02  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200902
+   Merge with NetBSD make, pick up
+   o use make_stat to ensure no confusion over valid fields
+   returned by cached_stat
+   o var.c: make VarQuote const-correct
+   o add unit tests for .for
+
+2020-09-01  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200901
+   Merge with NetBSD make, pick up
+   o rename Hash_Table fields
+   o make data types in Dir_HasWildcards more precise
+
+2020-08-31  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200831
+   Merge with NetBSD make, pick up
+   o suff.c: fix unbalanced Lst_Open/Lst_Close in SuffFindCmds
+   o lst.c: Lst_Open renable assert that list isn't open
+   o unit test for .TARGET dependent flags
+   o var.c: fix aliasing bug in VarUniq
+   o more unit tests for :u
+
+2020-08-30  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200830
+   Merge with NetBSD make, pick up
+   o allow for strict type checking for Boolean
+   o Var_Parse never returns NULL
+   o Var_Subst never returns NULL
+   o Lst_Find now takes boolean match function
+   o rename Lst_Memeber to Lst_FindDatum

svn commit: r364965 - in head/stand: common libsa

2020-08-29 Thread Simon J. Gerraty
Author: sjg
Date: Sat Aug 29 21:05:43 2020
New Revision: 364965
URL: https://svnweb.freebsd.org/changeset/base/364965

Log:
  zalloc_malloc:Free hexdump preceeding buffer when we detect overflow
  
  Move hexdump from stand/common/misc.c to stand/libsa/hexdump.c
  (svn cp)
  Disable use of pager - causes linking issue for boot1
  can be re-enabled by defining HEXDUMP_PAGER.
  
  Reviewed by:  stevek, imp
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision: https://reviews.freebsd.org/D26235

Added:
  head/stand/libsa/hexdump.c   (contents, props changed)
 - copied, changed from r364346, head/stand/common/misc.c
Modified:
  head/stand/common/bootstrap.h
  head/stand/common/misc.c
  head/stand/libsa/Makefile
  head/stand/libsa/pkgfs.c
  head/stand/libsa/stand.h
  head/stand/libsa/zalloc_malloc.c

Modified: head/stand/common/bootstrap.h
==
--- head/stand/common/bootstrap.h   Sat Aug 29 19:26:31 2020
(r364964)
+++ head/stand/common/bootstrap.h   Sat Aug 29 21:05:43 2020
(r364965)
@@ -68,7 +68,6 @@ int   getrootmount(char *rootdev);
 
 /* misc.c */
 char   *unargv(int argc, char *argv[]);
-void   hexdump(caddr_t region, size_t len);
 size_t strlenout(vm_offset_t str);
 char   *strdupout(vm_offset_t str);
 void   kern_bzero(vm_offset_t dest, size_t len);

Modified: head/stand/common/misc.c
==
--- head/stand/common/misc.cSat Aug 29 19:26:31 2020(r364964)
+++ head/stand/common/misc.cSat Aug 29 21:05:43 2020(r364965)
@@ -169,46 +169,6 @@ alloc_pread(readin_handle_t fd, off_t off, size_t len)
return (buf);
 }
 
-/*
- * Display a region in traditional hexdump format.
- */
-void
-hexdump(caddr_t region, size_t len)
-{
-caddr_tline;
-intx, c;
-char   lbuf[80];
-#define emit(fmt, args...) {sprintf(lbuf, fmt , ## args); 
pager_output(lbuf);}
-
-pager_open();
-for (line = region; line < (region + len); line += 16) {
-   emit("%08lx  ", (long) line);
-   
-   for (x = 0; x < 16; x++) {
-   if ((line + x) < (region + len)) {
-   emit("%02x ", *(uint8_t *)(line + x));
-   } else {
-   emit("-- ");
-   }
-   if (x == 7)
-   emit(" ");
-   }
-   emit(" |");
-   for (x = 0; x < 16; x++) {
-   if ((line + x) < (region + len)) {
-   c = *(uint8_t *)(line + x);
-   if ((c < ' ') || (c > '~')) /* !isprint(c) */
-   c = '.';
-   emit("%c", c);
-   } else {
-   emit(" ");
-   }
-   }
-   emit("|\n");
-}
-pager_close();
-}
-
 void
 dev_cleanup(void)
 {

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Sat Aug 29 19:26:31 2020(r364964)
+++ head/stand/libsa/Makefile   Sat Aug 29 21:05:43 2020(r364965)
@@ -13,8 +13,9 @@ LIBSA_CPUARCH?=${MACHINE_CPUARCH}
 LIB?=  sa
 
 # standalone components and stuff we have modified locally
-SRCS+= gzguts.h zutil.h __main.c abort.c assert.c bcd.c environment.c getopt.c 
gets.c \
-   globals.c pager.c panic.c printf.c strdup.c strerror.c \
+SRCS+= gzguts.h zutil.h __main.c abort.c assert.c bcd.c environment.c \
+   getopt.c gets.c globals.c \
+   hexdump.c pager.c panic.c printf.c strdup.c strerror.c \
random.c sbrk.c twiddle.c zalloc.c zalloc_malloc.c
 
 # private (pruned) versions of libc string functions

Copied and modified: head/stand/libsa/hexdump.c (from r364346, 
head/stand/common/misc.c)
==
--- head/stand/common/misc.cTue Aug 18 14:17:14 2020(r364346, copy 
source)
+++ head/stand/libsa/hexdump.c  Sat Aug 29 21:05:43 2020(r364965)
@@ -29,147 +29,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 
 /*
- * Concatenate the (argc) elements of (argv) into a single string, and return
- * a copy of same.
- */
-char *
-unargv(int argc, char *argv[])
-{
-size_t hlong;
-inti;
-char   *cp;
-
-for (i = 0, hlong = 0; i < argc; i++)
-   hlong += strlen(argv[i]) + 2;
-
-if(hlong == 0)
-   return(NULL);
-
-cp = malloc(hlong);
-cp[0] = 0;
-for (i = 0; i < argc; i++) {
-   strcat(cp, argv[i]);
-   if (i < (argc - 1))
- strcat(cp, " ");
-}
- 
-return(cp);
-}
-
-/*
- * Get the length of a string in kernel space
- */
-size_t
-strlenout(vm_offset_t src)
-{
-char   c;
-size_t len;
-
-for (len = 0; ; len++) {
-   archsw.arch_copyout(src++, , 1);
-   if (c == 0)
-   break;
-}
-return(len);
-}
-
-/*
- * Make a duplicate copy of a string in kernel space
- 

svn commit: r364962 - stable/12/sys/security/mac_veriexec

2020-08-29 Thread Simon J. Gerraty
Author: sjg
Date: Sat Aug 29 16:27:21 2020
New Revision: 364962
URL: https://svnweb.freebsd.org/changeset/base/364962

Log:
  mac_veriexec_fingerprint_check_vnode: v_writecount > 0 means active writers
  
  v_writecount can actually be < 0 for text,
  so check for v_writecount > 0
  
  MFC of r362125
  
  Reviewed by:  stevek

Modified:
  stable/12/sys/security/mac_veriexec/veriexec_fingerprint.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/security/mac_veriexec/veriexec_fingerprint.c
==
--- stable/12/sys/security/mac_veriexec/veriexec_fingerprint.c  Sat Aug 29 
16:23:00 2020(r364961)
+++ stable/12/sys/security/mac_veriexec/veriexec_fingerprint.c  Sat Aug 29 
16:27:21 2020(r364962)
@@ -214,7 +214,7 @@ mac_veriexec_fingerprint_check_vnode(struct vnode *vp,
int error;
 
/* reject fingerprint if writers are active */
-   if (vp->v_writecount)
+   if (vp->v_writecount > 0)
return (ETXTBSY);
 
if ((vp->v_mount->mnt_flag & MNT_VERIFIED) != 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364961 - in stable/12: lib/libsecureboot stand/common stand/uboot/lib sys/kern

2020-08-29 Thread Simon J. Gerraty
Author: sjg
Date: Sat Aug 29 16:23:00 2020
New Revision: 364961
URL: https://svnweb.freebsd.org/changeset/base/364961

Log:
  MFC loader fixes
  
  r361710: stand/uboot: fix setting of gateip.s_addr
  Missplaced paren.
  
  r361933: loader: install allow for more complete device spec in url
  
  Rework to simplify and impose sane url syntax.
  That is we allow for file://[devname[:fstype]]/package
  
  r362127: verify_pcr_export: bump kenv_mvallen if needed
  r362231: make KENV_MVALLEN tunable
  
  When doing secure boot, loader wants to export loader.ve.hashed
  the value of which typically exceeds KENV_MVALLEN.
  
  Replace use of KENV_MVALLEN with tunable kenv_mvallen.
  
  Add getenv_string_buffer() for the case where a stack buffer cannot be
  created and use uma_zone_t kenv_zone for suitably sized buffers.
  
  r364443: veloader: insist on verifying .4th .lua etc
  
  When files are read from .rc or .4th, verify_file is asked to
  guess the severity (VE_TRY,VE_WANT,VE_MUST)
  
  Reviewed by:  imp, stevek, kevans

Modified:
  stable/12/lib/libsecureboot/verify_file.c
  stable/12/stand/common/install.c
  stable/12/stand/uboot/lib/net.c
  stable/12/sys/kern/kern_environment.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libsecureboot/verify_file.c
==
--- stable/12/lib/libsecureboot/verify_file.c   Sat Aug 29 16:04:02 2020
(r364960)
+++ stable/12/lib/libsecureboot/verify_file.c   Sat Aug 29 16:23:00 2020
(r364961)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2017-2018, Juniper Networks, Inc.
+ * Copyright (c) 2017-2020, Juniper Networks, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "libsecureboot.h"
 #include 
@@ -254,6 +255,10 @@ severity_guess(const char *filename)
strcmp(cp, ".cookie") == 0 ||
strcmp(cp, ".hints") == 0)
return (VE_TRY);
+   if (strcmp(cp, ".4th") == 0 ||
+   strcmp(cp, ".lua") == 0 ||
+   strcmp(cp, ".rc") == 0)
+   return (VE_MUST);
}
return (VE_WANT);
 }
@@ -532,6 +537,19 @@ verify_pcr_export(void)
DEBUG_PRINTF(1,
("%s: setenv(loader.ve.hashed, %s\n",
__func__, hinfo));
+   if ((hlen = strlen(hinfo)) > KENV_MVALLEN) {
+   /*
+* bump kenv_mvallen
+* roundup to multiple of KENV_MVALLEN
+*/
+   char mvallen[16];
+
+   hlen += KENV_MVALLEN -
+   (hlen % KENV_MVALLEN);
+   if (snprintf(mvallen, sizeof(mvallen),
+   "%d", (int) hlen) < 
sizeof(mvallen))
+   setenv("kenv_mvallen", mvallen, 
1);
+   }
free(hinfo);
}
}

Modified: stable/12/stand/common/install.c
==
--- stable/12/stand/common/install.cSat Aug 29 16:04:02 2020
(r364960)
+++ stable/12/stand/common/install.cSat Aug 29 16:23:00 2020
(r364961)
@@ -184,7 +184,8 @@ cleanup(void)
 
 /*
  * usage: install URL
- * where: URL = (tftp|file)://[host]/
+ * where: URL = tftp://[host]/
+ * or  file://[devname[:fstype]]/
  */
 static int
 install(char *pkgname)
@@ -192,8 +193,9 @@ install(char *pkgname)
static char buf[256];
struct fs_ops *proto;
struct preloaded_file *fp;
-   char *s, *currdev;
-   const char *devname;
+   char *e, *s, *currdev;
+   char *devname;
+   size_t devnamelen;
int error, fd, i, local;
 
s = strstr(pkgname, "://");
@@ -201,34 +203,74 @@ install(char *pkgname)
goto invalid_url;
 
i = s - pkgname;
+   s += 3;
+   if (*s == '\0')
+   goto invalid_url;
+
+   devname = NULL;
+   devnamelen = 0;
+   proto = NULL;
+   local = 0;
+
if (i == 4 && !strncasecmp(pkgname, "tftp", i)) {
devname = "net0";
+   devnamelen = 4;
proto = _fsops;
-   local = 0;
} else if (i == 4 && !strncasecmp(pkgname, "file", i)) {
currdev = getenv("currdev");
-   if (currdev != NULL && strcmp(currdev, "pxe0:") == 0) {
-   devname = 

svn commit: r364443 - head/lib/libsecureboot

2020-08-20 Thread Simon J. Gerraty
Author: sjg
Date: Fri Aug 21 00:27:06 2020
New Revision: 364443
URL: https://svnweb.freebsd.org/changeset/base/364443

Log:
  veloader: insist on verifying .4th .lua etc
  
  When files are read from .rc or .4th, verify_file is asked to
  guess the severity (VE_TRY,VE_WANT,VE_MUST)
  
  Reviewed by:  stevek
  MFC after:1 week
  Sponsored by: Juniper Networks

Modified:
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cFri Aug 21 00:03:24 2020
(r364442)
+++ head/lib/libsecureboot/verify_file.cFri Aug 21 00:27:06 2020
(r364443)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2017-2018, Juniper Networks, Inc.
+ * Copyright (c) 2017-2020, Juniper Networks, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -255,6 +255,10 @@ severity_guess(const char *filename)
strcmp(cp, ".cookie") == 0 ||
strcmp(cp, ".hints") == 0)
return (VE_TRY);
+   if (strcmp(cp, ".4th") == 0 ||
+   strcmp(cp, ".lua") == 0 ||
+   strcmp(cp, ".rc") == 0)
+   return (VE_MUST);
}
return (VE_WANT);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363352 - in stable/12: contrib/bmake contrib/bmake/filemon contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2020-07-19 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jul 20 00:17:08 2020
New Revision: 363352
URL: https://svnweb.freebsd.org/changeset/base/363352

Log:
  Update to bmake-20200710
  
  Key changes include reduced noise at end of failed build log
  and avoid evaluation of unnecessary terms in conditionals.
  In META MODE; a target flagged .META is out-of-date if meta file
  is missing
  
  MFC of r361986, r363117

Added:
  stable/12/contrib/bmake/unit-tests/cond-short.exp
  stable/12/contrib/bmake/unit-tests/cond-short.mk   (contents, props changed)
  stable/12/usr.bin/bmake/unit-tests/Makefile.config   (contents, props changed)
Modified:
  stable/12/contrib/bmake/ChangeLog
  stable/12/contrib/bmake/FILES
  stable/12/contrib/bmake/Makefile
  stable/12/contrib/bmake/VERSION
  stable/12/contrib/bmake/arch.c
  stable/12/contrib/bmake/bmake.1
  stable/12/contrib/bmake/bmake.cat1
  stable/12/contrib/bmake/buf.c
  stable/12/contrib/bmake/compat.c
  stable/12/contrib/bmake/cond.c
  stable/12/contrib/bmake/configure
  stable/12/contrib/bmake/configure.in
  stable/12/contrib/bmake/dir.c
  stable/12/contrib/bmake/dirname.c
  stable/12/contrib/bmake/filemon/filemon_dev.c
  stable/12/contrib/bmake/for.c
  stable/12/contrib/bmake/hash.c
  stable/12/contrib/bmake/hash.h
  stable/12/contrib/bmake/job.c
  stable/12/contrib/bmake/job.h
  stable/12/contrib/bmake/lst.lib/lstAppend.c
  stable/12/contrib/bmake/lst.lib/lstAtEnd.c
  stable/12/contrib/bmake/lst.lib/lstAtFront.c
  stable/12/contrib/bmake/lst.lib/lstClose.c
  stable/12/contrib/bmake/lst.lib/lstConcat.c
  stable/12/contrib/bmake/lst.lib/lstDatum.c
  stable/12/contrib/bmake/lst.lib/lstDeQueue.c
  stable/12/contrib/bmake/lst.lib/lstDupl.c
  stable/12/contrib/bmake/lst.lib/lstEnQueue.c
  stable/12/contrib/bmake/lst.lib/lstFind.c
  stable/12/contrib/bmake/lst.lib/lstFindFrom.c
  stable/12/contrib/bmake/lst.lib/lstFirst.c
  stable/12/contrib/bmake/lst.lib/lstForEach.c
  stable/12/contrib/bmake/lst.lib/lstForEachFrom.c
  stable/12/contrib/bmake/lst.lib/lstInit.c
  stable/12/contrib/bmake/lst.lib/lstInsert.c
  stable/12/contrib/bmake/lst.lib/lstIsAtEnd.c
  stable/12/contrib/bmake/lst.lib/lstIsEmpty.c
  stable/12/contrib/bmake/lst.lib/lstLast.c
  stable/12/contrib/bmake/lst.lib/lstNext.c
  stable/12/contrib/bmake/lst.lib/lstOpen.c
  stable/12/contrib/bmake/lst.lib/lstPrev.c
  stable/12/contrib/bmake/lst.lib/lstRemove.c
  stable/12/contrib/bmake/lst.lib/lstReplace.c
  stable/12/contrib/bmake/lst.lib/lstSucc.c
  stable/12/contrib/bmake/main.c
  stable/12/contrib/bmake/make.1
  stable/12/contrib/bmake/make.c
  stable/12/contrib/bmake/make.h
  stable/12/contrib/bmake/make_malloc.c
  stable/12/contrib/bmake/meta.c
  stable/12/contrib/bmake/meta.h
  stable/12/contrib/bmake/mk/ChangeLog
  stable/12/contrib/bmake/mk/FILES
  stable/12/contrib/bmake/mk/dirdeps-targets.mk
  stable/12/contrib/bmake/mk/dirdeps.mk
  stable/12/contrib/bmake/mk/gendirdeps.mk
  stable/12/contrib/bmake/mk/host-target.mk
  stable/12/contrib/bmake/mk/init.mk
  stable/12/contrib/bmake/mk/install-mk
  stable/12/contrib/bmake/mk/meta2deps.py
  stable/12/contrib/bmake/mk/mkopt.sh
  stable/12/contrib/bmake/mk/sys/AIX.mk
  stable/12/contrib/bmake/mk/sys/Darwin.mk
  stable/12/contrib/bmake/mk/sys/Generic.mk
  stable/12/contrib/bmake/mk/sys/HP-UX.mk
  stable/12/contrib/bmake/mk/sys/IRIX.mk
  stable/12/contrib/bmake/mk/sys/Linux.mk
  stable/12/contrib/bmake/mk/sys/NetBSD.mk
  stable/12/contrib/bmake/mk/sys/OSF1.mk
  stable/12/contrib/bmake/mk/sys/OpenBSD.mk
  stable/12/contrib/bmake/mk/sys/SunOS.mk
  stable/12/contrib/bmake/mk/sys/UnixWare.mk
  stable/12/contrib/bmake/nonints.h
  stable/12/contrib/bmake/parse.c
  stable/12/contrib/bmake/str.c
  stable/12/contrib/bmake/suff.c
  stable/12/contrib/bmake/targ.c
  stable/12/contrib/bmake/trace.c
  stable/12/contrib/bmake/unit-tests/Makefile
  stable/12/contrib/bmake/unit-tests/modmatch.mk
  stable/12/contrib/bmake/unit-tests/modmisc.exp
  stable/12/contrib/bmake/unit-tests/modmisc.mk
  stable/12/contrib/bmake/unit-tests/modorder.exp
  stable/12/contrib/bmake/unit-tests/modorder.mk
  stable/12/contrib/bmake/unit-tests/sysv.exp
  stable/12/contrib/bmake/unit-tests/sysv.mk
  stable/12/contrib/bmake/unit-tests/varmisc.exp
  stable/12/contrib/bmake/unit-tests/varmisc.mk
  stable/12/contrib/bmake/util.c
  stable/12/contrib/bmake/var.c
  stable/12/usr.bin/bmake/Makefile
  stable/12/usr.bin/bmake/Makefile.config
  stable/12/usr.bin/bmake/config.h
  stable/12/usr.bin/bmake/unit-tests/Makefile

Modified: stable/12/contrib/bmake/ChangeLog
==
--- stable/12/contrib/bmake/ChangeLog   Sun Jul 19 23:56:19 2020
(r363351)
+++ stable/12/contrib/bmake/ChangeLog   Mon Jul 20 00:17:08 2020
(r363352)
@@ -1,3 +1,120 @@
+2020-07-10  Simon J Gerraty  
+
+   * configure.in: use AC_INCLUDES_DEFAULT rather than AC_HEADER_STDC
+
+   * VERSION (_MAKE_VERSION): 20200710
+   Merge with NetBSD make, pick up
+   o filemon

svn commit: r363351 - in head: lib/libbearssl lib/libc lib/libsecureboot libexec/dma/dmagent libexec/rc/rc.d sbin/veriexec stand/efi/loader stand/i386/loader

2020-07-19 Thread Simon J. Gerraty
Author: sjg
Date: Sun Jul 19 23:56:19 2020
New Revision: 363351
URL: https://svnweb.freebsd.org/changeset/base/363351

Log:
  Revert that!

Modified:
  head/lib/libbearssl/Makefile.depend
  head/lib/libc/Makefile
  head/lib/libsecureboot/local.trust.mk
  head/libexec/dma/dmagent/Makefile.depend
  head/libexec/rc/rc.d/tmp
  head/sbin/veriexec/Makefile.depend
  head/stand/efi/loader/Makefile
  head/stand/i386/loader/Makefile

Modified: head/lib/libbearssl/Makefile.depend
==
--- head/lib/libbearssl/Makefile.depend Sun Jul 19 23:54:00 2020
(r363350)
+++ head/lib/libbearssl/Makefile.depend Sun Jul 19 23:56:19 2020
(r363351)
@@ -2,6 +2,7 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
+   gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Sun Jul 19 23:54:00 2020(r363350)
+++ head/lib/libc/Makefile  Sun Jul 19 23:56:19 2020(r363351)
@@ -186,7 +186,7 @@ SUBDIR.${MK_TESTS}+= tests
 .if (${LIBC_ARCH} == amd64 || ${LIBC_ARCH} == i386) && \
 ${.TARGETS:Mall} == all && \
 defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
-#.error ${LIBC_ARCH} libc requires linker ifunc support
+.error ${LIBC_ARCH} libc requires linker ifunc support
 .endif
 
 .if !defined(_SKIP_BUILD)

Modified: head/lib/libsecureboot/local.trust.mk
==
--- head/lib/libsecureboot/local.trust.mk   Sun Jul 19 23:54:00 2020
(r363350)
+++ head/lib/libsecureboot/local.trust.mk   Sun Jul 19 23:56:19 2020
(r363351)
@@ -8,9 +8,6 @@
 
 # force these for Junos
 #MANIFEST_SKIP_ALWAYS= boot
-MANIFEST_SKIP= boot
-XCFLAGS.veopen+= -DMANIFEST_SKIP_MAYBE=\"${MANIFEST_SKIP}\"
-
 VE_HASH_LIST= \
SHA1 \
SHA256 \
@@ -40,7 +37,6 @@ VE_SIGNATURE_EXT_LIST+= \
 VE_SIGNATURE_LIST+= OPENPGP
 VE_SIGNATURE_EXT_LIST+= asc
 
-PYTHON ?= /usr/local/bin/python
 SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py
 
 .if exists(${SIGNER})
@@ -103,7 +99,7 @@ ta.h: vc_rsa.pem
 .endif
 
 # we take the mtime of this as our baseline time
-BUILD_UTC_FILE= ecerts.pem
+#BUILD_UTC_FILE= ecerts.pem
 #VE_DEBUG_LEVEL=3
 #VE_VERBOSE_DEFAULT=1
 

Modified: head/libexec/dma/dmagent/Makefile.depend
==
--- head/libexec/dma/dmagent/Makefile.dependSun Jul 19 23:54:00 2020
(r363350)
+++ head/libexec/dma/dmagent/Makefile.dependSun Jul 19 23:56:19 2020
(r363351)
@@ -2,6 +2,7 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
+   gnu/lib/csu \
include \
include/arpa \
include/xlocale \
@@ -10,6 +11,7 @@ DIRDEPS = \
lib/libcompiler_rt \
secure/lib/libcrypto \
secure/lib/libssl \
+   usr.bin/yacc.host \
 
 
 .include 

Modified: head/libexec/rc/rc.d/tmp
==
--- head/libexec/rc/rc.d/tmpSun Jul 19 23:54:00 2020(r363350)
+++ head/libexec/rc/rc.d/tmpSun Jul 19 23:56:19 2020(r363351)
@@ -41,9 +41,6 @@ load_rc_config $name
 mount_tmpmfs()
 {
if ! /bin/df /tmp | grep -q "^/dev/md[0-9].* /tmp"; then
-   if test -w /tmp/. && checkyesno tmpmfs_clear_mnt; then
-   (cd /tmp/. && rm -rf .* *)
-   fi
mount_md ${tmpsize} /tmp "${tmpmfs_flags}"
chmod 01777 /tmp
fi

Modified: head/sbin/veriexec/Makefile.depend
==
--- head/sbin/veriexec/Makefile.depend  Sun Jul 19 23:54:00 2020
(r363350)
+++ head/sbin/veriexec/Makefile.depend  Sun Jul 19 23:56:19 2020
(r363351)
@@ -2,6 +2,7 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
+   gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \
@@ -10,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libsecureboot \
lib/libveriexec \
-   usr.bin/yacc.host \
 
 
 .include 

Modified: head/stand/efi/loader/Makefile
==
--- head/stand/efi/loader/Makefile  Sun Jul 19 23:54:00 2020
(r363350)
+++ head/stand/efi/loader/Makefile  Sun Jul 19 23:56:19 2020
(r363351)
@@ -102,8 +102,3 @@ DPADD=  ${LDR_INTERP} ${LIBEFI} ${LIBFDT} 
${LIBEFI_FDT
 LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA}
 
 .include 
-
-PATH_BOOTABLE_TOKEN=/boot/boot.4th
-CFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U}
-XCFLAGS.main+= -DPATH_BOOTABLE_TOKEN=\"${PATH_BOOTABLE_TOKEN}\"
-

Modified: head/stand/i386/loader/Makefile

svn commit: r363350 - in head: lib/libbearssl lib/libc lib/libsecureboot libexec/dma/dmagent libexec/rc/rc.d sbin/veriexec stand/efi/loader stand/i386/loader usr.bin/bmake/unit-tests

2020-07-19 Thread Simon J. Gerraty
Author: sjg
Date: Sun Jul 19 23:54:00 2020
New Revision: 363350
URL: https://svnweb.freebsd.org/changeset/base/363350

Log:
  Oops missed Makefile.config

Added:
  head/usr.bin/bmake/unit-tests/Makefile.config   (contents, props changed)
Modified:
  head/lib/libbearssl/Makefile.depend
  head/lib/libc/Makefile
  head/lib/libsecureboot/local.trust.mk
  head/libexec/dma/dmagent/Makefile.depend
  head/libexec/rc/rc.d/tmp
  head/sbin/veriexec/Makefile.depend
  head/stand/efi/loader/Makefile
  head/stand/i386/loader/Makefile

Modified: head/lib/libbearssl/Makefile.depend
==
--- head/lib/libbearssl/Makefile.depend Sun Jul 19 23:45:49 2020
(r363349)
+++ head/lib/libbearssl/Makefile.depend Sun Jul 19 23:54:00 2020
(r363350)
@@ -2,7 +2,6 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
-   gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Sun Jul 19 23:45:49 2020(r363349)
+++ head/lib/libc/Makefile  Sun Jul 19 23:54:00 2020(r363350)
@@ -186,7 +186,7 @@ SUBDIR.${MK_TESTS}+= tests
 .if (${LIBC_ARCH} == amd64 || ${LIBC_ARCH} == i386) && \
 ${.TARGETS:Mall} == all && \
 defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
-.error ${LIBC_ARCH} libc requires linker ifunc support
+#.error ${LIBC_ARCH} libc requires linker ifunc support
 .endif
 
 .if !defined(_SKIP_BUILD)

Modified: head/lib/libsecureboot/local.trust.mk
==
--- head/lib/libsecureboot/local.trust.mk   Sun Jul 19 23:45:49 2020
(r363349)
+++ head/lib/libsecureboot/local.trust.mk   Sun Jul 19 23:54:00 2020
(r363350)
@@ -8,6 +8,9 @@
 
 # force these for Junos
 #MANIFEST_SKIP_ALWAYS= boot
+MANIFEST_SKIP= boot
+XCFLAGS.veopen+= -DMANIFEST_SKIP_MAYBE=\"${MANIFEST_SKIP}\"
+
 VE_HASH_LIST= \
SHA1 \
SHA256 \
@@ -37,6 +40,7 @@ VE_SIGNATURE_EXT_LIST+= \
 VE_SIGNATURE_LIST+= OPENPGP
 VE_SIGNATURE_EXT_LIST+= asc
 
+PYTHON ?= /usr/local/bin/python
 SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py
 
 .if exists(${SIGNER})
@@ -99,7 +103,7 @@ ta.h: vc_rsa.pem
 .endif
 
 # we take the mtime of this as our baseline time
-#BUILD_UTC_FILE= ecerts.pem
+BUILD_UTC_FILE= ecerts.pem
 #VE_DEBUG_LEVEL=3
 #VE_VERBOSE_DEFAULT=1
 

Modified: head/libexec/dma/dmagent/Makefile.depend
==
--- head/libexec/dma/dmagent/Makefile.dependSun Jul 19 23:45:49 2020
(r363349)
+++ head/libexec/dma/dmagent/Makefile.dependSun Jul 19 23:54:00 2020
(r363350)
@@ -2,7 +2,6 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
-   gnu/lib/csu \
include \
include/arpa \
include/xlocale \
@@ -11,7 +10,6 @@ DIRDEPS = \
lib/libcompiler_rt \
secure/lib/libcrypto \
secure/lib/libssl \
-   usr.bin/yacc.host \
 
 
 .include 

Modified: head/libexec/rc/rc.d/tmp
==
--- head/libexec/rc/rc.d/tmpSun Jul 19 23:45:49 2020(r363349)
+++ head/libexec/rc/rc.d/tmpSun Jul 19 23:54:00 2020(r363350)
@@ -41,6 +41,9 @@ load_rc_config $name
 mount_tmpmfs()
 {
if ! /bin/df /tmp | grep -q "^/dev/md[0-9].* /tmp"; then
+   if test -w /tmp/. && checkyesno tmpmfs_clear_mnt; then
+   (cd /tmp/. && rm -rf .* *)
+   fi
mount_md ${tmpsize} /tmp "${tmpmfs_flags}"
chmod 01777 /tmp
fi

Modified: head/sbin/veriexec/Makefile.depend
==
--- head/sbin/veriexec/Makefile.depend  Sun Jul 19 23:45:49 2020
(r363349)
+++ head/sbin/veriexec/Makefile.depend  Sun Jul 19 23:54:00 2020
(r363350)
@@ -2,7 +2,6 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
-   gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \
@@ -11,6 +10,7 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libsecureboot \
lib/libveriexec \
+   usr.bin/yacc.host \
 
 
 .include 

Modified: head/stand/efi/loader/Makefile
==
--- head/stand/efi/loader/Makefile  Sun Jul 19 23:45:49 2020
(r363349)
+++ head/stand/efi/loader/Makefile  Sun Jul 19 23:54:00 2020
(r363350)
@@ -102,3 +102,8 @@ DPADD=  ${LDR_INTERP} ${LIBEFI} ${LIBFDT} 
${LIBEFI_FDT
 LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA}
 
 .include 
+
+PATH_BOOTABLE_TOKEN=/boot/boot.4th
+CFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U}
+XCFLAGS.main+= -DPATH_BOOTABLE_TOKEN=\"${PATH_BOOTABLE_TOKEN}\"
+

Modified: 

svn commit: r363117 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2020-07-11 Thread Simon J. Gerraty
Author: sjg
Date: Sun Jul 12 01:11:48 2020
New Revision: 363117
URL: https://svnweb.freebsd.org/changeset/base/363117

Log:
  Update to bmake-20200710
  
  Key changes include reduced noise at end of failed build log
  and avoid evaluation of unnecessary terms in conditionals.
  In META MODE; a target flagged .META is out-of-date if meta file
  is missing
  
  MFC after:  1 week

Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/FILES
  head/contrib/bmake/VERSION
  head/contrib/bmake/arch.c
  head/contrib/bmake/buf.c
  head/contrib/bmake/compat.c
  head/contrib/bmake/cond.c
  head/contrib/bmake/configure
  head/contrib/bmake/configure.in
  head/contrib/bmake/dir.c
  head/contrib/bmake/filemon/filemon_dev.c
  head/contrib/bmake/for.c
  head/contrib/bmake/hash.c
  head/contrib/bmake/hash.h
  head/contrib/bmake/job.c
  head/contrib/bmake/job.h
  head/contrib/bmake/lst.lib/lstAppend.c
  head/contrib/bmake/lst.lib/lstAtEnd.c
  head/contrib/bmake/lst.lib/lstAtFront.c
  head/contrib/bmake/lst.lib/lstClose.c
  head/contrib/bmake/lst.lib/lstConcat.c
  head/contrib/bmake/lst.lib/lstDatum.c
  head/contrib/bmake/lst.lib/lstDeQueue.c
  head/contrib/bmake/lst.lib/lstDupl.c
  head/contrib/bmake/lst.lib/lstEnQueue.c
  head/contrib/bmake/lst.lib/lstFind.c
  head/contrib/bmake/lst.lib/lstFindFrom.c
  head/contrib/bmake/lst.lib/lstFirst.c
  head/contrib/bmake/lst.lib/lstForEach.c
  head/contrib/bmake/lst.lib/lstForEachFrom.c
  head/contrib/bmake/lst.lib/lstInit.c
  head/contrib/bmake/lst.lib/lstInsert.c
  head/contrib/bmake/lst.lib/lstIsAtEnd.c
  head/contrib/bmake/lst.lib/lstIsEmpty.c
  head/contrib/bmake/lst.lib/lstLast.c
  head/contrib/bmake/lst.lib/lstNext.c
  head/contrib/bmake/lst.lib/lstOpen.c
  head/contrib/bmake/lst.lib/lstPrev.c
  head/contrib/bmake/lst.lib/lstRemove.c
  head/contrib/bmake/lst.lib/lstReplace.c
  head/contrib/bmake/lst.lib/lstSucc.c
  head/contrib/bmake/main.c
  head/contrib/bmake/make.c
  head/contrib/bmake/make.h
  head/contrib/bmake/make_malloc.c
  head/contrib/bmake/meta.c
  head/contrib/bmake/meta.h
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/FILES
  head/contrib/bmake/mk/dirdeps.mk
  head/contrib/bmake/mk/gendirdeps.mk
  head/contrib/bmake/mk/host-target.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/mkopt.sh
  head/contrib/bmake/mk/sys/AIX.mk
  head/contrib/bmake/mk/sys/Darwin.mk
  head/contrib/bmake/mk/sys/Generic.mk
  head/contrib/bmake/mk/sys/HP-UX.mk
  head/contrib/bmake/mk/sys/IRIX.mk
  head/contrib/bmake/mk/sys/Linux.mk
  head/contrib/bmake/mk/sys/NetBSD.mk
  head/contrib/bmake/mk/sys/OSF1.mk
  head/contrib/bmake/mk/sys/OpenBSD.mk
  head/contrib/bmake/mk/sys/SunOS.mk
  head/contrib/bmake/mk/sys/UnixWare.mk
  head/contrib/bmake/nonints.h
  head/contrib/bmake/parse.c
  head/contrib/bmake/str.c
  head/contrib/bmake/suff.c
  head/contrib/bmake/targ.c
  head/contrib/bmake/trace.c
  head/contrib/bmake/unit-tests/Makefile
  head/contrib/bmake/unit-tests/cond-short.exp
  head/contrib/bmake/unit-tests/cond-short.mk
  head/contrib/bmake/unit-tests/modmatch.mk
  head/contrib/bmake/unit-tests/modmisc.exp
  head/contrib/bmake/unit-tests/modmisc.mk
  head/contrib/bmake/unit-tests/modorder.exp
  head/contrib/bmake/unit-tests/modorder.mk
  head/contrib/bmake/unit-tests/sysv.exp
  head/contrib/bmake/unit-tests/sysv.mk
  head/contrib/bmake/unit-tests/varmisc.exp
  head/contrib/bmake/unit-tests/varmisc.mk
  head/contrib/bmake/util.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile.config
  head/usr.bin/bmake/config.h
  head/usr.bin/bmake/unit-tests/Makefile
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogSat Jul 11 22:45:36 2020
(r363116)
+++ head/contrib/bmake/ChangeLogSun Jul 12 01:11:48 2020
(r363117)
@@ -1,3 +1,98 @@
+2020-07-10  Simon J Gerraty  
+
+   * configure.in: use AC_INCLUDES_DEFAULT rather than AC_HEADER_STDC
+
+   * VERSION (_MAKE_VERSION): 20200710
+   Merge with NetBSD make, pick up
+   o filemon/filemon_dev.c: use O_CLOEXEC rather than extra syscall
+   o meta.c: target flagged .META is out-of-date if meta file missing
+
+2020-07-09  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200709
+   Merge with NetBSD make, pick up
+   o cond.c: fix for compare_expression when doEval=0
+   o unit-tests/Makefile: rework
+   o filemon/filemon_dev.c: ensure filemon fd is closed on exec.
+
+2020-07-04  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200704
+   Merge with NetBSD make, pick up
+   (most of this by rillig@)
+   o lots of style and white-space cleanup
+   o lots more unit tests for variable modifiers
+   o simplified description of some functions
+   o str.c: refactor Str_Match
+   o var.c: debugging output for :@
+ constify VarModify parameter

svn commit: r363115 - in vendor/NetBSD/bmake/dist: . filemon mk unit-tests

2020-07-11 Thread Simon J. Gerraty
Author: sjg
Date: Sat Jul 11 22:45:05 2020
New Revision: 363115
URL: https://svnweb.freebsd.org/changeset/base/363115

Log:
  Import bmake-20200710
  
  from ChangeLog:
  
  o filemon/filemon_dev.c: use O_CLOEXEC rather than extra syscall
  o meta.c: target flagged .META is out-of-date if meta file missing
  o cond.c: fix for compare_expression when doEval=0
  o unit-tests/Makefile: rework
  o filemon/filemon_dev.c: ensure filemon fd is closed on exec.

Modified:
  vendor/NetBSD/bmake/dist/ChangeLog
  vendor/NetBSD/bmake/dist/VERSION
  vendor/NetBSD/bmake/dist/cond.c
  vendor/NetBSD/bmake/dist/configure
  vendor/NetBSD/bmake/dist/configure.in
  vendor/NetBSD/bmake/dist/filemon/filemon_dev.c
  vendor/NetBSD/bmake/dist/meta.c
  vendor/NetBSD/bmake/dist/mk/ChangeLog
  vendor/NetBSD/bmake/dist/mk/dirdeps.mk
  vendor/NetBSD/bmake/dist/mk/host-target.mk
  vendor/NetBSD/bmake/dist/mk/install-mk
  vendor/NetBSD/bmake/dist/unit-tests/Makefile
  vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp
  vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk
  vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp
  vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Sat Jul 11 22:14:44 2020
(r363114)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Sat Jul 11 22:45:05 2020
(r363115)
@@ -1,3 +1,20 @@
+2020-07-10  Simon J Gerraty  
+
+   * configure.in: use AC_INCLUDES_DEFAULT rather than AC_HEADER_STDC
+
+   * VERSION (_MAKE_VERSION): 20200710
+   Merge with NetBSD make, pick up
+   o filemon/filemon_dev.c: use O_CLOEXEC rather than extra syscall
+   o meta.c: target flagged .META is out-of-date if meta file missing
+
+2020-07-09  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200709
+   Merge with NetBSD make, pick up
+   o cond.c: fix for compare_expression when doEval=0
+   o unit-tests/Makefile: rework
+   o filemon/filemon_dev.c: ensure filemon fd is closed on exec.
+
 2020-07-04  Simon J Gerraty  
 
* VERSION (_MAKE_VERSION): 20200704

Modified: vendor/NetBSD/bmake/dist/VERSION
==
--- vendor/NetBSD/bmake/dist/VERSIONSat Jul 11 22:14:44 2020
(r363114)
+++ vendor/NetBSD/bmake/dist/VERSIONSat Jul 11 22:45:05 2020
(r363115)
@@ -1,2 +1,2 @@
 # keep this compatible with sh and make
-_MAKE_VERSION=20200704
+_MAKE_VERSION=20200710

Modified: vendor/NetBSD/bmake/dist/cond.c
==
--- vendor/NetBSD/bmake/dist/cond.c Sat Jul 11 22:14:44 2020
(r363114)
+++ vendor/NetBSD/bmake/dist/cond.c Sat Jul 11 22:45:05 2020
(r363115)
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp 
$";
+static char rcsid[] = "$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -735,6 +735,11 @@ compare_expression(Boolean doEval)
 rhs = CondGetString(doEval, , , FALSE);
 if (!rhs)
goto done;
+
+if (!doEval) {
+   t = TOK_FALSE;
+   goto done;
+}
 
 if (rhsQuoted || lhsQuoted) {
 do_string_compare:

Modified: vendor/NetBSD/bmake/dist/configure
==
Binary file (source and/or target). No diff available.

Modified: vendor/NetBSD/bmake/dist/configure.in
==
--- vendor/NetBSD/bmake/dist/configure.in   Sat Jul 11 22:14:44 2020
(r363114)
+++ vendor/NetBSD/bmake/dist/configure.in   Sat Jul 11 22:45:05 2020
(r363115)
@@ -1,11 +1,11 @@
 dnl
 dnl RCSid:
-dnl$Id: configure.in,v 1.65 2020/05/25 01:11:40 sjg Exp $
+dnl$Id: configure.in,v 1.66 2020/07/10 16:34:38 sjg Exp $
 dnl
 dnl Process this file with autoconf to produce a configure script
 dnl
 AC_PREREQ(2.50)
-AC_INIT([bmake], [20200524], [s...@netbsd.org])
+AC_INIT([bmake], [20200710], [s...@netbsd.org])
 AC_CONFIG_HEADERS(config.h)
 
 dnl make srcdir absolute
@@ -128,7 +128,7 @@ dnl AC_C_CROSS
 dnl
 
 dnl Checks for header files.
-AC_HEADER_STDC
+AC_INCLUDES_DEFAULT
 AC_HEADER_SYS_WAIT
 AC_HEADER_DIRENT
 dnl Keep this list sorted
@@ -149

svn commit: r363116 - vendor/NetBSD/bmake/20200710

2020-07-11 Thread Simon J. Gerraty
Author: sjg
Date: Sat Jul 11 22:45:36 2020
New Revision: 363116
URL: https://svnweb.freebsd.org/changeset/base/363116

Log:
  tag bmake-20200710

Added:
  vendor/NetBSD/bmake/20200710/
 - copied from r363115, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r363031 - in head: contrib/bmake contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake

2020-07-09 Thread Simon J. Gerraty via svn-src-all
Cy Schubert  wrote:

> [External Email. Be cautious of content]
> 
> 
> In message <45359.1594266...@kaos.jnpr.net>, "Simon J. Gerraty" writes:
> > Cy Schubert  wrote:
> > > This broke ports.
> >
> > I've reverted the change.
> >
> > Let me know if you still see issue.
> 
> As I said in my email, all I did was revert cond.c, and that fixed it. You
> don't need to revert the whole patch. Just revert cond.c and let NetBSD
> know.

Ah I missed that bit - rats.
I think I've a fix for cond.c, but unfortunately I'm so far unable to
construct a unit-test that triggers the problem.

Even with bsd.compiler.mk I was unable to get it to fail in debugger,
so added an abort and looked at the core file.
The problem is in something like:

.if 1 || ${something-complicated} > 0

the ${something-complicated} isn't resolved because we do not need to
evaluate anything after '1', but the comparator check is still applied.
Fix should be simple, but in unit-tests the above does not trigger the
problem ;-)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r363031 - in head: contrib/bmake contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake

2020-07-08 Thread Simon J. Gerraty via svn-src-all
Cy Schubert  wrote:
> This broke ports.

I've reverted the change.

Let me know if you still see issue.

> 
> cwsys# make checksum
> make: "/usr/ports/Mk/Uses/python.mk" line 367: warning: String comparison
> operator should be either == or !=
> make: "/usr/ports/Mk/Uses/python.mk" line 367: Malformed conditional
> (!defined(_PYTHON_VERSION) &&  !(!empty(_PYTHON_VERSION_MINIMUM) && (
> ${__VER} < ${_PYTHON_VERSION_MINIMUM})) &&  !(!empty(_PYTHON_VERSION_MAXIMUM
> ) && (  ${__VER} > ${_PYTHON_VERSION_MAXIMUM})))
> make: "/usr/ports/Mk/Uses/python.mk" line 367: warning: String comparison
> operator should be either == or !=
> make: "/usr/ports/Mk/Uses/python.mk" line 367: Malformed conditional
> (!defined(_PYTHON_VERSION) &&  !(!empty(_PYTHON_VERSION_MINIMUM) && (
> ${__VER} < ${_PYTHON_VERSION_MINIMUM})) &&  !(!empty(_PYTHON_VERSION_MAXIMUM
> ) && (  ${__VER} > ${_PYTHON_VERSION_MAXIMUM})))
> make: "/usr/ports/Mk/Uses/python.mk" line 367: warning: String comparison
> operator should be either == or !=
> make: "/usr/ports/Mk/Uses/python.mk" line 367: Malformed conditional
> (!defined(_PYTHON_VERSION) &&  !(!empty(_PYTHON_VERSION_MINIMUM) && (
> ${__VER} < ${_PYTHON_VERSION_MINIMUM})) &&  !(!empty(_PYTHON_VERSION_MAXIMUM
> ) && (  ${__VER} > ${_PYTHON_VERSION_MAXIMUM})))
> make: "/usr/ports/Mk/Uses/python.mk" line 367: warning: String comparison
> operator should be either == or !=
> make: "/usr/ports/Mk/Uses/python.mk" line 367: Malformed conditional
> (!defined(_PYTHON_VERSION) &&  !(!empty(_PYTHON_VERSION_MINIMUM) && (
> ${__VER} < ${_PYTHON_VERSION_MINIMUM})) &&  !(!empty(_PYTHON_VERSION_MAXIMUM
> ) && (  ${__VER} > ${_PYTHON_VERSION_MAXIMUM})))
> make: "/usr/ports/Mk/Uses/python.mk" line 367: warning: String comparison
> operator should be either == or !=
> make: "/usr/ports/Mk/Uses/python.mk" line 367: Malformed conditional
> (!defined(_PYTHON_VERSION) &&  !(!empty(_PYTHON_VERSION_MINIMUM) && (
> ${__VER} < ${_PYTHON_VERSION_MINIMUM})) &&  !(!empty(_PYTHON_VERSION_MAXIMUM
> ) && (  ${__VER} > ${_PYTHON_VERSION_MAXIMUM})))
> make: "/usr/ports/Mk/Uses/python.mk" line 367: warning: String comparison
> operator should be either == or !=
> make: "/usr/ports/Mk/Uses/python.mk" line 367: Malformed conditional
> (!defined(_PYTHON_VERSION) &&  !(!empty(_PYTHON_VERSION_MINIMUM) && (
> ${__VER} < ${_PYTHON_VERSION_MINIMUM})) &&  !(!empty(_PYTHON_VERSION_MAXIMUM
> ) && (  ${__VER} > ${_PYTHON_VERSION_MAXIMUM})))
> make: "/usr/ports/Mk/bsd.port.mk" line 2096: warning: String comparison
> operator should be either == or !=
> make: "/usr/ports/Mk/bsd.port.mk" line 2096: Malformed conditional
> (defined(MAKE_JOBS_NUMBER_LIMIT) && ( ${MAKE_JOBS_NUMBER_LIMIT} <
> ${_MAKE_JOBS_NUMBER} ))
> make: Fatal errors encountered -- cannot continue
> make: stopped in /usr/ports/www/firefox
> cwsys#
> 
> The same errors occur during buildworld.
> 
> Simply reverting just contrib/bmake/cond.c resolves this issue. The cause of
> this issue is NetBSD cond.c r1.76, therefore it is safe to revert just the
> one file without reverting the complete upgrade.
> 
> https://urldefense.com/v3/__http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/cond.c?rev=1.76=text*x-cvsweb-markup_with_tag=MAIN__;Lw!!NEt6yMaO-gk!VltPNuPO6XKkx3hxHjCA98ZeFCqyVtHYuLQi8D1AE6HcNIFdwIRm80hIxRvmDA$
> 
> 
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  
> https://urldefense.com/v3/__https://FreeBSD.org__;!!NEt6yMaO-gk!VltPNuPO6XKkx3hxHjCA98ZeFCqyVtHYuLQi8D1AE6HcNIFdwIRm80gLfK9-dg$
> NTP:   Web:  
> https://urldefense.com/v3/__https://nwtime.org__;!!NEt6yMaO-gk!VltPNuPO6XKkx3hxHjCA98ZeFCqyVtHYuLQi8D1AE6HcNIFdwIRm80gVslaffA$
> 
> The need of the many outweighs the greed of the few.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363035 - in head: contrib/bmake contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake

2020-07-08 Thread Simon J. Gerraty
Author: sjg
Date: Thu Jul  9 03:46:07 2020
New Revision: 363035
URL: https://svnweb.freebsd.org/changeset/base/363035

Log:
  Revert r363031

Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/FILES
  head/contrib/bmake/LICENSE
  head/contrib/bmake/VERSION
  head/contrib/bmake/arch.c
  head/contrib/bmake/buf.c
  head/contrib/bmake/compat.c
  head/contrib/bmake/cond.c
  head/contrib/bmake/dir.c
  head/contrib/bmake/for.c
  head/contrib/bmake/hash.c
  head/contrib/bmake/hash.h
  head/contrib/bmake/job.c
  head/contrib/bmake/job.h
  head/contrib/bmake/lst.lib/lstAppend.c
  head/contrib/bmake/lst.lib/lstAtEnd.c
  head/contrib/bmake/lst.lib/lstAtFront.c
  head/contrib/bmake/lst.lib/lstClose.c
  head/contrib/bmake/lst.lib/lstConcat.c
  head/contrib/bmake/lst.lib/lstDatum.c
  head/contrib/bmake/lst.lib/lstDeQueue.c
  head/contrib/bmake/lst.lib/lstDupl.c
  head/contrib/bmake/lst.lib/lstEnQueue.c
  head/contrib/bmake/lst.lib/lstFind.c
  head/contrib/bmake/lst.lib/lstFindFrom.c
  head/contrib/bmake/lst.lib/lstFirst.c
  head/contrib/bmake/lst.lib/lstForEach.c
  head/contrib/bmake/lst.lib/lstForEachFrom.c
  head/contrib/bmake/lst.lib/lstInit.c
  head/contrib/bmake/lst.lib/lstInsert.c
  head/contrib/bmake/lst.lib/lstIsAtEnd.c
  head/contrib/bmake/lst.lib/lstIsEmpty.c
  head/contrib/bmake/lst.lib/lstLast.c
  head/contrib/bmake/lst.lib/lstNext.c
  head/contrib/bmake/lst.lib/lstOpen.c
  head/contrib/bmake/lst.lib/lstPrev.c
  head/contrib/bmake/lst.lib/lstRemove.c
  head/contrib/bmake/lst.lib/lstReplace.c
  head/contrib/bmake/lst.lib/lstSucc.c
  head/contrib/bmake/main.c
  head/contrib/bmake/make.c
  head/contrib/bmake/make.h
  head/contrib/bmake/make_malloc.c
  head/contrib/bmake/meta.c
  head/contrib/bmake/meta.h
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/FILES
  head/contrib/bmake/mk/gendirdeps.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/mkopt.sh
  head/contrib/bmake/mk/sys/AIX.mk
  head/contrib/bmake/mk/sys/Darwin.mk
  head/contrib/bmake/mk/sys/Generic.mk
  head/contrib/bmake/mk/sys/HP-UX.mk
  head/contrib/bmake/mk/sys/IRIX.mk
  head/contrib/bmake/mk/sys/Linux.mk
  head/contrib/bmake/mk/sys/NetBSD.mk
  head/contrib/bmake/mk/sys/OSF1.mk
  head/contrib/bmake/mk/sys/OpenBSD.mk
  head/contrib/bmake/mk/sys/SunOS.mk
  head/contrib/bmake/mk/sys/UnixWare.mk
  head/contrib/bmake/nonints.h
  head/contrib/bmake/parse.c
  head/contrib/bmake/str.c
  head/contrib/bmake/suff.c
  head/contrib/bmake/targ.c
  head/contrib/bmake/trace.c
  head/contrib/bmake/unit-tests/Makefile
  head/contrib/bmake/unit-tests/cond-short.exp
  head/contrib/bmake/unit-tests/cond-short.mk
  head/contrib/bmake/unit-tests/modmatch.mk
  head/contrib/bmake/unit-tests/modmisc.exp
  head/contrib/bmake/unit-tests/modmisc.mk
  head/contrib/bmake/unit-tests/modorder.exp
  head/contrib/bmake/unit-tests/modorder.mk
  head/contrib/bmake/unit-tests/sysv.exp
  head/contrib/bmake/unit-tests/sysv.mk
  head/contrib/bmake/unit-tests/varmisc.exp
  head/contrib/bmake/unit-tests/varmisc.mk
  head/contrib/bmake/util.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile.config

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogThu Jul  9 02:52:39 2020
(r363034)
+++ head/contrib/bmake/ChangeLogThu Jul  9 03:46:07 2020
(r363035)
@@ -1,81 +1,3 @@
-2020-07-04  Simon J Gerraty  
-
-   * VERSION (_MAKE_VERSION): 20200704
-   Merge with NetBSD make, pick up
-   (most of this by rillig@)
-   o lots of style and white-space cleanup
-   o lots more unit tests for variable modifiers
-   o simplified description of some functions
-   o str.c: refactor Str_Match
-   o var.c: debugging output for :@
- constify VarModify parameter
- fix :hash modifier on 16-bit platforms
- remove unnecessary forward declarations
- refactor ApplyModifier_SysV to have less indentation
- simplify code for :E and :R
- clean up code for :H and :T
- refactor ApplyModifiers
-
-   * var.c: we need stdint.h on some platforms to get uint32_t
-   * unit-test/Makefile: we need to supress the specific error
-   for RE substitution error in modmisc, since it varies accross
-   different OS.
-
-2020-07-02  Simon J Gerraty  
-
-   * VERSION (_MAKE_VERSION): 20200702
-   Merge with NetBSD make, pick up
-   o var.c: more improvements to avoiding unnecessary evaluation
-   use enums for flags
-   o remove flags arg to Var_Set which outside of var.c is always 0
-
-2020-07-01  Simon J Gerraty  
-
-   * VERSION (_MAKE_VERSION): 20200701
-   Merge with NetBSD make, pick up
-   o var.c: with change to cond.c; ensure that nested variables
-   within a variable name are expanded.
-   o unit-tests/varmisc.mk: test for nested varname
-
-2020-06-29  Simon J Gerraty  
-
-   * VERSION (_MAKE_VERSION): 20200629

svn commit: r363031 - in head: contrib/bmake contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake

2020-07-08 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul  8 21:20:12 2020
New Revision: 363031
URL: https://svnweb.freebsd.org/changeset/base/363031

Log:
  Update to bmake-20200704
  
  Key changes include reduced noise at end of failed build log
  and avoid evaluation of unnecessary terms in conditionals.
  
  MFC after:1 week

Added:
  head/contrib/bmake/LICENSE
 - copied unchanged from r363019, vendor/NetBSD/bmake/dist/LICENSE
  head/contrib/bmake/unit-tests/cond-short.exp
 - copied unchanged from r363019, 
vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp
  head/contrib/bmake/unit-tests/cond-short.mk
 - copied unchanged from r363019, 
vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk
Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/FILES
  head/contrib/bmake/VERSION
  head/contrib/bmake/arch.c
  head/contrib/bmake/buf.c
  head/contrib/bmake/compat.c
  head/contrib/bmake/cond.c
  head/contrib/bmake/dir.c
  head/contrib/bmake/for.c
  head/contrib/bmake/hash.c
  head/contrib/bmake/hash.h
  head/contrib/bmake/job.c
  head/contrib/bmake/job.h
  head/contrib/bmake/lst.lib/lstAppend.c
  head/contrib/bmake/lst.lib/lstAtEnd.c
  head/contrib/bmake/lst.lib/lstAtFront.c
  head/contrib/bmake/lst.lib/lstClose.c
  head/contrib/bmake/lst.lib/lstConcat.c
  head/contrib/bmake/lst.lib/lstDatum.c
  head/contrib/bmake/lst.lib/lstDeQueue.c
  head/contrib/bmake/lst.lib/lstDupl.c
  head/contrib/bmake/lst.lib/lstEnQueue.c
  head/contrib/bmake/lst.lib/lstFind.c
  head/contrib/bmake/lst.lib/lstFindFrom.c
  head/contrib/bmake/lst.lib/lstFirst.c
  head/contrib/bmake/lst.lib/lstForEach.c
  head/contrib/bmake/lst.lib/lstForEachFrom.c
  head/contrib/bmake/lst.lib/lstInit.c
  head/contrib/bmake/lst.lib/lstInsert.c
  head/contrib/bmake/lst.lib/lstIsAtEnd.c
  head/contrib/bmake/lst.lib/lstIsEmpty.c
  head/contrib/bmake/lst.lib/lstLast.c
  head/contrib/bmake/lst.lib/lstNext.c
  head/contrib/bmake/lst.lib/lstOpen.c
  head/contrib/bmake/lst.lib/lstPrev.c
  head/contrib/bmake/lst.lib/lstRemove.c
  head/contrib/bmake/lst.lib/lstReplace.c
  head/contrib/bmake/lst.lib/lstSucc.c
  head/contrib/bmake/main.c
  head/contrib/bmake/make.c
  head/contrib/bmake/make.h
  head/contrib/bmake/make_malloc.c
  head/contrib/bmake/meta.c
  head/contrib/bmake/meta.h
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/FILES
  head/contrib/bmake/mk/gendirdeps.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/mkopt.sh
  head/contrib/bmake/mk/sys/AIX.mk
  head/contrib/bmake/mk/sys/Darwin.mk
  head/contrib/bmake/mk/sys/Generic.mk
  head/contrib/bmake/mk/sys/HP-UX.mk
  head/contrib/bmake/mk/sys/IRIX.mk
  head/contrib/bmake/mk/sys/Linux.mk
  head/contrib/bmake/mk/sys/NetBSD.mk
  head/contrib/bmake/mk/sys/OSF1.mk
  head/contrib/bmake/mk/sys/OpenBSD.mk
  head/contrib/bmake/mk/sys/SunOS.mk
  head/contrib/bmake/mk/sys/UnixWare.mk
  head/contrib/bmake/nonints.h
  head/contrib/bmake/parse.c
  head/contrib/bmake/str.c
  head/contrib/bmake/suff.c
  head/contrib/bmake/targ.c
  head/contrib/bmake/trace.c
  head/contrib/bmake/unit-tests/Makefile
  head/contrib/bmake/unit-tests/modmatch.mk
  head/contrib/bmake/unit-tests/modmisc.exp
  head/contrib/bmake/unit-tests/modmisc.mk
  head/contrib/bmake/unit-tests/modorder.exp
  head/contrib/bmake/unit-tests/modorder.mk
  head/contrib/bmake/unit-tests/sysv.exp
  head/contrib/bmake/unit-tests/sysv.mk
  head/contrib/bmake/unit-tests/varmisc.exp
  head/contrib/bmake/unit-tests/varmisc.mk
  head/contrib/bmake/util.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile.config
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogWed Jul  8 20:26:19 2020
(r363030)
+++ head/contrib/bmake/ChangeLogWed Jul  8 21:20:12 2020
(r363031)
@@ -1,3 +1,81 @@
+2020-07-04  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200704
+   Merge with NetBSD make, pick up
+   (most of this by rillig@)
+   o lots of style and white-space cleanup
+   o lots more unit tests for variable modifiers
+   o simplified description of some functions
+   o str.c: refactor Str_Match
+   o var.c: debugging output for :@
+ constify VarModify parameter
+ fix :hash modifier on 16-bit platforms
+ remove unnecessary forward declarations
+ refactor ApplyModifier_SysV to have less indentation
+ simplify code for :E and :R
+ clean up code for :H and :T
+ refactor ApplyModifiers
+
+   * var.c: we need stdint.h on some platforms to get uint32_t
+   * unit-test/Makefile: we need to supress the specific error
+   for RE substitution error in modmisc, since it varies accross
+   different OS.
+
+2020-07-02  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200702
+   Merge with NetBSD make, pick up
+   o var.c: more improvements to avoiding unnecessary

svn commit: r363019 - vendor/NetBSD/bmake/20200704

2020-07-08 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul  8 18:32:25 2020
New Revision: 363019
URL: https://svnweb.freebsd.org/changeset/base/363019

Log:
  tag bmake-20200704

Added:
  vendor/NetBSD/bmake/20200704/
 - copied from r363018, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363018 - in vendor/NetBSD/bmake/dist: . lst.lib unit-tests

2020-07-08 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul  8 18:32:15 2020
New Revision: 363018
URL: https://svnweb.freebsd.org/changeset/base/363018

Log:
  Import bmake-20200704
  
  from ChangeLog:
  
  (most of this by rillig@)
  o lots of style and white-space cleanup
  o lots more unit tests for variable modifiers
  o simplified description of some functions
  o str.c: refactor Str_Match
  o var.c: debugging output for :@
constify VarModify parameter
fix :hash modifier on 16-bit platforms
remove unnecessary forward declarations
refactor ApplyModifier_SysV to have less indentation
simplify code for :E and :R
clean up code for :H and :T
refactor ApplyModifiers
  
  * var.c: we need stdint.h on some platforms to get uint32_t
  * unit-test/Makefile: we need to supress the specific error
  for RE substitution error in modmisc, since it varies accross
  different OS.

Modified:
  vendor/NetBSD/bmake/dist/ChangeLog
  vendor/NetBSD/bmake/dist/VERSION
  vendor/NetBSD/bmake/dist/arch.c
  vendor/NetBSD/bmake/dist/buf.c
  vendor/NetBSD/bmake/dist/compat.c
  vendor/NetBSD/bmake/dist/cond.c
  vendor/NetBSD/bmake/dist/dir.c
  vendor/NetBSD/bmake/dist/for.c
  vendor/NetBSD/bmake/dist/hash.c
  vendor/NetBSD/bmake/dist/hash.h
  vendor/NetBSD/bmake/dist/job.c
  vendor/NetBSD/bmake/dist/job.h
  vendor/NetBSD/bmake/dist/lst.lib/lstAppend.c
  vendor/NetBSD/bmake/dist/lst.lib/lstAtEnd.c
  vendor/NetBSD/bmake/dist/lst.lib/lstAtFront.c
  vendor/NetBSD/bmake/dist/lst.lib/lstClose.c
  vendor/NetBSD/bmake/dist/lst.lib/lstConcat.c
  vendor/NetBSD/bmake/dist/lst.lib/lstDatum.c
  vendor/NetBSD/bmake/dist/lst.lib/lstDeQueue.c
  vendor/NetBSD/bmake/dist/lst.lib/lstDupl.c
  vendor/NetBSD/bmake/dist/lst.lib/lstEnQueue.c
  vendor/NetBSD/bmake/dist/lst.lib/lstFind.c
  vendor/NetBSD/bmake/dist/lst.lib/lstFindFrom.c
  vendor/NetBSD/bmake/dist/lst.lib/lstFirst.c
  vendor/NetBSD/bmake/dist/lst.lib/lstForEach.c
  vendor/NetBSD/bmake/dist/lst.lib/lstForEachFrom.c
  vendor/NetBSD/bmake/dist/lst.lib/lstInit.c
  vendor/NetBSD/bmake/dist/lst.lib/lstInsert.c
  vendor/NetBSD/bmake/dist/lst.lib/lstIsAtEnd.c
  vendor/NetBSD/bmake/dist/lst.lib/lstIsEmpty.c
  vendor/NetBSD/bmake/dist/lst.lib/lstLast.c
  vendor/NetBSD/bmake/dist/lst.lib/lstNext.c
  vendor/NetBSD/bmake/dist/lst.lib/lstOpen.c
  vendor/NetBSD/bmake/dist/lst.lib/lstPrev.c
  vendor/NetBSD/bmake/dist/lst.lib/lstRemove.c
  vendor/NetBSD/bmake/dist/lst.lib/lstReplace.c
  vendor/NetBSD/bmake/dist/lst.lib/lstSucc.c
  vendor/NetBSD/bmake/dist/main.c
  vendor/NetBSD/bmake/dist/make.c
  vendor/NetBSD/bmake/dist/make.h
  vendor/NetBSD/bmake/dist/make_malloc.c
  vendor/NetBSD/bmake/dist/meta.c
  vendor/NetBSD/bmake/dist/meta.h
  vendor/NetBSD/bmake/dist/nonints.h
  vendor/NetBSD/bmake/dist/parse.c
  vendor/NetBSD/bmake/dist/str.c
  vendor/NetBSD/bmake/dist/suff.c
  vendor/NetBSD/bmake/dist/targ.c
  vendor/NetBSD/bmake/dist/trace.c
  vendor/NetBSD/bmake/dist/unit-tests/Makefile
  vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp
  vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk
  vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp
  vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk
  vendor/NetBSD/bmake/dist/unit-tests/sysv.exp
  vendor/NetBSD/bmake/dist/unit-tests/sysv.mk
  vendor/NetBSD/bmake/dist/unit-tests/varmisc.exp
  vendor/NetBSD/bmake/dist/unit-tests/varmisc.mk
  vendor/NetBSD/bmake/dist/util.c
  vendor/NetBSD/bmake/dist/var.c

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Wed Jul  8 18:29:06 2020
(r363017)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Wed Jul  8 18:32:15 2020
(r363018)
@@ -1,3 +1,42 @@
+2020-07-04  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200704
+   Merge with NetBSD make, pick up
+   (most of this by rillig@)
+   o lots of style and white-space cleanup
+   o lots more unit tests for variable modifiers
+   o simplified description of some functions
+   o str.c: refactor Str_Match
+   o var.c: debugging output for :@
+ constify VarModify parameter
+ fix :hash modifier on 16-bit platforms
+ remove unnecessary forward declarations
+ refactor ApplyModifier_SysV to have less indentation
+ simplify code for :E and :R
+ clean up code for :H and :T
+ refactor ApplyModifiers
+
+   * var.c: we need stdint.h on some platforms to get uint32_t
+   * unit-test/Makefile: we need to supress the specific error
+   for RE substitution error in modmisc, since it varies accross
+   different OS.
+
+2020-07-02  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200702
+   Merge with NetBSD make, pick up
+   o var.c: more improvements to avoiding unnecessary evaluation
+   use enums for flags
+   o remove flags arg to Var_Set which outside of var.c is always 0
+
+2020-07-01

svn commit: r362822 - vendor/NetBSD/bmake/20200629

2020-06-30 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul  1 02:13:16 2020
New Revision: 362822
URL: https://svnweb.freebsd.org/changeset/base/362822

Log:
  tag bmake-20200629

Added:
  vendor/NetBSD/bmake/20200629/
 - copied from r362821, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362821 - in vendor/NetBSD/bmake/dist: . mk mk/sys unit-tests

2020-06-30 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul  1 02:13:04 2020
New Revision: 362821
URL: https://svnweb.freebsd.org/changeset/base/362821

Log:
  Import bmake-20200629
  
  from ChangeLog:
  
  o cond.c: do not eval unnecessary terms of conditionals.
  
  o meta.c: report error if lseek in filemon_read fails
  
  o str.c: performance improvement for Str_Match for multiple '*'
  
  o dieQuietly: supress the failure output from make
  when failing node is a sub-make or a sibling failed.
  This cuts down greatly on unhelpful noise at the end of
  build log.  Disabled by -dj or .MAKE.DIE_QUIETLY=no
  
  o unit test for :Or

Added:
  vendor/NetBSD/bmake/dist/LICENSE
  vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp
  vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk   (contents, props changed)
Modified:
  vendor/NetBSD/bmake/dist/ChangeLog
  vendor/NetBSD/bmake/dist/FILES
  vendor/NetBSD/bmake/dist/VERSION
  vendor/NetBSD/bmake/dist/cond.c
  vendor/NetBSD/bmake/dist/job.c
  vendor/NetBSD/bmake/dist/main.c
  vendor/NetBSD/bmake/dist/make.h
  vendor/NetBSD/bmake/dist/meta.c
  vendor/NetBSD/bmake/dist/mk/ChangeLog
  vendor/NetBSD/bmake/dist/mk/FILES
  vendor/NetBSD/bmake/dist/mk/gendirdeps.mk
  vendor/NetBSD/bmake/dist/mk/install-mk
  vendor/NetBSD/bmake/dist/mk/mkopt.sh
  vendor/NetBSD/bmake/dist/mk/sys/AIX.mk
  vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk
  vendor/NetBSD/bmake/dist/mk/sys/Generic.mk
  vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk
  vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk
  vendor/NetBSD/bmake/dist/mk/sys/Linux.mk
  vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk
  vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk
  vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk
  vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk
  vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk
  vendor/NetBSD/bmake/dist/str.c
  vendor/NetBSD/bmake/dist/unit-tests/Makefile
  vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk
  vendor/NetBSD/bmake/dist/unit-tests/modorder.exp
  vendor/NetBSD/bmake/dist/unit-tests/modorder.mk

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Wed Jul  1 02:11:15 2020
(r362820)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Wed Jul  1 02:13:04 2020
(r362821)
@@ -1,3 +1,42 @@
+2020-06-29  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200629
+   Merge with NetBSD make, pick up
+   o cond.c: do not eval unnecessary terms of conditionals.
+
+2020-06-25  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200625
+   Merge with NetBSD make, pick up
+   o meta.c: report error if lseek in filemon_read fails
+
+2020-06-22  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200622
+   Merge with NetBSD make, pick up
+   o dieQuietly: ignore OP_SUBMAKE as too aggressive
+
+2020-06-19  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200619
+   Merge with NetBSD make, pick up
+   o str.c: performance improvement for Str_Match for multiple '*'
+   o dieQuietly: supress the failure output from make
+   when failing node is a sub-make or a sibling failed.
+   This cuts down greatly on unhelpful noise at the end of
+   build log.  Disabled by -dj or .MAKE.DIE_QUIETLY=no
+
+2020-06-10  Simon J Gerraty  
+
+   * FILES: add LICENSE to appease some packagers.
+   This is an attempt to fairly represent the license on almost
+   200 files, which are almost all BSD-3-Clause
+   The few exceptions being more liberal.
+
+   * VERSION (_MAKE_VERSION): 20200610
+   Merge with NetBSD make, pick up
+   o unit test for :Or
+
 2020-06-06  Simon J Gerraty  
 
* VERSION (_MAKE_VERSION): 20200606

Modified: vendor/NetBSD/bmake/dist/FILES
==
--- vendor/NetBSD/bmake/dist/FILES  Wed Jul  1 02:11:15 2020
(r362820)
+++ vendor/NetBSD/bmake/dist/FILES  Wed Jul  1 02:13:04 2020
(r362821)
@@ -1,5 +1,6 @@
 ChangeLog
 FILES
+LICENSE
 Makefile
 Makefile.config.in
 PSD.doc/Makefile
@@ -107,6 +108,8 @@ unit-tests/cond2.exp
 unit-tests/cond2.mk
 unit-tests/cond-late.mk
 unit-tests/cond-late.exp
+unit-tests/cond-short.mk
+unit-tests/cond-short.exp
 unit-tests/dollar.exp
 unit-tests/dollar.mk
 unit-tests/doterror.exp

Added: vendor/NetBSD/bmake/dist/LICENSE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/NetBSD/bmake/dist/LICENSEWed Jul  1 02:13:04 2020
(r362821)
@@ -0,0 +1,59 @@
+The individual files in this distribution are copyright their
+original contributors or assignees.
+Including:
+
+Copyright (c) 1993-2020, Simon J Gerraty
+Copyright (c) 2009-2016, Juniper Networks, Inc.
+Copyright (c) 2009, John Birrell.
+Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
+Copyright (c) 1998 Todd C. Miller

svn commit: r362231 - head/sys/kern

2020-06-16 Thread Simon J. Gerraty
Author: sjg
Date: Tue Jun 16 17:02:56 2020
New Revision: 362231
URL: https://svnweb.freebsd.org/changeset/base/362231

Log:
  Make KENV_MVALLEN tunable
  
  When doing secure boot, loader wants to export loader.ve.hashed
  the value of which typically exceeds KENV_MVALLEN.
  
  Replace use of KENV_MVALLEN with tunable kenv_mvallen.
  
  Add getenv_string_buffer() for the case where a stack buffer cannot be
  created and use uma_zone_t kenv_zone for suitably sized buffers.
  
  Reviewed by:  stevek, kevans
  Obtained from:Abhishek Kulkarni 
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision: https://reviews.freebsd.org//D25259

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cTue Jun 16 16:48:52 2020
(r362230)
+++ head/sys/kern/kern_environment.cTue Jun 16 17:02:56 2020
(r362231)
@@ -63,6 +63,9 @@ static MALLOC_DEFINE(M_KENV, "kenv", "kernel environme
 
 #define KENV_SIZE  512 /* Maximum number of environment strings */
 
+static uma_zone_t kenv_zone;
+static int kenv_mvallen = KENV_MVALLEN;
+
 /* pointer to the config-generated static environment */
 char   *kern_envp;
 
@@ -85,6 +88,8 @@ bool  dynamic_kenv;
 #define KENV_CHECK if (!dynamic_kenv) \
panic("%s: called before SI_SUB_KMEM", __func__)
 
+static char*getenv_string_buffer(const char *);
+
 int
 sys_kenv(td, uap)
struct thread *td;
@@ -110,9 +115,9 @@ sys_kenv(td, uap)
 #endif
done = needed = 0;
buflen = uap->len;
-   if (buflen > KENV_SIZE * (KENV_MNAMELEN + KENV_MVALLEN + 2))
+   if (buflen > KENV_SIZE * (KENV_MNAMELEN + kenv_mvallen + 2))
buflen = KENV_SIZE * (KENV_MNAMELEN +
-   KENV_MVALLEN + 2);
+   kenv_mvallen + 2);
if (uap->len > 0 && uap->value != NULL)
buffer = malloc(buflen, M_TEMP, M_WAITOK|M_ZERO);
mtx_lock(_lock);
@@ -185,8 +190,8 @@ sys_kenv(td, uap)
error = EINVAL;
goto done;
}
-   if (len > KENV_MVALLEN + 1)
-   len = KENV_MVALLEN + 1;
+   if (len > kenv_mvallen + 1)
+   len = kenv_mvallen + 1;
value = malloc(len, M_TEMP, M_WAITOK);
error = copyinstr(uap->value, value, len, NULL);
if (error) {
@@ -327,7 +332,7 @@ init_dynamic_kenv_from(char *init_env, int *curpos)
for (cp = init_env; cp != NULL; cp = cpnext) {
cpnext = kernenv_next(cp);
len = strlen(cp) + 1;
-   if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) {
+   if (len > KENV_MNAMELEN + 1 + kenv_mvallen + 1) {
printf(
"WARNING: too long kenv string, ignoring %s\n",
cp);
@@ -375,7 +380,14 @@ static void
 init_dynamic_kenv(void *data __unused)
 {
int dynamic_envpos;
+   int size;
 
+   TUNABLE_INT_FETCH("kenv_mvallen", _mvallen);
+   size = KENV_MNAMELEN + 1 + kenv_mvallen + 1;
+
+   kenv_zone = uma_zcreate("kenv", size, NULL, NULL, NULL, NULL,
+   UMA_ALIGN_PTR, 0);
+
kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV,
M_WAITOK | M_ZERO);
 
@@ -395,7 +407,7 @@ freeenv(char *env)
 
if (dynamic_kenv && env != NULL) {
explicit_bzero(env, strlen(env));
-   free(env, M_KENV);
+   uma_zfree(kenv_zone, env);
}
 }
 
@@ -470,14 +482,11 @@ _getenv_static(const char *name)
 char *
 kern_getenv(const char *name)
 {
-   char buf[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1];
char *ret;
 
if (dynamic_kenv) {
-   if (getenv_string(name, buf, sizeof(buf))) {
-   ret = strdup(buf, M_KENV);
-   } else {
-   ret = NULL;
+   ret = getenv_string_buffer(name);
+   if (ret == NULL) {
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
"getenv");
}
@@ -548,7 +557,7 @@ kern_setenv(const char *name, const char *value)
if (namelen > KENV_MNAMELEN + 1)
return (-1);
vallen = strlen(value) + 1;
-   if (vallen > KENV_MVALLEN + 1)
+   if (vallen > kenv_mvallen + 1)
return (-1);
buf = malloc(namelen + vallen, M_KENV, M_WAITOK);
sprintf(buf, "%s=%s", name, value);
@@ -607,6 +616,33 @@ kern_unsetenv(const char *name)
 }
 
 /*
+ * Return a buffer containing the string value from an environment variable
+ */
+static char *

svn commit: r362127 - head/lib/libsecureboot

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:55:30 2020
New Revision: 362127
URL: https://svnweb.freebsd.org/changeset/base/362127

Log:
  verify_pcr_export: bump kenv_mvallen if needed
  
  The loader.ve.hashed list can easily exceed KENV_MVALLEN.
  If so, bump kenv_mvallen to a multiple of KENV_MVALLEN to
  accommodate the value.
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cFri Jun 12 21:53:08 2020
(r362126)
+++ head/lib/libsecureboot/verify_file.cFri Jun 12 21:55:30 2020
(r362127)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "libsecureboot.h"
 #include 
@@ -532,6 +533,19 @@ verify_pcr_export(void)
DEBUG_PRINTF(1,
("%s: setenv(loader.ve.hashed, %s\n",
__func__, hinfo));
+   if ((hlen = strlen(hinfo)) > KENV_MVALLEN) {
+   /*
+* bump kenv_mvallen
+* roundup to multiple of KENV_MVALLEN
+*/
+   char mvallen[16];
+
+   hlen += KENV_MVALLEN -
+   (hlen % KENV_MVALLEN);
+   if (snprintf(mvallen, sizeof(mvallen),
+   "%d", (int) hlen) < 
sizeof(mvallen))
+   setenv("kenv_mvallen", mvallen, 
1);
+   }
free(hinfo);
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362125 - head/sys/security/mac_veriexec

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:51:20 2020
New Revision: 362125
URL: https://svnweb.freebsd.org/changeset/base/362125

Log:
  mac_veriexec_fingerprint_check_vnode: v_writecount > 0 means active writers
  
  v_writecount can actually be < 0 for text,
  so check for v_writecount > 0
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/sys/security/mac_veriexec/veriexec_fingerprint.c

Modified: head/sys/security/mac_veriexec/veriexec_fingerprint.c
==
--- head/sys/security/mac_veriexec/veriexec_fingerprint.c   Fri Jun 12 
21:48:46 2020(r362124)
+++ head/sys/security/mac_veriexec/veriexec_fingerprint.c   Fri Jun 12 
21:51:20 2020(r362125)
@@ -215,7 +215,7 @@ mac_veriexec_fingerprint_check_vnode(struct vnode *vp,
int error;
 
/* reject fingerprint if writers are active */
-   if (vp->v_writecount)
+   if (vp->v_writecount > 0)
return (ETXTBSY);
 
if ((vp->v_mount->mnt_flag & MNT_VERIFIED) != 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362124 - head/stand/common

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:48:46 2020
New Revision: 362124
URL: https://svnweb.freebsd.org/changeset/base/362124

Log:
  Minor cleanup of initialized variables
  
  Sort the list and cleanup trailing white-space
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/stand/common/install.c

Modified: head/stand/common/install.c
==
--- head/stand/common/install.c Fri Jun 12 21:33:02 2020(r362123)
+++ head/stand/common/install.c Fri Jun 12 21:48:46 2020(r362124)
@@ -207,15 +207,15 @@ install(char *pkgname)
if (*s == '\0')
goto invalid_url;
 
-   proto = NULL;
devname = NULL;
devnamelen = 0;
-   
+   proto = NULL;
+   local = 0;
+
if (i == 4 && !strncasecmp(pkgname, "tftp", i)) {
devname = "net0";
devnamelen = 4;
proto = _fsops;
-   local = 0;
} else if (i == 4 && !strncasecmp(pkgname, "file", i)) {
currdev = getenv("currdev");
local = 1;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361986 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake

2020-06-09 Thread Simon J. Gerraty
Author: sjg
Date: Tue Jun  9 20:52:35 2020
New Revision: 361986
URL: https://svnweb.freebsd.org/changeset/base/361986

Log:
  Merge bmake-20200606
  
  Relevant items from ChangeLog:
  
o dir.c: cached_stats - don't confuse stat and lstat results.
o var.c: add :Or for reverse sort.

Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/Makefile
  head/contrib/bmake/VERSION
  head/contrib/bmake/bmake.1
  head/contrib/bmake/bmake.cat1
  head/contrib/bmake/configure
  head/contrib/bmake/configure.in
  head/contrib/bmake/dir.c
  head/contrib/bmake/dirname.c
  head/contrib/bmake/make.1
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/dirdeps-targets.mk
  head/contrib/bmake/mk/init.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/meta2deps.py
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/Makefile.config
  head/usr.bin/bmake/config.h
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogTue Jun  9 20:27:35 2020
(r361985)
+++ head/contrib/bmake/ChangeLogTue Jun  9 20:52:35 2020
(r361986)
@@ -1,3 +1,25 @@
+2020-06-06  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200606
+   Merge with NetBSD make, pick up
+   o make.1: cleanup
+
+   * Makefile: fix depends for main.o which broke MAKE_VERSION
+
+2020-06-05  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200605
+   Merge with NetBSD make, pick up
+   o dir.c: cached_stats - don't confuse stat and lstat results.
+   o var.c: add :Or for reverse sort.
+
+2020-05-24  Simon J Gerraty  
+
+   * configure.in: add AC_PROG_CC_C99 for mipspro compiler
+   also if --with-filemon= specifies path to filemon.h
+   set use_filemon=dev
+   * dirname.c: remove include of namespace.h
+
 2020-05-17  Simon J Gerraty  
 
* VERSION (_MAKE_VERSION): 20200517

Modified: head/contrib/bmake/Makefile
==
--- head/contrib/bmake/Makefile Tue Jun  9 20:27:35 2020(r361985)
+++ head/contrib/bmake/Makefile Tue Jun  9 20:52:35 2020(r361986)
@@ -1,4 +1,4 @@
-#  $Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $
+#  $Id: Makefile,v 1.107 2020/06/07 21:18:46 sjg Exp $
 
 PROG=  bmake
 
@@ -82,7 +82,7 @@ COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
 # should be set by now
 USE_FILEMON ?= no
 .if ${USE_FILEMON:tl} != "no"
-.PATH: ${.CURDIR}/filemon
+.PATH: ${srcdir}/filemon
 SRCS+= filemon_${USE_FILEMON}.c
 COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
 COPTS.job.c+= ${COPTS.meta.c}
@@ -158,7 +158,7 @@ MAN1= ${MAN}
 .if (${PROG} != "make")
 CLEANFILES+= my.history
 .if make(${MAN}) || !exists(${srcdir}/${MAN})
-my.history: ${MAKEFILE}
+my.history:
@(echo ".Nm"; \
echo "is derived from NetBSD"; \
echo ".Xr make 1 ."; \
@@ -207,7 +207,7 @@ ${OBJS}: config.h
 # start-delete2 for bsd.after-import.mk
 
 # make sure that MAKE_VERSION gets updated.
-main.o: ${SRCS} ${.CURDIR}/VERSION
+main.o: ${srcdir}/VERSION
 
 .if ${MK_AUTOCONF_MK} == "yes"
 CONFIGURE_DEPS += ${.CURDIR}/VERSION

Modified: head/contrib/bmake/VERSION
==
--- head/contrib/bmake/VERSION  Tue Jun  9 20:27:35 2020(r361985)
+++ head/contrib/bmake/VERSION  Tue Jun  9 20:52:35 2020(r361986)
@@ -1,2 +1,2 @@
 # keep this compatible with sh and make
-_MAKE_VERSION=20200517
+_MAKE_VERSION=20200606

Modified: head/contrib/bmake/bmake.1
==
--- head/contrib/bmake/bmake.1  Tue Jun  9 20:27:35 2020(r361985)
+++ head/contrib/bmake/bmake.1  Tue Jun  9 20:52:35 2020(r361986)
@@ -1,4 +1,4 @@
-.\"$NetBSD: make.1,v 1.273 2018/05/27 01:14:51 christos Exp $
+.\"$NetBSD: make.1,v 1.282 2020/06/06 20:28:42 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"from: @(#)make.18.4 (Berkeley) 3/19/94
 .\"
-.Dd May 26, 2018
+.Dd June 5, 2020
 .Dt BMAKE 1
 .Os
 .Sh NAME
@@ -272,7 +272,7 @@ that do not depend on the target whose creation caused
 .It Fl m Ar directory
 Specify a directory in which to search for sys.mk and makefiles included
 via the
-.Ao Ar file Ac Ns -style
+.Li \&< Ns Ar file Ns Li \&> Ns -style
 include statement.
 The
 .Fl m
@@ -280,7 +280,7 @@ option can be used multiple times to form a search pat
 This path will override the default system include path: /usr/share/mk.
 Furthermore the system include path will be appended to the search path used
 f

svn commit: r361955 - vendor/NetBSD/bmake/20200606

2020-06-08 Thread Simon J. Gerraty
Author: sjg
Date: Tue Jun  9 02:07:43 2020
New Revision: 361955
URL: https://svnweb.freebsd.org/changeset/base/361955

Log:
  tag bmake-20200606

Added:
  vendor/NetBSD/bmake/20200606/
 - copied from r361954, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361954 - in vendor/NetBSD/bmake/dist: . mk

2020-06-08 Thread Simon J. Gerraty
Author: sjg
Date: Tue Jun  9 02:07:26 2020
New Revision: 361954
URL: https://svnweb.freebsd.org/changeset/base/361954

Log:
  Import bmake-20200606
  
  Relevant items from ChangeLog:
  
o dir.c: cached_stats - don't confuse stat and lstat results.
o var.c: add :Or for reverse sort.

Modified:
  vendor/NetBSD/bmake/dist/ChangeLog
  vendor/NetBSD/bmake/dist/Makefile
  vendor/NetBSD/bmake/dist/VERSION
  vendor/NetBSD/bmake/dist/bmake.1
  vendor/NetBSD/bmake/dist/bmake.cat1
  vendor/NetBSD/bmake/dist/configure
  vendor/NetBSD/bmake/dist/configure.in
  vendor/NetBSD/bmake/dist/dir.c
  vendor/NetBSD/bmake/dist/dirname.c
  vendor/NetBSD/bmake/dist/make.1
  vendor/NetBSD/bmake/dist/mk/ChangeLog
  vendor/NetBSD/bmake/dist/mk/dirdeps-targets.mk
  vendor/NetBSD/bmake/dist/mk/init.mk
  vendor/NetBSD/bmake/dist/mk/install-mk
  vendor/NetBSD/bmake/dist/mk/meta2deps.py
  vendor/NetBSD/bmake/dist/var.c

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Tue Jun  9 02:03:30 2020
(r361953)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Tue Jun  9 02:07:26 2020
(r361954)
@@ -1,3 +1,25 @@
+2020-06-06  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200606
+   Merge with NetBSD make, pick up
+   o make.1: cleanup
+
+   * Makefile: fix depends for main.o which broke MAKE_VERSION
+
+2020-06-05  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200605
+   Merge with NetBSD make, pick up
+   o dir.c: cached_stats - don't confuse stat and lstat results.
+   o var.c: add :Or for reverse sort.
+
+2020-05-24  Simon J Gerraty  
+
+   * configure.in: add AC_PROG_CC_C99 for mipspro compiler
+   also if --with-filemon= specifies path to filemon.h
+   set use_filemon=dev
+   * dirname.c: remove include of namespace.h
+
 2020-05-17  Simon J Gerraty  
 
* VERSION (_MAKE_VERSION): 20200517

Modified: vendor/NetBSD/bmake/dist/Makefile
==
--- vendor/NetBSD/bmake/dist/Makefile   Tue Jun  9 02:03:30 2020
(r361953)
+++ vendor/NetBSD/bmake/dist/Makefile   Tue Jun  9 02:07:26 2020
(r361954)
@@ -1,4 +1,4 @@
-#  $Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $
+#  $Id: Makefile,v 1.107 2020/06/07 21:18:46 sjg Exp $
 
 PROG=  bmake
 
@@ -82,7 +82,7 @@ COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
 # should be set by now
 USE_FILEMON ?= no
 .if ${USE_FILEMON:tl} != "no"
-.PATH: ${.CURDIR}/filemon
+.PATH: ${srcdir}/filemon
 SRCS+= filemon_${USE_FILEMON}.c
 COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
 COPTS.job.c+= ${COPTS.meta.c}
@@ -158,7 +158,7 @@ MAN1= ${MAN}
 .if (${PROG} != "make")
 CLEANFILES+= my.history
 .if make(${MAN}) || !exists(${srcdir}/${MAN})
-my.history: ${MAKEFILE}
+my.history:
@(echo ".Nm"; \
echo "is derived from NetBSD"; \
echo ".Xr make 1 ."; \
@@ -207,7 +207,7 @@ ${OBJS}: config.h
 # start-delete2 for bsd.after-import.mk
 
 # make sure that MAKE_VERSION gets updated.
-main.o: ${SRCS} ${.CURDIR}/VERSION
+main.o: ${srcdir}/VERSION
 
 .if ${MK_AUTOCONF_MK} == "yes"
 CONFIGURE_DEPS += ${.CURDIR}/VERSION

Modified: vendor/NetBSD/bmake/dist/VERSION
==
--- vendor/NetBSD/bmake/dist/VERSIONTue Jun  9 02:03:30 2020
(r361953)
+++ vendor/NetBSD/bmake/dist/VERSIONTue Jun  9 02:07:26 2020
(r361954)
@@ -1,2 +1,2 @@
 # keep this compatible with sh and make
-_MAKE_VERSION=20200517
+_MAKE_VERSION=20200606

Modified: vendor/NetBSD/bmake/dist/bmake.1
==
--- vendor/NetBSD/bmake/dist/bmake.1Tue Jun  9 02:03:30 2020
(r361953)
+++ vendor/NetBSD/bmake/dist/bmake.1Tue Jun  9 02:07:26 2020
(r361954)
@@ -1,4 +1,4 @@
-.\"$NetBSD: make.1,v 1.273 2018/05/27 01:14:51 christos Exp $
+.\"$NetBSD: make.1,v 1.282 2020/06/06 20:28:42 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"from: @(#)make.18.4 (Berkeley) 3/19/94
 .\"
-.Dd May 26, 2018
+.Dd June 5, 2020
 .Dt BMAKE 1
 .Os
 .Sh NAME
@@ -272,7 +272,7 @@ that do not depend on the target whose creation caused
 .It Fl m Ar directory
 Specify a directory in which to search for sys.mk and makefiles included
 via the
-.Ao Ar file Ac Ns -style
+.Li \&< Ns Ar file Ns Li \&> Ns -style
 include statement.
 The
 .Fl m
@@ -280,7 +280,7 @@ option can be used multiple times to form a search pat
 This path will override the default system include path: /usr/share/mk.
 Furthermore the system include path will be appended to the search path

svn commit: r361933 - head/stand/common

2020-06-08 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jun  8 18:13:38 2020
New Revision: 361933
URL: https://svnweb.freebsd.org/changeset/base/361933

Log:
  loader: install allow for more complete device spec in url
  
  Rework to simplify and impose sane url syntax.
  That is we allow for file://[devname[:fstype]]/package
  
  Reviewed by:  stevek
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision: https://reviews.freebsd.org//D25134

Modified:
  head/stand/common/install.c

Modified: head/stand/common/install.c
==
--- head/stand/common/install.c Mon Jun  8 17:57:21 2020(r361932)
+++ head/stand/common/install.c Mon Jun  8 18:13:38 2020(r361933)
@@ -184,7 +184,8 @@ cleanup(void)
 
 /*
  * usage: install URL
- * where: URL = (tftp|file)://[host]/
+ * where: URL = tftp://[host]/
+ * or  file://[devname[:fstype]]/
  */
 static int
 install(char *pkgname)
@@ -192,8 +193,9 @@ install(char *pkgname)
static char buf[256];
struct fs_ops *proto;
struct preloaded_file *fp;
-   char *s, *currdev;
-   const char *devname;
+   char *e, *s, *currdev;
+   char *devname;
+   size_t devnamelen;
int error, fd, i, local;
 
s = strstr(pkgname, "://");
@@ -201,34 +203,74 @@ install(char *pkgname)
goto invalid_url;
 
i = s - pkgname;
+   s += 3;
+   if (*s == '\0')
+   goto invalid_url;
+
+   proto = NULL;
+   devname = NULL;
+   devnamelen = 0;
+   
if (i == 4 && !strncasecmp(pkgname, "tftp", i)) {
devname = "net0";
+   devnamelen = 4;
proto = _fsops;
local = 0;
} else if (i == 4 && !strncasecmp(pkgname, "file", i)) {
currdev = getenv("currdev");
-   if (currdev != NULL && strcmp(currdev, "pxe0:") == 0) {
-   devname = "pxe0";
-   proto = NULL;
+   local = 1;
+
+   if (*s == '/') {/* file:/// */
+   if (devname == NULL)
+   devname = currdev;
+   if (devname == NULL)
+   devname = "disk1";
+   } else {/* file://devname[:fstype]/ */
+   devname = s;
+   e = strchr(devname, '/');
+   if (!e)
+   goto invalid_url;
+   devnamelen = e - devname;
+   s = e;  /* consume devname */
+   }
+   if ((e = strchr(devname, ':')) != NULL) {
+   /* could be :fstype */
+   devnamelen = e - devname;
+   switch (e[1]) {
+   case '\0':  /* just currdev */
+   break;
+   case 'd':
+   proto = _fsops;
+   break;
 #ifdef HOSTPROG
-   } else if (currdev != NULL && strcmp(currdev, "host0:") == 0) {
-   extern struct fs_ops host_fsops;
+   case 'h':
+   {
+   extern struct fs_ops host_fsops;
 
-   devname = "host0";
-   proto = _fsops;
+   proto = _fsops;
+   }
+   break;
 #endif
-   } else {
-   devname = "disk1";
+   case 'u':
+   proto = _fsops;
+   break;
+   }
+   }
+   if (proto == NULL && strncmp(devname, "disk", 4) == 0) {
proto = _fsops;
}
-   local = 1;
-   } else
-   goto invalid_url;
+   }
 
-   s += 3;
-   if (*s == '\0')
+   if (devname == NULL)
goto invalid_url;
 
+   if (devnamelen == 0) {
+   /* default is currdev which ends with ':' */
+   devnamelen = strlen(devname);
+   if (devname[devnamelen - 1] == ':')
+   devnamelen--;
+   }
+
if (*s != '/' ) {
if (local)
goto invalid_url;
@@ -252,11 +294,12 @@ install(char *pkgname)
} else
pkgname = s;
 
-   if (strlen(devname) + strlen(pkgname) + 2 > sizeof(buf)) {
+   i = snprintf(buf, sizeof(buf), "%.*s:%s",
+   (int) devnamelen, devname, pkgname);
+   if (i >= (int) sizeof(buf)) {
command_errmsg = "package name too long";
return (CMD_ERROR);
}
-   sprintf(buf, "%s:%s", devname, pkgname);
setenv("install_package", buf, 1);
 
error = 

svn commit: r361710 - head/stand/uboot/lib

2020-06-01 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jun  1 23:44:03 2020
New Revision: 361710
URL: https://svnweb.freebsd.org/changeset/base/361710

Log:
  stand/uboot: fix setting of gateip.s_addr
  
  Missplaced paren.
  
  Reviewed by:  imp
  MFC after:1 week

Modified:
  head/stand/uboot/lib/net.c

Modified: head/stand/uboot/lib/net.c
==
--- head/stand/uboot/lib/net.c  Mon Jun  1 23:26:37 2020(r361709)
+++ head/stand/uboot/lib/net.c  Mon Jun  1 23:44:03 2020(r361710)
@@ -187,7 +187,7 @@ get_env_net_params()
rootip.s_addr = 0;
return;
}
-   if ((gateip.s_addr = inet_addr(envstr) == INADDR_NONE)) {
+   if ((gateip.s_addr = inet_addr(envstr)) == INADDR_NONE) {
printf("Could not parse gatewayip '%s'\n", envstr);
rootip.s_addr = 0;
return;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361674 - in stable/12: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2020-05-31 Thread Simon J. Gerraty
.1
  stable/12/contrib/bmake/boot-strap
  stable/12/contrib/bmake/bsd.after-import.mk
  stable/12/contrib/bmake/compat.c
  stable/12/contrib/bmake/config.h.in
  stable/12/contrib/bmake/configure
  stable/12/contrib/bmake/configure.in
  stable/12/contrib/bmake/dir.c
  stable/12/contrib/bmake/dirname.c
  stable/12/contrib/bmake/job.c
  stable/12/contrib/bmake/make-bootstrap.sh.in
  stable/12/contrib/bmake/make.1
  stable/12/contrib/bmake/make.h
  stable/12/contrib/bmake/meta.c
  stable/12/contrib/bmake/meta.h
  stable/12/contrib/bmake/mk/ChangeLog
  stable/12/contrib/bmake/mk/FILES
  stable/12/contrib/bmake/mk/autodep.mk
  stable/12/contrib/bmake/mk/dirdeps-options.mk
  stable/12/contrib/bmake/mk/dirdeps.mk
  stable/12/contrib/bmake/mk/doc.mk
  stable/12/contrib/bmake/mk/dpadd.mk
  stable/12/contrib/bmake/mk/gendirdeps.mk
  stable/12/contrib/bmake/mk/init.mk
  stable/12/contrib/bmake/mk/install-mk
  stable/12/contrib/bmake/mk/lib.mk
  stable/12/contrib/bmake/mk/meta.autodep.mk
  stable/12/contrib/bmake/mk/meta.stage.mk
  stable/12/contrib/bmake/mk/meta.sys.mk
  stable/12/contrib/bmake/mk/meta2deps.py
  stable/12/contrib/bmake/mk/mk-files.txt
  stable/12/contrib/bmake/mk/options.mk
  stable/12/contrib/bmake/mk/sys.mk
  stable/12/contrib/bmake/mk/sys.vars.mk
  stable/12/contrib/bmake/mk/sys/AIX.mk
  stable/12/contrib/bmake/mk/sys/Darwin.mk
  stable/12/contrib/bmake/mk/sys/Generic.mk
  stable/12/contrib/bmake/mk/sys/HP-UX.mk
  stable/12/contrib/bmake/mk/sys/IRIX.mk
  stable/12/contrib/bmake/mk/sys/Linux.mk
  stable/12/contrib/bmake/mk/sys/NetBSD.mk
  stable/12/contrib/bmake/mk/sys/OSF1.mk
  stable/12/contrib/bmake/mk/sys/OpenBSD.mk
  stable/12/contrib/bmake/mk/sys/SunOS.mk
  stable/12/contrib/bmake/mk/sys/UnixWare.mk
  stable/12/contrib/bmake/mk/whats.mk
  stable/12/contrib/bmake/nonints.h
  stable/12/contrib/bmake/parse.c
  stable/12/contrib/bmake/str.c
  stable/12/contrib/bmake/unit-tests/escape.mk
  stable/12/contrib/bmake/unit-tests/forloop.exp
  stable/12/contrib/bmake/unit-tests/forloop.mk
  stable/12/contrib/bmake/unit-tests/modorder.mk
  stable/12/contrib/bmake/unit-tests/sysv.exp
  stable/12/contrib/bmake/unit-tests/sysv.mk
  stable/12/contrib/bmake/util.c
  stable/12/contrib/bmake/var.c
  stable/12/usr.bin/bmake/Makefile
  stable/12/usr.bin/bmake/Makefile.config
  stable/12/usr.bin/bmake/Makefile.depend
  stable/12/usr.bin/bmake/config.h
  stable/12/usr.bin/bmake/unit-tests/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/bmake/ChangeLog
==
--- stable/12/contrib/bmake/ChangeLog   Sun May 31 21:38:33 2020
(r361673)
+++ stable/12/contrib/bmake/ChangeLog   Sun May 31 21:43:59 2020
(r361674)
@@ -1,3 +1,172 @@
+2020-05-17  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200517
+   Merge with NetBSD make, pick up
+   o modified dollar tests to avoid shell dependencies
+   o new tests for .INCLUDEFROM
+
+2020-05-16  Simon J Gerraty  
+
+   * unit-tests/dollar.mk: tweak  '1 dollar literal' test
+   to not depend so much on shell behavior
+
+2020-05-10  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200510
+   Merge with NetBSD make, pick up
+   o unit test for dollar handling
+
+2020-05-06  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200506
+   Merge with NetBSD make, pick up
+   o str.c: empty string does not match % pattern
+ plus unit-test changes
+
+2020-05-04  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200504
+   May the 4th be with you
+   Merge with NetBSD make, pick up
+   o var.c: import handling of old sysV style modifier using '%'
+   o str.c: refactor brk_string
+   o unit-tests: add test case for lazy conditions
+
+2020-04-18  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200418
+
+   * configure.in: use_makefile=no for cygwin et al.
+   case insensitive filesystems just don't work if both
+   makefile and Makefile exist.
+   NOTE: bmake does not support cygwin and likely never will,
+   but if brave souls want to try it - help them out.
+
+2020-04-02  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200402
+   Merge with NetBSD make, pick up
+   o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD
+ a blank command is perfectly valid.
+
+2020-03-30  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200330
+   Merge with NetBSD make, pick up
+   o make.h: extern debug_file
+
+2020-03-18  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200318
+   Merge with NetBSD make, pick up
+   o meta.c: meta_oodate, check for corrupted meta file
+ earlier and more often.
+
+2020-02-20  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200220
+
+2020-02-19  Simon J Gerraty  
+
+   * boot-strap: unset MAKEFLAGS
+
+2020-02-12  Simon J Gerraty

svn commit: r361307 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake

2020-05-20 Thread Simon J. Gerraty
/contrib/bmake/mk/meta.stage.mk
  head/contrib/bmake/mk/meta.sys.mk
  head/contrib/bmake/mk/meta2deps.py
  head/contrib/bmake/mk/options.mk
  head/contrib/bmake/mk/sys.mk
  head/contrib/bmake/mk/sys.vars.mk
  head/contrib/bmake/mk/sys/AIX.mk
  head/contrib/bmake/mk/sys/Darwin.mk
  head/contrib/bmake/mk/sys/Generic.mk
  head/contrib/bmake/mk/sys/HP-UX.mk
  head/contrib/bmake/mk/sys/IRIX.mk
  head/contrib/bmake/mk/sys/Linux.mk
  head/contrib/bmake/mk/sys/NetBSD.mk
  head/contrib/bmake/mk/sys/OSF1.mk
  head/contrib/bmake/mk/sys/OpenBSD.mk
  head/contrib/bmake/mk/sys/SunOS.mk
  head/contrib/bmake/mk/sys/UnixWare.mk
  head/contrib/bmake/mk/whats.mk
  head/contrib/bmake/nonints.h
  head/contrib/bmake/parse.c
  head/contrib/bmake/str.c
  head/contrib/bmake/unit-tests/escape.mk
  head/contrib/bmake/unit-tests/forloop.exp
  head/contrib/bmake/unit-tests/forloop.mk
  head/contrib/bmake/unit-tests/modorder.mk
  head/contrib/bmake/unit-tests/sysv.exp
  head/contrib/bmake/unit-tests/sysv.mk
  head/contrib/bmake/util.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/Makefile.config
  head/usr.bin/bmake/Makefile.depend
  head/usr.bin/bmake/config.h
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogWed May 20 22:25:41 2020
(r361306)
+++ head/contrib/bmake/ChangeLogWed May 20 22:25:46 2020
(r361307)
@@ -1,3 +1,138 @@
+2020-05-17  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200517
+   Merge with NetBSD make, pick up
+   o modified dollar tests to avoid shell dependencies
+   o new tests for .INCLUDEFROM
+
+2020-05-16  Simon J Gerraty  
+
+   * unit-tests/dollar.mk: tweak  '1 dollar literal' test
+   to not depend so much on shell behavior
+
+2020-05-10  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200510
+   Merge with NetBSD make, pick up
+   o unit test for dollar handling
+
+2020-05-06  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200506
+   Merge with NetBSD make, pick up
+   o str.c: empty string does not match % pattern
+ plus unit-test changes
+
+2020-05-04  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200504
+   May the 4th be with you
+   Merge with NetBSD make, pick up
+   o var.c: import handling of old sysV style modifier using '%'
+   o str.c: refactor brk_string
+   o unit-tests: add test case for lazy conditions
+
+2020-04-18  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200418
+
+   * configure.in: use_makefile=no for cygwin et al.
+   case insensitive filesystems just don't work if both
+   makefile and Makefile exist.
+   NOTE: bmake does not support cygwin and likely never will,
+   but if brave souls want to try it - help them out.
+
+2020-04-02  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200402
+   Merge with NetBSD make, pick up
+   o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD
+ a blank command is perfectly valid.
+
+2020-03-30  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200330
+   Merge with NetBSD make, pick up
+   o make.h: extern debug_file
+
+2020-03-18  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200318
+   Merge with NetBSD make, pick up
+   o meta.c: meta_oodate, check for corrupted meta file
+ earlier and more often.
+
+2020-02-20  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200220
+
+2020-02-19  Simon J Gerraty  
+
+   * boot-strap: unset MAKEFLAGS
+
+2020-02-12  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200212
+   * meta.c: meta_compat_parent check for USE_FILEMON
+ patch from Soeren Tempel
+
+2020-02-05  Simon J Gerraty  
+
+   * VERSION: 20200205
+   Merge with NetBSD make, pick up
+   o meta.c: fix compat mode, need to call meta_job_output()
+   o job.c: extra fds for meta mode not needed if using filemon_dev
+
+2020-01-22  Simon J Gerraty  
+
+   * VERSION: 20200122
+   Merge with NetBSD make, pick up
+   o meta.c: avoid passing NULL to filemon_*() when meta_needed()
+ returns FALSE.
+
+2020-01-21  Simon J Gerraty  
+
+   * VERSION: 20200121
+   Merge with NetBSD make, pick up
+   o filemon/filemon_{dev,ktrace}.c: allow selection of
+ filemon implementation.  filemon_dev.c uses the kernel module
+ while filemon_ktrace.c leverages the fktrace api available in
+ NetBSD.  filemon_ktrace.c can hopefully form the basis for
+ adding support for other tracing mechanisms such as strace on
+ Linux.
+   o meta.c: when target is out-of-date per normal make rules
+ record value of .OODATE in meta file.
+
+2019-09-26  Simon J Gerraty  
+
+   * VERSION: 20190926
+ Merge with NetBSD make

svn commit: r361289 - vendor/NetBSD/bmake/20200517

2020-05-20 Thread Simon J. Gerraty
Author: sjg
Date: Wed May 20 19:35:38 2020
New Revision: 361289
URL: https://svnweb.freebsd.org/changeset/base/361289

Log:
  tag bmake-20200517

Added:
  vendor/NetBSD/bmake/20200517/
 - copied from r361288, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361288 - in vendor/NetBSD/bmake/dist: . filemon mk mk/sys unit-tests

2020-05-20 Thread Simon J. Gerraty
/dist/mk/sys/NetBSD.mk
  vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk
  vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk
  vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk
  vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk
  vendor/NetBSD/bmake/dist/mk/whats.mk
  vendor/NetBSD/bmake/dist/nonints.h
  vendor/NetBSD/bmake/dist/parse.c
  vendor/NetBSD/bmake/dist/str.c
  vendor/NetBSD/bmake/dist/unit-tests/escape.mk
  vendor/NetBSD/bmake/dist/unit-tests/forloop.exp
  vendor/NetBSD/bmake/dist/unit-tests/forloop.mk
  vendor/NetBSD/bmake/dist/unit-tests/modorder.mk
  vendor/NetBSD/bmake/dist/unit-tests/sysv.exp
  vendor/NetBSD/bmake/dist/unit-tests/sysv.mk
  vendor/NetBSD/bmake/dist/util.c
  vendor/NetBSD/bmake/dist/var.c

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Wed May 20 18:29:23 2020
(r361287)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Wed May 20 19:34:48 2020
(r361288)
@@ -1,3 +1,138 @@
+2020-05-17  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200517
+   Merge with NetBSD make, pick up
+   o modified dollar tests to avoid shell dependencies
+   o new tests for .INCLUDEFROM
+
+2020-05-16  Simon J Gerraty  
+
+   * unit-tests/dollar.mk: tweak  '1 dollar literal' test
+   to not depend so much on shell behavior
+
+2020-05-10  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200510
+   Merge with NetBSD make, pick up
+   o unit test for dollar handling
+
+2020-05-06  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200506
+   Merge with NetBSD make, pick up
+   o str.c: empty string does not match % pattern
+ plus unit-test changes
+
+2020-05-04  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200504
+   May the 4th be with you
+   Merge with NetBSD make, pick up
+   o var.c: import handling of old sysV style modifier using '%'
+   o str.c: refactor brk_string
+   o unit-tests: add test case for lazy conditions
+
+2020-04-18  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200418
+
+   * configure.in: use_makefile=no for cygwin et al.
+   case insensitive filesystems just don't work if both
+   makefile and Makefile exist.
+   NOTE: bmake does not support cygwin and likely never will,
+   but if brave souls want to try it - help them out.
+
+2020-04-02  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200402
+   Merge with NetBSD make, pick up
+   o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD
+ a blank command is perfectly valid.
+
+2020-03-30  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200330
+   Merge with NetBSD make, pick up
+   o make.h: extern debug_file
+
+2020-03-18  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200318
+   Merge with NetBSD make, pick up
+   o meta.c: meta_oodate, check for corrupted meta file
+ earlier and more often.
+
+2020-02-20  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200220
+
+2020-02-19  Simon J Gerraty  
+
+   * boot-strap: unset MAKEFLAGS
+
+2020-02-12  Simon J Gerraty  
+
+   * VERSION (_MAKE_VERSION): 20200212
+   * meta.c: meta_compat_parent check for USE_FILEMON
+ patch from Soeren Tempel
+
+2020-02-05  Simon J Gerraty  
+
+   * VERSION: 20200205
+   Merge with NetBSD make, pick up
+   o meta.c: fix compat mode, need to call meta_job_output()
+   o job.c: extra fds for meta mode not needed if using filemon_dev
+
+2020-01-22  Simon J Gerraty  
+
+   * VERSION: 20200122
+   Merge with NetBSD make, pick up
+   o meta.c: avoid passing NULL to filemon_*() when meta_needed()
+ returns FALSE.
+
+2020-01-21  Simon J Gerraty  
+
+   * VERSION: 20200121
+   Merge with NetBSD make, pick up
+   o filemon/filemon_{dev,ktrace}.c: allow selection of
+ filemon implementation.  filemon_dev.c uses the kernel module
+ while filemon_ktrace.c leverages the fktrace api available in
+ NetBSD.  filemon_ktrace.c can hopefully form the basis for
+ adding support for other tracing mechanisms such as strace on
+ Linux.
+   o meta.c: when target is out-of-date per normal make rules
+ record value of .OODATE in meta file.
+
+2019-09-26  Simon J Gerraty  
+
+   * VERSION: 20190926
+ Merge with NetBSD make, pick up
+ o parse.c: don't pass NULL to realpath(3)
+   some versions cannot handle it.
+
+2019-04-09  Simon J Gerraty  
+
+   * VERSION: 20190409
+ Merge with NetBSD make, pick up
+ o parse.c: ParseDoDependency: free paths rather than assert
+
+2018-12-22  Simon J Gerraty  
+
+   * VERSION: 20181222
+
+   * configure.in: add --without-makefile to avoid generating
+ makefile and make-bootstrap.sh
+
+   * include Makefile.inc if it exists
+
+   * Use Makefile

svn commit: r360481 - stable/12/sys/sys

2020-04-29 Thread Simon J. Gerraty
Author: sjg
Date: Thu Apr 30 00:20:31 2020
New Revision: 360481
URL: https://svnweb.freebsd.org/changeset/base/360481

Log:
  Define enum for so_qstate outside of struct.
  
  LLVM-9.0 clang++ throws an error for enum defined within
  an anonymous struct.
  
  MFC of r360059
  
  Reviewed by:  jtl, rpokala
  Differential Revision: https://reviews.freebsd.org//D24477

Modified:
  stable/12/sys/sys/socketvar.h

Modified: stable/12/sys/sys/socketvar.h
==
--- stable/12/sys/sys/socketvar.h   Thu Apr 30 00:14:14 2020
(r360480)
+++ stable/12/sys/sys/socketvar.h   Thu Apr 30 00:20:31 2020
(r360481)
@@ -67,6 +67,12 @@ typedef  void so_dtor_t(struct socket *);
 
 struct socket;
 
+enum socket_qstate {
+   SQ_NONE = 0,
+   SQ_INCOMP = 0x0800, /* on sol_incomp */
+   SQ_COMP = 0x1000,   /* on sol_comp */
+};
+
 /*-
  * Locking key to struct socket:
  * (a) constant after allocation, no locking required.
@@ -122,12 +128,7 @@ struct socket {
/* (e) Our place on accept queue. */
TAILQ_ENTRY(socket) so_list;
struct socket   *so_listen; /* (b) */
-   enum {
-   SQ_NONE = 0,
-   SQ_INCOMP = 0x0800, /* on sol_incomp */
-   SQ_COMP = 0x1000,   /* on sol_comp */
-   }   so_qstate;  /* (b) */
-
+   enum socket_qstate so_qstate;   /* (b) */
/* (b) cached MAC label for peer */
struct  label   *so_peerlabel;
u_long  so_oobmark; /* chars to oob mark */
@@ -172,6 +173,10 @@ struct socket {
short   sol_sbsnd_flags;
sbintime_t  sol_sbrcv_timeo;
sbintime_t  sol_sbsnd_timeo;
+
+   /* Information tracking listen queue overflows. */
+   struct timeval  sol_lastover;   /* (e) */
+   int sol_overcount;  /* (e) */
};
};
 };
@@ -180,13 +185,13 @@ struct socket {
 /*
  * Socket state bits.
  *
- * Historically, this bits were all kept in the so_state field.  For
- * locking reasons, they are now in multiple fields, as they are
- * locked differently.  so_state maintains basic socket state protected
- * by the socket lock.  so_qstate holds information about the socket
- * accept queues.  Each socket buffer also has a state field holding
- * information relevant to that socket buffer (can't send, rcv).  Many
- * fields will be read without locks to improve performance and avoid
+ * Historically, these bits were all kept in the so_state field.
+ * They are now split into separate, lock-specific fields.
+ * so_state maintains basic socket state protected by the socket lock.
+ * so_qstate holds information about the socket accept queues.
+ * Each socket buffer also has a state field holding information
+ * relevant to that socket buffer (can't send, rcv).
+ * Many fields will be read without locks to improve performance and avoid
  * lock order issues.  However, this approach must be used with caution.
  */
 #defineSS_NOFDREF  0x0001  /* no file table ref any more */
@@ -379,7 +384,8 @@ struct uio;
 /*
  * From uipc_socket and friends
  */
-intgetsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len);
+intgetsockaddr(struct sockaddr **namp, const struct sockaddr *uaddr,
+   size_t len);
 intgetsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
struct file **fpp, u_int *fflagp, struct filecaps *havecaps);
 void   soabort(struct socket *so);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360059 - head/sys/sys

2020-04-17 Thread Simon J. Gerraty
Author: sjg
Date: Sat Apr 18 01:22:41 2020
New Revision: 360059
URL: https://svnweb.freebsd.org/changeset/base/360059

Log:
  Define enum for so_qstate outside of struct.
  
  LLVM-9.0 clang++ throws an error for enum defined within
  an anonymous struct.
  
  Reviewed by:  jtl, rpokala
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org//D24477

Modified:
  head/sys/sys/socketvar.h

Modified: head/sys/sys/socketvar.h
==
--- head/sys/sys/socketvar.hSat Apr 18 01:16:30 2020(r360058)
+++ head/sys/sys/socketvar.hSat Apr 18 01:22:41 2020(r360059)
@@ -67,6 +67,12 @@ typedef  void so_dtor_t(struct socket *);
 
 struct socket;
 
+enum socket_qstate {
+   SQ_NONE = 0,
+   SQ_INCOMP = 0x0800, /* on sol_incomp */
+   SQ_COMP = 0x1000,   /* on sol_comp */
+};
+
 /*-
  * Locking key to struct socket:
  * (a) constant after allocation, no locking required.
@@ -122,12 +128,7 @@ struct socket {
/* (e) Our place on accept queue. */
TAILQ_ENTRY(socket) so_list;
struct socket   *so_listen; /* (b) */
-   enum {
-   SQ_NONE = 0,
-   SQ_INCOMP = 0x0800, /* on sol_incomp */
-   SQ_COMP = 0x1000,   /* on sol_comp */
-   }   so_qstate;  /* (b) */
-
+   enum socket_qstate so_qstate;   /* (b) */
/* (b) cached MAC label for peer */
struct  label   *so_peerlabel;
u_long  so_oobmark; /* chars to oob mark */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359913 - in stable/12: lib/libveriexec share/mk

2020-04-13 Thread Simon J. Gerraty
Author: sjg
Date: Tue Apr 14 01:07:58 2020
New Revision: 359913
URL: https://svnweb.freebsd.org/changeset/base/359913

Log:
  Do not claim libbearssl et al are INTERNALLIB
  
  If INTERNALLIB is defined we need PIE and bsd.incs.mk is
  not included.
  
  MFC of r359502
  
  PR:   245189
  Reviewed by:  emaste
  Differential Revision: https://reviews.freebsd.org//D24233

Modified:
  stable/12/lib/libveriexec/Makefile
  stable/12/share/mk/src.libnames.mk

Modified: stable/12/lib/libveriexec/Makefile
==
--- stable/12/lib/libveriexec/Makefile  Tue Apr 14 01:05:11 2020
(r359912)
+++ stable/12/lib/libveriexec/Makefile  Tue Apr 14 01:07:58 2020
(r359913)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-.include 
+.include 
 
 LIB=   veriexec
 MAN=   veriexec.3

Modified: stable/12/share/mk/src.libnames.mk
==
--- stable/12/share/mk/src.libnames.mk  Tue Apr 14 01:05:11 2020
(r359912)
+++ stable/12/share/mk/src.libnames.mk  Tue Apr 14 01:07:58 2020
(r359913)
@@ -214,18 +214,18 @@ _LIBRARIES+= \
 .endif
 
 .if ${MK_BEARSSL} == "yes"
-_INTERNALLIBS+= \
+_LIBRARIES+= \
bearssl \
secureboot \
 
-LIBBEARSSL?=   ${LIBBEARSSLDIR}/libbearssl${PIE_SUFFIX}.a
-LIBSECUREBOOT?=${LIBSECUREBOOTDIR}/libsecureboot${PIE_SUFFIX}.a
+LIBBEARSSL?=   ${LIBBEARSSLDIR}/libbearssl.a
+LIBSECUREBOOT?=${LIBSECUREBOOTDIR}/libsecureboot.a
 .endif
 
 .if ${MK_VERIEXEC} == "yes"
-_INTERNALLIBS+= veriexec
+_LIBRARIES+= veriexec
 
-LIBVERIEXEC?=  ${LIBVERIEXECDIR}/libveriexec${PIE_SUFFIX}.a
+LIBVERIEXEC?=  ${LIBVERIEXECDIR}/libveriexec.a
 .endif
 
 # Each library's LIBADD needs to be duplicated here for static linkage of
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359912 - stable/12/share/mk

2020-04-13 Thread Simon J. Gerraty
Author: sjg
Date: Tue Apr 14 01:05:11 2020
New Revision: 359912
URL: https://svnweb.freebsd.org/changeset/base/359912

Log:
  Include ${.CURDIR}/local.init.mk if it exists
  
  This is handy for making local hacks to an app
  (eg to build it as tool for non-BSD host)
  without making a mess of the code base.
  
  MFC of r359488
  
  Reviewed by:  bdrewery
  Differential Revision: https://reviews.freebsd.org//D24101

Modified:
  stable/12/share/mk/local.init.mk

Modified: stable/12/share/mk/local.init.mk
==
--- stable/12/share/mk/local.init.mkTue Apr 14 00:57:50 2020
(r359911)
+++ stable/12/share/mk/local.init.mkTue Apr 14 01:05:11 2020
(r359912)
@@ -1,5 +1,8 @@
 # $FreeBSD$
 
+.if !target(__${_this}__)
+__${_this}__:
+
 .if ${.MAKE.MODE:Mmeta*} != ""
 .if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && 
${.MAKE.MAKEFILES:M*bsd.prog.mk} == ""
 .if ${.MAKE.MODE:Mleaf*} != ""
@@ -33,3 +36,5 @@ CFLAGS+= ${HOST_CFLAGS}
 .endif
 
 .-include "src.init.mk"
+.-include "${.CURDIR}/local.init.mk"
+.endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359911 - in stable/12: lib/libsecureboot stand/libsa

2020-04-13 Thread Simon J. Gerraty
Author: sjg
Date: Tue Apr 14 00:57:50 2020
New Revision: 359911
URL: https://svnweb.freebsd.org/changeset/base/359911

Log:
  Improve interaction of vectx and tftp
  
  On slow platforms, it helps to spread the hashing load
  over time so that tftp does not timeout.
  
  Also, some .4th files are too big to fit in cache of pkgfs,
  so increase cache size and ensure fully populated.
  
  MFC of r359700
  
  Reviewed by:  stevek
  Differential Revision: https://reviews.freebsd.org/D24287

Modified:
  stable/12/lib/libsecureboot/vectx.c
  stable/12/stand/libsa/pkgfs.c
  stable/12/stand/libsa/tftp.c

Modified: stable/12/lib/libsecureboot/vectx.c
==
--- stable/12/lib/libsecureboot/vectx.c Tue Apr 14 00:01:26 2020
(r359910)
+++ stable/12/lib/libsecureboot/vectx.c Tue Apr 14 00:57:50 2020
(r359911)
@@ -211,6 +211,7 @@ ssize_t
 vectx_read(struct vectx *ctx, void *buf, size_t nbytes)
 {
unsigned char *bp = buf;
+   int d;
int n;
int delta;
int x;
@@ -221,23 +222,30 @@ vectx_read(struct vectx *ctx, void *buf, size_t nbytes
 
off = 0;
do {
-   n = read(ctx->vec_fd, [off], nbytes - off);
-   if (n < 0)
+   /*
+* Do this in reasonable chunks so
+* we don't timeout if doing tftp
+*/
+   x = nbytes - off;
+   x = MIN(PAGE_SIZE, x);
+   d = n = read(ctx->vec_fd, [off], x);
+   if (n < 0) {
return (n);
-   if (n > 0) {
+   }
+   if (d > 0) {
/* we may have seeked backwards! */
delta = ctx->vec_hashed - ctx->vec_off;
if (delta > 0) {
-   x = MIN(delta, n);
+   x = MIN(delta, d);
off += x;
-   n -= x;
+   d -= x;
ctx->vec_off += x;
}
-   if (n > 0) {
-   ctx->vec_md->update(>vec_ctx.vtable, 
[off], n);
-   off += n;
-   ctx->vec_off += n;
-   ctx->vec_hashed += n;
+   if (d > 0) {
+   ctx->vec_md->update(>vec_ctx.vtable, 
[off], d);
+   off += d;
+   ctx->vec_off += d;
+   ctx->vec_hashed += d;
}
}
} while (n > 0 && off < nbytes);

Modified: stable/12/stand/libsa/pkgfs.c
==
--- stable/12/stand/libsa/pkgfs.c   Tue Apr 14 00:01:26 2020
(r359910)
+++ stable/12/stand/libsa/pkgfs.c   Tue Apr 14 00:57:50 2020
(r359911)
@@ -60,7 +60,7 @@ struct fs_ops pkgfs_fsops = {
 };
 
 #define PKG_BUFSIZE512
-#definePKG_MAXCACHESZ  16384
+#definePKG_MAXCACHESZ  (16384 * 3)
 
 #definePKG_FILEEXT ".tgz"
 
@@ -132,6 +132,7 @@ struct package
 static struct package *package = NULL;
 
 static int new_package(int, struct package **);
+static int cache_data(struct tarfile *tf, int);
 
 void
 pkgfs_cleanup(void)
@@ -282,6 +283,9 @@ pkg_read(struct open_file *f, void *buf, size_t size, 
return (EBADF);
}
 
+   if (tf->tf_cachesz == 0)
+   cache_data(tf, 1);
+
fp = tf->tf_fp;
p = buf;
sz = 0;
@@ -311,16 +315,6 @@ pkg_read(struct open_file *f, void *buf, size_t size, 
fp += sz;
p += sz;
size -= sz;
-
-   if (tf->tf_cachesz != 0)
-   continue;
-
-   tf->tf_cachesz = (sz <= PKG_MAXCACHESZ) ? sz : PKG_MAXCACHESZ;
-   tf->tf_cache = malloc(tf->tf_cachesz);
-   if (tf->tf_cache != NULL)
-   memcpy(tf->tf_cache, buf, tf->tf_cachesz);
-   else
-   tf->tf_cachesz = 0;
}
 
tf->tf_fp = fp;
@@ -484,8 +478,20 @@ get_zipped(struct package *pkg, void *buf, size_t bufs
return (0);
 }
 
+/**
+ * @brief
+ * cache data of a tarfile
+ *
+ * @param[in] tf
+ * tarfile pointer
+ *
+ * @param[in] force
+ * If file size > PKG_MAXCACHESZ, cache that much
+ *
+ * @return 0, -1 (errno set to error value)
+ */
 static int
-cache_data(struct tarfile *tf)
+cache_data(struct tarfile *tf, int force)
 {
struct package *pkg;
size_t sz;
@@ -503,21 +509,28 @@ cache_data(struct tarfile *tf)
return (-1);
}
 
+   if (tf->tf_cachesz > 0) {
+   DBG(("%s: data already cached\n", __func__));
+   errno = EINVAL;
+   return (-1);

svn commit: r359769 - stable/12/stand/liblua

2020-04-09 Thread Simon J. Gerraty
Author: sjg
Date: Fri Apr 10 05:13:15 2020
New Revision: 359769
URL: https://svnweb.freebsd.org/changeset/base/359769

Log:
  veloader use vectx API for kernel and modules
  
  The vectx API, computes the hash for verifying a file as it is read.
  This avoids the overhead of reading files twice - once to verify, then
  again to load.
  
  For doing an install via loader, avoiding the need to rewind
  large files is critical.
  
  This API is only used for modules, kernel and mdimage as these are the
  biggest files read by the loader.
  The reduction in boot time depends on how expensive the I/O is
  on any given platform.  On a fast VM we see 6% improvement.
  
  For install via loader the first file to be verified is likely to be the
  kernel, so some of the prep work (finding manifest etc) done by
  verify_file() needs to be factored so it can be reused for
  vectx_open().
  
  For missing or unrecognized fingerprint entries, we fail
  in vectx_open() unless verifying is disabled.
  
  Otherwise fingerprint check happens in vectx_close() and
  since this API is only used for files which must be verified
  (VE_MUST) we panic if we get an incorrect hash.
  
  MFC of r358811
  
  Reviewed by:  imp,tsoome
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D23827

Modified:
  stable/12/stand/liblua/lstd.c

Modified: stable/12/stand/liblua/lstd.c
==
--- stable/12/stand/liblua/lstd.c   Fri Apr 10 01:37:00 2020
(r359768)
+++ stable/12/stand/liblua/lstd.c   Fri Apr 10 05:13:15 2020
(r359769)
@@ -83,7 +83,7 @@ fopen(const char *filename, const char *mode)
 #ifdef LOADER_VERIEXEC
/* only regular files and only reading makes sense */
if (S_ISREG(st.st_mode) && !(m & O_WRONLY)) {
-   if (verify_file(fd, filename, 0, VE_GUESS) < 0) {
+   if (verify_file(fd, filename, 0, VE_GUESS, __func__) < 0) {
free(f);
close(fd);
return (NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359735 - in stable/12: lib/libsecureboot lib/libsecureboot/h lib/libsecureboot/tests share/mk stand stand/common stand/efi/loader stand/efi/loader/arch/i386 stand/ficl stand/i386/libi3...

2020-04-08 Thread Simon J. Gerraty
Author: sjg
Date: Thu Apr  9 04:50:19 2020
New Revision: 359735
URL: https://svnweb.freebsd.org/changeset/base/359735

Log:
  veloader use vectx API for kernel and modules
  
  The vectx API, computes the hash for verifying a file as it is read.
  This avoids the overhead of reading files twice - once to verify, then
  again to load.
  
  For doing an install via loader, avoiding the need to rewind
  large files is critical.
  
  This API is only used for modules, kernel and mdimage as these are the
  biggest files read by the loader.
  The reduction in boot time depends on how expensive the I/O is
  on any given platform.  On a fast VM we see 6% improvement.
  
  For install via loader the first file to be verified is likely to be the
  kernel, so some of the prep work (finding manifest etc) done by
  verify_file() needs to be factored so it can be reused for
  vectx_open().
  
  For missing or unrecognized fingerprint entries, we fail
  in vectx_open() unless verifying is disabled.
  
  Otherwise fingerprint check happens in vectx_close() and
  since this API is only used for files which must be verified
  (VE_MUST) we panic if we get an incorrect hash.
  
  Fix pkgfs stat so it satisfies libsecureboot
  
  We need a valid st_dev, st_ino and st_mtime
  to correctly track which files have been verified
  and to update our notion of time.
  
  ve_utc_set(): ignore utc if it would jump our current time
  by more than VE_UTC_MAX_JUMP (20 years).
  
  Allow testing of install command via userboot.
  Need to fix its stat implementation too.
  
  bhyveload also needs stat fixed - due to change to userboot.h
  
  Call ve_error_get() from vectx_close() when hash is wrong.
  
  Track the names of files we have hashed into pcr
  
  For the purposes of measured boot, it is important
  to be able to reproduce the hash reflected in
  loader.ve.pcr
  so loader.ve.hashed provides a list of names in the order they
  were added.
  
  Avoid unused vars when VE_ECDSA_HASH_AGAIN undefined
  
  MFC of r358744 r358767 r359307 r355962
  
  Reviewed by:  imp,tsoome,emaste
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D23827 
https://reviews.freebsd.org//D24027

Added:
  stable/12/stand/common/readin.h
 - copied unchanged from r358767, head/stand/common/readin.h
Modified:
  stable/12/lib/libsecureboot/h/libsecureboot.h
  stable/12/lib/libsecureboot/h/verify_file.h
  stable/12/lib/libsecureboot/tests/tvo.c
  stable/12/lib/libsecureboot/vectx.c
  stable/12/lib/libsecureboot/veopen.c
  stable/12/lib/libsecureboot/vepcr.c
  stable/12/lib/libsecureboot/verify_file.c
  stable/12/lib/libsecureboot/vets.c
  stable/12/share/mk/src.opts.mk
  stable/12/stand/common/bootstrap.h
  stable/12/stand/common/install.c
  stable/12/stand/common/interp_forth.c
  stable/12/stand/common/interp_simple.c
  stable/12/stand/common/load_elf.c
  stable/12/stand/common/load_elf_obj.c
  stable/12/stand/common/misc.c
  stable/12/stand/common/module.c
  stable/12/stand/efi/loader/arch/i386/i386_copy.c
  stable/12/stand/efi/loader/copy.c
  stable/12/stand/efi/loader/loader_efi.h
  stable/12/stand/efi/loader/main.c
  stable/12/stand/ficl/loader.c
  stable/12/stand/i386/libi386/i386_copy.c
  stable/12/stand/i386/libi386/libi386.h
  stable/12/stand/i386/loader/chain.c
  stable/12/stand/libsa/pkgfs.c
  stable/12/stand/loader.mk
  stable/12/stand/mips/beri/loader/arch.c
  stable/12/stand/powerpc/kboot/main.c
  stable/12/stand/uboot/lib/copy.c
  stable/12/stand/uboot/lib/libuboot.h
  stable/12/stand/userboot/test/test.c
  stable/12/stand/userboot/userboot.h
  stable/12/stand/userboot/userboot/conf.c
  stable/12/stand/userboot/userboot/copy.c
  stable/12/stand/userboot/userboot/host.c
  stable/12/stand/userboot/userboot/libuserboot.h
  stable/12/usr.sbin/bhyveload/bhyveload.c

Modified: stable/12/lib/libsecureboot/h/libsecureboot.h
==
--- stable/12/lib/libsecureboot/h/libsecureboot.h   Thu Apr  9 02:00:59 
2020(r359734)
+++ stable/12/lib/libsecureboot/h/libsecureboot.h   Thu Apr  9 04:50:19 
2020(r359735)
@@ -69,12 +69,6 @@ void fingerprint_info_add(const char *, const char *, 
 int ve_check_hash(br_hash_compat_context *, const br_hash_class *,
 const char *, const char *, size_t);
 
-struct vectx;
-struct vectx* vectx_open(int, const char *, off_t, struct stat *, int *);
-ssize_t vectx_read(struct vectx *, void *, size_t);
-off_t vectx_lseek(struct vectx *, off_t, int);
-int vectx_close(struct vectx *);
-
 char * hexdigest(char *, size_t, unsigned char *, size_t);
 int  verify_fd(int, const char *, off_t, struct stat *);
 int  verify_open(const char *, int);
@@ -84,10 +78,11 @@ unsigned char *verify_sig(const char *, int);
 unsigned char *verify_asc(const char *, int); /* OpenPGP */
 
 void ve_pcr_init(void);
-void ve_pcr_update(unsigned char *, size_t);
+void ve_pcr_update(const char *, unsigned char *, size_t);
 

Re: svn commit: r359705 - head/share/mk

2020-04-07 Thread Simon J. Gerraty via svn-src-all
Kyle Evans  wrote:
> universe13a% make -C stand -V .OBJDIR
> /scratch/tmp/kevans/obj/home/kevans/head/amd64.amd64/stand
> 
> But in a buildenv:
> universe13a% make TARGET_ARCH=armv7 buildenv
> Entering world for armv7:arm
> For ZSH you must run: export CPUTYPE=
> universe13a% make -C stand -V .OBJDIR
> [Creating objdir /scratch/tmp/kevans/obj/home/kevans/head/stand...]
> /scratch/tmp/kevans/obj/home/kevans/head/stand

What do you get for:

env | grep MAKE


> Using buildenv with BUILDENV_SHELL="make -C stand -V .OBDJIR"
> *doesn't* reproduce it (objdir has arm.armv7 in it again).
> 
> I tried with both zsh (and export CPUTYPE=) and /bin/sh, but it seems
> to reproduce both ways.
> 
> Thanks,
> 
> Kyle Evans
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359700 - in head: lib/libsecureboot stand/libsa

2020-04-07 Thread Simon J. Gerraty
Author: sjg
Date: Tue Apr  7 16:56:34 2020
New Revision: 359700
URL: https://svnweb.freebsd.org/changeset/base/359700

Log:
  Improve interaction of vectx and tftp
  
  On slow platforms, it helps to spread the hashing load
  over time so that tftp does not timeout.
  
  Also, some .4th files are too big to fit in cache of pkgfs,
  so increase cache size and ensure fully populated.
  
  Reviewed by:  stevek
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D24287

Modified:
  head/lib/libsecureboot/vectx.c
  head/stand/libsa/pkgfs.c
  head/stand/libsa/tftp.c

Modified: head/lib/libsecureboot/vectx.c
==
--- head/lib/libsecureboot/vectx.c  Tue Apr  7 16:52:45 2020
(r359699)
+++ head/lib/libsecureboot/vectx.c  Tue Apr  7 16:56:34 2020
(r359700)
@@ -211,6 +211,7 @@ ssize_t
 vectx_read(struct vectx *ctx, void *buf, size_t nbytes)
 {
unsigned char *bp = buf;
+   int d;
int n;
int delta;
int x;
@@ -221,23 +222,30 @@ vectx_read(struct vectx *ctx, void *buf, size_t nbytes
 
off = 0;
do {
-   n = read(ctx->vec_fd, [off], nbytes - off);
-   if (n < 0)
+   /*
+* Do this in reasonable chunks so
+* we don't timeout if doing tftp
+*/
+   x = nbytes - off;
+   x = MIN(PAGE_SIZE, x);
+   d = n = read(ctx->vec_fd, [off], x);
+   if (n < 0) {
return (n);
-   if (n > 0) {
+   }
+   if (d > 0) {
/* we may have seeked backwards! */
delta = ctx->vec_hashed - ctx->vec_off;
if (delta > 0) {
-   x = MIN(delta, n);
+   x = MIN(delta, d);
off += x;
-   n -= x;
+   d -= x;
ctx->vec_off += x;
}
-   if (n > 0) {
-   ctx->vec_md->update(>vec_ctx.vtable, 
[off], n);
-   off += n;
-   ctx->vec_off += n;
-   ctx->vec_hashed += n;
+   if (d > 0) {
+   ctx->vec_md->update(>vec_ctx.vtable, 
[off], d);
+   off += d;
+   ctx->vec_off += d;
+   ctx->vec_hashed += d;
}
}
} while (n > 0 && off < nbytes);

Modified: head/stand/libsa/pkgfs.c
==
--- head/stand/libsa/pkgfs.cTue Apr  7 16:52:45 2020(r359699)
+++ head/stand/libsa/pkgfs.cTue Apr  7 16:56:34 2020(r359700)
@@ -60,7 +60,7 @@ struct fs_ops pkgfs_fsops = {
 };
 
 #define PKG_BUFSIZE512
-#definePKG_MAXCACHESZ  16384
+#definePKG_MAXCACHESZ  (16384 * 3)
 
 #definePKG_FILEEXT ".tgz"
 
@@ -132,6 +132,7 @@ struct package
 static struct package *package = NULL;
 
 static int new_package(int, struct package **);
+static int cache_data(struct tarfile *tf, int);
 
 void
 pkgfs_cleanup(void)
@@ -282,6 +283,9 @@ pkg_read(struct open_file *f, void *buf, size_t size, 
return (EBADF);
}
 
+   if (tf->tf_cachesz == 0)
+   cache_data(tf, 1);
+
fp = tf->tf_fp;
p = buf;
sz = 0;
@@ -311,16 +315,6 @@ pkg_read(struct open_file *f, void *buf, size_t size, 
fp += sz;
p += sz;
size -= sz;
-
-   if (tf->tf_cachesz != 0)
-   continue;
-
-   tf->tf_cachesz = (sz <= PKG_MAXCACHESZ) ? sz : PKG_MAXCACHESZ;
-   tf->tf_cache = malloc(tf->tf_cachesz);
-   if (tf->tf_cache != NULL)
-   memcpy(tf->tf_cache, buf, tf->tf_cachesz);
-   else
-   tf->tf_cachesz = 0;
}
 
tf->tf_fp = fp;
@@ -484,8 +478,20 @@ get_zipped(struct package *pkg, void *buf, size_t bufs
return (0);
 }
 
+/**
+ * @brief
+ * cache data of a tarfile
+ *
+ * @param[in] tf
+ * tarfile pointer
+ *
+ * @param[in] force
+ * If file size > PKG_MAXCACHESZ, cache that much
+ *
+ * @return 0, -1 (errno set to error value)
+ */
 static int
-cache_data(struct tarfile *tf)
+cache_data(struct tarfile *tf, int force)
 {
struct package *pkg;
size_t sz;
@@ -503,21 +509,28 @@ cache_data(struct tarfile *tf)
return (-1);
}
 
+   if (tf->tf_cachesz > 0) {
+   DBG(("%s: data already cached\n", __func__));
+   errno = EINVAL;
+   return (-1);
+   }
+
if (tf->tf_ofs != 

svn commit: r359502 - in head: lib/libveriexec share/mk

2020-04-01 Thread Simon J. Gerraty
Author: sjg
Date: Wed Apr  1 05:45:12 2020
New Revision: 359502
URL: https://svnweb.freebsd.org/changeset/base/359502

Log:
  Do not claim libbearssl et al are INTERNALLIB
  
  If INTERNALLIB is defined we need PIE and bsd.incs.mk is
  not included.
  
  PR:   245189
  Reviewed by:  emaste
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org//D24233

Modified:
  head/lib/libveriexec/Makefile
  head/share/mk/src.libnames.mk

Modified: head/lib/libveriexec/Makefile
==
--- head/lib/libveriexec/Makefile   Wed Apr  1 04:51:39 2020
(r359501)
+++ head/lib/libveriexec/Makefile   Wed Apr  1 05:45:12 2020
(r359502)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-.include 
+.include 
 
 LIB=   veriexec
 MAN=   veriexec.3

Modified: head/share/mk/src.libnames.mk
==
--- head/share/mk/src.libnames.mk   Wed Apr  1 04:51:39 2020
(r359501)
+++ head/share/mk/src.libnames.mk   Wed Apr  1 05:45:12 2020
(r359502)
@@ -222,18 +222,18 @@ _LIBRARIES+= \
 .endif
 
 .if ${MK_BEARSSL} == "yes"
-_INTERNALLIBS+= \
+_LIBRARIES+= \
bearssl \
secureboot \
 
-LIBBEARSSL?=   ${LIBBEARSSLDIR}/libbearssl${PIE_SUFFIX}.a
-LIBSECUREBOOT?=${LIBSECUREBOOTDIR}/libsecureboot${PIE_SUFFIX}.a
+LIBBEARSSL?=   ${LIBBEARSSLDIR}/libbearssl.a
+LIBSECUREBOOT?=${LIBSECUREBOOTDIR}/libsecureboot.a
 .endif
 
 .if ${MK_VERIEXEC} == "yes"
-_INTERNALLIBS+= veriexec
+_LIBRARIES+= veriexec
 
-LIBVERIEXEC?=  ${LIBVERIEXECDIR}/libveriexec${PIE_SUFFIX}.a
+LIBVERIEXEC?=  ${LIBVERIEXECDIR}/libveriexec.a
 .endif
 
 # Each library's LIBADD needs to be duplicated here for static linkage of
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359488 - head/share/mk

2020-03-31 Thread Simon J. Gerraty
Author: sjg
Date: Tue Mar 31 15:59:29 2020
New Revision: 359488
URL: https://svnweb.freebsd.org/changeset/base/359488

Log:
  Include ${.CURDIR}/local.init.mk if it exists
  
  This is handy for making local hacks to an app
  (eg to build it as tool for non-BSD host)
  without making a mess of the code base.
  
  Reviewed by:  bdrewery
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org//D24101

Modified:
  head/share/mk/local.init.mk

Modified: head/share/mk/local.init.mk
==
--- head/share/mk/local.init.mk Tue Mar 31 15:54:54 2020(r359487)
+++ head/share/mk/local.init.mk Tue Mar 31 15:59:29 2020(r359488)
@@ -1,5 +1,8 @@
 # $FreeBSD$
 
+.if !target(__${_this}__)
+__${_this}__:
+
 .if ${.MAKE.MODE:Mmeta*} != ""
 .if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && 
${.MAKE.MAKEFILES:M*bsd.prog.mk} == ""
 .if ${.MAKE.MODE:Mleaf*} != ""
@@ -33,3 +36,5 @@ CFLAGS+= ${HOST_CFLAGS}
 .endif
 
 .-include "src.init.mk"
+.-include "${.CURDIR}/local.init.mk"
+.endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359307 - in head: lib/libsecureboot lib/libsecureboot/h stand/common stand/libsa stand/userboot stand/userboot/test stand/userboot/userboot usr.sbin/bhyveload

2020-03-25 Thread Simon J. Gerraty
Author: sjg
Date: Wed Mar 25 19:12:19 2020
New Revision: 359307
URL: https://svnweb.freebsd.org/changeset/base/359307

Log:
  Fix pkgfs stat so it satisfies libsecureboot
  
  We need a valid st_dev, st_ino and st_mtime
  to correctly track which files have been verified
  and to update our notion of time.
  
  ve_utc_set(): ignore utc if it would jump our current time
  by more than VE_UTC_MAX_JUMP (20 years).
  
  Allow testing of install command via userboot.
  Need to fix its stat implementation too.
  
  bhyveload also needs stat fixed - due to change to userboot.h
  
  Call ve_error_get() from vectx_close() when hash is wrong.
  
  Track the names of files we have hashed into pcr
  
  For the purposes of measured boot, it is important
  to be able to reproduce the hash reflected in
  loader.ve.pcr
  so loader.ve.hashed provides a list of names in the order they
  were added.
  
  Reviewed by:  imp
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D24027

Modified:
  head/lib/libsecureboot/h/libsecureboot.h
  head/lib/libsecureboot/vectx.c
  head/lib/libsecureboot/veopen.c
  head/lib/libsecureboot/vepcr.c
  head/lib/libsecureboot/verify_file.c
  head/lib/libsecureboot/vets.c
  head/stand/common/install.c
  head/stand/libsa/pkgfs.c
  head/stand/userboot/test/test.c
  head/stand/userboot/userboot.h
  head/stand/userboot/userboot/conf.c
  head/stand/userboot/userboot/host.c
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/lib/libsecureboot/h/libsecureboot.h
==
--- head/lib/libsecureboot/h/libsecureboot.hWed Mar 25 18:20:37 2020
(r359306)
+++ head/lib/libsecureboot/h/libsecureboot.hWed Mar 25 19:12:19 2020
(r359307)
@@ -78,10 +78,11 @@ unsigned char *verify_sig(const char *, int);
 unsigned char *verify_asc(const char *, int); /* OpenPGP */
 
 void ve_pcr_init(void);
-void ve_pcr_update(unsigned char *, size_t);
+void ve_pcr_update(const char *, unsigned char *, size_t);
 ssize_t ve_pcr_get(unsigned char *, size_t);
 int ve_pcr_updating_get(void);
 void ve_pcr_updating_set(int);
+char * ve_pcr_hashed_get(int);
 
 /* flags for verify_{asc,sig,signed} */
 #define VEF_VERBOSE1

Modified: head/lib/libsecureboot/vectx.c
==
--- head/lib/libsecureboot/vectx.c  Wed Mar 25 18:20:37 2020
(r359306)
+++ head/lib/libsecureboot/vectx.c  Wed Mar 25 19:12:19 2020
(r359307)
@@ -104,8 +104,8 @@ vectx_open(int fd, const char *path, off_t off, struct
rc = verify_prep(fd, path, off, stp, __func__);
 
DEBUG_PRINTF(2,
-   ("vectx_open: caller=%s,name='%s',prep_rc=%d\n",
-   caller,path, rc));
+   ("vectx_open: caller=%s,fd=%d,name='%s',prep_rc=%d\n",
+   caller, fd, path, rc));
 
switch (rc) {
case VE_FINGERPRINT_NONE:
@@ -316,6 +316,9 @@ vectx_lseek(struct vectx *ctx, off_t off, int whence)
  * We have finished reading file, compare the hash with what
  * we wanted.
  *
+ * Be sure to call this before closing the file, since we may
+ * need to seek to the end to ensure hashing is complete.
+ *
  * @param[in] pctx
  * pointer to ctx
  *
@@ -337,20 +340,25 @@ vectx_close(struct vectx *ctx, int severity, const cha
 */
ve_pcr_updating_set((severity == VE_MUST));
 #endif
+   /* make sure we have hashed it all */
+   vectx_lseek(ctx, 0, SEEK_END);
rc = ve_check_hash(>vec_ctx, ctx->vec_md,
ctx->vec_path, ctx->vec_want, ctx->vec_hashsz);
}
DEBUG_PRINTF(2,
("vectx_close: caller=%s,name='%s',rc=%d,severity=%d\n",
caller,ctx->vec_path, rc, severity));
-   if (severity > VE_WANT || rc == VE_FINGERPRINT_WRONG)
-   printf("%serified %s\n", (rc <= 0) ? "Unv" : "V",
-   ctx->vec_path);
+   if (rc == VE_FINGERPRINT_WRONG) {
+   printf("Unverified: %s\n", ve_error_get());
 #if !defined(UNIT_TEST) && !defined(DEBUG_VECTX)
-   /* we are generally called with VE_MUST */
-   if (severity > VE_WANT && rc == VE_FINGERPRINT_WRONG)
-   panic("cannot continue");
+   /* we are generally called with VE_MUST */
+   if (severity > VE_WANT)
+   panic("cannot continue");
 #endif
+   } else if (severity > VE_WANT) {
+   printf("%serified %s\n", (rc <= 0) ? "Unv" : "V",
+   ctx->vec_path);
+   }
free(ctx);
return ((rc < 0) ? rc : 0);
 }

Modified: head/lib/libsecureboot/veopen.c
==
--- head/lib/libsecureboot/veopen.c Wed Mar 25 18:20:37 2020
(r359306)
+++ head/lib/libsecureboot/veopen.c Wed Mar 25 19:12:19 2020

Re: svn commit: r358744 - in head: lib/libsecureboot lib/libsecureboot/h lib/libsecureboot/tests share/mk stand stand/common stand/efi/loader stand/efi/loader/arch/i386 stand/ficl stand/i386/libi386 s

2020-03-09 Thread Simon J. Gerraty via svn-src-all
O. Hartmann  wrote:
> > To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
> [... deleted ...]
> 
> 
> buildworld seems to be broken on this commit:

Ah! I did a buildworld, but build the 4th version of loader.
Sorry, will fix.

> 
> [...]
> --- all_subdir_stand ---
> --- lstd.o ---
> /usr/src/stand/liblua/lstd.c:86:44: error: too few arguments to function call,
> expected 5, have 4 if (verify_file(fd, filename, 0, VE_GUESS) < 0) {
> ~~~  ^
> /usr/src/lib/libsecureboot/h/verify_file.h:50:1: note: 'verify_file' declared
> here int verify_file(int, const char *, off_t, int, const char *);
> ^
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358813 - in head/stand: ficl i386/loader

2020-03-09 Thread Simon J. Gerraty
Author: sjg
Date: Mon Mar  9 16:02:54 2020
New Revision: 358813
URL: https://svnweb.freebsd.org/changeset/base/358813

Log:
  veloader use vectx API for kernel and modules
  
  The vectx API, computes the hash for verifying a file as it is read.
  This avoids the overhead of reading files twice - once to verify, then
  again to load.
  
  For doing an install via loader, avoiding the need to rewind
  large files is critical.
  
  This API is only used for modules, kernel and mdimage as these are the
  biggest files read by the loader.
  The reduction in boot time depends on how expensive the I/O is
  on any given platform.  On a fast VM we see 6% improvement.
  
  For install via loader the first file to be verified is likely to be the
  kernel, so some of the prep work (finding manifest etc) done by
  verify_file() needs to be factored so it can be reused for
  vectx_open().
  
  For missing or unrecognized fingerprint entries, we fail
  in vectx_open() unless verifying is disabled.
  
  Otherwise fingerprint check happens in vectx_close() and
  since this API is only used for files which must be verified
  (VE_MUST) we panic if we get an incorrect hash.
  
  Reviewed by:  imp,tsoome
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D23827

Modified:
  head/stand/ficl/fileaccess.c
  head/stand/i386/loader/chain.c

Modified: head/stand/ficl/fileaccess.c
==
--- head/stand/ficl/fileaccess.cMon Mar  9 15:55:13 2020
(r358812)
+++ head/stand/ficl/fileaccess.cMon Mar  9 16:02:54 2020
(r358813)
@@ -69,7 +69,7 @@ static void ficlFopen(FICL_VM *pVM, char *writeMode) /
 else
 #ifdef LOADER_VERIEXEC
if (*mode == 'r' &&
-   verify_file(fileno(f), filename, 0, VE_GUESS) < 0) {
+   verify_file(fileno(f), filename, 0, VE_GUESS, __func__) < 0) {
fclose(f);
stackPushPtr(pVM->pStack, NULL);
} else

Modified: head/stand/i386/loader/chain.c
==
--- head/stand/i386/loader/chain.c  Mon Mar  9 15:55:13 2020
(r358812)
+++ head/stand/i386/loader/chain.c  Mon Mar  9 16:02:54 2020
(r358813)
@@ -95,7 +95,7 @@ command_chain(int argc, char *argv[])
}
 #else
 #ifdef LOADER_VERIEXEC
-   if (verify_file(fd, argv[1], 0, VE_MUST) < 0) {
+   if (verify_file(fd, argv[1], 0, VE_MUST, __func__) < 0) {
sprintf(command_errbuf, "can't verify: %s", argv[1]);
close(fd);
return (CMD_ERROR);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358811 - head/stand/liblua

2020-03-09 Thread Simon J. Gerraty
Author: sjg
Date: Mon Mar  9 15:48:53 2020
New Revision: 358811
URL: https://svnweb.freebsd.org/changeset/base/358811

Log:
  veloader use vectx API for kernel and modules
  
  The vectx API, computes the hash for verifying a file as it is read.
  This avoids the overhead of reading files twice - once to verify, then
  again to load.
  
  For doing an install via loader, avoiding the need to rewind
  large files is critical.
  
  This API is only used for modules, kernel and mdimage as these are the
  biggest files read by the loader.
  The reduction in boot time depends on how expensive the I/O is
  on any given platform.  On a fast VM we see 6% improvement.
  
  For install via loader the first file to be verified is likely to be the
  kernel, so some of the prep work (finding manifest etc) done by
  verify_file() needs to be factored so it can be reused for
  vectx_open().
  
  For missing or unrecognized fingerprint entries, we fail
  in vectx_open() unless verifying is disabled.
  
  Otherwise fingerprint check happens in vectx_close() and
  since this API is only used for files which must be verified
  (VE_MUST) we panic if we get an incorrect hash.
  
  Reviewed by:  imp,tsoome
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D23827

Modified:
  head/stand/liblua/lstd.c

Modified: head/stand/liblua/lstd.c
==
--- head/stand/liblua/lstd.cMon Mar  9 15:28:52 2020(r358810)
+++ head/stand/liblua/lstd.cMon Mar  9 15:48:53 2020(r358811)
@@ -83,7 +83,7 @@ fopen(const char *filename, const char *mode)
 #ifdef LOADER_VERIEXEC
/* only regular files and only reading makes sense */
if (S_ISREG(st.st_mode) && !(m & O_WRONLY)) {
-   if (verify_file(fd, filename, 0, VE_GUESS) < 0) {
+   if (verify_file(fd, filename, 0, VE_GUESS, __func__) < 0) {
free(f);
close(fd);
return (NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358744 - in head: lib/libsecureboot lib/libsecureboot/h lib/libsecureboot/tests share/mk stand stand/common stand/efi/loader stand/efi/loader/arch/i386 stand/ficl stand/i386/libi386 s

2020-03-08 Thread Simon J. Gerraty via svn-src-all
Sorry, this header was in the diff I checked just before commit,
but somehow it got left behind.

Should be fixed now.
r358767

Ed Maste  wrote:

> On Sun, 8 Mar 2020 at 13:42, Simon J. Gerraty  wrote:
> >
> > Author: sjg
> > Date: Sun Mar  8 17:42:42 2020
> > New Revision: 358744
> > URL: 
> > https://urldefense.com/v3/__https://svnweb.freebsd.org/changeset/base/358744__;!!NEt6yMaO-gk!UN1BS-3MIiR9SzEXAP4CaXw9L8Y3jVsZwKB6fbjrjIiZGgrRXFp5uE0oPx-XgA$
> >  
> >
> > Log:
> >   veloader use vectx API for kernel and modules
> 
> CI reports the build is now broken:
> 18:12:46 --- geliboot.o ---
> 18:12:46 In file included from /usr/src/stand/libsa/geli/geliboot.c:33:
> 18:12:46 In file included from 
> /usr/src/stand/libsa/geli/geliboot_internal.h:43:
> 18:12:46 /usr/src/stand/common/bootstrap.h:36:10: fatal error:
> 'readin.h' file not found
> 18:12:46 #include "readin.h"
> 18:12:46  ^~
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358767 - head/stand/common

2020-03-08 Thread Simon J. Gerraty
Author: sjg
Date: Sun Mar  8 18:48:01 2020
New Revision: 358767
URL: https://svnweb.freebsd.org/changeset/base/358767

Log:
  veloader use vectx API for kernel and modules
  
  The vectx API, computes the hash for verifying a file as it is read.
  This avoids the overhead of reading files twice - once to verify, then
  again to load.
  
  For doing an install via loader, avoiding the need to rewind
  large files is critical.
  
  This API is only used for modules, kernel and mdimage as these are the
  biggest files read by the loader.
  The reduction in boot time depends on how expensive the I/O is
  on any given platform.  On a fast VM we see 6% improvement.
  
  For install via loader the first file to be verified is likely to be the
  kernel, so some of the prep work (finding manifest etc) done by
  verify_file() needs to be factored so it can be reused for
  vectx_open().
  
  For missing or unrecognized fingerprint entries, we fail
  in vectx_open() unless verifying is disabled.
  
  Otherwise fingerprint check happens in vectx_close() and
  since this API is only used for files which must be verified
  (VE_MUST) we panic if we get an incorrect hash.
  
  Reviewed by:  imp,tsoome
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D23827

Added:
  head/stand/common/readin.h   (contents, props changed)

Added: head/stand/common/readin.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/common/readin.h  Sun Mar  8 18:48:01 2020(r358767)
@@ -0,0 +1,43 @@
+/*-
+ * Copyright (c) 2020, Juniper Networks, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#ifndef _READIN_H_
+#define_READIN_H_
+
+#ifdef LOADER_VERIEXEC
+#include 
+#endif
+#ifdef LOADER_VERIEXEC_VECTX
+typedef struct vectx * readin_handle_t;
+#define VECTX_READ vectx_read
+#define VECTX_LSEEK vectx_lseek
+#else
+typedef int readin_handle_t;
+#define VECTX_READ read
+#define VECTX_LSEEK lseek
+#endif
+
+#endif /* !_READIN_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358744 - in head: lib/libsecureboot lib/libsecureboot/h lib/libsecureboot/tests share/mk stand stand/common stand/efi/loader stand/efi/loader/arch/i386 stand/ficl stand/i386/libi386 st...

2020-03-08 Thread Simon J. Gerraty
Author: sjg
Date: Sun Mar  8 17:42:42 2020
New Revision: 358744
URL: https://svnweb.freebsd.org/changeset/base/358744

Log:
  veloader use vectx API for kernel and modules
  
  The vectx API, computes the hash for verifying a file as it is read.
  This avoids the overhead of reading files twice - once to verify, then
  again to load.
  
  For doing an install via loader, avoiding the need to rewind
  large files is critical.
  
  This API is only used for modules, kernel and mdimage as these are the
  biggest files read by the loader.
  The reduction in boot time depends on how expensive the I/O is
  on any given platform.  On a fast VM we see 6% improvement.
  
  For install via loader the first file to be verified is likely to be the
  kernel, so some of the prep work (finding manifest etc) done by
  verify_file() needs to be factored so it can be reused for
  vectx_open().
  
  For missing or unrecognized fingerprint entries, we fail
  in vectx_open() unless verifying is disabled.
  
  Otherwise fingerprint check happens in vectx_close() and
  since this API is only used for files which must be verified
  (VE_MUST) we panic if we get an incorrect hash.
  
  Reviewed by:  imp,tsoome
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D23827

Modified:
  head/lib/libsecureboot/h/libsecureboot.h
  head/lib/libsecureboot/h/verify_file.h
  head/lib/libsecureboot/tests/tvo.c
  head/lib/libsecureboot/vectx.c
  head/lib/libsecureboot/verify_file.c
  head/share/mk/src.opts.mk
  head/stand/common/bootstrap.h
  head/stand/common/interp_forth.c
  head/stand/common/interp_simple.c
  head/stand/common/load_elf.c
  head/stand/common/load_elf_obj.c
  head/stand/common/misc.c
  head/stand/common/module.c
  head/stand/efi/loader/arch/i386/i386_copy.c
  head/stand/efi/loader/copy.c
  head/stand/efi/loader/loader_efi.h
  head/stand/efi/loader/main.c
  head/stand/ficl/loader.c
  head/stand/i386/libi386/i386_copy.c
  head/stand/i386/libi386/libi386.h
  head/stand/i386/loader/chain.c
  head/stand/libofw/libofw.h
  head/stand/libofw/ofw_copy.c
  head/stand/loader.mk
  head/stand/mips/beri/loader/arch.c
  head/stand/powerpc/kboot/main.c
  head/stand/uboot/lib/copy.c
  head/stand/uboot/lib/libuboot.h
  head/stand/userboot/userboot/copy.c
  head/stand/userboot/userboot/libuserboot.h

Modified: head/lib/libsecureboot/h/libsecureboot.h
==
--- head/lib/libsecureboot/h/libsecureboot.hSun Mar  8 16:55:34 2020
(r358743)
+++ head/lib/libsecureboot/h/libsecureboot.hSun Mar  8 17:42:42 2020
(r358744)
@@ -69,12 +69,6 @@ void fingerprint_info_add(const char *, const char *, 
 int ve_check_hash(br_hash_compat_context *, const br_hash_class *,
 const char *, const char *, size_t);
 
-struct vectx;
-struct vectx* vectx_open(int, const char *, off_t, struct stat *, int *);
-ssize_t vectx_read(struct vectx *, void *, size_t);
-off_t vectx_lseek(struct vectx *, off_t, int);
-int vectx_close(struct vectx *);
-
 char * hexdigest(char *, size_t, unsigned char *, size_t);
 int  verify_fd(int, const char *, off_t, struct stat *);
 int  verify_open(const char *, int);

Modified: head/lib/libsecureboot/h/verify_file.h
==
--- head/lib/libsecureboot/h/verify_file.h  Sun Mar  8 16:55:34 2020
(r358743)
+++ head/lib/libsecureboot/h/verify_file.h  Sun Mar  8 17:42:42 2020
(r358744)
@@ -39,13 +39,21 @@
 
 struct stat;
 
-voidve_debug_set(int);
-int ve_status_get(int);
-voidve_efi_init(void);
-int load_manifest(const char *, const char *, const char *, struct stat *);
-int pass_manifest(const char *, const char *);
-int pass_manifest_export_envs(void);
-int verify_file(int, const char *, off_t, int);
-voidverify_pcr_export(void);
+intverify_prep(int, const char *, off_t, struct stat *, const char *);
+void   ve_debug_set(int);
+char   *ve_error_get(void);
+void   ve_efi_init(void);
+intve_status_get(int);
+intload_manifest(const char *, const char *, const char *, struct stat *);
+intpass_manifest(const char *, const char *);
+intpass_manifest_export_envs(void);
+intverify_file(int, const char *, off_t, int, const char *);
+void   verify_pcr_export(void);
+
+struct vectx;
+struct vectx* vectx_open(int, const char *, off_t, struct stat *, int *, const 
char *);
+ssize_tvectx_read(struct vectx *, void *, size_t);
+off_t  vectx_lseek(struct vectx *, off_t, int);
+intvectx_close(struct vectx *, int, const char *);
 
 #endif /* _VERIFY_FILE_H_ */

Modified: head/lib/libsecureboot/tests/tvo.c
==
--- head/lib/libsecureboot/tests/tvo.c  Sun Mar  8 16:55:34 2020
(r358743)
+++ head/lib/libsecureboot/tests/tvo.c  Sun Mar  8 17:42:42 2020
(r358744)
@@ 

svn commit: r355962 - head/lib/libsecureboot

2019-12-20 Thread Simon J. Gerraty
Author: sjg
Date: Fri Dec 20 21:56:28 2019
New Revision: 355962
URL: https://svnweb.freebsd.org/changeset/base/355962

Log:
  Avoid unused vars when VE_ECDSA_HASH_AGAIN undefined
  
  Reviewed by:  emaste
  MFC after:1 week

Modified:
  head/lib/libsecureboot/vets.c

Modified: head/lib/libsecureboot/vets.c
==
--- head/lib/libsecureboot/vets.c   Fri Dec 20 21:55:13 2019
(r355961)
+++ head/lib/libsecureboot/vets.c   Fri Dec 20 21:56:28 2019
(r355962)
@@ -642,9 +642,10 @@ hexdigest(char *buf, size_t bufsz, unsigned char *foo,
 static unsigned char *
 verify_ec(br_x509_pkey *pk, const char *file, const char *sigfile)
 {
-   char hexbuf[br_sha512_SIZE * 2 + 2];
+#ifdef VE_ECDSA_HASH_AGAIN
+   char *hex, hexbuf[br_sha512_SIZE * 2 + 2];
+#endif
unsigned char rhbuf[br_sha512_SIZE];
-   char *hex;
br_sha256_context ctx;
unsigned char *fcp, *scp;
size_t flen, slen, plen;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355906 - in stable/12: bin/ls cddl/lib/libavl cddl/lib/libctf cddl/lib/libnvpair cddl/lib/libumem cddl/lib/libuutil cddl/lib/libzfs cddl/lib/libzfs_core gnu/lib/libdialog gnu/lib/libgo...

2019-12-18 Thread Simon J. Gerraty
Author: sjg
Date: Thu Dec 19 04:58:11 2019
New Revision: 355906
URL: https://svnweb.freebsd.org/changeset/base/355906

Log:
  Add Makefile.depend.options
  
  Leaf directories that have dependencies impacted
  by options need a Makefile.depend.options file
  to avoid churn in Makefile.depend
  
  DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc
  can be set in local.dirdeps-options.mk
  which can add to those set in Makefile.depend.options
  
  See share/mk/dirdeps-options.mk
  
  Also update affected Makefile.depend files.
  
  MFC of r355616 and r355617
  
  Reviewed by:   bdrewery
  Sponsored by:   Juniper Networks
  Differential Revision:  https://reviews.freebsd.org/D22469

Added:
  stable/12/bin/ls/Makefile.depend.options
 - copied unchanged from r355616, head/bin/ls/Makefile.depend.options
  stable/12/lib/libarchive/Makefile.depend.options
 - copied unchanged from r355616, 
head/lib/libarchive/Makefile.depend.options
  stable/12/lib/libbe/Makefile.depend
 - copied unchanged from r355617, head/lib/libbe/Makefile.depend
  stable/12/lib/libbsnmp/libbsnmp/Makefile.depend.options
 - copied unchanged from r355616, 
head/lib/libbsnmp/libbsnmp/Makefile.depend.options
  stable/12/lib/libc/Makefile.depend.options
 - copied unchanged from r355616, head/lib/libc/Makefile.depend.options
  stable/12/lib/libcasper/services/cap_syslog/Makefile.depend
 - copied unchanged from r355617, 
head/lib/libcasper/services/cap_syslog/Makefile.depend
  stable/12/lib/libfetch/Makefile.depend.options
 - copied unchanged from r355616, head/lib/libfetch/Makefile.depend.options
  stable/12/lib/libmagic/Makefile.depend.inc
 - copied unchanged from r355617, head/lib/libmagic/Makefile.depend.inc
  stable/12/lib/libomp/Makefile.depend
 - copied unchanged from r355617, head/lib/libomp/Makefile.depend
  stable/12/lib/libopencsd/Makefile.depend
 - copied unchanged from r355617, head/lib/libopencsd/Makefile.depend
  stable/12/lib/libpam/modules/pam_unix/Makefile.depend.options
 - copied unchanged from r355616, 
head/lib/libpam/modules/pam_unix/Makefile.depend.options
  stable/12/lib/libpcap/Makefile.depend.options
 - copied unchanged from r355616, head/lib/libpcap/Makefile.depend.options
  stable/12/lib/libproc/Makefile.depend.options
 - copied unchanged from r355616, head/lib/libproc/Makefile.depend.options
  stable/12/lib/libradius/Makefile.depend.options
 - copied unchanged from r355616, head/lib/libradius/Makefile.depend.options
  stable/12/lib/libsecureboot/Makefile.depend.amd64
 - copied unchanged from r355617, 
head/lib/libsecureboot/Makefile.depend.amd64
  stable/12/lib/libveriexec/Makefile.depend
 - copied unchanged from r355617, head/lib/libveriexec/Makefile.depend
  stable/12/lib/ofed/complib/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/complib/Makefile.depend
  stable/12/lib/ofed/include/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/include/Makefile.depend
  stable/12/lib/ofed/libcxgb4/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libcxgb4/Makefile.depend
  stable/12/lib/ofed/libibcm/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libibcm/Makefile.depend
  stable/12/lib/ofed/libibmad/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libibmad/Makefile.depend
  stable/12/lib/ofed/libibnetdisc/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libibnetdisc/Makefile.depend
  stable/12/lib/ofed/libibverbs/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libibverbs/Makefile.depend
  stable/12/lib/ofed/libmlx4/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libmlx4/Makefile.depend
  stable/12/lib/ofed/libmlx5/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libmlx5/Makefile.depend
  stable/12/lib/ofed/libopensm/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libopensm/Makefile.depend
  stable/12/lib/ofed/librdmacm/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/librdmacm/Makefile.depend
  stable/12/lib/ofed/libvendor/Makefile.depend
 - copied unchanged from r355617, head/lib/ofed/libvendor/Makefile.depend
  stable/12/libexec/fingerd/Makefile.depend.options
 - copied unchanged from r355616, 
head/libexec/fingerd/Makefile.depend.options
  stable/12/libexec/ftpd/Makefile.depend.options
 - copied unchanged from r355616, head/libexec/ftpd/Makefile.depend.options
  stable/12/libexec/telnetd/Makefile.depend.options
 - copied unchanged from r355616, 
head/libexec/telnetd/Makefile.depend.options
  stable/12/libexec/tftpd/Makefile.depend.options
 - copied unchanged from r355616, head/libexec/tftpd/Makefile.depend.options
  stable/12/sbin/bectl/Makefile.depend
 - copied unchanged from r355617, head/sbin/bectl/Makefile.depend
  stable/12/sbin/devmatch/Makefile.depend
 - copied unchanged from r355617, head/sbin/devmatch/Makefile.depend
  

svn commit: r355905 - in stable/12: lib/libbsnmp/libbsnmp lib/libgcc_eh lib/libmagic lib/libpmc share/mk targets

2019-12-18 Thread Simon J. Gerraty
(r355905, copy of r355618, head/share/mk/dirdeps-targets.mk)
@@ -0,0 +1,134 @@
+# $FreeBSD$
+# RCSid:
+#   $Id: dirdeps-targets.mk,v 1.9 2019/10/06 20:07:50 sjg Exp $
+#
+#   @(#) Copyright (c) 2019 Simon J. Gerraty
+#
+#   This file is provided in the hope that it will
+#   be of use.  There is absolutely NO WARRANTY.
+#   Permission to copy, redistribute or otherwise
+#   use this file is hereby granted provided that 
+#   the above copyright notice and this notice are
+#   left intact. 
+#  
+#   Please send copies of changes and bug-fixes to:
+#   s...@crufty.net
+#
+
+##
+# This makefile is used to set initial DIRDEPS for top-level build
+# targets.
+#
+# The basic idea is that we have a list of directories in
+# DIRDEPS_TARGETS_DIRS which are relative to SRCTOP.
+# When asked to make 'foo' we look for any directory named 'foo'
+# under DIRDEPS_TARGETS_DIRS.
+# We then search those dirs for any Makefile.depend*
+# Finally we select any that match conditions like REQUESTED_MACHINE
+# or TARGET_SPEC and initialize DIRDEPS accordingly.
+# 
+
+.if ${.MAKE.LEVEL} == 0
+# pickup customizations
+.-include 
+
+# for DIRDEPS_BUILD this is how we prime the pump
+DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo
+# these prefixes can modify how we behave
+# they need to be stripped when looking for target dirs
+DIRDEPS_TARGETS_PREFIX_LIST ?= pkg- build-
+
+# matching target dirs if any
+tdirs := 
${.TARGETS:Nall:${DIRDEPS_TARGETS_PREFIX_LIST:@p@S,^$p,,@:ts:}:@t@${DIRDEPS_TARGETS_DIRS:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@}
+
+.if !empty(DEBUG_DIRDEPS_TARGETS)
+.info tdirs=${tdirs}
+.endif
+
+.if !empty(tdirs)
+# some things we know we want to ignore
+DIRDEPS_TARGETS_SKIP_LIST += \
+   *~ \
+   *.bak \
+   *.inc \
+   *.old \
+   *.options \
+   *.orig \
+   *.rej \
+
+# the list of MACHINEs we consider
+DIRDEPS_TARGETS_MACHINE_LIST += \
+   ${ALL_MACHINE_LIST:U} \
+   ${PSEUDO_MACHINE_LIST:Ucommon host host32} \
+   ${TARGET_MACHINE_LIST}
+
+DIRDEPS_TARGETS_MACHINE_LIST := ${DIRDEPS_TARGETS_MACHINE_LIST:O:u}
+
+# raw Makefile.depend* list
+tdeps != 'cd' ${SRCTOP} && 'ls' -1 
${tdirs:O:u:@d@$d/${.MAKE.DEPENDFILE_PREFIX}*@} 2> /dev/null; echo
+.if ${DEBUG_DIRDEPS_TARGETS:U:Mdep*} != ""
+.info tdeps=${tdeps}
+.endif
+# remove things we know we don't want
+tdeps := ${tdeps:${DIRDEPS_TARGETS_SKIP_LIST:${M_ListToSkip}}}
+.if ${DEBUG_DIRDEPS_TARGETS:U:Mdep*} != ""
+.info tdeps=${tdeps}
+.endif
+
+# plain entries (no qualifiers) these apply to any TARGET_SPEC
+ptdeps := ${tdeps:M*${.MAKE.DEPENDFILE_PREFIX}:S,/${.MAKE.DEPENDFILE_PREFIX},,}
+
+# MACHINE qualified entries
+mqtdeps := 
${DIRDEPS_TARGETS_MACHINE_LIST:@m@${tdeps:M*.$m}@:S,/${.MAKE.DEPENDFILE_PREFIX},,}
+
+tqtdeps =
+.if ${TARGET_SPEC_VARS:[#]} > 1
+# TARGET_SPEC qualified entries
+.if !empty(TARGET_SPEC_LIST)
+# we have a list of valid TARGET_SPECS; use it
+tqtdeps := 
${TARGET_SPEC_LIST:U:O:u:@t@${tdeps:M*.$t}@:S,/${.MAKE.DEPENDFILE_PREFIX},,}
+.else
+# do we have a list of valid tuple members for at least
+# the last tupple element? if so match on that
+TARGET_SPEC_LAST_LIST ?= ${${TARGET_SPEC_VARS:[-1]}_LIST}
+.if !empty(TARGET_SPEC_LAST_LIST)
+tqtdeps := 
${TARGET_SPEC_LAST_LIST:U:O:u:@t@${tdeps:M*,$t}@:S,/${.MAKE.DEPENDFILE_PREFIX},,}
+.else
+# this is sub-optimal match MACHINE,
+tqtdeps := 
${DIRDEPS_TARGETS_MACHINE_LIST:@m@${tdeps:M*.$m,*}@:S,/${.MAKE.DEPENDFILE_PREFIX},,}
+.endif
+.endif
+.endif
+
+# now work out what we want in DIRDEPS
+.if empty(REQUESTED_MACHINE)
+# we want them all just as found
+DIRDEPS = ${ptdeps} ${mqtdeps} ${tqtdeps}
+.else
+# we only want those that match REQUESTED_MACHINE/REQUESTED_TARGET_SPEC
+# or REQUESTED_TARGET_SPEC (TARGET_SPEC)
+DIRDEPS = \
+   
${ptdeps:@d@$d.${REQUESTED_TARGET_SPEC:U${TARGET_SPEC:U${REQUESTED_MACHINE}}}@} 
\
+   ${mqtdeps:M*.${REQUESTED_MACHINE}} \
+   ${tqtdeps:M*.${REQUESTED_TARGET_SPEC:U${TARGET_SPEC}}}
+.endif
+# clean up
+DIRDEPS := ${DIRDEPS:O:u}
+
+.if !empty(DEBUG_DIRDEPS_TARGETS)
+.for x in tdeps ptdeps mqtdeps tqtdeps DIRDEPS
+.info $x=${$x}
+.endfor
+.endif
+.endif
+# if we got DIRDEPS get to work
+.if !empty(DIRDEPS)
+.include 
+
+DIRDEPS_TARGETS_SKIP += all clean* destroy*
+
+.for t in ${.TARGETS:${DIRDEPS_TARGETS_SKIP:${M_ListToSkip}}}
+$t: dirdeps
+.endfor
 
+.endif
+.endif

Modified: stable/12/share/mk/dirdeps.mk
==
--- stable/12/share/mk/dirdeps.mk   Thu Dec 19 02:40:04 2019
(r355904)
+++ stable/12/share/mk/dirdeps.mk   Thu Dec 19 04:49:34 2019
(r355905)
@@ -1,5 +1,5 @@
 # $FreeBSD$
-# $Id: dirdeps.mk,v 1.96 2018/06/20 22:26:39 sjg Exp $
+# $Id: dirdeps.mk,v 1.100 2019/11/12 06:47:58 sjg Exp $
 
 # Copyright (c) 2010-2013, Juniper Networks, Inc.
 # All rights reserved.
@

svn commit: r355904 - in head: lib/libmagic lib/libpmc share/mk

2019-12-18 Thread Simon J. Gerraty
Author: sjg
Date: Thu Dec 19 02:40:04 2019
New Revision: 355904
URL: https://svnweb.freebsd.org/changeset/base/355904

Log:
  Tweaks for DIRDEPS_BUILD
  
  libmagic only depend on mkmagic if not DIRDEPS_BUILD
  
  libpmc fix -I for libpmcstat
  
  local.dirdeps.mk be even more careful about adding gnu/lib/csu to DIRDEPS
  
  Reviewed by:  bdrewery
  Differential Revision:https://reviews.freebsd.org/D22872

Modified:
  head/lib/libmagic/Makefile
  head/lib/libpmc/Makefile
  head/share/mk/local.dirdeps.mk

Modified: head/lib/libmagic/Makefile
==
--- head/lib/libmagic/Makefile  Thu Dec 19 02:32:37 2019(r355903)
+++ head/lib/libmagic/Makefile  Thu Dec 19 02:40:04 2019(r355904)
@@ -37,7 +37,7 @@ MAGFILES= ${CONTRDIR}/magic/Header \
 magic: ${MAGFILES}
cat ${.ALLSRC:O} > ${.TARGET}
 
-magic.mgc: mkmagic magic
+magic.mgc: magic
${BTOOLSPATH:U.}/mkmagic magic
 
 .if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no"
@@ -51,6 +51,8 @@ mkmagic: apprentice.c cdf_time.c encoding.c funcs.c ma
 .endif
 .if ${MK_DIRDEPS_BUILD} == "yes"
 BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR}
+.else
+magic.mgc: mkmagic
 .endif
 
 FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \

Modified: head/lib/libpmc/Makefile
==
--- head/lib/libpmc/MakefileThu Dec 19 02:32:37 2019(r355903)
+++ head/lib/libpmc/MakefileThu Dec 19 02:40:04 2019(r355904)
@@ -20,7 +20,7 @@ EVENT_ARCH="powerpc"
 
 .if ${MK_DIRDEPS_BUILD} == "yes"
 # avoid circular dependency
-CFLAGS+= -I${RELDIR:H}/libpmcstat
+CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat
 GENDIRDEPS_FILTER+= N${RELDIR:H}/libpmcstat
 JEVENTS?= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents
 .else

Modified: head/share/mk/local.dirdeps.mk
==
--- head/share/mk/local.dirdeps.mk  Thu Dec 19 02:32:37 2019
(r355903)
+++ head/share/mk/local.dirdeps.mk  Thu Dec 19 02:40:04 2019
(r355904)
@@ -222,7 +222,7 @@ DIRDEPS += targets/pseudo/stage
 .endif
 
 # this one is too pervasive
-.if ${MK_BSD_CRTBEGIN} == "no" && ${DEP_RELDIR} != "gnu/lib/csu"
+.if ${MK_BSD_CRTBEGIN} == "no" && 
${DEP_RELDIR:N.:Ngnu/lib/csu:Ninclude*:Ntargets/*} != ""
 DIRDEPS+= gnu/lib/csu
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355616 - in head: bin/ls lib/libarchive lib/libbsnmp/libbsnmp lib/libc lib/libfetch lib/libpam/modules/pam_unix lib/libpcap lib/libproc lib/libradius libexec/fingerd libexec/ftpd libex...

2019-12-11 Thread Simon J. Gerraty
Author: sjg
Date: Wed Dec 11 17:37:37 2019
New Revision: 355616
URL: https://svnweb.freebsd.org/changeset/base/355616

Log:
  Add Makefile.depend.options
  
  Leaf directories that have dependencies impacted
  by options need a Makefile.depend.options file
  to avoid churn in Makefile.depend
  
  DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc
  can be set in local.dirdeps-options.mk
  which can add to those set in Makefile.depend.options
  
  See share/mk/dirdeps-options.mk
  
  Reviewed by:   bdrewery
  MFC after:1 week
  Sponsored by:   Juniper Networks
  Differential Revision:  https://reviews.freebsd.org/D22469

Added:
  head/bin/ls/Makefile.depend.options   (contents, props changed)
  head/lib/libarchive/Makefile.depend.options   (contents, props changed)
  head/lib/libbsnmp/libbsnmp/Makefile.depend.options   (contents, props changed)
  head/lib/libc/Makefile.depend.options   (contents, props changed)
  head/lib/libfetch/Makefile.depend.options   (contents, props changed)
  head/lib/libpam/modules/pam_unix/Makefile.depend.options   (contents, props 
changed)
  head/lib/libpcap/Makefile.depend.options   (contents, props changed)
  head/lib/libproc/Makefile.depend.options   (contents, props changed)
  head/lib/libradius/Makefile.depend.options   (contents, props changed)
  head/libexec/fingerd/Makefile.depend.options   (contents, props changed)
  head/libexec/ftpd/Makefile.depend.options   (contents, props changed)
  head/libexec/telnetd/Makefile.depend.options   (contents, props changed)
  head/libexec/tftpd/Makefile.depend.options   (contents, props changed)
  head/sbin/dhclient/Makefile.depend.options   (contents, props changed)
  head/sbin/dumpon/Makefile.depend.options   (contents, props changed)
  head/sbin/ifconfig/Makefile.depend.options   (contents, props changed)
  head/sbin/ping/Makefile.depend.options   (contents, props changed)
  head/sbin/ping6/Makefile.depend.options   (contents, props changed)
  head/sbin/rtsol/Makefile.depend.options   (contents, props changed)
  head/sbin/savecore/Makefile.depend.options   (contents, props changed)
  head/secure/usr.bin/ssh/Makefile.depend.options   (contents, props changed)
  head/secure/usr.sbin/sshd/Makefile.depend.options   (contents, props changed)
  head/usr.bin/brandelf/Makefile.depend.options   (contents, props changed)
  head/usr.bin/chkey/Makefile.depend.options   (contents, props changed)
  head/usr.bin/chpass/Makefile.depend.options   (contents, props changed)
  head/usr.bin/factor/Makefile.depend.options   (contents, props changed)
  head/usr.bin/grep/Makefile.depend.options   (contents, props changed)
  head/usr.bin/gzip/Makefile.depend.options   (contents, props changed)
  head/usr.bin/head/Makefile.depend.options   (contents, props changed)
  head/usr.bin/kdump/Makefile.depend.options   (contents, props changed)
  head/usr.bin/login/Makefile.depend.options   (contents, props changed)
  head/usr.bin/netstat/Makefile.depend.options   (contents, props changed)
  head/usr.bin/nm/Makefile.depend.options   (contents, props changed)
  head/usr.bin/readelf/Makefile.depend.options   (contents, props changed)
  head/usr.bin/size/Makefile.depend.options   (contents, props changed)
  head/usr.bin/sort/Makefile.depend.options   (contents, props changed)
  head/usr.bin/strings/Makefile.depend.options   (contents, props changed)
  head/usr.bin/su/Makefile.depend.options   (contents, props changed)
  head/usr.bin/tail/Makefile.depend.options   (contents, props changed)
  head/usr.bin/telnet/Makefile.depend.options   (contents, props changed)
  head/usr.bin/wc/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/amd/amd/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/bhyve/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/bsnmpd/bsnmpd/Makefile.depend.options   (contents, props 
changed)
  head/usr.sbin/fstyp/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/gssd/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/inetd/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/ngctl/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/ntp/ntp-keygen/Makefile.depend.options   (contents, props 
changed)
  head/usr.sbin/ntp/ntpd/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/ntp/ntpdate/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/ntp/ntpdc/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/ntp/ntpq/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/ntp/sntp/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/rpcbind/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/rtsold/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/sendmail/Makefile.depend.options   (contents, props changed)
  head/usr.sbin/tcpdump/tcpdump/Makefile.depend.options   (contents, props 
changed)
  

svn commit: r355618 - in head: lib/libbsnmp/libbsnmp lib/libgcc_eh lib/libmagic lib/libpmc share/mk targets

2019-12-11 Thread Simon J. Gerraty
Author: sjg
Date: Wed Dec 11 17:38:15 2019
New Revision: 355618
URL: https://svnweb.freebsd.org/changeset/base/355618

Log:
  Update dirdeps.mk and gendirdeps.mk
  
  The env space consumed by exporting all libc's .meta files
  left little room for command line,
  so unexport when done.
  
  Update dirdeps.mk to latest and add
  dirdeps-targets.mk to simplify/update targets/Makefile
  
  Makefile changes to go with Makefile.depend changes in D22494
  
  Reviewed by:   bdrewery
  MFC after:1 week
  Sponsored by:   Juniper Networks
  Differential Revision:  https://reviews.freebsd.org/D22495

Added:
  head/share/mk/dirdeps-targets.mk   (contents, props changed)
  head/share/mk/local.dirdeps-options.mk   (contents, props changed)
Modified:
  head/lib/libbsnmp/libbsnmp/Makefile
  head/lib/libgcc_eh/Makefile
  head/lib/libmagic/Makefile
  head/lib/libpmc/Makefile
  head/share/mk/dirdeps.mk
  head/share/mk/gendirdeps.mk
  head/share/mk/local.dirdeps.mk
  head/share/mk/local.gendirdeps.mk
  head/share/mk/local.meta.sys.mk
  head/share/mk/meta.sys.mk
  head/targets/Makefile
  head/targets/Makefile.inc

Modified: head/lib/libbsnmp/libbsnmp/Makefile
==
--- head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 11 17:37:53 2019
(r355617)
+++ head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 11 17:38:15 2019
(r355618)
@@ -24,12 +24,17 @@ SRCS+=  snmptc.h
 INCS=  asn1.h snmp.h snmpagent.h snmpclient.h
 MAN=   asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3
 
+.if ${MK_DIRDEPS_BUILD} == "yes"
+GENSNMPTREE?= ${HOST_OBJTOP}/usr.sbin/bsnmpd/gensnmptree/gensnmptree
+.endif
+GENSNMPTREE?= gensnmptree
+
 snmptc.h : tc.def
(\
echo "/* autogenerated from tc.def */";\
echo "#ifndef snmptc_h_1529923773";\
echo "#define snmptc_h_1529923773";\
-   gensnmptree -E -f <${.ALLSRC};\
+   ${GENSNMPTREE} -E -f <${.ALLSRC};\
echo "#endif" ; \
) >${.TARGET}
 

Modified: head/lib/libgcc_eh/Makefile
==
--- head/lib/libgcc_eh/Makefile Wed Dec 11 17:37:53 2019(r355617)
+++ head/lib/libgcc_eh/Makefile Wed Dec 11 17:38:15 2019(r355618)
@@ -10,4 +10,10 @@ WARNS?=  2
 
 .include "Makefile.inc"
 
+.if ${.MAKE.LEVEL} > 0
+# avoid circular dependencies
+GENDIRDEPS_FILTER+= Nlib/msun
+CFLAGS+= -I${SRCTOP}/lib/msun/src
+.endif
+
 .include 

Modified: head/lib/libmagic/Makefile
==
--- head/lib/libmagic/Makefile  Wed Dec 11 17:37:53 2019(r355617)
+++ head/lib/libmagic/Makefile  Wed Dec 11 17:38:15 2019(r355618)
@@ -40,12 +40,18 @@ magic: ${MAGFILES}
 magic.mgc: mkmagic magic
${BTOOLSPATH:U.}/mkmagic magic
 
+.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no"
 CLEANFILES+=   mkmagic
 DEPENDOBJS+=   mkmagic
 build-tools: mkmagic
 mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} 
${BUILD_TOOLS_META}
${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \
${.ALLSRC:N*.h:O:u} ${LDADD}
+
+.endif
+.if ${MK_DIRDEPS_BUILD} == "yes"
+BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR}
+.endif
 
 FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \
${.CURDIR}/config.h

Modified: head/lib/libpmc/Makefile
==
--- head/lib/libpmc/MakefileWed Dec 11 17:37:53 2019(r355617)
+++ head/lib/libpmc/MakefileWed Dec 11 17:38:15 2019(r355618)
@@ -17,11 +17,19 @@ EVENT_ARCH="x86"
 EVENT_ARCH="powerpc"
 .endif
 
+.if ${MK_DIRDEPS_BUILD} == "yes"
+# avoid circular dependency
+CFLAGS+= -I${RELDIR:H}/libpmcstat
+GENDIRDEPS_FILTER+= N${RELDIR:H}/libpmcstat
+JEVENTS?= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents
+.else
 JEVENTS= ${BTOOLSPATH:U.}/pmu-events/jevents
+
 # This file is built in a subdirectory so never try to rebuild it here.
 ${JEVENTS}: .PHONY
 .if make(*clean*)
 SUBDIR+= pmu-events
+.endif
 .endif
 
 libpmc_events.c: ${JEVENTS}

Added: head/share/mk/dirdeps-targets.mk
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/mk/dirdeps-targets.mkWed Dec 11 17:38:15 2019    
(r355618)
@@ -0,0 +1,134 @@
+# $FreeBSD$
+# RCSid:
+#   $Id: dirdeps-targets.mk,v 1.9 2019/10/06 20:07:50 sjg Exp $
+#
+#   @(#) Copyright (c) 2019 Simon J. Gerraty
+#
+#   This file is provided in the hope that it will
+#   be of use.  There is absolutely NO WARRANTY.
+#   Permission to copy, redistribute or otherwise
+#   use this file is hereby granted provided that 
+#   

svn commit: r355617 - in head: bin/ls cddl/lib/libavl cddl/lib/libctf cddl/lib/libnvpair cddl/lib/libumem cddl/lib/libuutil cddl/lib/libzfs cddl/lib/libzfs_core gnu/lib/libdialog gnu/lib/libgomp gn...

2019-12-11 Thread Simon J. Gerraty
Author: sjg
Date: Wed Dec 11 17:37:53 2019
New Revision: 355617
URL: https://svnweb.freebsd.org/changeset/base/355617

Log:
  Update Makefile.depend files
  
  Update a bunch of Makefile.depend files as
  a result of adding Makefile.depend.options files
  
  Reviewed by:   bdrewery
  MFC after:1 week
  Sponsored by:   Juniper Networks
  Differential Revision:  https://reviews.freebsd.org/D22494

Added:
  head/lib/libbe/Makefile.depend   (contents, props changed)
  head/lib/libcasper/services/cap_fileargs/Makefile.depend   (contents, props 
changed)
  head/lib/libcasper/services/cap_syslog/Makefile.depend   (contents, props 
changed)
  head/lib/libedit/Makefile.depend   (contents, props changed)
  head/lib/libedit/readline/Makefile.depend   (contents, props changed)
  head/lib/libmagic/Makefile.depend.inc   (contents, props changed)
  head/lib/libomp/Makefile.depend   (contents, props changed)
  head/lib/libopencsd/Makefile.depend   (contents, props changed)
  head/lib/libsecureboot/Makefile.depend.amd64   (contents, props changed)
  head/lib/libveriexec/Makefile.depend   (contents, props changed)
  head/lib/ofed/complib/Makefile.depend   (contents, props changed)
  head/lib/ofed/include/Makefile.depend   (contents, props changed)
  head/lib/ofed/libcxgb4/Makefile.depend   (contents, props changed)
  head/lib/ofed/libibcm/Makefile.depend   (contents, props changed)
  head/lib/ofed/libibmad/Makefile.depend   (contents, props changed)
  head/lib/ofed/libibnetdisc/Makefile.depend   (contents, props changed)
  head/lib/ofed/libibverbs/Makefile.depend   (contents, props changed)
  head/lib/ofed/libmlx4/Makefile.depend   (contents, props changed)
  head/lib/ofed/libmlx5/Makefile.depend   (contents, props changed)
  head/lib/ofed/libopensm/Makefile.depend   (contents, props changed)
  head/lib/ofed/librdmacm/Makefile.depend   (contents, props changed)
  head/lib/ofed/libvendor/Makefile.depend   (contents, props changed)
  head/sbin/bectl/Makefile.depend   (contents, props changed)
  head/sbin/devmatch/Makefile.depend   (contents, props changed)
  head/sbin/geom/Makefile.depend   (contents, props changed)
  head/stand/i386/loader_4th/Makefile.depend   (contents, props changed)
Modified:
  head/bin/ls/Makefile.depend
  head/cddl/lib/libavl/Makefile.depend
  head/cddl/lib/libctf/Makefile.depend
  head/cddl/lib/libnvpair/Makefile.depend
  head/cddl/lib/libumem/Makefile.depend
  head/cddl/lib/libuutil/Makefile.depend
  head/cddl/lib/libzfs/Makefile.depend
  head/cddl/lib/libzfs_core/Makefile.depend
  head/gnu/lib/libdialog/Makefile.depend
  head/gnu/lib/libgomp/Makefile.depend
  head/gnu/lib/libregex/Makefile.depend
  head/gnu/lib/libssp/Makefile.depend
  head/gnu/lib/libstdc++/Makefile.depend
  head/gnu/lib/libsupc++/Makefile.depend
  head/kerberos5/lib/libasn1/Makefile.depend
  head/kerberos5/lib/libgssapi_krb5/Makefile.depend
  head/kerberos5/lib/libhdb/Makefile.depend
  head/kerberos5/lib/libheimbase/Makefile.depend
  head/kerberos5/lib/libheimipcc/Makefile.depend
  head/kerberos5/lib/libheimntlm/Makefile.depend
  head/kerberos5/lib/libhx509/Makefile.depend
  head/kerberos5/lib/libkadm5clnt/Makefile.depend
  head/kerberos5/lib/libkafs5/Makefile.depend
  head/kerberos5/lib/libkdc/Makefile.depend
  head/kerberos5/lib/libkrb5/Makefile.depend
  head/kerberos5/lib/libroken/Makefile.depend
  head/kerberos5/lib/libwind/Makefile.depend
  head/lib/atf/libatf-c/Makefile.depend
  head/lib/lib80211/Makefile.depend
  head/lib/libalias/libalias/Makefile.depend
  head/lib/libarchive/Makefile.depend
  head/lib/libbegemot/Makefile.depend
  head/lib/libblacklist/Makefile.depend
  head/lib/libblocksruntime/Makefile.depend
  head/lib/libbluetooth/Makefile.depend
  head/lib/libbsdstat/Makefile.depend
  head/lib/libbsm/Makefile.depend
  head/lib/libbsnmp/libbsnmp/Makefile.depend
  head/lib/libbz2/Makefile.depend
  head/lib/libc++/Makefile.depend
  head/lib/libc/Makefile.depend
  head/lib/libc/tests/tls_dso/Makefile.depend
  head/lib/libcalendar/Makefile.depend
  head/lib/libcam/Makefile.depend
  head/lib/libcasper/libcasper/Makefile.depend
  head/lib/libcasper/services/cap_dns/Makefile.depend
  head/lib/libcasper/services/cap_grp/Makefile.depend
  head/lib/libcasper/services/cap_pwd/Makefile.depend
  head/lib/libcasper/services/cap_sysctl/Makefile.depend
  head/lib/libcom_err/Makefile.depend
  head/lib/libcrypt/Makefile.depend
  head/lib/libcuse/Makefile.depend
  head/lib/libcxxrt/Makefile.depend
  head/lib/libdevctl/Makefile.depend
  head/lib/libdevdctl/Makefile.depend
  head/lib/libdevinfo/Makefile.depend
  head/lib/libdevstat/Makefile.depend
  head/lib/libdpv/Makefile.depend
  head/lib/libdwarf/Makefile.depend
  head/lib/libefivar/Makefile.depend
  head/lib/libelf/Makefile.depend
  head/lib/libevent/Makefile.depend
  head/lib/libexecinfo/Makefile.depend
  head/lib/libexpat/Makefile.depend
  head/lib/libfetch/Makefile.depend
  head/lib/libfigpar/Makefile.depend
  head/lib/libgcc_s/Makefile.depend
  

svn commit: r354230 - in stable/12/stand: . efi/loader ficl ficl/amd64 ficl/i386 ficl/x86 i386/loader libsa libsa/x86

2019-10-31 Thread Simon J. Gerraty
Author: sjg
Date: Thu Oct 31 21:32:59 2019
New Revision: 354230
URL: https://svnweb.freebsd.org/changeset/base/354230

Log:
  Add support for hypervisor check on x86
  
  Add ficl words for isvirtualized
  and move ficl inb and outb words to ficl/x86/sysdep.c
  so can be shared by i386 and amd64
  
  MFC of r354043, r354055
  
  Reviewed by:  imp bdrewery
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org/D22069

Added:
  stable/12/stand/ficl/x86/
 - copied from r354043, head/stand/ficl/x86/
  stable/12/stand/libsa/x86/
 - copied from r354043, head/stand/libsa/x86/
Modified:
  stable/12/stand/defs.mk
  stable/12/stand/efi/loader/main.c
  stable/12/stand/ficl/amd64/sysdep.c
  stable/12/stand/ficl/i386/sysdep.c
  stable/12/stand/ficl/loader.c
  stable/12/stand/i386/loader/main.c
  stable/12/stand/libsa/Makefile
  stable/12/stand/libsa/stand.h

Modified: stable/12/stand/defs.mk
==
--- stable/12/stand/defs.mk Thu Oct 31 21:01:34 2019(r354229)
+++ stable/12/stand/defs.mk Thu Oct 31 21:32:59 2019(r354230)
@@ -182,14 +182,15 @@ CFLAGS+=-I.
 all: ${PROG}
 
 .if !defined(NO_OBJ)
-_ILINKS=machine
+_ILINKS=include/machine
 .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
-_ILINKS+=${MACHINE_CPUARCH}
+_ILINKS+=include/${MACHINE_CPUARCH}
 .endif
 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-_ILINKS+=x86
+_ILINKS+=include/x86
 .endif
-CLEANFILES+=${_ILINKS}
+CFLAGS+= -Iinclude
+CLEANDIRS+= include
 
 beforedepend: ${_ILINKS}
 beforebuild: ${_ILINKS}
@@ -204,8 +205,8 @@ ${OBJS}:   ${_link}
 
 .NOPATH: ${_ILINKS}
 
-${_ILINKS}:
-   @case ${.TARGET} in \
+${_ILINKS}: .NOMETA
+   @case ${.TARGET:T} in \
machine) \
if [ ${DO32:U0} -eq 0 ]; then \
path=${SYSDIR}/${MACHINE}/include ; \
@@ -215,8 +216,11 @@ ${_ILINKS}:
*) \
path=${SYSDIR}/${.TARGET:T}/include ;; \
esac ; \
+   case ${.TARGET} in \
+   */*) mkdir -p ${.TARGET:H};; \
+   esac ; \
path=`(cd $$path && /bin/pwd)` ; \
-   ${ECHO} ${.TARGET:T} "->" $$path ; \
-   ln -fhs $$path ${.TARGET:T}
+   ${ECHO} ${.TARGET} "->" $$path ; \
+   ln -fhs $$path ${.TARGET}
 .endif # !NO_OBJ
 .endif # __BOOT_DEFS_MK__

Modified: stable/12/stand/efi/loader/main.c
==
--- stable/12/stand/efi/loader/main.c   Thu Oct 31 21:01:34 2019
(r354229)
+++ stable/12/stand/efi/loader/main.c   Thu Oct 31 21:32:59 2019
(r354230)
@@ -863,6 +863,9 @@ main(int argc, CHAR16 *argv[])
archsw.arch_getdev = efi_getdev;
archsw.arch_copyin = efi_copyin;
archsw.arch_copyout = efi_copyout;
+#ifdef __amd64__
+   archsw.arch_hypervisor = x86_hypervisor;
+#endif
archsw.arch_readin = efi_readin;
archsw.arch_zfs_probe = efi_zfs_probe;
 

Modified: stable/12/stand/ficl/amd64/sysdep.c
==
--- stable/12/stand/ficl/amd64/sysdep.c Thu Oct 31 21:01:34 2019
(r354229)
+++ stable/12/stand/ficl/amd64/sysdep.c Thu Oct 31 21:32:59 2019
(r354230)
@@ -17,6 +17,8 @@
 #endif
 #include "ficl.h"
 
+#include "../x86/sysdep.c"
+
 /*
 ***  FreeBSD  P O R T   B E G I N S   H E R E 
 Michael Smith
 */

Modified: stable/12/stand/ficl/i386/sysdep.c
==
--- stable/12/stand/ficl/i386/sysdep.c  Thu Oct 31 21:01:34 2019
(r354229)
+++ stable/12/stand/ficl/i386/sysdep.c  Thu Oct 31 21:32:59 2019
(r354230)
@@ -14,12 +14,11 @@
 #include 
 #else
 #include 
-#ifdef __i386__
-#include 
 #endif
-#endif
 #include "ficl.h"
 
+#include "../x86/sysdep.c"
+
 /*
 ***  FreeBSD  P O R T   B E G I N S   H E R E 
 Michael Smith
 */
@@ -80,53 +79,6 @@ void  ficlFree   (void *p)
 free(p);
 }
 
-#ifndef TESTMAIN
-/* 
- * outb ( port# c -- )
- * Store a byte to I/O port number port#
- */
-void
-ficlOutb(FICL_VM *pVM)
-{
-   u_char c;
-   uint32_t port;
-
-   port=stackPopUNS(pVM->pStack);
-   c=(u_char)stackPopINT(pVM->pStack);
-   outb(port,c);
-}
-
-/*
- * inb ( port# -- c )
- * Fetch a byte from I/O port number port#
- */
-void
-ficlInb(FICL_VM *pVM)
-{
-   u_char c;
-   uint32_t port;
-
-   port=stackPopUNS(pVM->pStack);
-   c=inb(port);
-   stackPushINT(pVM->pStack,c);
-}
-
-/*
- * Glue function to add the appropriate forth words to access x86 special cpu
- * functionality.
- */
-static void ficlCompileCpufunc(FICL_SYSTEM *pSys)
-{
-FICL_DICT *dp = pSys->dp;
-assert (dp);
-
-dictAppendWord(dp, "outb",  ficlOutb,   FW_DEFAULT);
-dictAppendWord(dp, "inb",   ficlInb,FW_DEFAULT);
-}
-

svn commit: r354226 - stable/12/lib/libsecureboot

2019-10-31 Thread Simon J. Gerraty
Author: sjg
Date: Thu Oct 31 20:29:45 2019
New Revision: 354226
URL: https://svnweb.freebsd.org/changeset/base/354226

Log:
  Initialize verbosity and debug level from env
  
  For EFI at least, we can seed the environment
  with VE_VERBOSE etc.
  
  MFC of r354038
  
  Reviewed by:  stevek imp
  Sponsored by: Juniper Networks
  Differential Revision:  https://reviews.freebsd.org/D22135

Modified:
  stable/12/lib/libsecureboot/verify_file.c
  stable/12/lib/libsecureboot/vets.c

Modified: stable/12/lib/libsecureboot/verify_file.c
==
--- stable/12/lib/libsecureboot/verify_file.c   Thu Oct 31 16:03:43 2019
(r354225)
+++ stable/12/lib/libsecureboot/verify_file.c   Thu Oct 31 20:29:45 2019
(r354226)
@@ -292,6 +292,28 @@ verify_tweak(int fd, off_t off, struct stat *stp,
}
 }
 
+#ifndef VE_DEBUG_LEVEL
+# define VE_DEBUG_LEVEL 0
+#endif
+
+static int
+getenv_int(const char *var, int def)
+{
+   const char *cp;
+   char *ep;
+   long val;
+
+   val = def;
+   cp = getenv(var);
+   if (cp && *cp) {
+   val = strtol(cp, , 0);
+   if ((ep && *ep) || val != (int)val) {
+   val = def;
+   }
+   }
+   return (int)val;
+}
+
 /**
  * @brief verify an open file
  *
@@ -331,9 +353,8 @@ verify_file(int fd, const char *filename, off_t off, i
 
if (verifying < 0) {
verifying = ve_trust_init();
-#ifdef VE_DEBUG_LEVEL
-   ve_debug_set(VE_DEBUG_LEVEL);
-#endif
+   verbose = getenv_int("VE_VERBOSE", VE_VERBOSE_DEFAULT);
+   ve_debug_set(getenv_int("VE_DEBUG_LEVEL", VE_DEBUG_LEVEL));
/* initialize ve_status with default result */
rc = verifying ? VE_NOT_CHECKED : VE_NOT_VERIFYING;
ve_status_set(0, rc);

Modified: stable/12/lib/libsecureboot/vets.c
==
--- stable/12/lib/libsecureboot/vets.c  Thu Oct 31 16:03:43 2019
(r354225)
+++ stable/12/lib/libsecureboot/vets.c  Thu Oct 31 20:29:45 2019
(r354226)
@@ -240,7 +240,7 @@ ve_forbidden_digest_add(hash_data *digest, size_t num)
 
 static size_t
 ve_anchors_add(br_x509_certificate *xcs, size_t num, anchor_list *anchors,
-char *anchors_name)
+const char *anchors_name)
 {
br_x509_trust_anchor ta;
size_t u;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354138 - in head: . tools/build

2019-10-28 Thread Simon J. Gerraty
Author: sjg
Date: Mon Oct 28 20:45:29 2019
New Revision: 354138
URL: https://svnweb.freebsd.org/changeset/base/354138

Log:
  Building head on stable/11 requires libzstd
  
  Add lib/libzstd to _elftoolchain_libs
  
  tools/build/Makefile needs to create the install dir for libzstd
  Since this would make the line too long, rework to use a list
  in one per line format (easier to add in future)
  and dispense with the .for loop
  
  Reviewed by:  emaste bapt
  Differential Revision:https://reviews.freebsd.org/D220134

Modified:
  head/Makefile.inc1
  head/tools/build/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Oct 28 19:00:27 2019(r354137)
+++ head/Makefile.inc1  Mon Oct 28 20:45:29 2019(r354138)
@@ -1697,7 +1697,7 @@ buildkernel: .MAKE .PHONY
@echo "--"
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
@echo "--"
-   
+
 .endfor
@seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
  echo -n ">>> Kernel(s) ${BUILDKERNELS} built in $$seconds seconds, "; 
\
@@ -2159,7 +2159,7 @@ _bootstrap_tools_links+=m4 lex
 # r339083 libelf: correct mips64el test to use ELF header
 # r348347 Add missing powerpc64 relocation support to libdwarf
 .if ${BOOTSTRAPPING} < 1300030
-_elftoolchain_libs= lib/libelf lib/libdwarf
+_elftoolchain_libs= lib/libelf lib/libdwarf lib/libzstd
 ${_bt}-lib/libelf: ${_bt_m4_depend}
 ${_bt}-lib/libdwarf: ${_bt_m4_depend}
 .endif
@@ -2360,7 +2360,6 @@ ${_bt}-link-${_tool}: .PHONY .MAKE
fi
 ${_bt}-links: ${_bt}-link-${_tool}
 .endfor
-
 
 bootstrap-tools: ${_bt}-links .PHONY
 

Modified: head/tools/build/Makefile
==
--- head/tools/build/Makefile   Mon Oct 28 19:00:27 2019(r354137)
+++ head/tools/build/Makefile   Mon Oct 28 20:45:29 2019(r354138)
@@ -120,10 +120,17 @@ host-symlinks:
 # Create all the directories that are needed during the legacy, bootstrap-tools
 # and cross-tools stages. We do this here using mkdir since mtree may not exist
 # yet (this happens if we are crossbuilding from Linux/Mac).
+INSTALLDIR_LIST= \
+   bin \
+   lib/casper \
+   lib/geom \
+   usr/include/casper \
+   usr/include/private/zstd \
+   usr/lib \
+
 installdirs:
-.for _dir in bin usr/lib usr/include usr/include/casper lib/geom lib/casper
-   mkdir -p "${DESTDIR}/${_dir}"
-.endfor
+   mkdir -p ${INSTALLDIR_LIST:S,^,${DESTDIR}/,}
+
 # Link usr/bin, sbin, and usr/sbin to bin so that it doesn't matter whether a
 # bootstrap tool was added to WORLTMP with a symlink or by building it in the
 # bootstrap-tools phase. We could also overrride BINDIR when building bootstrap
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354055 - head/stand/efi/loader

2019-10-24 Thread Simon J. Gerraty
Author: sjg
Date: Thu Oct 24 22:26:06 2019
New Revision: 354055
URL: https://svnweb.freebsd.org/changeset/base/354055

Log:
  Guard reference to x86_hypervisor
  
  Obviously we only want x86_hypervisor on x86
  Guard reference to x86_hypervisor
  
  Obviously we only want x86_hypervisor on x86

Modified:
  head/stand/efi/loader/main.c

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cThu Oct 24 22:23:53 2019
(r354054)
+++ head/stand/efi/loader/main.cThu Oct 24 22:26:06 2019
(r354055)
@@ -863,7 +863,9 @@ main(int argc, CHAR16 *argv[])
archsw.arch_getdev = efi_getdev;
archsw.arch_copyin = efi_copyin;
archsw.arch_copyout = efi_copyout;
+#ifdef __amd64__
archsw.arch_hypervisor = x86_hypervisor;
+#endif
archsw.arch_readin = efi_readin;
archsw.arch_zfs_probe = efi_zfs_probe;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354043 - in head/stand: . ficl ficl/amd64 ficl/i386 ficl/x86 i386/loader libsa libsa/x86

2019-10-24 Thread Simon J. Gerraty
Author: sjg
Date: Thu Oct 24 20:02:48 2019
New Revision: 354043
URL: https://svnweb.freebsd.org/changeset/base/354043

Log:
  Add support for hypervisor check on x86
  
  Add ficl words for isvirtualized
  and move ficl inb and outb words to ficl/x86/sysdep.c
  so can be shared by i386 and amd64
  
  Reviewed by:  imp bdrewery
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org/D22069

Added:
  head/stand/ficl/x86/
  head/stand/ficl/x86/sysdep.c   (contents, props changed)
  head/stand/libsa/x86/
  head/stand/libsa/x86/hypervisor.c   (contents, props changed)
Modified:
  head/stand/defs.mk
  head/stand/ficl/amd64/sysdep.c
  head/stand/ficl/i386/sysdep.c
  head/stand/ficl/loader.c
  head/stand/i386/loader/main.c
  head/stand/libsa/Makefile
  head/stand/libsa/stand.h

Modified: head/stand/defs.mk
==
--- head/stand/defs.mk  Thu Oct 24 20:00:37 2019(r354042)
+++ head/stand/defs.mk  Thu Oct 24 20:02:48 2019(r354043)
@@ -189,14 +189,15 @@ teken_state.h: ${SYSDIR}/teken/sequences
${SYSDIR}/teken/sequences > teken_state.h
 
 .if !defined(NO_OBJ)
-_ILINKS=machine
+_ILINKS=include/machine
 .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
-_ILINKS+=${MACHINE_CPUARCH}
+_ILINKS+=include/${MACHINE_CPUARCH}
 .endif
 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-_ILINKS+=x86
+_ILINKS+=include/x86
 .endif
-CLEANFILES+=${_ILINKS}
+CFLAGS+= -Iinclude
+CLEANDIRS+= include
 
 beforedepend: ${_ILINKS}
 beforebuild: ${_ILINKS}
@@ -211,8 +212,8 @@ ${OBJS}:   ${_link}
 
 .NOPATH: ${_ILINKS}
 
-${_ILINKS}:
-   @case ${.TARGET} in \
+${_ILINKS}: .NOMETA
+   @case ${.TARGET:T} in \
machine) \
if [ ${DO32:U0} -eq 0 ]; then \
path=${SYSDIR}/${MACHINE}/include ; \
@@ -222,8 +223,11 @@ ${_ILINKS}:
*) \
path=${SYSDIR}/${.TARGET:T}/include ;; \
esac ; \
+   case ${.TARGET} in \
+   */*) mkdir -p ${.TARGET:H};; \
+   esac ; \
path=`(cd $$path && /bin/pwd)` ; \
-   ${ECHO} ${.TARGET:T} "->" $$path ; \
-   ln -fhs $$path ${.TARGET:T}
+   ${ECHO} ${.TARGET} "->" $$path ; \
+   ln -fhs $$path ${.TARGET}
 .endif # !NO_OBJ
 .endif # __BOOT_DEFS_MK__

Modified: head/stand/ficl/amd64/sysdep.c
==
--- head/stand/ficl/amd64/sysdep.c  Thu Oct 24 20:00:37 2019
(r354042)
+++ head/stand/ficl/amd64/sysdep.c  Thu Oct 24 20:02:48 2019
(r354043)
@@ -17,6 +17,8 @@
 #endif
 #include "ficl.h"
 
+#include "../x86/sysdep.c"
+
 /*
 ***  FreeBSD  P O R T   B E G I N S   H E R E 
 Michael Smith
 */

Modified: head/stand/ficl/i386/sysdep.c
==
--- head/stand/ficl/i386/sysdep.c   Thu Oct 24 20:00:37 2019
(r354042)
+++ head/stand/ficl/i386/sysdep.c   Thu Oct 24 20:02:48 2019
(r354043)
@@ -14,12 +14,11 @@
 #include 
 #else
 #include 
-#ifdef __i386__
-#include 
 #endif
-#endif
 #include "ficl.h"
 
+#include "../x86/sysdep.c"
+
 /*
 ***  FreeBSD  P O R T   B E G I N S   H E R E 
 Michael Smith
 */
@@ -80,53 +79,6 @@ void  ficlFree   (void *p)
 free(p);
 }
 
-#ifndef TESTMAIN
-/* 
- * outb ( port# c -- )
- * Store a byte to I/O port number port#
- */
-void
-ficlOutb(FICL_VM *pVM)
-{
-   u_char c;
-   uint32_t port;
-
-   port=stackPopUNS(pVM->pStack);
-   c=(u_char)stackPopINT(pVM->pStack);
-   outb(port,c);
-}
-
-/*
- * inb ( port# -- c )
- * Fetch a byte from I/O port number port#
- */
-void
-ficlInb(FICL_VM *pVM)
-{
-   u_char c;
-   uint32_t port;
-
-   port=stackPopUNS(pVM->pStack);
-   c=inb(port);
-   stackPushINT(pVM->pStack,c);
-}
-
-/*
- * Glue function to add the appropriate forth words to access x86 special cpu
- * functionality.
- */
-static void ficlCompileCpufunc(FICL_SYSTEM *pSys)
-{
-FICL_DICT *dp = pSys->dp;
-assert (dp);
-
-dictAppendWord(dp, "outb",  ficlOutb,   FW_DEFAULT);
-dictAppendWord(dp, "inb",   ficlInb,FW_DEFAULT);
-}
-
-FICL_COMPILE_SET(ficlCompileCpufunc);
-
-#endif
 
 /*
 ** Stub function for dictionary access control - does nothing

Modified: head/stand/ficl/loader.c
==
--- head/stand/ficl/loader.cThu Oct 24 20:00:37 2019(r354042)
+++ head/stand/ficl/loader.cThu Oct 24 20:02:48 2019(r354043)
@@ -287,6 +287,32 @@ ficlFindfile(FICL_VM *pVM)
return;
 }
 
+#ifndef TESTMAIN
+
+/* isvirtualized? - Return whether the loader runs under a
+ * hypervisor.
+ *
+ * isvirtualized? ( -- flag )
+ */
+static void
+ficlIsvirtualizedQ(FICL_VM *pVM)
+{
+

svn commit: r354039 - head/stand/efi/loader

2019-10-24 Thread Simon J. Gerraty
Author: sjg
Date: Thu Oct 24 19:52:41 2019
New Revision: 354039
URL: https://svnweb.freebsd.org/changeset/base/354039

Log:
  Allow loader.efi to identify non-standard boot setup
  
  PATH_BOOTABLE_TOKEN can be set to a non-standard
  path that identifies a device as bootable.
  
  Reviewed by: kevans, bcran
  Differential Revision:  https://reviews.freebsd.org/D22062

Modified:
  head/stand/efi/loader/main.c

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cThu Oct 24 19:50:18 2019
(r354038)
+++ head/stand/efi/loader/main.cThu Oct 24 19:52:41 2019
(r354039)
@@ -863,6 +863,7 @@ main(int argc, CHAR16 *argv[])
archsw.arch_getdev = efi_getdev;
archsw.arch_copyin = efi_copyin;
archsw.arch_copyout = efi_copyout;
+   archsw.arch_hypervisor = x86_hypervisor;
archsw.arch_readin = efi_readin;
archsw.arch_zfs_probe = efi_zfs_probe;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354038 - head/lib/libsecureboot

2019-10-24 Thread Simon J. Gerraty
Author: sjg
Date: Thu Oct 24 19:50:18 2019
New Revision: 354038
URL: https://svnweb.freebsd.org/changeset/base/354038

Log:
  Initialize verbosity and debug level from env
  
  For EFI at least, we can seed the environment
  with VE_VERBOSE etc.
  
  Reviewed by:  stevek imp
  Sponsored by: Juniper Networks
  MFC after:1 week
  Differential Revision:  https://reviews.freebsd.org/D22135

Modified:
  head/lib/libsecureboot/verify_file.c
  head/lib/libsecureboot/vets.c

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cThu Oct 24 19:47:32 2019
(r354037)
+++ head/lib/libsecureboot/verify_file.cThu Oct 24 19:50:18 2019
(r354038)
@@ -292,6 +292,28 @@ verify_tweak(int fd, off_t off, struct stat *stp,
}
 }
 
+#ifndef VE_DEBUG_LEVEL
+# define VE_DEBUG_LEVEL 0
+#endif
+
+static int
+getenv_int(const char *var, int def)
+{
+   const char *cp;
+   char *ep;
+   long val;
+
+   val = def;
+   cp = getenv(var);
+   if (cp && *cp) {
+   val = strtol(cp, , 0);
+   if ((ep && *ep) || val != (int)val) {
+   val = def;
+   }
+   }
+   return (int)val;
+}
+
 /**
  * @brief verify an open file
  *
@@ -331,9 +353,8 @@ verify_file(int fd, const char *filename, off_t off, i
 
if (verifying < 0) {
verifying = ve_trust_init();
-#ifdef VE_DEBUG_LEVEL
-   ve_debug_set(VE_DEBUG_LEVEL);
-#endif
+   verbose = getenv_int("VE_VERBOSE", VE_VERBOSE_DEFAULT);
+   ve_debug_set(getenv_int("VE_DEBUG_LEVEL", VE_DEBUG_LEVEL));
/* initialize ve_status with default result */
rc = verifying ? VE_NOT_CHECKED : VE_NOT_VERIFYING;
ve_status_set(0, rc);

Modified: head/lib/libsecureboot/vets.c
==
--- head/lib/libsecureboot/vets.c   Thu Oct 24 19:47:32 2019
(r354037)
+++ head/lib/libsecureboot/vets.c   Thu Oct 24 19:50:18 2019
(r354038)
@@ -240,7 +240,7 @@ ve_forbidden_digest_add(hash_data *digest, size_t num)
 
 static size_t
 ve_anchors_add(br_x509_certificate *xcs, size_t num, anchor_list *anchors,
-char *anchors_name)
+const char *anchors_name)
 {
br_x509_trust_anchor ta;
size_t u;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r353697 - head/stand/efi/loader

2019-10-17 Thread Simon J. Gerraty
Author: sjg
Date: Thu Oct 17 20:40:06 2019
New Revision: 353697
URL: https://svnweb.freebsd.org/changeset/base/353697

Log:
  Allow loader.efi to identify non-standard boot setup
  
  PATH_BOOTABLE_TOKEN can be set to a non-standard
  path that identifies a device as bootable.
  
  Reviewed by: kevans, bcran
  Differential Revision:  https://reviews.freebsd.org/D22062

Modified:
  head/stand/efi/loader/main.c

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cThu Oct 17 20:25:15 2019
(r353696)
+++ head/stand/efi/loader/main.cThu Oct 17 20:40:06 2019
(r353697)
@@ -239,6 +239,9 @@ sanity_check_currdev(void)
struct stat st;
 
return (stat(PATH_DEFAULTS_LOADER_CONF, ) == 0 ||
+#ifdef PATH_BOOTABLE_TOKEN
+   stat(PATH_BOOTABLE_TOKEN, ) == 0 || /* non-standard layout */
+#endif
stat(PATH_KERNEL, ) == 0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r353322 - stable/12/share/mk

2019-10-08 Thread Simon J. Gerraty
Author: sjg
Date: Tue Oct  8 20:14:33 2019
New Revision: 353322
URL: https://svnweb.freebsd.org/changeset/base/353322

Log:
  Need to use ${${_${group}DIR_${file}}} for STAGE_DIR
  
  STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g} was getting
  ${STAGE_OBJTOP}BINDIR rather than
  ${STAGE_OBJTOP}${BINDIR} when FILESDIR=BINDIR
  
  MFC of r352942
  
  Reviewed by:  stevek
  Differential Revision:https://reviews.freebsd.org/D21858

Modified:
  stable/12/share/mk/bsd.files.mk

Modified: stable/12/share/mk/bsd.files.mk
==
--- stable/12/share/mk/bsd.files.mk Tue Oct  8 19:49:25 2019
(r353321)
+++ stable/12/share/mk/bsd.files.mk Tue Oct  8 20:14:33 2019
(r353322)
@@ -105,7 +105,7 @@ STAGE_AS_${file}= ${${group}NAME_${file}}
 # we need to expand ${group}DIR_${file} and replace
 # all '/' and '*' with '_' to make a safe target name.
 STAGE_AS_SETS+=${${_${group}DIR_${file}}:C,[/*],_,g}
-STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${group}DIR_${file}}
+STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${_${group}DIR_${file}}}
 stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352942 - head/share/mk

2019-10-01 Thread Simon J. Gerraty
Author: sjg
Date: Tue Oct  1 20:32:03 2019
New Revision: 352942
URL: https://svnweb.freebsd.org/changeset/base/352942

Log:
  Need to use ${${_${group}DIR_${file}}} for STAGE_DIR
  
  STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g} was getting
  ${STAGE_OBJTOP}BINDIR rather than
  ${STAGE_OBJTOP}${BINDIR} when FILESDIR=BINDIR
  
  Reviewed by:  stevek
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D21858

Modified:
  head/share/mk/bsd.files.mk

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Tue Oct  1 20:22:54 2019(r352941)
+++ head/share/mk/bsd.files.mk  Tue Oct  1 20:32:03 2019(r352942)
@@ -109,7 +109,7 @@ STAGE_AS_${file}= ${${group}NAME_${file}}
 # we need to expand ${group}DIR_${file} and replace
 # all '/' and '*' with '_' to make a safe target name.
 STAGE_AS_SETS+=${${_${group}DIR_${file}}:C,[/*],_,g}
-STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${group}DIR_${file}}
+STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${_${group}DIR_${file}}}
 stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352782 - stable/12/share/mk

2019-09-26 Thread Simon J. Gerraty
Author: sjg
Date: Fri Sep 27 00:11:09 2019
New Revision: 352782
URL: https://svnweb.freebsd.org/changeset/base/352782

Log:
  Document logic for __DEFAULT_DEPENDENT_OPTIONS
  
  MFC of r352370
  
  Reviewed by:  stevek
  Differential Revision:https://reviews.freebsd.org/D21640

Modified:
  stable/12/share/mk/bsd.mkopt.mk

Modified: stable/12/share/mk/bsd.mkopt.mk
==
--- stable/12/share/mk/bsd.mkopt.mk Fri Sep 27 00:08:40 2019
(r352781)
+++ stable/12/share/mk/bsd.mkopt.mk Fri Sep 27 00:11:09 2019
(r352782)
@@ -11,12 +11,16 @@
 # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no",
 # unless WITH_FOO is defined, in which case it is set to "yes".
 #
+# For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS,
+# MK_FOO is set to "no" if WITHOUT_FOO is defined,
+# "yes" if WITH_FOO is defined, otherwise the value of MK_BAR.
+#
 # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
 # MK_FOO is set to "no" regardless of which list it was in.
 #
-# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd
-# after all this processing, allowing this file to be included
-# multiple times with different lists.
+# All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and
+# __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing,
+# allowing this file to be included multiple times with different lists.
 #
 # Other parts of the build system will set BROKEN_OPTIONS to a list
 # of options that are broken on this platform. This will not be unset
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352781 - stable/12/share/mk

2019-09-26 Thread Simon J. Gerraty
Author: sjg
Date: Fri Sep 27 00:08:40 2019
New Revision: 352781
URL: https://svnweb.freebsd.org/changeset/base/352781

Log:
  Use .undef per variable
  
  Attempting to expand a variable to a list of vars to .undef
  does not actually work.
  
  MFC of r343066
  
  Reviewed by:  bdrewery
  Differential Revision:D17251

Modified:
  stable/12/share/mk/dirdeps-options.mk

Modified: stable/12/share/mk/dirdeps-options.mk
==
--- stable/12/share/mk/dirdeps-options.mk   Fri Sep 27 00:00:21 2019
(r352780)
+++ stable/12/share/mk/dirdeps-options.mk   Fri Sep 27 00:08:40 2019
(r352781)
@@ -1,5 +1,5 @@
 # $FreeBSD$
-# $Id: dirdeps-options.mk,v 1.8 2018/05/29 22:31:21 sjg Exp $
+# $Id: dirdeps-options.mk,v 1.9 2018/09/20 00:07:19 sjg Exp $
 #
 #  @(#) Copyright (c) 2018, Simon J. Gerraty
 #
@@ -54,7 +54,8 @@ DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U}
 DIRDEPS := ${DIRDEPS:O:u}
 # avoid cross contamination
 .for o in ${DIRDEPS_OPTIONS:tu}
-.undef DIRDEPS.$o.yes DIRDEPS.$o.no
+.undef DIRDEPS.$o.yes
+.undef DIRDEPS.$o.no
 .endfor
 .else
 # whether options are enabled or not,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352370 - head/share/mk

2019-09-15 Thread Simon J. Gerraty
Author: sjg
Date: Mon Sep 16 00:32:23 2019
New Revision: 352370
URL: https://svnweb.freebsd.org/changeset/base/352370

Log:
  Document logic for __DEFAULT_DEPENDENT_OPTIONS
  
  Reviewed by:  stevek
  Differential Revision:https://reviews.freebsd.org/D21640

Modified:
  head/share/mk/bsd.mkopt.mk

Modified: head/share/mk/bsd.mkopt.mk
==
--- head/share/mk/bsd.mkopt.mk  Sun Sep 15 23:56:39 2019(r352369)
+++ head/share/mk/bsd.mkopt.mk  Mon Sep 16 00:32:23 2019(r352370)
@@ -11,12 +11,16 @@
 # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no",
 # unless WITH_FOO is defined, in which case it is set to "yes".
 #
+# For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS,
+# MK_FOO is set to "no" if WITHOUT_FOO is defined,
+# "yes" if WITH_FOO is defined, otherwise the value of MK_BAR.
+#
 # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
 # MK_FOO is set to "no" regardless of which list it was in.
 #
-# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd
-# after all this processing, allowing this file to be included
-# multiple times with different lists.
+# All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and
+# __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing,
+# allowing this file to be included multiple times with different lists.
 #
 # Other parts of the build system will set BROKEN_OPTIONS to a list
 # of options that are broken on this platform. This will not be unset
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r352273 - stable/12/share/mk

2019-09-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Sep 13 05:54:09 2019
New Revision: 352273
URL: https://svnweb.freebsd.org/changeset/base/352273

Log:
  Use file destdir for stage_as sets
  
  We cannot use file (without :T) to name targets
  but we can use the destination directory (with / replaced by _)
  This has the benefit of minimizing the targets created.
  
  MFC r351954
  
  Reviewed by:  bdrewery
  Differential Revision:https://reviews.freebsd.org//D21283

Modified:
  stable/12/share/mk/bsd.files.mk

Modified: stable/12/share/mk/bsd.files.mk
==
--- stable/12/share/mk/bsd.files.mk Fri Sep 13 01:14:58 2019
(r352272)
+++ stable/12/share/mk/bsd.files.mk Fri Sep 13 05:54:09 2019
(r352273)
@@ -37,7 +37,6 @@ ${group}GRP=  ${SHAREGRP}
 ${group}MODE?= ${SHAREMODE}
 ${group}DIR?=  BINDIR
 STAGE_SETS+=   ${group:C,[/*],_,g}
-STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR}
 
 .if defined(NO_ROOT)
 .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*}
@@ -57,6 +56,7 @@ DIRS+=${group}DIR
 _${group}DIR=  ${group}DIR
 .endif
 
+STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}}
 
 .for file in ${${group}}
 ${group}OWN_${file}?=  ${${group}OWN}
@@ -97,11 +97,16 @@ ${group}NAME_${file}?=  ${${group}NAME}
 .else
 ${group}NAME_${file}?= ${file:T}
 .endif # defined(${group}NAME)
-STAGE_AS_SETS+=${file}
 STAGE_AS_${file}= ${${group}NAME_${file}}
-# XXX {group}OWN,GRP,MODE
-STAGE_DIR.${file}= ${STAGE_OBJTOP}${${group}DIR_${file}}
-stage_as.${file}: ${file}
+# we cannot use file safely as a set name
+# since we cannot? apply :T
+# but we can use the ${group}DIR_${file}
+# as a set - meta.stage.mk will :O:u for us
+# we need to expand ${group}DIR_${file} and replace
+# all '/' and '*' with '_' to make a safe target name.
+STAGE_AS_SETS+=${${_${group}DIR_${file}}:C,[/*],_,g}
+STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${group}DIR_${file}}
+stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
 _${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file}
@@ -118,12 +123,16 @@ realinstall: installfiles
 .ORDER: beforeinstall installfiles
 
 .if ${MK_STAGING} != "no"
+.if ${FILESGROUPS:@g@${$g}@} != ""
 .if !empty(STAGE_SETS)
 buildfiles: stage_files
 STAGE_TARGETS+= stage_files
+stage_files:
 .if !empty(STAGE_AS_SETS)
 buildfiles: stage_as
 STAGE_TARGETS+= stage_as
+stage_as:
+.endif
 .endif
 .endif
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351954 - head/share/mk

2019-09-06 Thread Simon J. Gerraty
Author: sjg
Date: Fri Sep  6 19:05:01 2019
New Revision: 351954
URL: https://svnweb.freebsd.org/changeset/base/351954

Log:
  Use file destdir for stage_as sets
  
  We cannot use file (without :T) to name targets
  but we can use the destination directory (with / replaced by _)
  This has the benefit of minimizing the targets created.
  
  Reviewed by:  bdrewery
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org//D21283

Modified:
  head/share/mk/bsd.files.mk

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Fri Sep  6 18:51:41 2019(r351953)
+++ head/share/mk/bsd.files.mk  Fri Sep  6 19:05:01 2019(r351954)
@@ -101,11 +101,16 @@ ${group}NAME_${file}?=${${group}NAME}
 .else
 ${group}NAME_${file}?= ${file:T}
 .endif # defined(${group}NAME)
-STAGE_AS_SETS+=${file}
 STAGE_AS_${file}= ${${group}NAME_${file}}
-# XXX {group}OWN,GRP,MODE
-STAGE_DIR.${file}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}}
-stage_as.${file}: ${file}
+# we cannot use file safely as a set name
+# since we cannot? apply :T
+# but we can use the ${group}DIR_${file}
+# as a set - meta.stage.mk will :O:u for us
+# we need to expand ${group}DIR_${file} and replace
+# all '/' and '*' with '_' to make a safe target name.
+STAGE_AS_SETS+=${${_${group}DIR_${file}}:C,[/*],_,g}
+STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${group}DIR_${file}}
+stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
 _${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file}
@@ -122,12 +127,16 @@ realinstall: installfiles
 .ORDER: beforeinstall installfiles
 
 .if ${MK_STAGING} != "no"
+.if ${FILESGROUPS:@g@${$g}@} != ""
 .if !empty(STAGE_SETS)
 buildfiles: stage_files
 STAGE_TARGETS+= stage_files
+stage_files:
 .if !empty(STAGE_AS_SETS)
 buildfiles: stage_as
 STAGE_TARGETS+= stage_as
+stage_as:
+.endif
 .endif
 .endif
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346604 - in head/lib/libsecureboot: . h

2019-09-03 Thread Simon J. Gerraty
Author: sjg
Date: Tue Apr 23 20:25:25 2019
New Revision: 346604
URL: https://svnweb.freebsd.org/changeset/base/346604

Log:
  Allow no_hash to appear in manifest.
  
  sbin/veriexec will ignore entries that have no hash anyway,
  but loader needs to be explicitly told that such files are
  ok to ignore (not verify).
  
  We will report as Unverified depending on verbose level,
  but with no reason - because we are not rejecting the file.
  
  Reviewed by: imp, mindal_semihalf
  Sponsored by:   Juniper Networks
  MFC After: 1 week
  Differential Revision: https://reviews.freebsd.org//D20018

Modified:
  head/lib/libsecureboot/h/libsecureboot.h
  head/lib/libsecureboot/vectx.c
  head/lib/libsecureboot/veopen.c
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/h/libsecureboot.h
==
--- head/lib/libsecureboot/h/libsecureboot.hTue Apr 23 18:10:46 2019
(r346603)
+++ head/lib/libsecureboot/h/libsecureboot.hTue Apr 23 20:25:25 2019
(r346604)
@@ -86,6 +86,7 @@ ssize_t ve_pcr_get(unsigned char *, size_t);
 #define VEF_VERBOSE1
 
 #define VE_FINGERPRINT_OK  1
+#define VE_FINGERPRINT_IGNORE  2
 /* errors from verify_fd */
 #define VE_FINGERPRINT_NONE-2
 #define VE_FINGERPRINT_WRONG   -3

Modified: head/lib/libsecureboot/vectx.c
==
--- head/lib/libsecureboot/vectx.c  Tue Apr 23 18:10:46 2019
(r346603)
+++ head/lib/libsecureboot/vectx.c  Tue Apr 23 20:25:25 2019
(r346604)
@@ -120,7 +120,10 @@ vectx_open(int fd, const char *path, off_t off, struct
ctx->vec_status = VE_FINGERPRINT_NONE;
ve_error_set("%s: no entry", path);
} else {
-   if (strncmp(cp, "sha256=", 7) == 0) {
+   if (strncmp(cp, "no_hash", 7) == 0) {
+   ctx->vec_status = VE_FINGERPRINT_IGNORE;
+   hashsz = 0;
+   } else if (strncmp(cp, "sha256=", 7) == 0) {
ctx->vec_md = _sha256_vtable;
hashsz = br_sha256_SIZE;
cp += 7;
@@ -150,11 +153,13 @@ vectx_open(int fd, const char *path, off_t off, struct
*error = ctx->vec_status;
ctx->vec_hashsz = hashsz;
ctx->vec_want = cp;
-   ctx->vec_md->init(>vec_ctx.vtable);
+   if (hashsz > 0) {
+   ctx->vec_md->init(>vec_ctx.vtable);
 
-   if (hashsz > 0 && off > 0) {
-   lseek(fd, 0, SEEK_SET);
-   vectx_lseek(ctx, off, SEEK_SET);
+   if (off > 0) {
+   lseek(fd, 0, SEEK_SET);
+   vectx_lseek(ctx, off, SEEK_SET);
+   }
}
return (ctx);
 

Modified: head/lib/libsecureboot/veopen.c
==
--- head/lib/libsecureboot/veopen.c Tue Apr 23 18:10:46 2019
(r346603)
+++ head/lib/libsecureboot/veopen.c Tue Apr 23 20:25:25 2019
(r346604)
@@ -345,7 +345,9 @@ verify_fingerprint(int fd, const char *path, const cha
size_t hlen;
int n;
 
-   if (strncmp(cp, "sha256=", 7) == 0) {
+   if (strncmp(cp, "no_hash", 7) == 0) {
+   return (VE_FINGERPRINT_IGNORE);
+   } else if (strncmp(cp, "sha256=", 7) == 0) {
md = _sha256_vtable;
hlen = br_sha256_SIZE;
cp += 7;
@@ -423,6 +425,7 @@ verify_fd(int fd, const char *path, off_t off, struct 
rc = verify_fingerprint(fd, path, cp, off);
switch (rc) {
case VE_FINGERPRINT_OK:
+   case VE_FINGERPRINT_IGNORE:
case VE_FINGERPRINT_UNKNOWN:
return (rc);
default:

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cTue Apr 23 18:10:46 2019
(r346603)
+++ head/lib/libsecureboot/verify_file.cTue Apr 23 20:25:25 2019
(r346604)
@@ -343,10 +343,14 @@ verify_file(int fd, const char *filename, off_t off, i
if ((rc = verify_fd(fd, filename, off, )) >= 0) {
if (verbose || severity > VE_WANT) {
 #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0
-   printf("Verified %s %llu,%llu\n", filename,
+   printf("%serified %s %llu,%llu\n",
+   (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V",
+   filename,
(long long)st.st_dev, (long long)st.st_ino);
 #else
-   printf("Verified %s\n", filename);
+   printf("%serified %s\n",
+   (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V",
+   

Re: svn commit: r346145 - in stable/12: contrib/bearssl etc/mtree include lib lib/libbearssl lib/libsecureboot lib/libsecureboot/tests sbin sbin/veriexec share/mk stand stand/common stand/ficl stand/f

2019-09-03 Thread Simon J. Gerraty via svn-src-all
John Baldwin  wrote:
> > but would it not be more correct to just run makeman ?
> 
> Yes, I would just run makeman and commit the result.  Ideally you'd
> have included that in the original MFC even, but a followup commit
> is fine.  I don't think it's really useful to try to MFC the 344853
> change as-is.

Done.


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r346145 - in stable/12: contrib/bearssl etc/mtree include lib lib/libbearssl lib/libsecureboot lib/libsecureboot/tests sbin sbin/veriexec share/mk stand stand/common stand/ficl stand/f

2019-09-03 Thread Simon J. Gerraty via svn-src-all
Herbert J. Skuhra  wrote:

> On Fri, 12 Apr 2019 03:03:00 +0200, "Simon J. Gerraty" wrote:
> >   Also sbin/veriexec for mac_veriexec
> >   
> >   MFC r343281,344564-344568,344780,344784,345289,346070
> 
> Partly MFC r344853?

Once the semihalf guys MFC their bits, that should apply in toto
but would it not be more correct to just run makeman ?


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346169 - stable/12/share/man/man5

2019-09-03 Thread Simon J. Gerraty
Author: sjg
Date: Fri Apr 12 20:35:11 2019
New Revision: 346169
URL: https://svnweb.freebsd.org/changeset/base/346169

Log:
  Regenerate src.conf.5 for recent changes.

Modified:
  stable/12/share/man/man5/src.conf.5

Modified: stable/12/share/man/man5/src.conf.5
==
--- stable/12/share/man/man5/src.conf.5 Fri Apr 12 20:03:27 2019
(r346168)
+++ stable/12/share/man/man5/src.conf.5 Fri Apr 12 20:35:11 2019
(r346169)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd November 29, 2018
+.Dd April 12, 2019
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -137,6 +137,29 @@ This must be set in the environment, make command line
 .Pa /etc/src-env.conf ,
 not
 .Pa /etc/src.conf .
+.It Va WITH_BEARSSL
+Build the BearSSL library.
+.Pp
+BearSSL is a tiny SSL library suitable for embedded environments.
+For details see
+.Lk http://www.BearSSL.org/
+.Pp
+This library is currently only used to perform
+signature verification and related operations
+for Verified Exec and
+.Xr loader 8 .
+When set, these options are also in effect:
+.Pp
+.Bl -inset -compact
+.It Va WITH_LOADER_VERIEXEC
+(unless
+.Va WITHOUT_LOADER_VERIEXEC
+is set explicitly)
+.It Va WITH_VERIEXEC
+(unless
+.Va WITHOUT_VERIEXEC
+is set explicitly)
+.El
 .It Va WITHOUT_BHYVE
 Set to not build or install
 .Xr bhyve 8 ,
@@ -314,6 +337,8 @@ When set, it enforces these options:
 .It
 .Va WITHOUT_CTF
 .It
+.Va WITHOUT_LOADER_ZFS
+.It
 .Va WITHOUT_ZFS
 .El
 .It Va WITHOUT_CLANG
@@ -1066,7 +1091,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_LLVM_TARGET_AARCH64
 Set to build LLVM target support for AArch64.
 The
@@ -1074,7 +1099,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
 .It Va WITHOUT_LLVM_TARGET_ALL
 Set to only build the required LLVM target support.
 This option is preferred to specific target support options.
@@ -1140,7 +1165,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_LLVM_TARGET_MIPS
 Set to build LLVM target support for MIPS.
 The
@@ -1148,7 +1173,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
 .It Va WITHOUT_LLVM_TARGET_POWERPC
 Set to not build LLVM target support for PowerPC.
 The
@@ -1156,7 +1181,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_LLVM_TARGET_POWERPC
 Set to build LLVM target support for PowerPC.
 The
@@ -1164,7 +1189,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
 .It Va WITHOUT_LLVM_TARGET_SPARC
 Set to not build LLVM target support for SPARC.
 The
@@ -1172,7 +1197,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_LLVM_TARGET_SPARC
 Set to build LLVM target support for SPARC.
 The
@@ -1180,7 +1205,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 

svn commit: r346145 - in stable/12: contrib/bearssl etc/mtree include lib lib/libbearssl lib/libsecureboot lib/libsecureboot/tests sbin sbin/veriexec share/mk stand stand/common stand/ficl stand/fi...

2019-09-03 Thread Simon J. Gerraty
Author: sjg
Date: Fri Apr 12 01:03:00 2019
New Revision: 346145
URL: https://svnweb.freebsd.org/changeset/base/346145

Log:
  Add support for loader veriexec
  
  Also sbin/veriexec for mac_veriexec
  
  MFC r343281,344564-344568,344780,344784,345289,346070

Added:
  stable/12/contrib/bearssl/
 - copied from r344564, head/contrib/bearssl/
  stable/12/lib/libbearssl/
 - copied from r344564, head/lib/libbearssl/
  stable/12/lib/libsecureboot/
 - copied from r344565, head/lib/libsecureboot/
  stable/12/sbin/veriexec/
 - copied from r344567, head/sbin/veriexec/
  stable/12/tools/build/options/WITH_BEARSSL
 - copied unchanged from r344566, head/tools/build/options/WITH_BEARSSL
  stable/12/tools/build/options/WITH_LOADER_VERIEXEC
 - copied unchanged from r344566, 
head/tools/build/options/WITH_LOADER_VERIEXEC
  stable/12/tools/build/options/WITH_VERIEXEC
 - copied unchanged from r344566, head/tools/build/options/WITH_VERIEXEC
Modified:
  stable/12/etc/mtree/BSD.include.dist
  stable/12/include/Makefile
  stable/12/lib/Makefile
  stable/12/lib/libsecureboot/Makefile.inc
  stable/12/lib/libsecureboot/tests/Makefile
  stable/12/lib/libsecureboot/verify_file.c
  stable/12/sbin/Makefile
  stable/12/share/mk/src.libnames.mk
  stable/12/share/mk/src.opts.mk
  stable/12/stand/common/boot.c
  stable/12/stand/common/bootstrap.h
  stable/12/stand/common/interp_forth.c
  stable/12/stand/common/interp_simple.c
  stable/12/stand/common/load_elf.c
  stable/12/stand/common/load_elf_obj.c
  stable/12/stand/common/module.c
  stable/12/stand/ficl/Makefile.depend
  stable/12/stand/ficl/ficl.h
  stable/12/stand/ficl/fileaccess.c
  stable/12/stand/ficl32/Makefile.depend
  stable/12/stand/i386/loader/Makefile.depend
  stable/12/stand/liblua/Makefile
  stable/12/stand/liblua/lstd.c
  stable/12/stand/libsa/Makefile
  stable/12/stand/libsa/Makefile.depend
  stable/12/stand/libsa32/Makefile.depend
  stable/12/stand/loader.mk
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/etc/mtree/BSD.include.dist
==
--- stable/12/etc/mtree/BSD.include.distFri Apr 12 00:53:30 2019
(r346144)
+++ stable/12/etc/mtree/BSD.include.distFri Apr 12 01:03:00 2019
(r346145)
@@ -160,6 +160,8 @@
 ..
 usb
 ..
+veriexec
+..
 vkbd
 ..
 wi
@@ -353,6 +355,8 @@
 mac_mls
 ..
 mac_partition
+..
+mac_veriexec
 ..
 ..
 ssp

Modified: stable/12/include/Makefile
==
--- stable/12/include/Makefile  Fri Apr 12 00:53:30 2019(r346144)
+++ stable/12/include/Makefile  Fri Apr 12 01:03:00 2019(r346145)
@@ -47,7 +47,7 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \
dev/hwpmc dev/hyperv \
dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \
dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
-   dev/speaker dev/tcp_log dev/vkbd dev/wi \
+   dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \
fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \
fs/procfs fs/smbfs fs/udf fs/unionfs \
geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
@@ -60,6 +60,7 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \
security/audit \
security/mac_biba security/mac_bsdextended security/mac_lomac \
security/mac_mls security/mac_partition \
+   security/mac_veriexec \
sys/disk \
ufs/ffs ufs/ufs
 
@@ -157,7 +158,7 @@ copies: .PHONY .META
done; \
fi
 .endfor
-.for i in ${LDIRS} 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci}
 ${LSUBSUBDIRS}
+.for i in ${LDIRS} 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci:Ndev/veriexec}
 ${LSUBSUBDIRS}
cd ${SRCTOP}/sys; \
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
${SDESTDIR}${INCLUDEDIR}/$i
@@ -196,6 +197,9 @@ copies: .PHONY .META
cd ${SRCTOP}/sys/dev/pci; \
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
${SDESTDIR}${INCLUDEDIR}/dev/pci
+   cd ${SRCTOP}/sys/dev/veriexec; \
+   ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 veriexec_ioctl.h \
+   ${SDESTDIR}${INCLUDEDIR}/dev/veriexec
cd ${SRCTOP}/sys/fs/cd9660/; \
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${SDESTDIR}${INCLUDEDIR}/isofs/cd9660
@@ -264,7 +268,7 @@ symlinks: .PHONY .META
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h 
${SDESTDIR}${INCLUDEDIR}/$i; \
done
 .endfor
-.for i in 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci}
+.for i in 

svn commit: r346070 - head/lib/libsecureboot

2019-09-03 Thread Simon J. Gerraty
Author: sjg
Date: Tue Apr  9 22:20:11 2019
New Revision: 346070
URL: https://svnweb.freebsd.org/changeset/base/346070

Log:
  Always report file with incorrect hash.

Modified:
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cTue Apr  9 22:15:39 2019
(r346069)
+++ head/lib/libsecureboot/verify_file.cTue Apr  9 22:20:11 2019
(r346070)
@@ -366,7 +366,7 @@ verify_file(int fd, const char *filename, off_t off, i
return (rc);
}
 
-   if (severity || verbose)
+   if (severity || verbose || rc == VE_FINGERPRINT_WRONG)
printf("Unverified: %s\n", ve_error_get());
if (rc == VE_FINGERPRINT_UNKNOWN && severity < VE_MUST)
rc = VE_UNVERIFIED_OK;


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346032 - in stable/11/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nandfs fs/nfsclient kern ufs/ufs

2019-09-03 Thread Simon J. Gerraty
Author: sjg
Date: Mon Apr  8 15:52:13 2019
New Revision: 346032
URL: https://svnweb.freebsd.org/changeset/base/346032

Log:
  Add _PC_ACL_* to vop_stdpathconf
  
  This avoid EINVAL from tmpfs etc.
  
  Merge of r345024
  
  Reviewed by:kib
  Differential Revision:  https://reviews.freebsd.org/D19512

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/11/sys/fs/nandfs/nandfs_vnops.c
  stable/11/sys/fs/nfsclient/nfs_clvnops.c
  stable/11/sys/kern/vfs_default.c
  stable/11/sys/ufs/ufs/ufs_vnops.c

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Mon Apr  8 15:20:05 2019(r346031)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Mon Apr  8 15:52:13 2019(r346032)
@@ -755,10 +755,6 @@ zfsctl_common_pathconf(ap)
*ap->a_retval = (int)SPA_MINBLOCKSIZE;
return (0);
 
-   case _PC_ACL_EXTENDED:
-   *ap->a_retval = 0;
-   return (0);
-
case _PC_ACL_NFS4:
*ap->a_retval = 1;
return (0);

Modified: stable/11/sys/fs/nandfs/nandfs_vnops.c
==
--- stable/11/sys/fs/nandfs/nandfs_vnops.c  Mon Apr  8 15:20:05 2019
(r346031)
+++ stable/11/sys/fs/nandfs/nandfs_vnops.c  Mon Apr  8 15:52:13 2019
(r346032)
@@ -2255,9 +2255,6 @@ nandfs_pathconf(struct vop_pathconf_args *ap)
case _PC_NO_TRUNC:
*ap->a_retval = 1;
break;
-   case _PC_ACL_EXTENDED:
-   *ap->a_retval = 0;
-   break;
case _PC_ALLOC_SIZE_MIN:
*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize;
break;

Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c
==
--- stable/11/sys/fs/nfsclient/nfs_clvnops.cMon Apr  8 15:20:05 2019
(r346031)
+++ stable/11/sys/fs/nfsclient/nfs_clvnops.cMon Apr  8 15:52:13 2019
(r346032)
@@ -3481,9 +3481,6 @@ nfs_pathconf(struct vop_pathconf_args *ap)
case _PC_NO_TRUNC:
*ap->a_retval = pc.pc_notrunc;
break;
-   case _PC_ACL_EXTENDED:
-   *ap->a_retval = 0;
-   break;
case _PC_ACL_NFS4:
if (NFS_ISV4(vp) && nfsrv_useacl != 0 && attrflag != 0 &&
NFSISSET_ATTRBIT(_suppattr, NFSATTRBIT_ACL))
@@ -3496,9 +3493,6 @@ nfs_pathconf(struct vop_pathconf_args *ap)
*ap->a_retval = ACL_MAX_ENTRIES;
else
*ap->a_retval = 3;
-   break;
-   case _PC_MAC_PRESENT:
-   *ap->a_retval = 0;
break;
case _PC_PRIO_IO:
*ap->a_retval = 0;

Modified: stable/11/sys/kern/vfs_default.c
==
--- stable/11/sys/kern/vfs_default.cMon Apr  8 15:20:05 2019
(r346031)
+++ stable/11/sys/kern/vfs_default.cMon Apr  8 15:52:13 2019
(r346032)
@@ -480,6 +480,13 @@ vop_stdpathconf(ap)
case _PC_PATH_MAX:
*ap->a_retval = PATH_MAX;
return (0);
+   case _PC_ACL_EXTENDED:
+   case _PC_ACL_NFS4:
+   case _PC_CAP_PRESENT:
+   case _PC_INF_PRESENT:
+   case _PC_MAC_PRESENT:
+   *ap->a_retval = 0;
+   return (0);
default:
return (EINVAL);
}

Modified: stable/11/sys/ufs/ufs/ufs_vnops.c
==
--- stable/11/sys/ufs/ufs/ufs_vnops.c   Mon Apr  8 15:20:05 2019
(r346031)
+++ stable/11/sys/ufs/ufs/ufs_vnops.c   Mon Apr  8 15:52:13 2019
(r346032)
@@ -2415,28 +2415,20 @@ ufs_pathconf(ap)
case _PC_NO_TRUNC:
*ap->a_retval = 1;
break;
-   case _PC_ACL_EXTENDED:
 #ifdef UFS_ACL
+   case _PC_ACL_EXTENDED:
if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS)
*ap->a_retval = 1;
else
*ap->a_retval = 0;
-#else
-   *ap->a_retval = 0;
-#endif
break;
-
case _PC_ACL_NFS4:
-#ifdef UFS_ACL
if (ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS)
*ap->a_retval = 1;
else
*ap->a_retval = 0;
-#else
-   *ap->a_retval = 0;
-#endif
break;
-
+#endif
case _PC_ACL_PATH_MAX:
 #ifdef UFS_ACL
if (ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS))
@@ -2447,16 

svn commit: r345972 - in stable/12/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nandfs fs/nfsclient kern ufs/ufs

2019-09-03 Thread Simon J. Gerraty
Author: sjg
Date: Fri Apr  5 23:34:46 2019
New Revision: 345972
URL: https://svnweb.freebsd.org/changeset/base/345972

Log:
  Add _PC_ACL_* to vop_stdpathconf
  
  This avoid EINVAL from tmpfs etc.
  
  Merge of r345024
  
  Reviewed by:kib
  Differential Revision:  https://reviews.freebsd.org/D19512

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/12/sys/fs/nandfs/nandfs_vnops.c
  stable/12/sys/fs/nfsclient/nfs_clvnops.c
  stable/12/sys/kern/vfs_default.c
  stable/12/sys/ufs/ufs/ufs_vnops.c

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Fri Apr  5 22:45:43 2019(r345971)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Fri Apr  5 23:34:46 2019(r345972)
@@ -755,10 +755,6 @@ zfsctl_common_pathconf(ap)
*ap->a_retval = (int)SPA_MINBLOCKSIZE;
return (0);
 
-   case _PC_ACL_EXTENDED:
-   *ap->a_retval = 0;
-   return (0);
-
case _PC_ACL_NFS4:
*ap->a_retval = 1;
return (0);

Modified: stable/12/sys/fs/nandfs/nandfs_vnops.c
==
--- stable/12/sys/fs/nandfs/nandfs_vnops.c  Fri Apr  5 22:45:43 2019
(r345971)
+++ stable/12/sys/fs/nandfs/nandfs_vnops.c  Fri Apr  5 23:34:46 2019
(r345972)
@@ -2258,9 +2258,6 @@ nandfs_pathconf(struct vop_pathconf_args *ap)
case _PC_NO_TRUNC:
*ap->a_retval = 1;
break;
-   case _PC_ACL_EXTENDED:
-   *ap->a_retval = 0;
-   break;
case _PC_ALLOC_SIZE_MIN:
*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize;
break;

Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c
==
--- stable/12/sys/fs/nfsclient/nfs_clvnops.cFri Apr  5 22:45:43 2019
(r345971)
+++ stable/12/sys/fs/nfsclient/nfs_clvnops.cFri Apr  5 23:34:46 2019
(r345972)
@@ -3485,9 +3485,6 @@ nfs_pathconf(struct vop_pathconf_args *ap)
case _PC_NO_TRUNC:
*ap->a_retval = pc.pc_notrunc;
break;
-   case _PC_ACL_EXTENDED:
-   *ap->a_retval = 0;
-   break;
case _PC_ACL_NFS4:
if (NFS_ISV4(vp) && nfsrv_useacl != 0 && attrflag != 0 &&
NFSISSET_ATTRBIT(_suppattr, NFSATTRBIT_ACL))
@@ -3500,9 +3497,6 @@ nfs_pathconf(struct vop_pathconf_args *ap)
*ap->a_retval = ACL_MAX_ENTRIES;
else
*ap->a_retval = 3;
-   break;
-   case _PC_MAC_PRESENT:
-   *ap->a_retval = 0;
break;
case _PC_PRIO_IO:
*ap->a_retval = 0;

Modified: stable/12/sys/kern/vfs_default.c
==
--- stable/12/sys/kern/vfs_default.cFri Apr  5 22:45:43 2019
(r345971)
+++ stable/12/sys/kern/vfs_default.cFri Apr  5 23:34:46 2019
(r345972)
@@ -482,6 +482,13 @@ vop_stdpathconf(ap)
case _PC_PATH_MAX:
*ap->a_retval = PATH_MAX;
return (0);
+   case _PC_ACL_EXTENDED:
+   case _PC_ACL_NFS4:
+   case _PC_CAP_PRESENT:
+   case _PC_INF_PRESENT:
+   case _PC_MAC_PRESENT:
+   *ap->a_retval = 0;
+   return (0);
default:
return (EINVAL);
}

Modified: stable/12/sys/ufs/ufs/ufs_vnops.c
==
--- stable/12/sys/ufs/ufs/ufs_vnops.c   Fri Apr  5 22:45:43 2019
(r345971)
+++ stable/12/sys/ufs/ufs/ufs_vnops.c   Fri Apr  5 23:34:46 2019
(r345972)
@@ -2421,28 +2421,20 @@ ufs_pathconf(ap)
case _PC_NO_TRUNC:
*ap->a_retval = 1;
break;
-   case _PC_ACL_EXTENDED:
 #ifdef UFS_ACL
+   case _PC_ACL_EXTENDED:
if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS)
*ap->a_retval = 1;
else
*ap->a_retval = 0;
-#else
-   *ap->a_retval = 0;
-#endif
break;
-
case _PC_ACL_NFS4:
-#ifdef UFS_ACL
if (ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS)
*ap->a_retval = 1;
else
*ap->a_retval = 0;
-#else
-   *ap->a_retval = 0;
-#endif
break;
-
+#endif
case _PC_ACL_PATH_MAX:
 #ifdef UFS_ACL
if (ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS))
@@ -2453,16 

svn commit: r351067 - head/share/mk

2019-08-15 Thread Simon J. Gerraty
Author: sjg
Date: Thu Aug 15 06:00:55 2019
New Revision: 351067
URL: https://svnweb.freebsd.org/changeset/base/351067

Log:
  Revert prior change till installworld sorted

Modified:
  head/share/mk/bsd.files.mk

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Thu Aug 15 04:47:42 2019(r351066)
+++ head/share/mk/bsd.files.mk  Thu Aug 15 06:00:55 2019(r351067)
@@ -101,11 +101,11 @@ STAGE_AS_SETS+=   ${file}
 STAGE_AS_${file}= ${${group}NAME_${file}}
 # XXX {group}OWN,GRP,MODE
 STAGE_DIR.${file}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}}
-stage_as.${file:T}: ${file}
+stage_as.${file}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
-_${group}INS1_${file:T}: installdirs-${_${group}DIR_${file}} 
_${group}INS_${file}
-_${group}INS_${file:T}: ${file}
+_${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file}
+_${group}INS_${file}: ${file}
${INSTALL} ${${group}TAG_ARGS} -o ${${group}OWN_${file}} \
-g ${${group}GRP_${file}} -m ${${group}MODE_${file}} \
${.ALLSRC} ${${group}PREFIX_${file}}/${${group}NAME_${file}}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r351055 - head/share/mk

2019-08-15 Thread Simon J. Gerraty via svn-src-all
O. Hartmann  wrote:
> This commit seems to break "make installworld" by this error during install:

Sorry, I'll revert if I cannot quickly spot the issue

> 
> [...]
> ===> share/doc (install)
> ===> share/doc/IPv6 (install)
> installing DIRS FILESDIR
> install  -d -m 0755 -o root  -g wheel  /usr/share/doc/IPv6
> install  -o root  -g wheel -m 444  /usr/src/share/doc/IPv6/IMPLEMENTATION
> /usr/share/doc/IPv6/IMPLEMENTATION ===> share/doc/legal (install)
> ===> share/doc/legal/intel_ipw (install)
> make[7]: don't know how to make
> _FILESINS1_/usr/src/sys/contrib/dev/ipw/LICENSE. Stop
> 
> make[7]: stopped in /usr/src/share/doc/legal/intel_ipw
> *** Error code 2
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r351055 - head/share/mk

2019-08-14 Thread Simon J. Gerraty
Author: sjg
Date: Wed Aug 14 22:33:46 2019
New Revision: 351055
URL: https://svnweb.freebsd.org/changeset/base/351055

Log:
  bsd.files.mk: fix targets to avoid directories
  
  Reintroduce :T when file is used as part of a target name.
  
  Reviewed by:  stevek

Modified:
  head/share/mk/bsd.files.mk

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Wed Aug 14 22:13:11 2019(r351054)
+++ head/share/mk/bsd.files.mk  Wed Aug 14 22:33:46 2019(r351055)
@@ -101,11 +101,11 @@ STAGE_AS_SETS+=   ${file}
 STAGE_AS_${file}= ${${group}NAME_${file}}
 # XXX {group}OWN,GRP,MODE
 STAGE_DIR.${file}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}}
-stage_as.${file}: ${file}
+stage_as.${file:T}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
-_${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file}
-_${group}INS_${file}: ${file}
+_${group}INS1_${file:T}: installdirs-${_${group}DIR_${file}} 
_${group}INS_${file}
+_${group}INS_${file:T}: ${file}
${INSTALL} ${${group}TAG_ARGS} -o ${${group}OWN_${file}} \
-g ${${group}GRP_${file}} -m ${${group}MODE_${file}} \
${.ALLSRC} ${${group}PREFIX_${file}}/${${group}NAME_${file}}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350312 - stable/12/stand/common

2019-07-24 Thread Simon J. Gerraty
Author: sjg
Date: Thu Jul 25 00:07:10 2019
New Revision: 350312
URL: https://svnweb.freebsd.org/changeset/base/350312

Log:
  loader: ignore some variable settings if input unverified
  
  libsecureboot can tell us if the most recent file opened was
  verfied or not.
  If it's state is VE_UNVERIFIED_OK, skip if variable
  matches one of the restricted prefixes.
  
  MFC of r350099
  
  Reviewed by:  stevek
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D20909

Modified:
  stable/12/stand/common/commands.c

Modified: stable/12/stand/common/commands.c
==
--- stable/12/stand/common/commands.c   Wed Jul 24 23:08:49 2019
(r350311)
+++ stable/12/stand/common/commands.c   Thu Jul 25 00:07:10 2019
(r350312)
@@ -304,6 +304,36 @@ command_set(int argc, char *argv[])
command_errmsg = "wrong number of arguments";
return (CMD_ERROR);
} else {
+#ifdef LOADER_VERIEXEC
+   /*
+* Impose restrictions if input is not verified
+*/
+   const char *restricted[] = {
+   "boot",
+   "init",
+   "loader.ve.",
+   "rootfs",
+   "secur",
+   "vfs.",
+   NULL,
+   };
+   const char **cp;
+   int ves;
+
+   ves = ve_status_get(-1);
+   if (ves == VE_UNVERIFIED_OK) {
+#ifdef LOADER_VERIEXEC_TESTING
+   printf("Checking: %s\n", argv[1]);
+#endif
+   for (cp = restricted; *cp; cp++) {
+   if (strncmp(argv[1], *cp, strlen(*cp)) == 0) {
+   printf("Ignoring restricted variable: 
%s\n",
+   argv[1]);
+   return (CMD_OK);
+   }
+   }
+   }
+#endif
if ((err = putenv(argv[1])) != 0) {
command_errmsg = strerror(err);
return (CMD_ERROR);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350099 - head/stand/common

2019-07-17 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul 17 23:33:14 2019
New Revision: 350099
URL: https://svnweb.freebsd.org/changeset/base/350099

Log:
  loader: ignore some variable settings if input unverified
  
  libsecureboot can tell us if the most recent file opened was
  verfied or not.
  If it's state is VE_UNVERIFIED_OK, skip if variable
  matches one of the restricted prefixes.
  
  Reviewed by:  stevek
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org//D20909

Modified:
  head/stand/common/commands.c

Modified: head/stand/common/commands.c
==
--- head/stand/common/commands.cWed Jul 17 23:09:40 2019
(r350098)
+++ head/stand/common/commands.cWed Jul 17 23:33:14 2019
(r350099)
@@ -304,6 +304,36 @@ command_set(int argc, char *argv[])
command_errmsg = "wrong number of arguments";
return (CMD_ERROR);
} else {
+#ifdef LOADER_VERIEXEC
+   /*
+* Impose restrictions if input is not verified
+*/
+   const char *restricted[] = {
+   "boot",
+   "init",
+   "loader.ve.",
+   "rootfs",
+   "secur",
+   "vfs.",
+   NULL,
+   };
+   const char **cp;
+   int ves;
+
+   ves = ve_status_get(-1);
+   if (ves == VE_UNVERIFIED_OK) {
+#ifdef LOADER_VERIEXEC_TESTING
+   printf("Checking: %s\n", argv[1]);
+#endif
+   for (cp = restricted; *cp; cp++) {
+   if (strncmp(argv[1], *cp, strlen(*cp)) == 0) {
+   printf("Ignoring restricted variable: 
%s\n",
+   argv[1]);
+   return (CMD_OK);
+   }
+   }
+   }
+#endif
if ((err = putenv(argv[1])) != 0) {
command_errmsg = strerror(err);
return (CMD_ERROR);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349924 - in head/lib/libsecureboot: . openpgp

2019-07-11 Thread Simon J. Gerraty
Author: sjg
Date: Thu Jul 11 22:06:59 2019
New Revision: 349924
URL: https://svnweb.freebsd.org/changeset/base/349924

Log:
  libsecureboot: avoid recusion in ve_trust_init
  
  set our guard value immediately.
  also replace call to ve_trust_init in opgp_sig.c:initialize with
  call to openpgp_trust_init.
  
  Reported by:  min...@semihalf.com
  Reviewed by:  jhibbits obrien
  MFC after:1 week

Modified:
  head/lib/libsecureboot/openpgp/opgp_sig.c
  head/lib/libsecureboot/vets.c

Modified: head/lib/libsecureboot/openpgp/opgp_sig.c
==
--- head/lib/libsecureboot/openpgp/opgp_sig.c   Thu Jul 11 20:52:39 2019
(r349923)
+++ head/lib/libsecureboot/openpgp/opgp_sig.c   Thu Jul 11 22:06:59 2019
(r349924)
@@ -67,9 +67,7 @@ __FBSDID("$FreeBSD$");
 void
 initialize (void)
 {
-#ifdef _STANDALONE
-ve_trust_init();
-#endif
+   openpgp_trust_init();
 }
 
 #else

Modified: head/lib/libsecureboot/vets.c
==
--- head/lib/libsecureboot/vets.c   Thu Jul 11 20:52:39 2019
(r349923)
+++ head/lib/libsecureboot/vets.c   Thu Jul 11 22:06:59 2019
(r349924)
@@ -345,7 +345,7 @@ ve_trust_init(void)
 
if (once >= 0)
return (once);
-
+   once = 0;   /* to be sure */
ve_utc_set(time(NULL));
 #ifdef BUILD_UTC
ve_utc_set(BUILD_UTC);  /* just in case */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349894 - in stable/12/lib/libsecureboot: . h openpgp

2019-07-10 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jul 10 21:35:55 2019
New Revision: 349894
URL: https://svnweb.freebsd.org/changeset/base/349894

Log:
  libsecureboot: allow OpenPGP support to be dormant
  
  Since we can now add OpenPGP trust anchors at runtime,
  ensure the latent support is available.
  
  Ensure we do not add duplicate keys to trust store.
  
  Also allow reporting names of trust anchors added/revoked
  
  We only do this for loader and only after initializing trust store.
  Thus only changes to initial trust store will be logged.
  
  MFC of r349446
  
  Reviewed by:stevek
  Differential Revision:  https://reviews.freebsd.org/D20700

Modified:
  stable/12/lib/libsecureboot/h/libsecureboot.h
  stable/12/lib/libsecureboot/libsecureboot-priv.h
  stable/12/lib/libsecureboot/local.trust.mk
  stable/12/lib/libsecureboot/openpgp/opgp_key.c
  stable/12/lib/libsecureboot/readfile.c
  stable/12/lib/libsecureboot/verify_file.c
  stable/12/lib/libsecureboot/vets.c

Modified: stable/12/lib/libsecureboot/h/libsecureboot.h
==
--- stable/12/lib/libsecureboot/h/libsecureboot.h   Wed Jul 10 20:40:39 
2019(r349893)
+++ stable/12/lib/libsecureboot/h/libsecureboot.h   Wed Jul 10 21:35:55 
2019(r349894)
@@ -42,6 +42,7 @@
 
 #include 
 
+unsigned char * read_fd(int, size_t);
 #ifndef NEED_BRSSL_H
 unsigned char * read_file(const char *, size_t *);
 #endif
@@ -51,8 +52,12 @@ extern int DebugVe;
 #define DEBUG_PRINTF(n, x) if (DebugVe >= n) printf x
 
 int ve_trust_init(void);
+size_t ve_trust_anchors_add_buf(unsigned char *, size_t);
+size_t ve_trust_anchors_revoke(unsigned char *, size_t);
 int ve_trust_add(const char *);
 void ve_debug_set(int);
+void ve_anchor_verbose_set(int);
+int ve_anchor_verbose_get(void);
 void ve_utc_set(time_t utc);
 char *ve_error_get(void);
 int ve_error_set(const char *, ...) __printflike(1,2);

Modified: stable/12/lib/libsecureboot/libsecureboot-priv.h
==
--- stable/12/lib/libsecureboot/libsecureboot-priv.hWed Jul 10 20:40:39 
2019(r349893)
+++ stable/12/lib/libsecureboot/libsecureboot-priv.hWed Jul 10 21:35:55 
2019(r349894)
@@ -56,6 +56,8 @@ int is_verified(struct stat *stp);
 void add_verify_status(struct stat *stp, int status);
 
 int openpgp_trust_init(void);
+int openpgp_trust_add_buf(unsigned char *, size_t);
+int openpgp_trust_revoke(const char *);
 int openpgp_self_tests(void);
 
 int efi_secure_boot_enabled(void);

Modified: stable/12/lib/libsecureboot/local.trust.mk
==
--- stable/12/lib/libsecureboot/local.trust.mk  Wed Jul 10 20:40:39 2019
(r349893)
+++ stable/12/lib/libsecureboot/local.trust.mk  Wed Jul 10 21:35:55 2019
(r349894)
@@ -33,6 +33,10 @@ VE_SIGNATURE_EXT_LIST+= \
sig
 .endif
 
+# add OpenPGP support - possibly dormant
+VE_SIGNATURE_LIST+= OPENPGP
+VE_SIGNATURE_EXT_LIST+= asc
+
 SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py
 
 .if exists(${SIGNER})
@@ -42,7 +46,12 @@ SIGN_ECDSA= ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${ECDS
 RSA2_PORT:= ${163%y:L:gmtime}
 SIGN_RSA2=   ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${RSA2_PORT} -h sha256
 
+# deal with quirk of our .esig format
+XCFLAGS.vets+= -DVE_ECDSA_HASH_AGAIN
+
 .if !empty(OPENPGP_SIGN_URL)
+XCFLAGS.opgp_key+= -DHAVE_TA_ASC_H
+
 VE_SIGNATURE_LIST+= OPENPGP
 VE_SIGNATURE_EXT_LIST+= asc
 

Modified: stable/12/lib/libsecureboot/openpgp/opgp_key.c
==
--- stable/12/lib/libsecureboot/openpgp/opgp_key.c  Wed Jul 10 20:40:39 
2019(r349893)
+++ stable/12/lib/libsecureboot/openpgp/opgp_key.c  Wed Jul 10 21:35:55 
2019(r349894)
@@ -209,13 +209,54 @@ openpgp_trust_add(OpenPGP_key *key)
 
LIST_INIT(_list);
}
-   if (key) {
-   DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id));
+   if (key && openpgp_trust_get(key->id) == NULL) {
+   if (ve_anchor_verbose_get())
+   printf("openpgp_trust_add(%s)\n", key->id);
LIST_INSERT_HEAD(_list, key, entries);
}
 }
 
 /**
+ * @brief add trust anchor from buf
+ */
+int
+openpgp_trust_add_buf(unsigned char *buf, size_t nbytes)
+{
+   OpenPGP_key *key;
+
+   if ((key = load_key_buf(buf, nbytes))) {
+   openpgp_trust_add(key);
+   }
+   return (key != NULL);
+}
+
+
+/**
+ * @brief if keyID is in our list clobber it
+ *
+ * @return true if keyID removed
+ */
+int
+openpgp_trust_revoke(const char *keyID)
+{
+   OpenPGP_key *key, *tkey;
+
+   openpgp_trust_add(NULL);/* initialize if needed */
+
+   LIST_FOREACH(key, _list, entries) {
+   if (strcmp(key->id, keyID) == 0) {
+   tkey = key;
+   

svn commit: r349446 - in head/lib/libsecureboot: . h openpgp

2019-06-26 Thread Simon J. Gerraty
Author: sjg
Date: Wed Jun 26 23:33:32 2019
New Revision: 349446
URL: https://svnweb.freebsd.org/changeset/base/349446

Log:
  libsecureboot: allow OpenPGP support to be dormant
  
  Since we can now add OpenPGP trust anchors at runtime,
  ensure the latent support is available.
  
  Ensure we do not add duplicate keys to trust store.
  
  Also allow reporting names of trust anchors added/revoked
  
  We only do this for loader and only after initializing trust store.
  Thus only changes to initial trust store will be logged.
  
  Reviewed by:  stevek
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D20700

Modified:
  head/lib/libsecureboot/h/libsecureboot.h
  head/lib/libsecureboot/libsecureboot-priv.h
  head/lib/libsecureboot/local.trust.mk
  head/lib/libsecureboot/openpgp/opgp_key.c
  head/lib/libsecureboot/readfile.c
  head/lib/libsecureboot/verify_file.c
  head/lib/libsecureboot/vets.c

Modified: head/lib/libsecureboot/h/libsecureboot.h
==
--- head/lib/libsecureboot/h/libsecureboot.hWed Jun 26 23:10:20 2019
(r349445)
+++ head/lib/libsecureboot/h/libsecureboot.hWed Jun 26 23:33:32 2019
(r349446)
@@ -42,6 +42,7 @@
 
 #include 
 
+unsigned char * read_fd(int, size_t);
 #ifndef NEED_BRSSL_H
 unsigned char * read_file(const char *, size_t *);
 #endif
@@ -51,8 +52,12 @@ extern int DebugVe;
 #define DEBUG_PRINTF(n, x) if (DebugVe >= n) printf x
 
 int ve_trust_init(void);
+size_t ve_trust_anchors_add_buf(unsigned char *, size_t);
+size_t ve_trust_anchors_revoke(unsigned char *, size_t);
 int ve_trust_add(const char *);
 void ve_debug_set(int);
+void ve_anchor_verbose_set(int);
+int ve_anchor_verbose_get(void);
 void ve_utc_set(time_t utc);
 char *ve_error_get(void);
 int ve_error_set(const char *, ...) __printflike(1,2);

Modified: head/lib/libsecureboot/libsecureboot-priv.h
==
--- head/lib/libsecureboot/libsecureboot-priv.h Wed Jun 26 23:10:20 2019
(r349445)
+++ head/lib/libsecureboot/libsecureboot-priv.h Wed Jun 26 23:33:32 2019
(r349446)
@@ -56,6 +56,8 @@ int is_verified(struct stat *stp);
 void add_verify_status(struct stat *stp, int status);
 
 int openpgp_trust_init(void);
+int openpgp_trust_add_buf(unsigned char *, size_t);
+int openpgp_trust_revoke(const char *);
 int openpgp_self_tests(void);
 
 int efi_secure_boot_enabled(void);

Modified: head/lib/libsecureboot/local.trust.mk
==
--- head/lib/libsecureboot/local.trust.mk   Wed Jun 26 23:10:20 2019
(r349445)
+++ head/lib/libsecureboot/local.trust.mk   Wed Jun 26 23:33:32 2019
(r349446)
@@ -33,6 +33,10 @@ VE_SIGNATURE_EXT_LIST+= \
sig
 .endif
 
+# add OpenPGP support - possibly dormant
+VE_SIGNATURE_LIST+= OPENPGP
+VE_SIGNATURE_EXT_LIST+= asc
+
 SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py
 
 .if exists(${SIGNER})
@@ -42,7 +46,12 @@ SIGN_ECDSA= ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${ECDS
 RSA2_PORT:= ${163%y:L:gmtime}
 SIGN_RSA2=   ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${RSA2_PORT} -h sha256
 
+# deal with quirk of our .esig format
+XCFLAGS.vets+= -DVE_ECDSA_HASH_AGAIN
+
 .if !empty(OPENPGP_SIGN_URL)
+XCFLAGS.opgp_key+= -DHAVE_TA_ASC_H
+
 VE_SIGNATURE_LIST+= OPENPGP
 VE_SIGNATURE_EXT_LIST+= asc
 

Modified: head/lib/libsecureboot/openpgp/opgp_key.c
==
--- head/lib/libsecureboot/openpgp/opgp_key.c   Wed Jun 26 23:10:20 2019
(r349445)
+++ head/lib/libsecureboot/openpgp/opgp_key.c   Wed Jun 26 23:33:32 2019
(r349446)
@@ -209,13 +209,54 @@ openpgp_trust_add(OpenPGP_key *key)
 
LIST_INIT(_list);
}
-   if (key) {
-   DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id));
+   if (key && openpgp_trust_get(key->id) == NULL) {
+   if (ve_anchor_verbose_get())
+   printf("openpgp_trust_add(%s)\n", key->id);
LIST_INSERT_HEAD(_list, key, entries);
}
 }
 
 /**
+ * @brief add trust anchor from buf
+ */
+int
+openpgp_trust_add_buf(unsigned char *buf, size_t nbytes)
+{
+   OpenPGP_key *key;
+
+   if ((key = load_key_buf(buf, nbytes))) {
+   openpgp_trust_add(key);
+   }
+   return (key != NULL);
+}
+
+
+/**
+ * @brief if keyID is in our list clobber it
+ *
+ * @return true if keyID removed
+ */
+int
+openpgp_trust_revoke(const char *keyID)
+{
+   OpenPGP_key *key, *tkey;
+
+   openpgp_trust_add(NULL);/* initialize if needed */
+
+   LIST_FOREACH(key, _list, entries) {
+   if (strcmp(key->id, keyID) == 0) {
+   tkey = key;
+   LIST_REMOVE(tkey, entries);
+   printf("openpgp_trust_revoke(%s)\n", 

svn commit: r348449 - in stable/12/stand: . ficl libsa

2019-05-30 Thread Simon J. Gerraty
Author: sjg
Date: Thu May 30 23:43:54 2019
New Revision: 348449
URL: https://svnweb.freebsd.org/changeset/base/348449

Log:
  ficl pfopen: verify file
  
  If the file is verified - do not allow write
  otherwise do not allow read.
  
  Add O_ACCMODE to stand.h
  
  MFC of r348249
  
  Reviewed by:  stevek, mindal_semihalf.com
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org/D20387

Modified:
  stable/12/stand/ficl.mk
  stable/12/stand/ficl/loader.c
  stable/12/stand/libsa/stand.h

Modified: stable/12/stand/ficl.mk
==
--- stable/12/stand/ficl.mk Thu May 30 21:54:49 2019(r348448)
+++ stable/12/stand/ficl.mk Thu May 30 23:43:54 2019(r348449)
@@ -16,3 +16,7 @@ CFLAGS+=  -fPIC
 
 CFLAGS+=   -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC}
 CFLAGS+=   -DBF_DICTSIZE=15000
+
+.if ${MK_LOADER_VERIEXEC} != "no"
+CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h
+.endif

Modified: stable/12/stand/ficl/loader.c
==
--- stable/12/stand/ficl/loader.c   Thu May 30 21:54:49 2019
(r348448)
+++ stable/12/stand/ficl/loader.c   Thu May 30 23:43:54 2019
(r348449)
@@ -502,6 +502,23 @@ static void pfopen(FICL_VM *pVM)
 
 /* open the file */
 fd = open(name, mode);
+#ifdef LOADER_VERIEXEC
+if (fd >= 0) {
+   if (verify_file(fd, name, 0, VE_GUESS) < 0) {
+   /* not verified writing ok but reading is not */
+   if ((mode & O_ACCMODE) != O_WRONLY) {
+   close(fd);
+   fd = -1;
+   }
+   } else {
+   /* verified reading ok but writing is not */
+   if ((mode & O_ACCMODE) != O_RDONLY) {
+   close(fd);
+   fd = -1;
+   }
+   }
+}
+#endif
 free(name);
 stackPushINT(pVM->pStack, fd);
 return;

Modified: stable/12/stand/libsa/stand.h
==
--- stable/12/stand/libsa/stand.h   Thu May 30 21:54:49 2019
(r348448)
+++ stable/12/stand/libsa/stand.h   Thu May 30 23:43:54 2019
(r348449)
@@ -286,6 +286,7 @@ extern int  open(const char *, int);
 #defineO_RDONLY0x0
 #define O_WRONLY   0x1
 #define O_RDWR 0x2
+#define O_ACCMODE  0x3
 /* NOT IMPLEMENTED */
 #defineO_CREAT 0x0200  /* create if nonexistent */
 #defineO_TRUNC 0x0400  /* truncate to zero length */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r348249 - in head/stand: . ficl libsa

2019-05-24 Thread Simon J. Gerraty
Author: sjg
Date: Fri May 24 19:43:38 2019
New Revision: 348249
URL: https://svnweb.freebsd.org/changeset/base/348249

Log:
  ficl pfopen: verify file
  
  If the file is verified - do not allow write
  otherwise do not allow read.
  
  Add O_ACCMODE to stand.h
  
  Reviewed by:  stevek, mindal_semihalf.com
  MFC after:3 days
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org/D20387

Modified:
  head/stand/ficl.mk
  head/stand/ficl/loader.c
  head/stand/libsa/stand.h

Modified: head/stand/ficl.mk
==
--- head/stand/ficl.mk  Fri May 24 18:41:31 2019(r348248)
+++ head/stand/ficl.mk  Fri May 24 19:43:38 2019(r348249)
@@ -16,3 +16,7 @@ CFLAGS+=  -fPIC
 
 CFLAGS+=   -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC}
 CFLAGS+=   -DBF_DICTSIZE=15000
+
+.if ${MK_LOADER_VERIEXEC} != "no"
+CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h
+.endif

Modified: head/stand/ficl/loader.c
==
--- head/stand/ficl/loader.cFri May 24 18:41:31 2019(r348248)
+++ head/stand/ficl/loader.cFri May 24 19:43:38 2019(r348249)
@@ -502,6 +502,23 @@ static void pfopen(FICL_VM *pVM)
 
 /* open the file */
 fd = open(name, mode);
+#ifdef LOADER_VERIEXEC
+if (fd >= 0) {
+   if (verify_file(fd, name, 0, VE_GUESS) < 0) {
+   /* not verified writing ok but reading is not */
+   if ((mode & O_ACCMODE) != O_WRONLY) {
+   close(fd);
+   fd = -1;
+   }
+   } else {
+   /* verified reading ok but writing is not */
+   if ((mode & O_ACCMODE) != O_RDONLY) {
+   close(fd);
+   fd = -1;
+   }
+   }
+}
+#endif
 free(name);
 stackPushINT(pVM->pStack, fd);
 return;

Modified: head/stand/libsa/stand.h
==
--- head/stand/libsa/stand.hFri May 24 18:41:31 2019(r348248)
+++ head/stand/libsa/stand.hFri May 24 19:43:38 2019(r348249)
@@ -286,6 +286,7 @@ extern int  open(const char *, int);
 #defineO_RDONLY0x0
 #define O_WRONLY   0x1
 #define O_RDWR 0x2
+#define O_ACCMODE  0x3
 /* NOT IMPLEMENTED */
 #defineO_CREAT 0x0200  /* create if nonexistent */
 #defineO_TRUNC 0x0400  /* truncate to zero length */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


  1   2   3   4   5   >