On Tue, Aug 24, 2021 at 01:53:41PM +0200, Paul de Weerd wrote:
> I have a new machine where I'd like to use IPMI.  Of course, doing
> `config -e -f /bsd` will break KARL, so I tried to find a minimal way
> of supporting this.  Done by introducing a new config file,
> /etc/kernel.conf, which gets applied to the kernel reorder_kernel
> builds and installs.

I like it: it is simple.

but here are some thoughts (with questions and some answers, but it is
open):

- does it integrate well with syspatch ?

  yes, syspatch will call /usr/libexec/reorder_kernel (and the
  configuration will be applied)


- after install or upgrade, does the installed kernel (by installer)
  has the configuration applied ?

  it seems not: install.sub has it owns logic and is directly calling
  "make newbsd ; make install" and do not use reorder_kernel script.
  

  I could see reason to avoid it, and reason to requiring it.


  For install, no problem: the file is controlled (it doesn't
  exist). It doesn't change anything.

  For upgrade, the file could exists. Should the installer using it or
  not ?


  If using it, it makes the upgrade process dependent of the file: how
  to deal with an invalid file ? should the file ignored (kernel
  installed but not configured) ?

  how to deal with a format change in config(8) (file on disk in old
  format, used config(8) understanding new format) ? but config(8)
  doesn't change often, and could take care of both formats for one
  release, and/or current.html could mention some required changes.


  If not using it, does it is a problem that the first boot will be
  different from next boot ?

  I could imagine some changes made to be the machine bootable, so the
  first boot could lead to unbootable machine (but it isn't different
  from now).


Questions are open: I have no problem which using or not using the
configuration file on upgrade, but I think it should be documented (to
avoid questions and/or surprises).

Thanks
-- 
Sebastien Marie



> Index: reorder_kernel.sh
> ===================================================================
> RCS file: /home/OpenBSD/cvs/src/libexec/reorder_kernel/reorder_kernel.sh,v
> retrieving revision 1.9
> diff -u -p -r1.9 reorder_kernel.sh
> --- reorder_kernel.sh 28 Sep 2019 17:30:07 -0000      1.9
> +++ reorder_kernel.sh 24 Aug 2021 07:01:10 -0000
> @@ -63,6 +63,7 @@ fi
>  
>  cd $KERNEL_DIR/$KERNEL
>  make newbsd
> +[ -f /etc/kernel.conf ] && config -e -c /etc/kernel.conf -f bsd
>  make newinstall
>  sync
>  
> Index: Makefile
> ===================================================================
> RCS file: /home/OpenBSD/cvs/src/libexec/reorder_kernel/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- Makefile  21 Aug 2017 21:24:11 -0000      1.1
> +++ Makefile  24 Aug 2021 07:23:38 -0000
> @@ -1,6 +1,7 @@
>  #    $OpenBSD: Makefile,v 1.1 2017/08/21 21:24:11 rpe Exp $
>  
>  SCRIPT=      reorder_kernel.sh
> +MAN= kernel.conf.5
>  
>  realinstall:
>       ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
> Index: kernel.conf.5
> ===================================================================
> RCS file: kernel.conf.5
> diff -N kernel.conf.5
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ kernel.conf.5     24 Aug 2021 07:23:07 -0000
> @@ -0,0 +1,46 @@
> +.\"  $OpenBSD$
> +.\"
> +.\" Copyright (c) 2021 Paul de Weerd <we...@weirdnet.nl>
> +.\"
> +.\" Permission to use, copy, modify, and distribute this software for any
> +.\" purpose with or without fee is hereby granted, provided that the above
> +.\" copyright notice and this permission notice appear in all copies.
> +.\"
> +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> +.\"
> +.Dd $Mdocdate: August 24 2021 $
> +.Dt KERNEL.CONF 5
> +.Os
> +.Sh NAME
> +.Nm kernel.conf
> +.Nd kernel configuration file
> +.Sh DESCRIPTION
> +The
> +.Nm
> +file contains configuration information for the kernel.
> +If present, it is used during system startup to configure the kernel
> +that will be running at the next boot.
> +It can be used to enable or disable specific devices in the kernel.
> +.Sh EXAMPLES
> +To enable the
> +.Xr ipmi 4
> +driver, add the following line to
> +.Nm :
> +.Pp
> +.Dl enable ipmi
> +.Pp
> +See 
> +.Xr config 8
> +for more details on how to configure the kernel.
> +.Sh FILES
> +.Bl -tag -width /etc/kernel.conf -compact
> +.It Pa /etc/kernel.conf
> +Kernel configuration file.
> +.Sh SEE ALSO
> +.Xr config 8
> 
> -- 
> >++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
> +++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
>                  http://www.weirdnet.nl/                 
> 

Reply via email to