On Mon, 20 Nov 2017, Theo de Raadt wrote:

If someone wants to solve this fully there have been some proposals
for keeping track of the instruction sequence, and attempting to
reapply it upon each relink in the build directory. There just hasn't
been any scripting changes to do that from anyone, and it isn't on my
radar as important.

How about making reorder_kernel do something like:

$ if test -f /etc/ukc.conf; then </etc/ukc.conf config -e $f; fi;

Hmm...  I can't seem to find a patch in there anywhere.


No patch from OP yet, so how about this: for someone needing config -e
it's probably sufficient if /usr/libexec/reorder_kernel checks for
a post-processing script, and invokes it if present and executable.

If the patch is acceptable, I'll post a sample post-processing script
that, for config -f -e, should only need one parameter change for
specific needs.

Patch (against 6.2 stable):
--- usr/libexec/reorder_kernel.orig     Tue Oct  3 23:13:27 2017
+++ usr/libexec/reorder_kernel  Wed Nov 22 09:30:27 2017
@@ -30,6 +30,8 @@
 LOGFILE=$COMPILE_DIR/$KERNEL/relink.log
 PROGNAME=${0##*/}
 SHA256=/var/db/kernel.SHA256
+# optional local postprocessing, e.g. config -e
+POSTPROC=/etc/after-karl

 # Create kernel compile dir and redirect stdout/stderr to a logfile.
 mkdir -m 700 -p $COMPILE_DIR/$KERNEL
@@ -55,6 +57,11 @@
 cd $COMPILE_DIR/$KERNEL
 make newbsd
 make newinstall
+
+# optional local postprocessing, e.g. config -e
+if [[ -f $POSTPROC && -x $POSTPROC ]]; then
+       "$POSTPROC" /bsd "$SHA256" /dev/stdout
+fi

 echo "\nKernel has been relinked and is active on next reboot.\n"
 cat $SHA256

Reply via email to