#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1177 2021/09/13 05:17:04 robert Exp $
+# $OpenBSD: install.sub,v 1.1178 2021/09/13 11:49:21 robert Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
tar -C $_kernel_dir -xzf $_kernel_dir.tgz $_kernel
rm -f $_kernel_dir.tgz
chroot /mnt /bin/ksh -e -c "cd ${_kernel_dir#/mnt}/$_kernel; \
- make newbsd; make newinstall"
+ make newbsd; \
+ [ -f /etc/bsd.re-config ] && \
+ config -e -c /etc/bsd.re-config -f bsd; \
+ make newinstall"
) >/dev/null 2>&1 && echo " done." || echo " failed."
fi
-# $OpenBSD: changelist,v 1.128 2021/07/30 07:00:02 bket Exp $
+# $OpenBSD: changelist,v 1.129 2021/09/13 11:49:21 robert Exp $
#
# List of files which the security script backs up and checks
# for modifications.
/etc/bgpd.conf
/etc/boot.conf
/etc/bootparams
+/etc/bsd.re-config
/etc/changelist
/etc/chio.conf
/etc/crontab
-# $OpenBSD: Makefile,v 1.1 2017/08/21 21:24:11 rpe Exp $
+# $OpenBSD: Makefile,v 1.2 2021/09/13 11:49:21 robert Exp $
SCRIPT= reorder_kernel.sh
+MAN= bsd.re-config.5
realinstall:
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
--- /dev/null
+.\" $OpenBSD: bsd.re-config.5,v 1.1 2021/09/13 11:49:21 robert Exp $
+.\"
+.\" Copyright (c) 2021 Paul de Weerd <weerd@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: September 13 2021 $
+.Dt KERNEL.CONF 5
+.Os
+.Sh NAME
+.Nm bsd.re-config
+.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/bsd.re-config -compact
+.It Pa /etc/bsd.re-config
+Kernel configuration file.
+.Sh SEE ALSO
+.Xr config 8
#!/bin/ksh
#
-# $OpenBSD: reorder_kernel.sh,v 1.9 2019/09/28 17:30:07 ajacoutot Exp $
+# $OpenBSD: reorder_kernel.sh,v 1.10 2021/09/13 11:49:21 robert Exp $
#
# Copyright (c) 2017 Robert Peichaer <rpe@openbsd.org>
#
cd $KERNEL_DIR/$KERNEL
make newbsd
+[ -f /etc/bsd.re-config ] && config -e -c /etc/bsd.re-config -f bsd
make newinstall
sync
-.\" $OpenBSD: boot_config.8,v 1.31 2019/09/06 21:30:32 cheloha Exp $
+.\" $OpenBSD: boot_config.8,v 1.32 2021/09/13 11:49:21 robert Exp $
.\"
.\" Copyright (c) 1996 Mats O Jansson
.\" All rights reserved.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: September 6 2019 $
+.Dd $Mdocdate: September 13 2021 $
.Dt BOOT_CONFIG 8
.Os
.Sh NAME
.Pp
Changes made can be saved for the next reboot, by using
.Xr config 8 .
+However, those would not be persisted across system upgrades and would
+prevent kernel relinking.
+To ensure these changes are carried over to upgraded kernels, they can
+be save to the
+.Xr bsd.re-config 5
+configuration file.
.Sh COMMANDS
.Bl -tag -width "disable devno | dev"
.It Ic add Ar dev
mainbus0 (root)
.Ed
.Sh SEE ALSO
+.Xr bsd.re-config 5
.Xr config 8
.Sh AUTHORS
.An Mats O Jansson Aq Mt moj@stacken.kth.se
-.\" $OpenBSD: config.8,v 1.71 2021/03/08 02:47:29 jsg Exp $
+.\" $OpenBSD: config.8,v 1.72 2021/09/13 11:49:22 robert Exp $
.\" $NetBSD: config.8,v 1.10 1996/08/31 20:58:16 mycroft Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\"
.\" from: @(#)config.8 8.2 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: March 8 2021 $
+.Dd $Mdocdate: September 13 2021 $
.Dt CONFIG 8
.Os
.Sh NAME
using the in-kernel editor,
as described in
.Xr boot_config 8 .
+Note that any such edits will be lost during upgrades and prevent a newly
+linked kernel from being installed at boot time.
+For such cases, this process can also be automated during boot using the
+.Xr bsd.re-config 5
+configuration file.
.Pp
For kernel building, the options are as follows:
.Bl -tag -width Ds
.Sh SEE ALSO
.Xr options 4 ,
.Xr files.conf 5 ,
+.Xr bsd.re-config 5,
.Xr boot.conf 8 ,
.Xr boot_config 8
.Pp